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

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

Issue 2620303004: Remove JNI onload callback vector construction in favour of direct calls. (Closed)
Patch Set: rebase compile errors Created 3 years, 10 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 | « android_webview/lib/main/webview_jni_onload.h ('k') | base/android/base_jni_onload.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « android_webview/lib/main/webview_jni_onload.h ('k') | base/android/base_jni_onload.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698