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

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

Issue 2162923002: jni_generator: Always generate native exports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/testCalledByNatives.golden
diff --git a/base/android/jni_generator/testCalledByNatives.golden b/base/android/jni_generator/testCalledByNatives.golden
index 3bc586c47eb4275c8a64a611e6f406e4f688bde3..82b741807be55f765e04669a42b034f4bfee94c5 100644
--- a/base/android/jni_generator/testCalledByNatives.golden
+++ b/base/android/jni_generator/testCalledByNatives.golden
@@ -21,11 +21,11 @@ namespace {
const char kTestJniClassPath[] = "org/chromium/TestJni";
const char kInfoBarClassPath[] = "org/chromium/TestJni$InfoBar";
// Leaking this jclass as we cannot use LazyInstance from some threads.
-jclass g_TestJni_clazz = NULL;
-#define TestJni_clazz(env) g_TestJni_clazz
+base::subtle::AtomicWord g_TestJni_clazz __attribute__((unused)) = 0;
+#define TestJni_clazz(env) base::android::LazyGetClass(env, kTestJniClassPath, &g_TestJni_clazz)
// Leaking this jclass as we cannot use LazyInstance from some threads.
-jclass g_InfoBar_clazz = NULL;
-#define InfoBar_clazz(env) g_InfoBar_clazz
+base::subtle::AtomicWord g_InfoBar_clazz __attribute__((unused)) = 0;
+#define InfoBar_clazz(env) base::android::LazyGetClass(env, kInfoBarClassPath, &g_InfoBar_clazz)
} // namespace
@@ -496,11 +496,7 @@ static ScopedJavaLocalRef<jobject> Java_TestJni_getCompressFormatList(JNIEnv*
// Step 3: RegisterNatives.
static bool RegisterNativesImpl(JNIEnv* env) {
-
- g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
- base::android::GetClass(env, kTestJniClassPath).obj()));
- g_InfoBar_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
- base::android::GetClass(env, kInfoBarClassPath).obj()));
+ if (base::android::IsManualJniRegistrationDisabled()) return true;
return true;
}
« no previous file with comments | « base/android/jni_generator/jni_generator_tests.py ('k') | base/android/jni_generator/testConstantsFromJavaP.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698