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

Unified Diff: base/android/jni_android.cc

Issue 920883002: Use combined native/manual JNI registration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Factor out common code in test Created 5 years, 10 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
« no previous file with comments | « base/android/jni_android.h ('k') | base/android/jni_generator/jni_generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_android.cc
diff --git a/base/android/jni_android.cc b/base/android/jni_android.cc
index e09c2d5d150587aedfbb9d57fc294b57dcc931ad..a2de00aca2a3fcf2ce0c8c82bd06afc48229c256 100644
--- a/base/android/jni_android.cc
+++ b/base/android/jni_android.cc
@@ -17,6 +17,8 @@ using base::android::GetClass;
using base::android::MethodID;
using base::android::ScopedJavaLocalRef;
+bool g_disable_manual_jni_registration = false;
+
JavaVM* g_jvm = NULL;
// Leak the global app context, as it is used from a non-joinable worker thread
// that may still be running at shutdown. There is no harm in doing this.
@@ -77,6 +79,15 @@ std::string GetJavaExceptionInfo(JNIEnv* env, jthrowable java_throwable) {
namespace base {
namespace android {
+bool IsManualJniRegistrationDisabled() {
+ return g_disable_manual_jni_registration;
+}
+
+void DisableManualJniRegistration() {
+ DCHECK(!g_disable_manual_jni_registration);
+ g_disable_manual_jni_registration = true;
+}
+
JNIEnv* AttachCurrentThread() {
DCHECK(g_jvm);
JNIEnv* env = NULL;
« no previous file with comments | « base/android/jni_android.h ('k') | base/android/jni_generator/jni_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698