Commit 30815c7b authored by Wei-Yin Chen (陳威尹)'s avatar Wei-Yin Chen (陳威尹) Committed by Commit Bot

Avoid calling FrozenNativePage.getView()

We are not supposed to call FrozenNativePage.getView().
This is no-op in Release build.

Bug: 952331
Change-Id: I10fe58f1daaaa4f5b42c913a8c0cbd6685441ddc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1643071Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666104}
parent aeaa13e0
......@@ -20,6 +20,7 @@ import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.native_page.FrozenNativePage;
import org.chromium.chrome.browser.native_page.NativePage;
import org.chromium.chrome.browser.tab.SadTab;
import org.chromium.chrome.browser.tab.Tab;
......@@ -195,7 +196,12 @@ public class TabContentManager {
return null;
}
View viewToDraw = isNativeViewShowing ? tab.getContentView() : nativePage.getView();
View viewToDraw = null;
if (isNativeViewShowing) {
viewToDraw = tab.getContentView();
} else if (!(nativePage instanceof FrozenNativePage)) {
viewToDraw = nativePage.getView();
}
if (viewToDraw == null || viewToDraw.getWidth() == 0 || viewToDraw.getHeight() == 0) {
return null;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment