| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/edk/test/scoped_ipc_support.h" | 5 #include "mojo/edk/test/scoped_ipc_support.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "mojo/edk/embedder/embedder.h" | 8 #include "mojo/edk/embedder/embedder.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 ShutdownIPCSupportAndWaitForNoChannels(); | 25 ShutdownIPCSupportAndWaitForNoChannels(); |
| 26 event_.Wait(); | 26 event_.Wait(); |
| 27 } | 27 } |
| 28 } | 28 } |
| 29 | 29 |
| 30 void ScopedIPCSupportHelper::Init( | 30 void ScopedIPCSupportHelper::Init( |
| 31 ProcessDelegate* process_delegate, | 31 ProcessDelegate* process_delegate, |
| 32 scoped_refptr<base::TaskRunner> io_thread_task_runner) { | 32 scoped_refptr<base::TaskRunner> io_thread_task_runner) { |
| 33 io_thread_task_runner_ = io_thread_task_runner; | 33 io_thread_task_runner_ = io_thread_task_runner; |
| 34 // Note: Run delegate methods on the I/O thread. | 34 // Note: Run delegate methods on the I/O thread. |
| 35 InitIPCSupport(io_thread_task_runner_, process_delegate, | 35 InitIPCSupport(process_delegate, io_thread_task_runner_); |
| 36 io_thread_task_runner_); | |
| 37 } | 36 } |
| 38 | 37 |
| 39 void ScopedIPCSupportHelper::OnShutdownCompleteImpl() { | 38 void ScopedIPCSupportHelper::OnShutdownCompleteImpl() { |
| 40 event_.Signal(); | 39 event_.Signal(); |
| 41 } | 40 } |
| 42 | 41 |
| 43 } // namespace internal | 42 } // namespace internal |
| 44 | 43 |
| 45 ScopedIPCSupport::ScopedIPCSupport( | 44 ScopedIPCSupport::ScopedIPCSupport( |
| 46 scoped_refptr<base::TaskRunner> io_thread_task_runner) { | 45 scoped_refptr<base::TaskRunner> io_thread_task_runner) { |
| 47 helper_.Init(this, io_thread_task_runner.Pass()); | 46 helper_.Init(this, io_thread_task_runner.Pass()); |
| 48 } | 47 } |
| 49 | 48 |
| 50 ScopedIPCSupport::~ScopedIPCSupport() { | 49 ScopedIPCSupport::~ScopedIPCSupport() { |
| 51 } | 50 } |
| 52 | 51 |
| 53 void ScopedIPCSupport::OnShutdownComplete() { | 52 void ScopedIPCSupport::OnShutdownComplete() { |
| 54 helper_.OnShutdownCompleteImpl(); | 53 helper_.OnShutdownCompleteImpl(); |
| 55 } | 54 } |
| 56 | 55 |
| 57 } // namespace test | 56 } // namespace test |
| 58 } // namespace edk | 57 } // namespace edk |
| 59 } // namespace mojo | 58 } // namespace mojo |
| OLD | NEW |