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

Unified Diff: cc/surfaces/compositor_frame_sink_support.cc

Issue 2557853002: cc: Unregister FrameSink hierarchy on CompositorFrameSinkSupport destruction (Closed)
Patch Set: Created 4 years 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/surfaces/compositor_frame_sink_support.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/compositor_frame_sink_support.cc
diff --git a/cc/surfaces/compositor_frame_sink_support.cc b/cc/surfaces/compositor_frame_sink_support.cc
index 011d9a091583d27ac07bb3598771baae74a3fc0a..c049ac7f3c0861e1d97485c851c83c2895ded975 100644
--- a/cc/surfaces/compositor_frame_sink_support.cc
+++ b/cc/surfaces/compositor_frame_sink_support.cc
@@ -33,6 +33,11 @@ CompositorFrameSinkSupport::CompositorFrameSinkSupport(
}
CompositorFrameSinkSupport::~CompositorFrameSinkSupport() {
+ for (auto& child_frame_sink_id : child_frame_sinks_) {
+ DCHECK(child_frame_sink_id.is_valid());
+ surface_manager_->UnregisterFrameSinkHierarchy(frame_sink_id_,
+ child_frame_sink_id);
+ }
// SurfaceFactory's destructor will attempt to return resources which will
// call back into here and access |client_| so we should destroy
// |surface_factory_|'s resources early on.
@@ -93,14 +98,19 @@ void CompositorFrameSinkSupport::DidReceiveCompositorFrameAck() {
void CompositorFrameSinkSupport::AddChildFrameSink(
const FrameSinkId& child_frame_sink_id) {
+ child_frame_sinks_.insert(child_frame_sink_id);
surface_manager_->RegisterFrameSinkHierarchy(frame_sink_id_,
child_frame_sink_id);
}
void CompositorFrameSinkSupport::RemoveChildFrameSink(
const FrameSinkId& child_frame_sink_id) {
+ auto it = child_frame_sinks_.find(child_frame_sink_id);
+ DCHECK(it != child_frame_sinks_.end());
+ DCHECK(it->is_valid());
surface_manager_->UnregisterFrameSinkHierarchy(frame_sink_id_,
child_frame_sink_id);
+ child_frame_sinks_.erase(it);
}
void CompositorFrameSinkSupport::DisplayOutputSurfaceLost() {}
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698