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

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: review + hack Created 6 years, 5 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 service_manager_.SetLoaderForURL( 123 service_manager_.SetLoaderForURL(
124 scoped_ptr<ServiceLoader>(new ProfileServiceLoader()), 124 scoped_ptr<ServiceLoader>(new ProfileServiceLoader()),
125 GURL("mojo:profile_service")); 125 GURL("mojo:profile_service"));
126 126
127 if (cmdline->HasSwitch(switches::kSpy)) { 127 if (cmdline->HasSwitch(switches::kSpy)) {
128 spy_.reset(new mojo::Spy(&service_manager_, 128 spy_.reset(new mojo::Spy(&service_manager_,
129 cmdline->GetSwitchValueASCII(switches::kSpy))); 129 cmdline->GetSwitchValueASCII(switches::kSpy)));
130 } 130 }
131 } 131 }
132 132
133 Context::~Context() { 133 void Context::Shutdown() {
134 // mojo_view_manager uses native_viewport. Destroy mojo_view_manager first so 134 // mojo_view_manager uses native_viewport. Destroy mojo_view_manager first so
135 // that there aren't shutdown ordering issues. Once native viewport service is 135 // that there aren't shutdown ordering issues. Once native viewport service is
136 // moved into its own process this can likely be nuked. 136 // moved into its own process this can likely be nuked.
137 #if defined(USE_AURA) 137 #if defined(USE_AURA)
138 service_manager_.SetLoaderForURL( 138 service_manager_.SetLoaderForURL(
139 scoped_ptr<ServiceLoader>(), 139 scoped_ptr<ServiceLoader>(),
140 GURL("mojo:mojo_view_manager")); 140 GURL("mojo:mojo_view_manager"));
141 #endif 141 #endif
142 service_manager_.SetLoaderForURL(scoped_ptr<ServiceLoader>(),
143 GURL("mojo:profile_service"));
142 service_manager_.set_default_loader(scoped_ptr<ServiceLoader>()); 144 service_manager_.set_default_loader(scoped_ptr<ServiceLoader>());
145 service_manager_.TerminateShellConnections();
146 }
147
148 Context::~Context() {
149 Shutdown();
143 } 150 }
144 151
145 } // namespace shell 152 } // namespace shell
146 } // namespace mojo 153 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698