diff options
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; |