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

Unified Diff: android_webview/lib/main/webview_entry_point.cc

Issue 2593653002: Split JNI init so native library preloading dosn't cause native init. (Closed)
Patch Set: Add library initialization to AwCookieManager constructor Created 3 years, 12 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: android_webview/lib/main/webview_entry_point.cc
diff --git a/android_webview/lib/main/webview_entry_point.cc b/android_webview/lib/main/webview_entry_point.cc
index 12d0fa99df1ae2b1a2cf53bdf482d7881bda5532..dfda80186b27ebc244ccb42c41d06b8c93031d95 100644
--- a/android_webview/lib/main/webview_entry_point.cc
+++ b/android_webview/lib/main/webview_entry_point.cc
@@ -4,6 +4,7 @@
#include "android_webview/lib/main/webview_jni_onload.h"
#include "base/android/jni_android.h"
+#include "base/android/library_loader/library_loader_hooks.h"
// This is called by the VM when the shared library is first loaded.
// Most of the initialization is done in LibraryLoadedOnMainThread(), not here.
@@ -12,16 +13,7 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
// we don't have a good way to detect the JNI registrations which is called,
// outside of OnJNIOnLoadRegisterJNI code path.
base::android::DisableManualJniRegistration();
-
- if (base::android::IsManualJniRegistrationDisabled()) {
- base::android::InitVM(vm);
- } else {
- if (android_webview::OnJNIOnLoadRegisterJNI(vm))
- return -1;
- }
-
- if (!android_webview::OnJNIOnLoadInit()) {
- return -1;
- }
+ base::android::InitVM(vm);
+ base::android::SetNativeInitializationHook(&android_webview::OnJNIOnLoadInit);
return JNI_VERSION_1_4;
}

Powered by Google App Engine
This is Rietveld 408576698