Commit 74309e27 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

weblayer: fix possible crash in destruction

getHandler() may return null, which the code was not
prepared for.

I'll work out a test case separately.

BUG=1075662
TEST=none

Change-Id: Ie880cba5a7bcfeaf848a71d667c36cc30e5b57ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2169021Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763323}
parent 9d5bcaf0
......@@ -134,7 +134,7 @@ class TopControlsContainerView extends FrameLayout {
TopControlsContainerViewJni.get().deleteTopControlsContainerView(
mNativeTopControlsContainerView, TopControlsContainerView.this);
if (mSystemUiFullscreenResizeRunnable != null) {
getHandler().removeCallbacks(mSystemUiFullscreenResizeRunnable);
removeCallbacks(mSystemUiFullscreenResizeRunnable);
mSystemUiFullscreenResizeRunnable = null;
}
}
......@@ -312,7 +312,7 @@ class TopControlsContainerView extends FrameLayout {
private void didToggleFullscreenModeForTab(final boolean isFullscreen) {
// Delay hiding until after the animation. This comes from Chrome code.
if (mSystemUiFullscreenResizeRunnable != null) {
getHandler().removeCallbacks(mSystemUiFullscreenResizeRunnable);
removeCallbacks(mSystemUiFullscreenResizeRunnable);
}
mSystemUiFullscreenResizeRunnable = () -> processFullscreenChanged(isFullscreen);
long delay = isFullscreen ? SYSTEM_UI_VIEWPORT_UPDATE_DELAY_MS : 0;
......
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