| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/system/message_pipe_test_utils.h" | 5 #include "mojo/system/message_pipe_test_utils.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/threading/platform_thread.h" // For |Sleep()|. | 8 #include "base/threading/platform_thread.h" // For |Sleep()|. |
| 9 #include "mojo/system/waiter.h" | 9 #include "mojo/system/waiter.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 : add_result; | 24 : add_result; |
| 25 } | 25 } |
| 26 | 26 |
| 27 MojoResult wait_result = waiter.Wait(MOJO_DEADLINE_INDEFINITE, NULL); | 27 MojoResult wait_result = waiter.Wait(MOJO_DEADLINE_INDEFINITE, NULL); |
| 28 mp->RemoveWaiter(0, &waiter, signals_state); | 28 mp->RemoveWaiter(0, &waiter, signals_state); |
| 29 return wait_result; | 29 return wait_result; |
| 30 } | 30 } |
| 31 | 31 |
| 32 ChannelThread::ChannelThread(embedder::PlatformSupport* platform_support) | 32 ChannelThread::ChannelThread(embedder::PlatformSupport* platform_support) |
| 33 : platform_support_(platform_support), | 33 : platform_support_(platform_support), |
| 34 test_io_thread_(test::TestIOThread::kManualStart) { | 34 test_io_thread_(base::TestIOThread::kManualStart) { |
| 35 } | 35 } |
| 36 | 36 |
| 37 ChannelThread::~ChannelThread() { | 37 ChannelThread::~ChannelThread() { |
| 38 Stop(); | 38 Stop(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void ChannelThread::Start(embedder::ScopedPlatformHandle platform_handle, | 41 void ChannelThread::Start(embedder::ScopedPlatformHandle platform_handle, |
| 42 scoped_refptr<MessagePipe> message_pipe) { | 42 scoped_refptr<MessagePipe> message_pipe) { |
| 43 test_io_thread_.Start(); | 43 test_io_thread_.Start(); |
| 44 test_io_thread_.PostTaskAndWait( | 44 test_io_thread_.PostTaskAndWait( |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 MultiprocessMessagePipeTestBase::~MultiprocessMessagePipeTestBase() { | 101 MultiprocessMessagePipeTestBase::~MultiprocessMessagePipeTestBase() { |
| 102 } | 102 } |
| 103 | 103 |
| 104 void MultiprocessMessagePipeTestBase::Init(scoped_refptr<MessagePipe> mp) { | 104 void MultiprocessMessagePipeTestBase::Init(scoped_refptr<MessagePipe> mp) { |
| 105 channel_thread_.Start(helper_.server_platform_handle.Pass(), mp); | 105 channel_thread_.Start(helper_.server_platform_handle.Pass(), mp); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace test | 108 } // namespace test |
| 109 } // namespace system | 109 } // namespace system |
| 110 } // namespace mojo | 110 } // namespace mojo |
| OLD | NEW |