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

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 feedf2bd28a0cf5366a92b1afb203f3c13f7aa9f..7a7444cff21c419f6faa8724557cf6c33731bc65 100644
--- a/services/ui/ws/frame_generator.cc
+++ b/services/ui/ws/frame_generator.cc
@@ -257,8 +257,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;
}
@@ -303,7 +302,7 @@ void FrameGenerator::ReleaseAllSurfaceReferences() {
}
void FrameGenerator::OnWindowDestroying(ServerWindow* window) {
- window->RemoveObserver(this);
+ Remove(window);
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