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

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

Issue 1914433002: Assert that AwGLFunctor instances do not leak. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 | android_webview/javatests/src/org/chromium/android_webview/test/AwContentsGarbageCollectionTest.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/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 0d681e6fd222884b186ace92a59058de3988f959..06468ec1532af3420ef8b8576309822d77730f07 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwGLFunctor.java
@@ -7,6 +7,7 @@ package org.chromium.android_webview;
import android.graphics.Canvas;
import android.view.ViewGroup;
+import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.content.common.CleanupReference;
@@ -19,7 +20,7 @@ import org.chromium.content.common.CleanupReference;
* the render node hierarchy.
*/
@JNINamespace("android_webview")
-class AwGLFunctor {
+public class AwGLFunctor {
private static final class DestroyRunnable implements Runnable {
private final long mNativeAwGLFunctor;
@@ -96,10 +97,20 @@ class AwGLFunctor {
return nativeGetAwDrawGLViewContext(mNativeAwGLFunctor);
}
+ /**
+ * Intended for test code.
+ * @return the number of native instances of this class.
+ */
+ @VisibleForTesting
+ public static int getNativeInstanceCount() {
+ return nativeGetNativeInstanceCount();
+ }
+
private native void nativeDeleteHardwareRenderer(long nativeAwGLFunctor);
private native long nativeGetAwDrawGLViewContext(long nativeAwGLFunctor);
private static native long nativeGetAwDrawGLFunction();
private static native void nativeDestroy(long nativeAwGLFunctor);
private static native long nativeCreate(AwGLFunctor javaProxy);
+ private static native int nativeGetNativeInstanceCount();
}
« no previous file with comments | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/AwContentsGarbageCollectionTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698