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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 2757373002: Fixing flakiness of TextureLayerChangeInvisibleMailboxTest (Closed)
Patch Set: c Created 3 years, 8 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/single_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/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 0386145c7c55fea08e4f34362dd5f3536b1b1a02..3e307bb7b1a54e5cfd92b0aa1f9d373ae9269d4d 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -425,7 +425,12 @@ void SingleThreadProxy::DidReceiveCompositorFrameAckOnImplThread() {
"SingleThreadProxy::DidReceiveCompositorFrameAckOnImplThread");
if (scheduler_on_impl_thread_)
scheduler_on_impl_thread_->DidReceiveCompositorFrameAck();
- layer_tree_host_->DidReceiveCompositorFrameAck();
+ // We do a PostTask here because freeing resources in some cases (such as in
+ // TextureLayer) is PostTasked and we want to make sure ack is received after
+ // resources are returned.
+ task_runner_provider_->MainThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&SingleThreadProxy::DidReceiveCompositorFrameAck,
+ weak_factory_.GetWeakPtr()));
}
void SingleThreadProxy::OnDrawForCompositorFrameSink(
@@ -794,4 +799,9 @@ void SingleThreadProxy::DidFinishImplFrame() {
#endif
}
+void SingleThreadProxy::DidReceiveCompositorFrameAck() {
+ if (layer_tree_host_)
danakj 2017/04/04 19:20:54 This is unusual in this file, the host is only nul
Saman Sami 2017/04/04 19:32:31 I'm not familiar with lifetime of layer_tree_host_
danakj 2017/04/04 19:36:21 I'm quite against branches just-in-case, and want
Saman Sami 2017/04/04 21:39:14 Done.
+ layer_tree_host_->DidReceiveCompositorFrameAck();
+}
+
} // namespace cc
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698