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

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

Issue 975253002: refactoring Android Webview JNI_OnLoad interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove at exit manager change Created 5 years, 9 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') | no next file » | 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 3e011903cb2dddcdf34012f5bc6b0b08db23c108..e728d620921024202f0fa4bdae2acb1e2a279265 100644
--- a/android_webview/lib/main/webview_jni_onload.cc
+++ b/android_webview/lib/main/webview_jni_onload.cc
@@ -8,8 +8,10 @@
#include "android_webview/native/android_webview_jni_registrar.h"
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
+#include "base/bind.h"
#include "components/navigation_interception/component_jni_registrar.h"
#include "components/web_contents_delegate_android/component_jni_registrar.h"
+#include "content/public/app/content_jni_onload.h"
#include "content/public/app/content_main.h"
#include "url/url_util.h"
@@ -25,8 +27,6 @@ static base::android::RegistrationMethod
web_contents_delegate_android::RegisterWebContentsDelegateAndroidJni },
};
-} // namespace
-
bool RegisterJNI(JNIEnv* env) {
// Register JNI for components we depend on.
if (!RegisterNativeMethods(
@@ -49,4 +49,18 @@ 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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698