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

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

Issue 1809643002: Make native AwContents hold a reference to the WindowAndroidWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hold the WindowAndroidWrapper reference on the Java side Created 4 years, 9 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 | no next file » | 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 7ec965fc3d99361dcb6e23176503ebc399a93f3e..046ccfccecb9e2b2281b33dc4b7e558345fc8cc6 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -316,9 +316,13 @@ public class AwContents implements SmartClipProvider,
private static final class DestroyRunnable implements Runnable {
private final long mNativeAwContents;
+ // Hold onto a reference to the window (via its wrapper), so that it is not destroyed
+ // until we are done here.
+ private final WindowAndroidWrapper mWindowAndroid;
- private DestroyRunnable(long nativeAwContents) {
+ private DestroyRunnable(long nativeAwContents, WindowAndroidWrapper windowAndroid) {
mNativeAwContents = nativeAwContents;
+ mWindowAndroid = windowAndroid;
}
@Override
public void run() {
@@ -991,7 +995,7 @@ public class AwContents implements SmartClipProvider,
// The native side object has been bound to this java instance, so now is the time to
// bind all the native->java relationships.
mCleanupReference =
- new CleanupReference(this, new DestroyRunnable(mNativeAwContents));
+ new CleanupReference(this, new DestroyRunnable(mNativeAwContents, mWindowAndroid));
}
private void installWebContentsObserver() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698