Index: content/common/mojo/embedded_application_runner.cc |
diff --git a/content/common/mojo/embedded_application_runner.cc b/content/common/mojo/embedded_application_runner.cc |
index 5d7abed900d54549082faca86bd848afaba85048..e28fbfc94b28d54db1b492ca46ed957d621f40a5 100644 |
--- a/content/common/mojo/embedded_application_runner.cc |
+++ b/content/common/mojo/embedded_application_runner.cc |
@@ -52,6 +52,11 @@ class EmbeddedApplicationRunner::Instance |
void ShutDown() { |
DCHECK(runner_thread_checker_.CalledOnValidThread()); |
+ // Any extant ServiceContexts must be destroyed on the correct thread. |
Ken Rockot(use gerrit already)
2016/07/27 18:23:05
If application_task_runner_ is null, the app has a
kmackay
2016/07/27 18:51:59
Done.
|
+ if (application_task_runner_) { |
+ application_task_runner_->PostTask(FROM_HERE, |
+ base::Bind(&Instance::Quit, this)); |
+ } |
if (thread_) { |
Ken Rockot(use gerrit already)
2016/07/27 18:23:05
And you can just delete this block now
kmackay
2016/07/27 18:51:59
I wasn't sure if we wanted to make sure that the a
|
thread_.reset(); |
application_task_runner_ = nullptr; |
@@ -108,7 +113,10 @@ class EmbeddedApplicationRunner::Instance |
void QuitOnRunnerThread() { |
DCHECK(runner_thread_checker_.CalledOnValidThread()); |
- ShutDown(); |
+ if (thread_) { |
+ thread_.reset(); |
+ application_task_runner_ = nullptr; |
+ } |
quit_closure_.Run(); |
} |