Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1653)

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 2292393002: aw: Cancel pending callbacks after native destroy (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 030a0a55bf0a10e9dbe748bc7c357e23b0e7f600..d1fd8e74faeeb7bbfcca9b46555fcc480a94e0bf 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -755,6 +755,13 @@ public class AwContents implements SmartClipProvider,
mInitialFunctor = new AwGLFunctor(mNativeDrawGLFunctorFactory, mContainerView);
mCurrentFunctor = mInitialFunctor;
mContentsClient = contentsClient;
+ mContentsClient.getCallbackHelper().setCancelCallbackPoller(
+ new AwContentsClientCallbackHelper.CancelCallbackPoller() {
+ @Override
+ public boolean cancelAllCallbacks() {
+ return AwContents.this.isDestroyed(NO_WARN);
+ }
+ });
mAwViewMethods = new AwViewMethodsImpl();
mFullScreenTransitionsState = new FullScreenTransitionsState(
mContainerView, mInternalAccessAdapter, mAwViewMethods);
@@ -1211,12 +1218,7 @@ public class AwContents implements SmartClipProvider,
* @return whether this instance of WebView is flagged as destroyed.
*/
private boolean isDestroyed(int warnIfDestroyed) {
- if (!mIsDestroyed) {
- assert mContentViewCore != null;
- assert mWebContents != null;
- assert mNavigationController != null;
- assert mNativeAwContents != 0;
- } else if (warnIfDestroyed == WARN) {
+ if (mIsDestroyed && warnIfDestroyed == WARN) {
Log.w(TAG, "Application attempted to call on a destroyed WebView", new Throwable());
}
boolean destroyRunnableHasRun =
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698