Commit c8a14551 authored by Scott Violet's avatar Scott Violet Committed by Chromium LUCI CQ

weblayer: throw exception before crash

We don't support synchronously exiting fullscreen when fullscreen
is entered. The code currently CHECKs in the native side. This
patch throws an exception in hopes of better identifying why
the java side is synchronously exiting. It doesn't seem the
embedder has a synchronous path that exits, but perhaps it's
because of a config change/retain issue?

BUG=1142101
TEST=none

Change-Id: Ia41dd9018c210a0b300223329a650cb0651030b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2626191Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843075}
parent 0c59d07f
......@@ -27,6 +27,7 @@ public final class FullscreenCallbackProxy {
private IFullscreenCallbackClient mClient;
private TabImpl mTab;
private FullscreenToast mToast;
private boolean mIsNotifyingClientOfEnter;
FullscreenCallbackProxy(TabImpl tab, long nativeTab, IFullscreenCallbackClient client) {
assert client != null;
......@@ -69,13 +70,22 @@ public final class FullscreenCallbackProxy {
if (mNativeFullscreenCallbackProxy == 0) {
throw new IllegalStateException("Called after destroy()");
}
if (mIsNotifyingClientOfEnter) {
throw new IllegalStateException(
"Fullscreen callback must not be called synchronously");
}
destroyToast();
FullscreenCallbackProxyJni.get().doExitFullscreen(mNativeFullscreenCallbackProxy);
}
};
destroyToast();
mToast = new FullscreenToast(mTab);
mIsNotifyingClientOfEnter = true;
try {
mClient.enterFullscreen(ObjectWrapper.wrap(exitFullscreenCallback));
} finally {
mIsNotifyingClientOfEnter = false;
}
}
@CalledByNative
......
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