Chromium Code Reviews| Index: mojo/edk/test/scoped_ipc_support.cc |
| diff --git a/mojo/edk/test/scoped_ipc_support.cc b/mojo/edk/test/scoped_ipc_support.cc |
| index 7dc7c99b946624eda9397242c9c33857d26f3c43..bbf2432798a3d5f2922c2d826750518dd721756b 100644 |
| --- a/mojo/edk/test/scoped_ipc_support.cc |
| +++ b/mojo/edk/test/scoped_ipc_support.cc |
| @@ -21,40 +21,22 @@ base::TaskRunner* GetIoTaskRunner() { |
| return g_io_task_runner; |
| } |
| -namespace internal { |
| - |
| -ScopedIPCSupportHelper::ScopedIPCSupportHelper() { |
| -} |
| - |
| -ScopedIPCSupportHelper::~ScopedIPCSupportHelper() { |
| - ShutdownIPCSupport(); |
| - run_loop_.Run(); |
| -} |
| - |
| -void ScopedIPCSupportHelper::Init( |
| - ProcessDelegate* process_delegate, |
| - scoped_refptr<base::TaskRunner> io_thread_task_runner) { |
| - io_thread_task_runner_ = io_thread_task_runner; |
| - InitIPCSupport(process_delegate, io_thread_task_runner_); |
| -} |
| - |
| -void ScopedIPCSupportHelper::OnShutdownCompleteImpl() { |
| - run_loop_.Quit(); |
| -} |
| - |
| -} // namespace internal |
| - |
| ScopedIPCSupport::ScopedIPCSupport( |
| scoped_refptr<base::TaskRunner> io_thread_task_runner) { |
| g_io_task_runner = io_thread_task_runner.get(); |
| - helper_.Init(this, std::move(io_thread_task_runner)); |
| + InitIPCSupport(this, io_thread_task_runner); |
| } |
| ScopedIPCSupport::~ScopedIPCSupport() { |
| + base::RunLoop run_loop; |
| + quit_closure = run_loop.QuitClosure(); |
| + ShutdownIPCSupport(); |
| + run_loop.Run(); |
| } |
| void ScopedIPCSupport::OnShutdownComplete() { |
| - helper_.OnShutdownCompleteImpl(); |
| + DCHECK(!quit_closure.is_null()); |
| + quit_closure.Run(); |
|
yzshen1
2016/11/20 06:07:35
(My understanding of the embedder API is purely fr
|
| } |
| } // namespace test |