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

Unified Diff: base/android/jni_generator/testJNIInitNativeNameOption.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/testJNIInitNativeNameOption.golden
diff --git a/base/android/jni_generator/testJNIInitNativeNameOption.golden b/base/android/jni_generator/testJNIInitNativeNameOption.golden
index 54e7b281c09084ab555a8cef5289d2f000c80490..cb0ccb3e66d0007032a8c0bee9b7b146780b039c 100644
--- a/base/android/jni_generator/testJNIInitNativeNameOption.golden
+++ b/base/android/jni_generator/testJNIInitNativeNameOption.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 jint Method(JNIEnv* env, jobject jcaller,
jlong nativeTest,
@@ -30,38 +29,14 @@ static jint Method(JNIEnv* env, jobject jcaller,
CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0);
return native->Method(env, jcaller, arg1);
}
+__attribute__((alias("Method"), visibility("default")))
+ jint 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"
-")"
-"I", reinterpret_cast<void*>(Method) },
};
-static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) {
- g_Test_clazz = static_cast<jclass>(env->NewWeakGlobalRef(clazz));
-
- 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;
-}
-
-extern "C" JNIEXPORT bool JNICALL
-Java_org_chromium_example_jni_generator_Test_nativeInitNativeClass(JNIEnv* env,
- jclass clazz) {
- return RegisterNativesImpl(env, clazz);
-}
+// Step 3: RegisterNatives.
#endif // org_chromium_example_jni_generator_Test_JNI

Powered by Google App Engine
This is Rietveld 408576698