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

Side by Side Diff: ash/mus/window_manager.cc

Issue 2269473003: ash/mus: Fix a crash during tear down. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: doc Created 4 years, 4 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ash/mus/window_manager.h" 5 #include "ash/mus/window_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 void WindowManager::OnEmbed(ui::Window* root) { 207 void WindowManager::OnEmbed(ui::Window* root) {
208 // WindowManager should never see this, instead OnWmNewDisplay() is called. 208 // WindowManager should never see this, instead OnWmNewDisplay() is called.
209 NOTREACHED(); 209 NOTREACHED();
210 } 210 }
211 211
212 void WindowManager::OnDidDestroyClient(ui::WindowTreeClient* client) { 212 void WindowManager::OnDidDestroyClient(ui::WindowTreeClient* client) {
213 // Destroying the roots should result in removal from 213 // Destroying the roots should result in removal from
214 // |root_window_controllers_|. 214 // |root_window_controllers_|.
215 DCHECK(root_window_controllers_.empty()); 215 DCHECK(root_window_controllers_.empty());
216 216
217 // Observers can rely on WmShell from the callback. So notify the observers
218 // before destroying it.
219 FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
220 OnWindowTreeClientDestroyed());
221
217 lookup_.reset(); 222 lookup_.reset();
218 shell_->Shutdown(); 223 shell_->Shutdown();
219 shell_.reset(); 224 shell_.reset();
220 shadow_controller_.reset(); 225 shadow_controller_.reset();
221 226
222 FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
223 OnWindowTreeClientDestroyed());
224
225 pointer_watcher_event_router_.reset(); 227 pointer_watcher_event_router_.reset();
226 228
227 window_tree_client_ = nullptr; 229 window_tree_client_ = nullptr;
228 window_manager_client_ = nullptr; 230 window_manager_client_ = nullptr;
229 } 231 }
230 232
231 void WindowManager::OnPointerEventObserved(const ui::PointerEvent& event, 233 void WindowManager::OnPointerEventObserved(const ui::PointerEvent& event,
232 ui::Window* target) { 234 ui::Window* target) {
233 pointer_watcher_event_router_->OnPointerEventObserved(event, target); 235 pointer_watcher_event_router_->OnPointerEventObserved(event, target);
234 } 236 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 const ui::Event& event) { 308 const ui::Event& event) {
307 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id)); 309 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id));
308 if (iter == accelerator_handlers_.end()) 310 if (iter == accelerator_handlers_.end())
309 return ui::mojom::EventResult::HANDLED; 311 return ui::mojom::EventResult::HANDLED;
310 312
311 return iter->second->OnAccelerator(id, event); 313 return iter->second->OnAccelerator(id, event);
312 } 314 }
313 315
314 } // namespace mus 316 } // namespace mus
315 } // namespace ash 317 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698