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

Unified Diff: cc/trees/thread_proxy.cc

Issue 870183004: Revert of cc: Control defer_commits logic by Scheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 5 years, 11 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') | no next file » | 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 88f1314c6d1c39bb4cba32910a81642a725cdeeb..c343c97e7064859cf91cd169a8290022b5944da3 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -452,16 +452,13 @@
else
TRACE_EVENT_ASYNC_END0("cc", "ThreadProxy::SetDeferCommits", this);
- Proxy::ImplThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&ThreadProxy::SetDeferCommitsOnImplThread,
- impl_thread_weak_ptr_,
- defer_commits));
-}
-
-void ThreadProxy::SetDeferCommitsOnImplThread(bool defer_commits) const {
- DCHECK(IsImplThread());
- impl().scheduler->SetDeferCommits(defer_commits);
+ 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 {
@@ -704,12 +701,10 @@
DCHECK(IsMainThread());
if (main().defer_commits) {
- TRACE_EVENT_INSTANT0("cc", "EarlyOut_DeferCommit",
- TRACE_EVENT_SCOPE_THREAD);
- Proxy::ImplThreadTaskRunner()->PostTask(
- FROM_HERE, base::Bind(&ThreadProxy::BeginMainFrameAbortedOnImplThread,
- impl_thread_weak_ptr_,
- CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT));
+ main().pending_deferred_commit = begin_main_frame_state.Pass();
+ layer_tree_host()->DidDeferCommit();
+ TRACE_EVENT_INSTANT0(
+ "cc", "EarlyOut_DeferCommits", TRACE_EVENT_SCOPE_THREAD);
return;
}
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698