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

Unified Diff: cc/trees/proxy_main.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/proxy_main.h ('k') | cc/trees/single_thread_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/proxy_main.cc
diff --git a/cc/trees/proxy_main.cc b/cc/trees/proxy_main.cc
index c11036c3ff32bae611bc372f7bfaf85f502ede71..33dfe12363257b78e07a1a1b5a4d4ddcb4f8c962 100644
--- a/cc/trees/proxy_main.cc
+++ b/cc/trees/proxy_main.cc
@@ -36,6 +36,7 @@ ProxyMain::ProxyMain(LayerTreeHost* layer_tree_host,
commit_waits_for_activation_(false),
started_(false),
defer_commits_(false),
+ frame_sink_bound_weak_factory_(this),
weak_factory_(this) {
TRACE_EVENT0("cc", "ProxyMain::ProxyMain");
DCHECK(task_runner_provider_);
@@ -298,9 +299,10 @@ bool ProxyMain::CommitToActiveTree() const {
void ProxyMain::SetCompositorFrameSink(
CompositorFrameSink* compositor_frame_sink) {
ImplThreadTaskRunner()->PostTask(
- FROM_HERE, base::BindOnce(&ProxyImpl::InitializeCompositorFrameSinkOnImpl,
- base::Unretained(proxy_impl_.get()),
- compositor_frame_sink));
+ FROM_HERE,
+ base::BindOnce(&ProxyImpl::InitializeCompositorFrameSinkOnImpl,
+ base::Unretained(proxy_impl_.get()), compositor_frame_sink,
+ frame_sink_bound_weak_factory_.GetWeakPtr()));
}
void ProxyMain::SetVisible(bool visible) {
@@ -479,6 +481,7 @@ bool ProxyMain::MainFrameWillHappenForTesting() {
void ProxyMain::ReleaseCompositorFrameSink() {
DCHECK(IsMainThread());
+ frame_sink_bound_weak_factory_.InvalidateWeakPtrs();
DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_);
CompletionEvent completion;
ImplThreadTaskRunner()->PostTask(
« no previous file with comments | « cc/trees/proxy_main.h ('k') | cc/trees/single_thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698