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

Unified Diff: base/android/jni_generator/testJarJarRemapping.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/testJarJarRemapping.golden
diff --git a/base/android/jni_generator/testJarJarRemapping.golden b/base/android/jni_generator/testJarJarRemapping.golden
index 26406e4bb5b2104d321920b78ee879b2db90050f..df44da90c90bd0026e810f9153f8374adcf85eb0 100644
--- a/base/android/jni_generator/testJarJarRemapping.golden
+++ b/base/android/jni_generator/testJarJarRemapping.golden
@@ -16,42 +16,21 @@
// Step 1: forward declarations.
namespace {
-const char kExampleClassPath[] = "com/test/jni_generator/Example";
-// Leaking this jclass as we cannot use LazyInstance from some threads.
-jclass g_Example_clazz = NULL;
} // namespace
+extern "C"{
+
static void Test(JNIEnv* env, jclass jcaller,
jobject t);
+__attribute__((alias("Test"), visibility("default"))) void
+ Java_com_test_jni_1generator_Example_nativeTest(JNIEnv* env, jclass jcaller,
+ jobject t);
// Step 2: method stubs.
-// Step 3: RegisterNatives.
-
-static const JNINativeMethod kMethodsExample[] = {
- { "nativeTest",
-"("
-"Lorg/test2/org/chromium/example2/Test;"
-")"
-"V", reinterpret_cast<void*>(Test) },
};
-static bool RegisterNativesImpl(JNIEnv* env) {
- g_Example_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
- base::android::GetClass(env, kExampleClassPath).obj()));
-
- const int kMethodsExampleSize = arraysize(kMethodsExample);
-
- if (env->RegisterNatives(g_Example_clazz,
- kMethodsExample,
- kMethodsExampleSize) < 0) {
- jni_generator::HandleRegistrationError(
- env, g_Example_clazz, __FILE__);
- return false;
- }
-
- return true;
-}
+// Step 3: RegisterNatives.
#endif // org_chromium_example_jni_generator_Example_JNI

Powered by Google App Engine
This is Rietveld 408576698