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

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: review 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
Index: mojo/shell/context.cc
diff --git a/mojo/shell/context.cc b/mojo/shell/context.cc
index 159e3230d5236cac5a603e8d8ead01ecc935dbf0..eb48a79b5c4b9b5fc715a4239484ed7a96684ccc 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());
darin (slow to review) 2014/07/28 23:02:12 perhaps the dtor should have a similar assertion?
tim (not reviewing) 2014/07/29 00:54:57 Done.
+}
+
+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]));

Powered by Google App Engine
This is Rietveld 408576698