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

Unified Diff: services/ui/ws/frame_generator.cc

Issue 2451863003: mus: Fix a teardown crash. (Closed)
Patch Set: . Created 4 years, 2 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 | « services/ui/ws/frame_generator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/frame_generator.cc
diff --git a/services/ui/ws/frame_generator.cc b/services/ui/ws/frame_generator.cc
index d42f96d1143200fcc394bd94eccf228ecbb672ba..f02a08a147218d83ecc3bce686b7bc56c043eb95 100644
--- a/services/ui/ws/frame_generator.cc
+++ b/services/ui/ws/frame_generator.cc
@@ -254,8 +254,7 @@ void FrameGenerator::AddOrUpdateSurfaceReference(
dependencies_[surface_id.frame_sink_id()] = dependency;
// Observe |window_surface|'s window so that we can release references when
// the window is destroyed.
- if (!window_surface->window()->HasObserver(this))
- window_surface->window()->AddObserver(this);
+ Add(window_surface->window());
return;
}
@@ -300,7 +299,7 @@ void FrameGenerator::ReleaseAllSurfaceReferences() {
}
void FrameGenerator::OnWindowDestroying(ServerWindow* window) {
- window->RemoveObserver(this);
+ ServerWindowTracker::OnWindowDestroying(window);
sky 2016/10/26 17:48:41 Seems weird to call OnWindowDestroying (which is r
sadrul 2016/10/27 04:59:44 Done.
ServerWindowCompositorFrameSinkManager* surface_manager =
window->compositor_frame_sink_manager();
// If FrameGenerator was observing |window|, then that means it had a surface
« no previous file with comments | « services/ui/ws/frame_generator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698