diff options
author | torne@chromium.org <torne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-16 03:12:35 +0000 |
---|---|---|
committer | torne@chromium.org <torne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-16 03:12:35 +0000 |
commit | 28e912726bb4dc4350628ad34ae60a4a050da401 (patch) | |
tree | d43793886763a49cef2402e340c84ed1b1b12d94 /android_webview/lib | |
parent | a722a58309cbb4ce928130ee35f095ea7eb15329 (diff) | |
download | chromium_src-28e912726bb4dc4350628ad34ae60a4a050da401.zip chromium_src-28e912726bb4dc4350628ad34ae60a4a050da401.tar.gz chromium_src-28e912726bb4dc4350628ad34ae60a4a050da401.tar.bz2 |
Android WebView: initialize url_util safely.
In the case where we use CookieManager before initializing the rest of
Chromium, we need to have initialized url_util at some reliable point
because its lazy init is not threadsafe. Do this in the entry point so
it's guaranteed we've always called it before any Chromium code runs.
BUG=334490
Review URL: https://codereview.chromium.org/136723010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245084 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/lib')
-rw-r--r-- | android_webview/lib/main/webview_entry_point.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/android_webview/lib/main/webview_entry_point.cc b/android_webview/lib/main/webview_entry_point.cc index 858601f3..7038416 100644 --- a/android_webview/lib/main/webview_entry_point.cc +++ b/android_webview/lib/main/webview_entry_point.cc @@ -10,6 +10,7 @@ #include "components/web_contents_delegate_android/component_jni_registrar.h" #include "content/public/app/android_library_loader_hooks.h" #include "content/public/app/content_main.h" +#include "url/url_util.h" static base::android::RegistrationMethod kWebViewDependencyRegisteredMethods[] = { @@ -44,5 +45,10 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { content::SetContentMainDelegate(new android_webview::AwMainDelegate()); + // Initialize url_util here while we are still single-threaded, in case we use + // CookieManager before initializing Chromium (which would normally have done + // this). It's safe to call this multiple times. + url_util::Initialize(); + return JNI_VERSION_1_4; } |