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

Side by Side Diff: services/ui/ws/window_manager_state.cc

Issue 2365243003: Fixes possible crash in ~Display (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 unified diff | Download patch
« no previous file with comments | « no previous file | services/ui/ws/window_manager_state_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/ws/window_manager_state.h" 5 #include "services/ui/ws/window_manager_state.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "services/shell/public/interfaces/connector.mojom.h" 10 #include "services/shell/public/interfaces/connector.mojom.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 WindowManagerState::WindowManagerState(WindowTree* window_tree) 113 WindowManagerState::WindowManagerState(WindowTree* window_tree)
114 : window_tree_(window_tree), event_dispatcher_(this), weak_factory_(this) { 114 : window_tree_(window_tree), event_dispatcher_(this), weak_factory_(this) {
115 frame_decoration_values_ = mojom::FrameDecorationValues::New(); 115 frame_decoration_values_ = mojom::FrameDecorationValues::New();
116 frame_decoration_values_->max_title_bar_button_width = 0u; 116 frame_decoration_values_->max_title_bar_button_width = 0u;
117 117
118 AddDebugAccelerators(); 118 AddDebugAccelerators();
119 } 119 }
120 120
121 WindowManagerState::~WindowManagerState() { 121 WindowManagerState::~WindowManagerState() {
122 for (auto& display_root : window_manager_display_roots_)
123 display_root->display()->OnWillDestroyTree(window_tree_);
124
122 for (auto& display_root : orphaned_window_manager_display_roots_) 125 for (auto& display_root : orphaned_window_manager_display_roots_)
123 display_root->root()->RemoveObserver(this); 126 display_root->root()->RemoveObserver(this);
124 } 127 }
125 128
126 void WindowManagerState::SetFrameDecorationValues( 129 void WindowManagerState::SetFrameDecorationValues(
127 mojom::FrameDecorationValuesPtr values) { 130 mojom::FrameDecorationValuesPtr values) {
128 got_frame_decoration_values_ = true; 131 got_frame_decoration_values_ = true;
129 frame_decoration_values_ = values.Clone(); 132 frame_decoration_values_ = values.Clone();
130 display_manager() 133 display_manager()
131 ->GetUserDisplayManager(user_id()) 134 ->GetUserDisplayManager(user_id())
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 window->RemoveObserver(this); 622 window->RemoveObserver(this);
620 orphaned_window_manager_display_roots_.erase(iter); 623 orphaned_window_manager_display_roots_.erase(iter);
621 return; 624 return;
622 } 625 }
623 } 626 }
624 NOTREACHED(); 627 NOTREACHED();
625 } 628 }
626 629
627 } // namespace ws 630 } // namespace ws
628 } // namespace ui 631 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | services/ui/ws/window_manager_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698