Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: android_webview/lib/main/aw_main_delegate.cc

Issue 14888002: Android WebView Merged-Thread Hardware Draw (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698