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

Unified Diff: testing/android/native_test/native_test_jni_onload.cc

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
Index: testing/android/native_test/native_test_jni_onload.cc
diff --git a/testing/android/native_test/native_test_jni_onload.cc b/testing/android/native_test/native_test_jni_onload.cc
index 8fecc444c0ecd306abadfbc323ba02c80aea3269..32e64270915a5227cdc633dd29c9b79e1b6a3325 100644
--- a/testing/android/native_test/native_test_jni_onload.cc
+++ b/testing/android/native_test/native_test_jni_onload.cc
@@ -23,6 +23,9 @@ bool Init() {
// This is called by the VM when the shared library is first loaded.
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
+ base::android::InitVM(vm);
+ base::android::InitJniRegistrationType(base::android::AttachCurrentThread(),
+ true);
std::vector<base::android::RegisterCallback> register_callbacks;
register_callbacks.push_back(base::Bind(&RegisterJNI));

Powered by Google App Engine
This is Rietveld 408576698