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

Unified Diff: mojo/shell/standalone/context.cc

Issue 1822213002: Changes to get mash browser_tests shutdown working correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: order Created 4 years, 9 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/standalone/context.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/standalone/context.cc
diff --git a/mojo/shell/standalone/context.cc b/mojo/shell/standalone/context.cc
index e64ed826364d591091c5c548acc64c9219c28440..c036694ee5dc34c684fa6055de8616d0faa5ded5 100644
--- a/mojo/shell/standalone/context.cc
+++ b/mojo/shell/standalone/context.cc
@@ -140,7 +140,8 @@ void Context::Init(scoped_ptr<InitParams> init_params) {
blocking_pool_ =
new base::SequencedWorkerPool(kMaxBlockingPoolThreads, "blocking_pool");
- if (!init_params || init_params->init_edk) {
+ init_edk_ = !init_params || init_params->init_edk;
+ if (init_edk_) {
edk::InitIPCSupport(this, io_thread_->task_runner().get());
#if defined(OS_MACOSX)
edk::SetMachPortProvider(MachBroker::GetInstance()->port_provider());
@@ -210,8 +211,13 @@ void Context::Shutdown() {
// loop shutdown.
shell_.reset();
- TRACE_EVENT0("mojo_shell", "Context::Shutdown");
DCHECK_EQ(base::MessageLoop::current()->task_runner(), shell_runner_);
+
+ // If we didn't initialize the edk we should not shut it down.
+ if (!init_edk_)
+ return;
+
+ TRACE_EVENT0("mojo_shell", "Context::Shutdown");
// Post a task in case OnShutdownComplete is called synchronously.
base::MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(edk::ShutdownIPCSupport));
« no previous file with comments | « mojo/shell/standalone/context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698