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

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

Issue 394903005: mojo: terminate apps if the shell goes away (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 service_manager_.SetLoaderForURL( 146 service_manager_.SetLoaderForURL(
147 scoped_ptr<ServiceLoader>( 147 scoped_ptr<ServiceLoader>(
148 new BackgroundServiceLoader( 148 new BackgroundServiceLoader(
149 scoped_ptr<ServiceLoader>(new NetworkServiceLoader()), 149 scoped_ptr<ServiceLoader>(new NetworkServiceLoader()),
150 "network_service", 150 "network_service",
151 base::MessageLoop::TYPE_IO)), 151 base::MessageLoop::TYPE_IO)),
152 GURL("mojo:mojo_network_service")); 152 GURL("mojo:mojo_network_service"));
153 #endif 153 #endif
154 } 154 }
155 155
156 void Context::Shutdown() { 156 Context::~Context() {
157 // mojo_view_manager uses native_viewport. Destroy mojo_view_manager first so 157 // mojo_view_manager uses native_viewport. Destroy mojo_view_manager first so
158 // that there aren't shutdown ordering issues. Once native viewport service is 158 // that there aren't shutdown ordering issues. Once native viewport service is
159 // moved into its own process this can likely be nuked. 159 // moved into its own process this can likely be nuked.
160 #if defined(USE_AURA) 160 #if defined(USE_AURA)
161 service_manager_.SetLoaderForURL( 161 service_manager_.SetLoaderForURL(
162 scoped_ptr<ServiceLoader>(), 162 scoped_ptr<ServiceLoader>(),
163 GURL("mojo:mojo_view_manager")); 163 GURL("mojo:mojo_view_manager"));
164 #endif 164 #endif
165 service_manager_.set_default_loader(scoped_ptr<ServiceLoader>()); 165 service_manager_.set_default_loader(scoped_ptr<ServiceLoader>());
166 service_manager_.TerminateShellConnections();
167 }
168
169 Context::~Context() {
170 Shutdown();
171 } 166 }
172 167
173 } // namespace shell 168 } // namespace shell
174 } // namespace mojo 169 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698