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

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: 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 FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
James Cook 2016/08/22 15:46:40 Can you add a comment here saying this must be des
sadrul 2016/08/22 15:52:20 Done. I looked into writing a unit-test for this,
218 OnWindowTreeClientDestroyed());
219
217 lookup_.reset(); 220 lookup_.reset();
218 shell_->Shutdown(); 221 shell_->Shutdown();
219 shell_.reset(); 222 shell_.reset();
220 shadow_controller_.reset(); 223 shadow_controller_.reset();
221 224
222 FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
223 OnWindowTreeClientDestroyed());
224
225 pointer_watcher_event_router_.reset(); 225 pointer_watcher_event_router_.reset();
226 226
227 window_tree_client_ = nullptr; 227 window_tree_client_ = nullptr;
228 window_manager_client_ = nullptr; 228 window_manager_client_ = nullptr;
229 } 229 }
230 230
231 void WindowManager::OnPointerEventObserved(const ui::PointerEvent& event, 231 void WindowManager::OnPointerEventObserved(const ui::PointerEvent& event,
232 ui::Window* target) { 232 ui::Window* target) {
233 pointer_watcher_event_router_->OnPointerEventObserved(event, target); 233 pointer_watcher_event_router_->OnPointerEventObserved(event, target);
234 } 234 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 const ui::Event& event) { 306 const ui::Event& event) {
307 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id)); 307 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id));
308 if (iter == accelerator_handlers_.end()) 308 if (iter == accelerator_handlers_.end())
309 return ui::mojom::EventResult::HANDLED; 309 return ui::mojom::EventResult::HANDLED;
310 310
311 return iter->second->OnAccelerator(id, event); 311 return iter->second->OnAccelerator(id, event);
312 } 312 }
313 313
314 } // namespace mus 314 } // namespace mus
315 } // namespace ash 315 } // 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