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

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

Issue 1905623002: aw: Fix AwGLFunctor lifetime object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/AwGLFunctor.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java b/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java
index e43b840fbf980e8ebd1a83b5794acca5899a77fc..be319dd1a52467c56e2c3cd70214a46bb1952187 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java
@@ -33,7 +33,8 @@ class AwGLFunctor {
}
private final long mNativeAwGLFunctor;
- private final DestroyRunnable mDestroyRunnable;
+ // Same gc-life time as this, but does not reference any members like |mContainerView|.
+ private final Object mLifetimeObject;
private final CleanupReference mCleanupReference;
private final AwContents.NativeGLDelegate mNativeGLDelegate;
private final ViewGroup mContainerView;
@@ -41,8 +42,9 @@ class AwGLFunctor {
public AwGLFunctor(AwContents.NativeGLDelegate nativeGLDelegate, ViewGroup containerView) {
mNativeAwGLFunctor = nativeCreate(this);
- mDestroyRunnable = new DestroyRunnable(mNativeAwGLFunctor);
- mCleanupReference = new CleanupReference(mDestroyRunnable, mDestroyRunnable);
+ mLifetimeObject = new Object();
+ mCleanupReference =
+ new CleanupReference(mLifetimeObject, new DestroyRunnable(mNativeAwGLFunctor));
mNativeGLDelegate = nativeGLDelegate;
mContainerView = containerView;
if (mNativeGLDelegate.supportsDrawGLFunctorReleasedCallback()) {
@@ -67,7 +69,7 @@ class AwGLFunctor {
}
public Object getNativeLifetimeObject() {
- return mDestroyRunnable;
+ return mLifetimeObject;
}
public boolean requestDrawGLForCanvas(Canvas canvas) {
« 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