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

Unified Diff: base/android/jni_android.h

Issue 2501193003: Selectively perform JNI registration in render processes on Android. (Closed)
Patch Set: Conditionally register JNI based on process type. 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..b4f2b4d3462c0e22d19f2a18851fa6632612c0f3 100644
--- a/base/android/jni_android.h
+++ b/base/android/jni_android.h
@@ -54,13 +54,27 @@ namespace android {
// Used to mark symbols to be exported in a shared library's symbol table.
#define JNI_EXPORT __attribute__ ((visibility("default")))
+// The level of JNI registration required for the current process.
+// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.base
+enum JniRegistrationType {
+ // Indicates the JNI registration type hasn't yet been set.
+ UNINITIALIZED_JNI_REGISTRATION,
+ // 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,
+};
+
// 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();
+// JNI exports for startup performance. Call DisableManualJniRegistration at
+// the very beginning of JNI_OnLoad to use this.
BASE_EXPORT void DisableManualJniRegistration();
Torne 2017/01/30 12:29:56 So with this change we do all registration by defa
estevenson 2017/01/30 19:19:27 We could remove JniRegistrationType from the Java
+// Gets the JniRegistrationType from Java and caches it on the native side.
+BASE_EXPORT JniRegistrationType FetchJniRegistrationType();
+
// Contains the registration method information for initializing JNI bindings.
struct RegistrationMethod {
const char* name;
« 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