diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-17 01:18:55 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-17 01:18:55 +0000 |
commit | 4313b9844c9a6d5ddf39226bd21aa16c15e4b0cb (patch) | |
tree | a2ace5f845277e707f2530f183774b107b96668e /content/utility | |
parent | ff22ccf782912f600272b42f2b31702bb90c5667 (diff) | |
download | chromium_src-4313b9844c9a6d5ddf39226bd21aa16c15e4b0cb.zip chromium_src-4313b9844c9a6d5ddf39226bd21aa16c15e4b0cb.tar.gz chromium_src-4313b9844c9a6d5ddf39226bd21aa16c15e4b0cb.tar.bz2 |
Fix race condition on utility thread shutdown in unit tests. The problem was that the main thread could be accessing the MessageLoop of the in-process utility thread, but that used to also kill itself in UtilityThreadImpl::ReleaseProcessIfNeeded().
BUG=260754
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/19437002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211891 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/utility')
-rw-r--r-- | content/utility/utility_thread_impl.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/content/utility/utility_thread_impl.cc b/content/utility/utility_thread_impl.cc index af6db9d..16d87ef 100644 --- a/content/utility/utility_thread_impl.cc +++ b/content/utility/utility_thread_impl.cc @@ -65,13 +65,11 @@ void UtilityThreadImpl::ReleaseProcessIfNeeded() { return; if (single_process_) { - // Just quit the message loop directly so that unit tests don't need to - // pump the client message loop again. In normal multi-process mode, need - // normal shutdown as the IO thread could still be sending the result IPC. - // Also close the IPC channel manually as normally that's done by the child - // process exiting, which doesn't happen here. + // Close the channel to cause UtilityProcessHostImpl to be deleted. We need + // to take a different code path than the multi-process case because that + // depends on the child process going away to close the channel, but that + // can't happen when we're in single process mode. channel()->Close(); - base::MessageLoop::current()->Quit(); } else { ChildProcess::current()->ReleaseProcess(); } |