OLD | NEW |
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_application.h" | 5 #include "ash/mus/window_manager_application.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/mojo_interface_factory.h" | 9 #include "ash/mojo_interface_factory.h" |
10 #include "ash/mus/network_connect_delegate_mus.h" | 10 #include "ash/mus/network_connect_delegate_mus.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "ui/events/event.h" | 31 #include "ui/events/event.h" |
32 #include "ui/message_center/message_center.h" | 32 #include "ui/message_center/message_center.h" |
33 #include "ui/views/mus/aura_init.h" | 33 #include "ui/views/mus/aura_init.h" |
34 | 34 |
35 namespace ash { | 35 namespace ash { |
36 namespace mus { | 36 namespace mus { |
37 | 37 |
38 WindowManagerApplication::WindowManagerApplication() {} | 38 WindowManagerApplication::WindowManagerApplication() {} |
39 | 39 |
40 WindowManagerApplication::~WindowManagerApplication() { | 40 WindowManagerApplication::~WindowManagerApplication() { |
| 41 // Verify that we created a WindowManager before attempting to tear everything |
| 42 // down. In some fast running tests OnStart may never have been called. |
| 43 if (!window_manager_.get()) |
| 44 return; |
| 45 |
41 // Destroy the WindowManager while still valid. This way we ensure | 46 // Destroy the WindowManager while still valid. This way we ensure |
42 // OnWillDestroyRootWindowController() is called (if it hasn't been already). | 47 // OnWillDestroyRootWindowController() is called (if it hasn't been already). |
43 window_manager_.reset(); | 48 window_manager_.reset(); |
44 | 49 |
45 if (blocking_pool_) { | 50 if (blocking_pool_) { |
46 // Like BrowserThreadImpl, the goal is to make it impossible for ash to | 51 // Like BrowserThreadImpl, the goal is to make it impossible for ash to |
47 // 'infinite loop' during shutdown, but to reasonably expect that all | 52 // 'infinite loop' during shutdown, but to reasonably expect that all |
48 // BLOCKING_SHUTDOWN tasks queued during shutdown get run. There's nothing | 53 // BLOCKING_SHUTDOWN tasks queued during shutdown get run. There's nothing |
49 // particularly scientific about the number chosen. | 54 // particularly scientific about the number chosen. |
50 const int kMaxNewShutdownBlockingTasks = 1000; | 55 const int kMaxNewShutdownBlockingTasks = 1000; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 void WindowManagerApplication::OnBindInterface( | 144 void WindowManagerApplication::OnBindInterface( |
140 const service_manager::ServiceInfo& source_info, | 145 const service_manager::ServiceInfo& source_info, |
141 const std::string& interface_name, | 146 const std::string& interface_name, |
142 mojo::ScopedMessagePipeHandle interface_pipe) { | 147 mojo::ScopedMessagePipeHandle interface_pipe) { |
143 registry_.BindInterface(source_info.identity, interface_name, | 148 registry_.BindInterface(source_info.identity, interface_name, |
144 std::move(interface_pipe)); | 149 std::move(interface_pipe)); |
145 } | 150 } |
146 | 151 |
147 } // namespace mus | 152 } // namespace mus |
148 } // namespace ash | 153 } // namespace ash |
OLD | NEW |