OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/shell/context.h" | 5 #include "mojo/shell/context.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 service_manager_.SetLoaderForURL( | 143 service_manager_.SetLoaderForURL( |
144 scoped_ptr<ServiceLoader>( | 144 scoped_ptr<ServiceLoader>( |
145 new BackgroundServiceLoader( | 145 new BackgroundServiceLoader( |
146 scoped_ptr<ServiceLoader>(new NetworkServiceLoader()), | 146 scoped_ptr<ServiceLoader>(new NetworkServiceLoader()), |
147 "network_service", | 147 "network_service", |
148 base::MessageLoop::TYPE_IO)), | 148 base::MessageLoop::TYPE_IO)), |
149 GURL("mojo:mojo_network_service")); | 149 GURL("mojo:mojo_network_service")); |
150 #endif | 150 #endif |
151 } | 151 } |
152 | 152 |
153 Context::~Context() { | 153 void Context::Shutdown() { |
154 // mojo_view_manager uses native_viewport. Destroy mojo_view_manager first so | 154 // mojo_view_manager uses native_viewport. Destroy mojo_view_manager first so |
155 // that there aren't shutdown ordering issues. Once native viewport service is | 155 // that there aren't shutdown ordering issues. Once native viewport service is |
156 // moved into its own process this can likely be nuked. | 156 // moved into its own process this can likely be nuked. |
157 #if defined(USE_AURA) | 157 #if defined(USE_AURA) |
158 service_manager_.SetLoaderForURL( | 158 service_manager_.SetLoaderForURL( |
159 scoped_ptr<ServiceLoader>(), | 159 scoped_ptr<ServiceLoader>(), |
160 GURL("mojo:mojo_view_manager")); | 160 GURL("mojo:mojo_view_manager")); |
161 #endif | 161 #endif |
162 service_manager_.set_default_loader(scoped_ptr<ServiceLoader>()); | 162 service_manager_.set_default_loader(scoped_ptr<ServiceLoader>()); |
| 163 service_manager_.TerminateShellConnections(); |
| 164 } |
| 165 |
| 166 Context::~Context() { |
| 167 Shutdown(); |
163 } | 168 } |
164 | 169 |
165 } // namespace shell | 170 } // namespace shell |
166 } // namespace mojo | 171 } // namespace mojo |
OLD | NEW |