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

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

Issue 1927543003: Remove DrawGLFunctor CleanupReference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make Runnable static, throw if native DrawGLFunctor destroyed 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
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 06468ec1532af3420ef8b8576309822d77730f07..e50928373f088b7d58d5a5dc7742e14e0876a7bd 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java
@@ -23,12 +23,16 @@ import org.chromium.content.common.CleanupReference;
public class AwGLFunctor {
private static final class DestroyRunnable implements Runnable {
private final long mNativeAwGLFunctor;
+ private final Runnable mNativeDrawGLFunctorDestroyRunnable;
- private DestroyRunnable(long nativeAwGLFunctor) {
+ private DestroyRunnable(
+ long nativeAwGLFunctor, Runnable nativeDrawGLFunctorDestroyRunnable) {
mNativeAwGLFunctor = nativeAwGLFunctor;
+ mNativeDrawGLFunctorDestroyRunnable = nativeDrawGLFunctorDestroyRunnable;
}
@Override
public void run() {
+ mNativeDrawGLFunctorDestroyRunnable.run();
nativeDestroy(mNativeAwGLFunctor);
}
}
@@ -44,10 +48,10 @@ public class AwGLFunctor {
public AwGLFunctor(AwContents.NativeDrawGLFunctorFactory nativeDrawGLFunctorFactory,
ViewGroup containerView) {
mNativeAwGLFunctor = nativeCreate(this);
- mLifetimeObject = new Object();
- mCleanupReference =
- new CleanupReference(mLifetimeObject, new DestroyRunnable(mNativeAwGLFunctor));
mNativeDrawGLFunctor = nativeDrawGLFunctorFactory.createFunctor(getAwDrawGLViewContext());
+ mLifetimeObject = new Object();
+ mCleanupReference = new CleanupReference(mLifetimeObject,
+ new DestroyRunnable(mNativeAwGLFunctor, mNativeDrawGLFunctor.getDestroyRunnable()));
mContainerView = containerView;
if (mNativeDrawGLFunctor.supportsDrawGLFunctorReleasedCallback()) {
mFunctorReleasedCallback = new Runnable() {

Powered by Google App Engine
This is Rietveld 408576698