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

Unified Diff: base/android/jni_android.h

Issue 2501193003: Selectively perform JNI registration in render processes on Android. (Closed)
Patch Set: Address Ted C comments Created 3 years, 11 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/java/src/org/chromium/base/JNIUtils.java ('k') | base/android/jni_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_android.h
diff --git a/base/android/jni_android.h b/base/android/jni_android.h
index 96746539b28c24322abdfb0bb7170dcfadaadf2c..de53c10f6d43e82099065427db083ff2547cf784 100644
--- a/base/android/jni_android.h
+++ b/base/android/jni_android.h
@@ -54,12 +54,23 @@ namespace android {
// Used to mark symbols to be exported in a shared library's symbol table.
#define JNI_EXPORT __attribute__ ((visibility("default")))
-// Used to disable manual JNI registration in binaries that prefer to use native
-// JNI exports for startup performance. This is not compatible with the crazy
-// linker and so defaults to off. Call DisableManualJniRegistration at the very
-// beginning of JNI_OnLoad to use this.
-BASE_EXPORT bool IsManualJniRegistrationDisabled();
-BASE_EXPORT void DisableManualJniRegistration();
+// The level of JNI registration required for the current process.
+enum JniRegistrationType {
+ // Register all native methods.
+ ALL_JNI_REGISTRATION,
+ // Register some native methods, as controlled by the jni_generator.
+ SELECTIVE_JNI_REGISTRATION,
+ // Do not register any native methods.
+ NO_JNI_REGISTRATION,
+};
+
+BASE_EXPORT JniRegistrationType GetJniRegistrationType();
+
+// Set the JniRegistrationType for this process (defaults to
+// ALL_JNI_REGISTRATION). This should be called in the JNI_OnLoad function
+// which is called when the native library is first loaded.
+BASE_EXPORT void SetJniRegistrationType(
+ JniRegistrationType jni_registration_type);
// Contains the registration method information for initializing JNI bindings.
struct RegistrationMethod {
« no previous file with comments | « base/android/java/src/org/chromium/base/JNIUtils.java ('k') | base/android/jni_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698