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

Unified Diff: trunk/src/mojo/shell/context.cc

Issue 443063003: Revert 287680 "mojo: terminate apps if the shell goes away" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/mojo/shell/context.h ('k') | trunk/src/mojo/shell/shell_test_base_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/mojo/shell/context.cc
===================================================================
--- trunk/src/mojo/shell/context.cc (revision 287751)
+++ trunk/src/mojo/shell/context.cc (working copy)
@@ -122,6 +122,8 @@
scoped_ptr<ServiceLoader>(new NativeViewportServiceLoader()),
"native_viewport",
base::MessageLoop::TYPE_UI));
+ // TODO(tim): NativeViewportService doesn't quit itself yet.
+ loader->set_quit_on_shutdown();
service_manager_.SetLoaderForURL(
loader.PassAs<ServiceLoader>(),
GURL("mojo:mojo_native_viewport_service"));
@@ -154,14 +156,30 @@
scoped_ptr<ServiceLoader>(new NetworkServiceLoader()),
"network_service",
base::MessageLoop::TYPE_IO));
+ // TODO(tim): NetworkService doesn't quit itself yet.
+ loader->set_quit_on_shutdown();
service_manager_.SetLoaderForURL(loader.PassAs<ServiceLoader>(),
GURL("mojo:mojo_network_service"));
}
#endif
}
+void Context::Shutdown() {
+ // mojo_view_manager uses native_viewport. Destroy mojo_view_manager first so
+ // that there aren't shutdown ordering issues. Once native viewport service is
+ // moved into its own process this can likely be nuked.
+#if defined(USE_AURA)
+ service_manager_.SetLoaderForURL(
+ scoped_ptr<ServiceLoader>(),
+ GURL("mojo:mojo_view_manager"));
+#endif
+ service_manager_.set_default_loader(scoped_ptr<ServiceLoader>());
+ service_manager_.TerminateShellConnections();
+}
+
Context::~Context() {
DCHECK(!base::MessageLoop::current());
+ Shutdown();
}
} // namespace shell
« no previous file with comments | « trunk/src/mojo/shell/context.h ('k') | trunk/src/mojo/shell/shell_test_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698