Index: cc/trees/proxy_main.cc |
diff --git a/cc/trees/proxy_main.cc b/cc/trees/proxy_main.cc |
index 5b9e7f0e576ca59ba5e35ad962e65c5e0d805468..de79051d4b38e3395e219f1054e431150859bd37 100644 |
--- a/cc/trees/proxy_main.cc |
+++ b/cc/trees/proxy_main.cc |
@@ -187,6 +187,26 @@ void ProxyMain::BeginMainFrame( |
layer_tree_host_->GetUIResourceManager()->RecreateUIResources(); |
layer_tree_host_->RequestMainFrameUpdate(); |
+ |
+ // At this point the main frame may have deferred commits to avoid committing |
+ // right now. |
+ if (defer_commits_) { |
+ TRACE_EVENT_INSTANT0("cc", "EarlyOut_DeferCommit_InsideBeginMainFrame", |
+ TRACE_EVENT_SCOPE_THREAD); |
+ std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; |
+ ImplThreadTaskRunner()->PostTask( |
+ FROM_HERE, base::Bind(&ProxyImpl::BeginMainFrameAbortedOnImpl, |
+ base::Unretained(proxy_impl_.get()), |
+ CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT, |
+ begin_main_frame_start_time, |
+ base::Passed(&empty_swap_promises))); |
+ current_pipeline_stage_ = NO_PIPELINE_STAGE; |
+ // We intentionally don't report CommitComplete() here since it was aborted |
+ // prematurely and we're waiting to do another commit in the future. |
+ layer_tree_host_->DidBeginMainFrame(); |
+ return; |
+ } |
+ |
TRACE_EVENT_SYNTHETIC_DELAY_END("cc.BeginMainFrame"); |
bool can_cancel_this_commit = final_pipeline_stage_ < COMMIT_PIPELINE_STAGE && |