summaryrefslogtreecommitdiffstats
path: root/android_webview
diff options
context:
space:
mode:
authortorne@chromium.org <torne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-04 12:25:43 +0000
committertorne@chromium.org <torne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-04 12:25:43 +0000
commit7661da4d5a7c4ba292e5b95d478d7f9b5c94bfe5 (patch)
tree74556052716999a9eae5ab0c17b9e33c82c0b88d /android_webview
parentef9787fd126f3759790ab051c0645d585b4c2fe9 (diff)
downloadchromium_src-7661da4d5a7c4ba292e5b95d478d7f9b5c94bfe5.zip
chromium_src-7661da4d5a7c4ba292e5b95d478d7f9b5c94bfe5.tar.gz
chromium_src-7661da4d5a7c4ba292e5b95d478d7f9b5c94bfe5.tar.bz2
Allow JNI registration to be performed eagerly.
Add a content API function which allows JNI registration to be performed immediately during JNI_OnLoad, instead of always being deferred until LibraryLoaded. Add a call to this new API in android_webview's entry point, since it benefits from the eager registration by allowing more pages to be shared, and for certain JNI functions to be called without starting all of Chromium (e.g. to enable AwCookieManager). BUG=304813 Review URL: https://codereview.chromium.org/50493015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview')
-rw-r--r--android_webview/lib/main/webview_entry_point.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/android_webview/lib/main/webview_entry_point.cc b/android_webview/lib/main/webview_entry_point.cc
index e7ea8af..858601f3 100644
--- a/android_webview/lib/main/webview_entry_point.cc
+++ b/android_webview/lib/main/webview_entry_point.cc
@@ -27,6 +27,11 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
if (!content::RegisterLibraryLoaderEntryHook(env))
return -1;
+ // Register content JNI functions now, rather than waiting until
+ // LibraryLoadedOnMainThread, so that we can call into native code early.
+ if (!content::EnsureJniRegistered(env))
+ return -1;
+
// Register JNI for components we depend on.
if (!RegisterNativeMethods(
env,