Index: android_webview/lib/main/webview_jni_onload.cc |
diff --git a/android_webview/lib/main/webview_jni_onload.cc b/android_webview/lib/main/webview_jni_onload.cc |
index eb8d10d5f7227edb913f331b0f0a4b4e7bc66d91..1edce097c9cbebe1a342b608ae060e9a2288802d 100644 |
--- a/android_webview/lib/main/webview_jni_onload.cc |
+++ b/android_webview/lib/main/webview_jni_onload.cc |
@@ -26,7 +26,12 @@ static base::android::RegistrationMethod |
web_contents_delegate_android::RegisterWebContentsDelegateAndroidJni }, |
}; |
-bool RegisterJNI(JNIEnv* env) { |
+} // namespace |
+ |
+bool OnJNIOnLoadRegisterJNI(JNIEnv* env) { |
+ if (!content::android::OnJNIOnLoadRegisterJNI(env)) |
+ return false; |
+ |
// Register JNI for components we depend on. |
if (!RegisterNativeMethods( |
env, |
@@ -38,7 +43,10 @@ bool RegisterJNI(JNIEnv* env) { |
return true; |
} |
-bool Init() { |
+bool OnJNIOnLoadInit() { |
+ if (!content::android::OnJNIOnLoadInit()) |
+ return false; |
+ |
base::android::SetVersionNumber(PRODUCT_VERSION); |
content::SetContentMainDelegate(new android_webview::AwMainDelegate()); |
@@ -49,18 +57,4 @@ bool Init() { |
return true; |
} |
-} // namespace |
- |
-bool OnJNIOnLoadRegisterJNI(JavaVM* vm) { |
- std::vector<base::android::RegisterCallback> register_callbacks; |
- register_callbacks.push_back(base::Bind(&RegisterJNI)); |
- return content::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks); |
-} |
- |
-bool OnJNIOnLoadInit() { |
- std::vector<base::android::InitCallback> init_callbacks; |
- init_callbacks.push_back(base::Bind(&Init)); |
- return content::android::OnJNIOnLoadInit(init_callbacks); |
-} |
- |
} // android_webview |