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

Unified Diff: base/android/jni_generator/testNativesLong.golden

Issue 147533004: Remove unneeded JNI registrations. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Fix android webview build issues. Created 6 years, 9 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: base/android/jni_generator/testNativesLong.golden
diff --git a/base/android/jni_generator/testNativesLong.golden b/base/android/jni_generator/testNativesLong.golden
index 24d4a15074cddcece3828a298034d51c3c204c3d..47982cf5e55243a08079fbe5ed7463bc46f87880 100644
--- a/base/android/jni_generator/testNativesLong.golden
+++ b/base/android/jni_generator/testNativesLong.golden
@@ -16,12 +16,11 @@
// Step 1: forward declarations.
namespace {
-const char kTestJniClassPath[] = "org/chromium/TestJni";
-// Leaking this jclass as we cannot use LazyInstance from some threads.
-jclass g_TestJni_clazz = NULL;
} // namespace
+extern "C"{
+
// Step 2: method stubs.
static void Destroy(JNIEnv* env, jobject jcaller,
jlong nativeChromeBrowserProvider) {
@@ -30,32 +29,13 @@ static void Destroy(JNIEnv* env, jobject jcaller,
CHECK_NATIVE_PTR(env, jcaller, native, "Destroy");
return native->Destroy(env, jcaller);
}
+__attribute__((alias("Destroy"), visibility("default")))
+ void Java_org_chromium_TestJni_nativeDestroy(JNIEnv* env,
+ jobject jcaller,
+ jlong nativeChromeBrowserProvider);
-// Step 3: RegisterNatives.
-
-static const JNINativeMethod kMethodsTestJni[] = {
- { "nativeDestroy",
-"("
-"J"
-")"
-"V", reinterpret_cast<void*>(Destroy) },
};
-static bool RegisterNativesImpl(JNIEnv* env) {
- g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
- base::android::GetClass(env, kTestJniClassPath).obj()));
-
- const int kMethodsTestJniSize = arraysize(kMethodsTestJni);
-
- if (env->RegisterNatives(g_TestJni_clazz,
- kMethodsTestJni,
- kMethodsTestJniSize) < 0) {
- jni_generator::HandleRegistrationError(
- env, g_TestJni_clazz, __FILE__);
- return false;
- }
-
- return true;
-}
+// Step 3: RegisterNatives.
#endif // org_chromium_TestJni_JNI

Powered by Google App Engine
This is Rietveld 408576698