Chromium Code Reviews| Index: chrome/browser/android/monochrome_entry_point.cc |
| diff --git a/chrome/browser/android/monochrome_entry_point.cc b/chrome/browser/android/monochrome_entry_point.cc |
| index a3c7f30457b627518a80a8f9137ec071ba72bc90..3ac599ded1f4cb54638b2c628ddf53389da729e1 100644 |
| --- a/chrome/browser/android/monochrome_entry_point.cc |
| +++ b/chrome/browser/android/monochrome_entry_point.cc |
| @@ -15,20 +15,11 @@ bool Init() { |
| } |
| bool NativeInit() { |
| - JNIEnv* env = base::android::AttachCurrentThread(); |
| - int library_process_type = base::android::GetLibraryProcessType(env); |
| - switch (library_process_type) { |
| - case base::android::PROCESS_WEBVIEW: |
| - case base::android::PROCESS_WEBVIEW_CHILD: |
| - return android_webview::OnJNIOnLoadInit(); |
| - break; |
| - case base::android::PROCESS_BROWSER: |
| - case base::android::PROCESS_CHILD: |
| - return android::OnJNIOnLoadInit(base::Bind(&Init)); |
| - break; |
| - default: |
| - NOTREACHED(); |
| - return false; |
| + if (base::android::GetJniRegistrationType() == |
|
Torne
2017/01/09 16:43:32
Don't use the JNI registration type to determine w
estevenson
2017/01/12 03:46:49
Done.
|
| + base::android::NO_JNI_REGISTRATION) { |
| + return android_webview::OnJNIOnLoadInit(); |
| + } else { |
| + return android::OnJNIOnLoadInit(base::Bind(&Init)); |
| } |
| } |
| @@ -36,8 +27,8 @@ bool NativeInit() { |
| // This is called by the VM when the shared library is first loaded. |
| JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
| - base::android::DisableManualJniRegistration(); |
| base::android::InitVM(vm); |
| + base::android::InitJniRegistrationType(base::android::AttachCurrentThread()); |
| base::android::SetNativeInitializationHook(NativeInit); |
| return JNI_VERSION_1_4; |
| } |