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

Unified Diff: base/android/jni_generator/testNativesLong.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/testNativesLong.golden
diff --git a/base/android/jni_generator/testNativesLong.golden b/base/android/jni_generator/testNativesLong.golden
index d5b67ba88d068b32b45f91264c7c0fe3ebe85523..61711c363ac27fe504b86b540cf664968de7f270 100644
--- a/base/android/jni_generator/testNativesLong.golden
+++ b/base/android/jni_generator/testNativesLong.golden
@@ -20,13 +20,14 @@
namespace {
const char kTestJniClassPath[] = "org/chromium/TestJni";
// 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)
} // namespace
// Step 2: method stubs.
-static void Java_org_chromium_TestJni_nativeDestroy(JNIEnv* env,
+extern "C" __attribute__((visibility("default")))
+void Java_org_chromium_TestJni_nativeDestroy(JNIEnv* env,
jobject jcaller,
jlong nativeChromeBrowserProvider) {
ChromeBrowserProvider* native =
@@ -46,9 +47,7 @@ static const JNINativeMethod kMethodsTestJni[] = {
};
static bool RegisterNativesImpl(JNIEnv* env) {
-
- g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
- base::android::GetClass(env, kTestJniClassPath).obj()));
+ if (base::android::IsManualJniRegistrationDisabled()) return true;
const int kMethodsTestJniSize = arraysize(kMethodsTestJni);
« no previous file with comments | « base/android/jni_generator/testNatives.golden ('k') | base/android/jni_generator/testSingleJNIAdditionalImport.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698