diff options
author | jam <jam@chromium.org> | 2015-11-13 10:07:31 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-13 18:08:50 +0000 |
commit | bd8d85445b843b795b0915703d0f844342dee4e3 (patch) | |
tree | d7bf6b06209b0afd35ba0b747fc53fa7806a1614 /mojo/edk/test/scoped_ipc_support.cc | |
parent | 30996193fe3e69fe9ccd52471900bf5685c54956 (diff) | |
download | chromium_src-bd8d85445b843b795b0915703d0f844342dee4e3.zip chromium_src-bd8d85445b843b795b0915703d0f844342dee4e3.tar.gz chromium_src-bd8d85445b843b795b0915703d0f844342dee4e3.tar.bz2 |
Fix racy crash in Mandoline child processes.
The problem is with the new EDK, the IO task runner pointer needs to be initialized before MojoMessagePump is created (in child_process.cc). The rest of the change is removing the delegate thread from the InitIPCSupport function.
BUG=478251
Committed: https://crrev.com/ee99b2d9ec86aa5bbc69169ea26964a6792d286b
Cr-Commit-Position: refs/heads/master@{#359266}
Review URL: https://codereview.chromium.org/1439863002
Cr-Commit-Position: refs/heads/master@{#359583}
Diffstat (limited to 'mojo/edk/test/scoped_ipc_support.cc')
-rw-r--r-- | mojo/edk/test/scoped_ipc_support.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mojo/edk/test/scoped_ipc_support.cc b/mojo/edk/test/scoped_ipc_support.cc index c416875..6e9c11c 100644 --- a/mojo/edk/test/scoped_ipc_support.cc +++ b/mojo/edk/test/scoped_ipc_support.cc @@ -13,8 +13,7 @@ namespace test { namespace internal { -ScopedIPCSupportHelper::ScopedIPCSupportHelper() - : event_(true, false) { // Manual reset. +ScopedIPCSupportHelper::ScopedIPCSupportHelper() { } ScopedIPCSupportHelper::~ScopedIPCSupportHelper() { @@ -23,7 +22,7 @@ ScopedIPCSupportHelper::~ScopedIPCSupportHelper() { ShutdownIPCSupportOnIOThread(); } else { ShutdownIPCSupportAndWaitForNoChannels(); - event_.Wait(); + run_loop_.Run(); } } @@ -31,12 +30,11 @@ void ScopedIPCSupportHelper::Init( ProcessDelegate* process_delegate, scoped_refptr<base::TaskRunner> io_thread_task_runner) { io_thread_task_runner_ = io_thread_task_runner; - // Note: Run delegate methods on the I/O thread. InitIPCSupport(process_delegate, io_thread_task_runner_); } void ScopedIPCSupportHelper::OnShutdownCompleteImpl() { - event_.Signal(); + run_loop_.Quit(); } } // namespace internal |