Chromium Code Reviews| 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..fa28a50ec23f69611bfcd7e15993873745a94738 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" |
| @@ -29,6 +30,9 @@ namespace { |
| 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; |
|
joth
2013/05/09 13:14:39
could you add a comment to remove both these?
|
| + |
| bool UIAndRendererCompositorThreadsNotMerged() { |
| return CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kNoMergeUIAndRendererCompositorThreads); |
| @@ -79,7 +83,13 @@ int AwMainDelegate::RunProcess( |
| // This is temporary until we remove the browser compositor |
| if (!UIAndRendererCompositorThreadsNotMerged()) { |
| 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 |