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

Unified Diff: mojo/shell/context.cc

Issue 420143003: mojo: shell::Context should outlive the shell MessageLoop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix + verify android 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/shell/context.h ('k') | mojo/shell/desktop/mojo_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/context.cc
diff --git a/mojo/shell/context.cc b/mojo/shell/context.cc
index 159e3230d5236cac5a603e8d8ead01ecc935dbf0..88335156aa2de6f652cca823950493218a1caafe 100644
--- a/mojo/shell/context.cc
+++ b/mojo/shell/context.cc
@@ -83,9 +83,14 @@ class Context::NativeViewportServiceLoader : public ServiceLoader {
DISALLOW_COPY_AND_ASSIGN(NativeViewportServiceLoader);
};
-Context::Context()
- : task_runners_(base::MessageLoop::current()->message_loop_proxy()) {
+Context::Context() {
+ DCHECK(!base::MessageLoop::current());
+}
+
+void Context::Init() {
setup.Get();
+ task_runners_.reset(
+ new TaskRunners(base::MessageLoop::current()->message_loop_proxy()));
for (size_t i = 0; i < arraysize(kLocalMojoURLs); ++i)
mojo_url_resolver_.AddLocalFileMapping(GURL(kLocalMojoURLs[i]));
@@ -164,6 +169,7 @@ void Context::Shutdown() {
}
Context::~Context() {
+ DCHECK(!base::MessageLoop::current());
Shutdown();
}
« 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