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

Unified Diff: cc/trees/thread_proxy.cc

Issue 400773002: cc: Parameterize the main thread task runner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WebView fix. Created 6 years, 5 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
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 5038c583b5d23c014cdb9be3a36327606412710e..941d7df18ff2a8e23820eba9fb6bdc6f640161b9 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -64,15 +64,18 @@ struct ThreadProxy::SchedulerStateRequest {
scoped_ptr<Proxy> ThreadProxy::Create(
LayerTreeHost* layer_tree_host,
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) {
- return make_scoped_ptr(new ThreadProxy(layer_tree_host, impl_task_runner))
- .PassAs<Proxy>();
+ return make_scoped_ptr(new ThreadProxy(layer_tree_host,
+ main_task_runner,
+ impl_task_runner)).PassAs<Proxy>();
}
ThreadProxy::ThreadProxy(
LayerTreeHost* layer_tree_host,
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner)
- : Proxy(impl_task_runner),
+ : Proxy(main_task_runner, impl_task_runner),
main_thread_only_vars_unsafe_(this, layer_tree_host->id()),
main_thread_or_blocked_vars_unsafe_(layer_tree_host),
compositor_thread_vars_unsafe_(this, layer_tree_host->id()) {
@@ -465,12 +468,13 @@ void ThreadProxy::SetDeferCommits(bool defer_commits) {
else
TRACE_EVENT_ASYNC_END0("cc", "ThreadProxy::SetDeferCommits", this);
- if (!main().defer_commits && main().pending_deferred_commit)
+ if (!main().defer_commits && main().pending_deferred_commit) {
Proxy::MainThreadTaskRunner()->PostTask(
FROM_HERE,
base::Bind(&ThreadProxy::BeginMainFrame,
main_thread_weak_ptr_,
base::Passed(&main().pending_deferred_commit)));
+ }
}
bool ThreadProxy::CommitRequested() const {
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698