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

Unified Diff: base/android/jni_generator/testPureNativeMethodsOption.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/testPureNativeMethodsOption.golden
diff --git a/base/android/jni_generator/testPureNativeMethodsOption.golden b/base/android/jni_generator/testPureNativeMethodsOption.golden
index e7f8d53dd4d792531b0b69537954d95969dfce7e..c30b78ecd1f3ca1ee317b0144f1b7ad43036d8d0 100644
--- a/base/android/jni_generator/testPureNativeMethodsOption.golden
+++ b/base/android/jni_generator/testPureNativeMethodsOption.golden
@@ -1,4 +1,4 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -16,12 +16,11 @@
// Step 1: forward declarations.
namespace {
-const char kTestClassPath[] = "org/chromium/example/jni_generator/Test";
-// Leaking this jclass as we cannot use LazyInstance from some threads.
-jclass g_Test_clazz = NULL;
} // namespace
+extern "C"{
+
// Step 2: method stubs.
static jlong Method(JNIEnv* env, jobject jcaller,
jlong nativeTest,
@@ -30,33 +29,14 @@ static jlong Method(JNIEnv* env, jobject jcaller,
CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0);
return native->Method(arg1);
}
+__attribute__((alias("Method"), visibility("default")))
+ jlong Java_org_chromium_example_jni_1generator_Test_nativeMethod(JNIEnv* env,
+ jobject jcaller,
+ jlong nativeTest,
+ jint arg1);
-// Step 3: RegisterNatives.
-
-static const JNINativeMethod kMethodsTest[] = {
- { "nativeMethod",
-"("
-"J"
-"I"
-")"
-"J", reinterpret_cast<void*>(Method) },
};
-static bool RegisterNativesImpl(JNIEnv* env) {
- g_Test_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
- base::android::GetClass(env, kTestClassPath).obj()));
-
- const int kMethodsTestSize = arraysize(kMethodsTest);
-
- if (env->RegisterNatives(g_Test_clazz,
- kMethodsTest,
- kMethodsTestSize) < 0) {
- jni_generator::HandleRegistrationError(
- env, g_Test_clazz, __FILE__);
- return false;
- }
-
- return true;
-}
+// Step 3: RegisterNatives.
#endif // org_chromium_example_jni_generator_Test_JNI

Powered by Google App Engine
This is Rietveld 408576698