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

Unified Diff: base/android/jni_generator/jni_generator_helper.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/jni_generator/jni_generator.py ('k') | base/android/jni_generator/jni_generator_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_generator/jni_generator_helper.h
diff --git a/base/android/jni_generator/jni_generator_helper.h b/base/android/jni_generator/jni_generator_helper.h
index 4c159c03a9f3975b08b487821a1839185918017b..3062806a85fd7f08732e88ff4b7e85c6fd6f0609 100644
--- a/base/android/jni_generator/jni_generator_helper.h
+++ b/base/android/jni_generator/jni_generator_helper.h
@@ -42,6 +42,21 @@ inline void CheckException(JNIEnv* env) {
base::android::CheckException(env);
}
+inline bool ShouldSkipJniRegistration(bool is_maindex_class) {
+ switch (base::android::GetJniRegistrationType()) {
+ case base::android::ALL_JNI_REGISTRATION:
+ return false;
+ case base::android::NO_JNI_REGISTRATION:
+ // TODO(estevenson): Change this to a DCHECK.
+ return true;
+ case base::android::SELECTIVE_JNI_REGISTRATION:
+ return !is_maindex_class;
+ default:
+ NOTREACHED();
+ return false;
+ }
+}
+
} // namespace jni_generator
#endif // BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_
« no previous file with comments | « base/android/jni_generator/jni_generator.py ('k') | base/android/jni_generator/jni_generator_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698