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

Side by Side Diff: mojo/shell/context.cc

Issue 397733003: mojo: kill app_thread before unloading main app library and add tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: also service_manager_unittests Created 6 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 | Annotate | Revision Log
« no previous file with comments | « mojo/shell/context.h ('k') | mojo/shell/desktop/mojo_main.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 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
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
OLDNEW
« no previous file with comments | « mojo/shell/context.h ('k') | mojo/shell/desktop/mojo_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698