diff options
author | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-24 13:19:37 +0000 |
---|---|---|
committer | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-24 13:19:37 +0000 |
commit | a6e8c49d3b1d9981ebd0e56a89ffc1c79543eb19 (patch) | |
tree | ca2df2ebfa9314623de454fbe96d2f5e33863d41 /android_webview/lib | |
parent | a9a064bff8415c30fb4f25ceac2cd6d61e44da54 (diff) | |
download | chromium_src-a6e8c49d3b1d9981ebd0e56a89ffc1c79543eb19.zip chromium_src-a6e8c49d3b1d9981ebd0e56a89ffc1c79543eb19.tar.gz chromium_src-a6e8c49d3b1d9981ebd0e56a89ffc1c79543eb19.tar.bz2 |
Set kEnableWebViewSynchronousAPIs later
Currently it's set too early, and gets overritten when
LibraryLoadedOnMainThread re-initializes the command line.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11662018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174576 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/lib')
-rw-r--r-- | android_webview/lib/main/aw_main_delegate.cc | 10 | ||||
-rw-r--r-- | android_webview/lib/main/webview_entry_point.cc | 7 |
2 files changed, 6 insertions, 11 deletions
diff --git a/android_webview/lib/main/aw_main_delegate.cc b/android_webview/lib/main/aw_main_delegate.cc index 379dbe8..8b18910 100644 --- a/android_webview/lib/main/aw_main_delegate.cc +++ b/android_webview/lib/main/aw_main_delegate.cc @@ -8,16 +8,14 @@ #include "android_webview/lib/aw_browser_dependency_factory_impl.h" #include "android_webview/native/aw_web_contents_view_delegate.h" #include "android_webview/renderer/aw_content_renderer_client.h" -#include "base/lazy_instance.h" +#include "base/command_line.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "content/public/browser/browser_main_runner.h" +#include "content/public/common/content_switches.h" namespace android_webview { -base::LazyInstance<AwContentRendererClient> - g_webview_content_renderer_client = LAZY_INSTANCE_INITIALIZER; - AwMainDelegate::AwMainDelegate() { } @@ -27,6 +25,10 @@ AwMainDelegate::~AwMainDelegate() { bool AwMainDelegate::BasicStartupComplete(int* exit_code) { content::SetContentClient(&content_client_); + CommandLine* command_line = CommandLine::ForCurrentProcess(); + // Set the command line to enable synchronous API compatibility. + command_line->AppendSwitch(switches::kEnableWebViewSynchronousAPIs); + return false; } diff --git a/android_webview/lib/main/webview_entry_point.cc b/android_webview/lib/main/webview_entry_point.cc index 8a4996f..567161e 100644 --- a/android_webview/lib/main/webview_entry_point.cc +++ b/android_webview/lib/main/webview_entry_point.cc @@ -5,10 +5,8 @@ #include "android_webview/lib/main/aw_main_delegate.h" #include "android_webview/native/android_webview_jni_registrar.h" #include "base/android/jni_android.h" -#include "base/command_line.h" #include "content/public/app/android_library_loader_hooks.h" #include "content/public/app/content_main.h" -#include "content/public/common/content_switches.h" // This is called by the VM when the shared library is first loaded. // Most of the initialization is done in LibraryLoadedOnMainThread(), not here. @@ -21,11 +19,6 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { if (!android_webview::RegisterJni(env)) return -1; - // Set the command line to enable synchronous API compatibility. - CommandLine::Init(0, NULL); - CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kEnableWebViewSynchronousAPIs); - content::SetContentMainDelegate(new android_webview::AwMainDelegate()); return JNI_VERSION_1_4; |