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 @@
// found in the LICENSE file.
package com.android.webview.chromium;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.base.annotations.JniIgnoreNatives;
@JniIgnoreNatives
class DrawFunctor {
public static long getDrawFnFunctionTable() {
return DrawFunctorJni.get().getFunctionTable();
return nativeGetFunctionTable();
}
@NativeMethods
interface Natives {
long getFunctionTable();
}
// The Android framework performs manual JNI registration on this method,
// so the method signature cannot change without updating the framework.
private static native long nativeGetFunctionTable();
}
......@@ -11,7 +11,7 @@ import android.view.View;
import com.android.webview.chromium.WebViewDelegateFactory.WebViewDelegate;
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.
......@@ -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
* detach respectively).
*/
@JniIgnoreNatives
class DrawGLFunctor implements AwContents.NativeDrawGLFunctor {
private static final String TAG = DrawGLFunctor.class.getSimpleName();
......@@ -27,7 +28,7 @@ class DrawGLFunctor implements AwContents.NativeDrawGLFunctor {
private long mNativeDrawGLFunctor;
public DrawGLFunctor(long viewContext, WebViewDelegate webViewDelegate) {
mNativeDrawGLFunctor = DrawGLFunctorJni.get().createGLFunctor(viewContext);
mNativeDrawGLFunctor = nativeCreateGLFunctor(viewContext);
mWebViewDelegate = webViewDelegate;
}
......@@ -81,18 +82,17 @@ class DrawGLFunctor implements AwContents.NativeDrawGLFunctor {
@Override
public void destroy() {
assert mNativeDrawGLFunctor != 0;
DrawGLFunctorJni.get().destroyGLFunctor(mNativeDrawGLFunctor);
nativeDestroyGLFunctor(mNativeDrawGLFunctor);
mNativeDrawGLFunctor = 0;
}
public static void setChromiumAwDrawGLFunction(long functionPointer) {
DrawGLFunctorJni.get().setChromiumAwDrawGLFunction(functionPointer);
nativeSetChromiumAwDrawGLFunction(functionPointer);
}
@NativeMethods
interface Natives {
long createGLFunctor(long viewContext);
void destroyGLFunctor(long functor);
void setChromiumAwDrawGLFunction(long functionPointer);
}
// The Android framework performs manual JNI registration on these methods,
// so the method signatures cannot change without updating the framework.
private static native long nativeCreateGLFunctor(long viewContext);
private static native void nativeDestroyGLFunctor(long functor);
private static native void nativeSetChromiumAwDrawGLFunction(long functionPointer);
}
......@@ -3,20 +3,21 @@
// found in the LICENSE file.
package com.android.webview.chromium;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.base.annotations.JniIgnoreNatives;
@JniIgnoreNatives
abstract class GraphicsUtils {
public static long getDrawSWFunctionTable() {
return GraphicsUtilsJni.get().getDrawSWFunctionTable();
return nativeGetDrawSWFunctionTable();
}
public static long getDrawGLFunctionTable() {
return GraphicsUtilsJni.get().getDrawGLFunctionTable();
return nativeGetDrawGLFunctionTable();
}
@NativeMethods
interface Natives {
long getDrawSWFunctionTable();
long getDrawGLFunctionTable();
}
// The Android framework performs manual JNI registration on these methods,
// so the method signatures cannot change without updating the framework.
private static native long nativeGetDrawSWFunctionTable();
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