| Index: android_webview/lib/main/aw_main_delegate.cc
|
| diff --git a/android_webview/lib/main/aw_main_delegate.cc b/android_webview/lib/main/aw_main_delegate.cc
|
| index 32afc03790db6d3eb52dd28b2e6c63eb1d155ae8..fe86e46c3dc6ba9c3db0488da311c2cd4a1a66df 100644
|
| --- a/android_webview/lib/main/aw_main_delegate.cc
|
| +++ b/android_webview/lib/main/aw_main_delegate.cc
|
| @@ -17,6 +17,7 @@
|
| #include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "base/threading/thread_restrictions.h"
|
| #include "content/public/browser/browser_main_runner.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/common/content_switches.h"
|
| @@ -26,9 +27,15 @@ namespace android_webview {
|
|
|
| namespace {
|
|
|
| +// TODO(boliu): Remove these global Allows once the underlying issues
|
| +// are resolved. See AwMainDelegate::RunProcess below.
|
| +
|
| base::LazyInstance<scoped_ptr<ScopedAllowWaitForLegacyWebViewApi> >
|
| g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER;
|
|
|
| +base::LazyInstance<scoped_ptr<base::ThreadRestrictions::ScopedAllowIO> >
|
| + g_allow_io_in_ui_thread = LAZY_INSTANCE_INITIALIZER;
|
| +
|
| bool UIAndRendererCompositorThreadsNotMerged() {
|
| return CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kNoMergeUIAndRendererCompositorThreads);
|
| @@ -76,10 +83,16 @@ int AwMainDelegate::RunProcess(
|
| int exit_code = browser_runner_->Initialize(main_function_params);
|
| DCHECK(exit_code < 0);
|
|
|
| - // This is temporary until we remove the browser compositor
|
| if (!UIAndRendererCompositorThreadsNotMerged()) {
|
| + // This is temporary until we remove the browser compositor
|
| g_allow_wait_in_ui_thread.Get().reset(
|
| - new ScopedAllowWaitForLegacyWebViewApi());
|
| + new ScopedAllowWaitForLegacyWebViewApi);
|
| +
|
| + // TODO(boliu): This is a HUGE hack to work around the fact that
|
| + // cc::WorkerPool joins on worker threads on the UI thread.
|
| + // See crbug.com/239423.
|
| + g_allow_io_in_ui_thread.Get().reset(
|
| + new base::ThreadRestrictions::ScopedAllowIO);
|
| }
|
|
|
| // Return 0 so that we do NOT trigger the default behavior. On Android, the
|
|
|