Commit ef7a9983 authored by Eric Stevenson's avatar Eric Stevenson Committed by Commit Bot

AW: Revert a few classes to old JNI to fix failing bots.

Didn't realize that the framework tries to perform JNI registration on
some WebView classes.

Bug: 1000471, 929661
Change-Id: Ic5f7d75dfdcaf40fe369dd82061333b452ad1327
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1783642
Commit-Queue: Eric Stevenson <estevenson@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693221}
parent 45d4b57e
...@@ -3,15 +3,16 @@ ...@@ -3,15 +3,16 @@
// found in the LICENSE file. // found in the LICENSE file.
package com.android.webview.chromium; package com.android.webview.chromium;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.base.annotations.JniIgnoreNatives;
@JniIgnoreNatives
class DrawFunctor { class DrawFunctor {
public static long getDrawFnFunctionTable() { public static long getDrawFnFunctionTable() {
return DrawFunctorJni.get().getFunctionTable(); return nativeGetFunctionTable();
} }
@NativeMethods // The Android framework performs manual JNI registration on this method,
interface Natives { // so the method signature cannot change without updating the framework.
long getFunctionTable(); private static native long nativeGetFunctionTable();
}
} }
...@@ -11,7 +11,7 @@ import android.view.View; ...@@ -11,7 +11,7 @@ import android.view.View;
import com.android.webview.chromium.WebViewDelegateFactory.WebViewDelegate; import com.android.webview.chromium.WebViewDelegateFactory.WebViewDelegate;
import org.chromium.android_webview.AwContents; import org.chromium.android_webview.AwContents;
import org.chromium.base.annotations.NativeMethods; import org.chromium.base.annotations.JniIgnoreNatives;
/** /**
* Simple Java abstraction and wrapper for the native DrawGLFunctor flow. * Simple Java abstraction and wrapper for the native DrawGLFunctor flow.
...@@ -19,6 +19,7 @@ import org.chromium.base.annotations.NativeMethods; ...@@ -19,6 +19,7 @@ import org.chromium.base.annotations.NativeMethods;
* and then drawn and detached from the view tree any number of times (using requestDrawGL and * and then drawn and detached from the view tree any number of times (using requestDrawGL and
* detach respectively). * detach respectively).
*/ */
@JniIgnoreNatives
class DrawGLFunctor implements AwContents.NativeDrawGLFunctor { class DrawGLFunctor implements AwContents.NativeDrawGLFunctor {
private static final String TAG = DrawGLFunctor.class.getSimpleName(); private static final String TAG = DrawGLFunctor.class.getSimpleName();
...@@ -27,7 +28,7 @@ class DrawGLFunctor implements AwContents.NativeDrawGLFunctor { ...@@ -27,7 +28,7 @@ class DrawGLFunctor implements AwContents.NativeDrawGLFunctor {
private long mNativeDrawGLFunctor; private long mNativeDrawGLFunctor;
public DrawGLFunctor(long viewContext, WebViewDelegate webViewDelegate) { public DrawGLFunctor(long viewContext, WebViewDelegate webViewDelegate) {
mNativeDrawGLFunctor = DrawGLFunctorJni.get().createGLFunctor(viewContext); mNativeDrawGLFunctor = nativeCreateGLFunctor(viewContext);
mWebViewDelegate = webViewDelegate; mWebViewDelegate = webViewDelegate;
} }
...@@ -81,18 +82,17 @@ class DrawGLFunctor implements AwContents.NativeDrawGLFunctor { ...@@ -81,18 +82,17 @@ class DrawGLFunctor implements AwContents.NativeDrawGLFunctor {
@Override @Override
public void destroy() { public void destroy() {
assert mNativeDrawGLFunctor != 0; assert mNativeDrawGLFunctor != 0;
DrawGLFunctorJni.get().destroyGLFunctor(mNativeDrawGLFunctor); nativeDestroyGLFunctor(mNativeDrawGLFunctor);
mNativeDrawGLFunctor = 0; mNativeDrawGLFunctor = 0;
} }
public static void setChromiumAwDrawGLFunction(long functionPointer) { public static void setChromiumAwDrawGLFunction(long functionPointer) {
DrawGLFunctorJni.get().setChromiumAwDrawGLFunction(functionPointer); nativeSetChromiumAwDrawGLFunction(functionPointer);
} }
@NativeMethods // The Android framework performs manual JNI registration on these methods,
interface Natives { // so the method signatures cannot change without updating the framework.
long createGLFunctor(long viewContext); private static native long nativeCreateGLFunctor(long viewContext);
void destroyGLFunctor(long functor); private static native void nativeDestroyGLFunctor(long functor);
void setChromiumAwDrawGLFunction(long functionPointer); private static native void nativeSetChromiumAwDrawGLFunction(long functionPointer);
}
} }
...@@ -3,20 +3,21 @@ ...@@ -3,20 +3,21 @@
// found in the LICENSE file. // found in the LICENSE file.
package com.android.webview.chromium; package com.android.webview.chromium;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.base.annotations.JniIgnoreNatives;
@JniIgnoreNatives
abstract class GraphicsUtils { abstract class GraphicsUtils {
public static long getDrawSWFunctionTable() { public static long getDrawSWFunctionTable() {
return GraphicsUtilsJni.get().getDrawSWFunctionTable(); return nativeGetDrawSWFunctionTable();
} }
public static long getDrawGLFunctionTable() { public static long getDrawGLFunctionTable() {
return GraphicsUtilsJni.get().getDrawGLFunctionTable(); return nativeGetDrawGLFunctionTable();
} }
@NativeMethods // The Android framework performs manual JNI registration on these methods,
interface Natives { // so the method signatures cannot change without updating the framework.
long getDrawSWFunctionTable(); private static native long nativeGetDrawSWFunctionTable();
long getDrawGLFunctionTable(); private static native long nativeGetDrawGLFunctionTable();
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment