| 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/edk/system/message_pipe_test_utils.h" | 5 #include "mojo/edk/system/message_pipe_test_utils.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "mojo/edk/system/channel.h" | 10 #include "mojo/edk/system/channel.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 : add_result; | 31 : add_result; |
| 32 } | 32 } |
| 33 | 33 |
| 34 MojoResult wait_result = waiter.Wait(MOJO_DEADLINE_INDEFINITE, nullptr); | 34 MojoResult wait_result = waiter.Wait(MOJO_DEADLINE_INDEFINITE, nullptr); |
| 35 mp->RemoveAwakable(0, &waiter, signals_state); | 35 mp->RemoveAwakable(0, &waiter, signals_state); |
| 36 return wait_result; | 36 return wait_result; |
| 37 } | 37 } |
| 38 | 38 |
| 39 ChannelThread::ChannelThread(embedder::PlatformSupport* platform_support) | 39 ChannelThread::ChannelThread(embedder::PlatformSupport* platform_support) |
| 40 : platform_support_(platform_support), | 40 : platform_support_(platform_support), |
| 41 test_io_thread_(mojo::test::TestIOThread::StartMode::MANUAL) {} | 41 test_io_thread_(TestIOThread::StartMode::MANUAL) {} |
| 42 | 42 |
| 43 ChannelThread::~ChannelThread() { | 43 ChannelThread::~ChannelThread() { |
| 44 Stop(); | 44 Stop(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void ChannelThread::Start(embedder::ScopedPlatformHandle platform_handle, | 47 void ChannelThread::Start(embedder::ScopedPlatformHandle platform_handle, |
| 48 RefPtr<ChannelEndpoint>&& channel_endpoint) { | 48 RefPtr<ChannelEndpoint>&& channel_endpoint) { |
| 49 test_io_thread_.Start(); | 49 test_io_thread_.Start(); |
| 50 test_io_thread_.PostTaskAndWait( | 50 test_io_thread_.PostTaskAndWait( |
| 51 base::Bind(&ChannelThread::InitChannelOnIOThread, base::Unretained(this), | 51 base::Bind(&ChannelThread::InitChannelOnIOThread, base::Unretained(this), |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } | 101 } |
| 102 | 102 |
| 103 void MultiprocessMessagePipeTestBase::Init(RefPtr<ChannelEndpoint>&& ep) { | 103 void MultiprocessMessagePipeTestBase::Init(RefPtr<ChannelEndpoint>&& ep) { |
| 104 channel_thread_.Start(helper_.server_platform_handle.Pass(), std::move(ep)); | 104 channel_thread_.Start(helper_.server_platform_handle.Pass(), std::move(ep)); |
| 105 } | 105 } |
| 106 #endif | 106 #endif |
| 107 | 107 |
| 108 } // namespace test | 108 } // namespace test |
| 109 } // namespace system | 109 } // namespace system |
| 110 } // namespace mojo | 110 } // namespace mojo |
| OLD | NEW |