| 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 "mojo/edk/embedder/simple_platform_support.h" | 9 #include "mojo/edk/embedder/simple_platform_support.h" |
| 10 #include "mojo/edk/platform/thread_utils.h" | 10 #include "mojo/edk/platform/thread_utils.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace system { | 23 namespace system { |
| 24 namespace test { | 24 namespace test { |
| 25 | 25 |
| 26 MojoResult WaitIfNecessary(MessagePipe* mp, | 26 MojoResult WaitIfNecessary(MessagePipe* mp, |
| 27 MojoHandleSignals signals, | 27 MojoHandleSignals signals, |
| 28 HandleSignalsState* signals_state) { | 28 HandleSignalsState* signals_state) { |
| 29 Waiter waiter; | 29 Waiter waiter; |
| 30 waiter.Init(); | 30 waiter.Init(); |
| 31 | 31 |
| 32 MojoResult add_result = | 32 MojoResult add_result = |
| 33 mp->AddAwakable(0, &waiter, signals, false, 0, signals_state); | 33 mp->AddAwakable(0, &waiter, 0, false, signals, signals_state); |
| 34 if (add_result != MOJO_RESULT_OK) { | 34 if (add_result != MOJO_RESULT_OK) { |
| 35 return (add_result == MOJO_RESULT_ALREADY_EXISTS) ? MOJO_RESULT_OK | 35 return (add_result == MOJO_RESULT_ALREADY_EXISTS) ? MOJO_RESULT_OK |
| 36 : add_result; | 36 : add_result; |
| 37 } | 37 } |
| 38 | 38 |
| 39 MojoResult wait_result = | 39 MojoResult wait_result = |
| 40 waiter.Wait(MOJO_DEADLINE_INDEFINITE, nullptr, nullptr); | 40 waiter.Wait(MOJO_DEADLINE_INDEFINITE, nullptr, nullptr); |
| 41 mp->RemoveAwakable(0, &waiter, signals_state); | 41 mp->RemoveAwakable(0, false, &waiter, 0, signals_state); |
| 42 return wait_result; | 42 return wait_result; |
| 43 } | 43 } |
| 44 | 44 |
| 45 ChannelThread::ChannelThread(embedder::PlatformSupport* platform_support) | 45 ChannelThread::ChannelThread(embedder::PlatformSupport* platform_support) |
| 46 : platform_support_(platform_support), | 46 : platform_support_(platform_support), |
| 47 test_io_thread_(TestIOThread::StartMode::MANUAL) {} | 47 test_io_thread_(TestIOThread::StartMode::MANUAL) {} |
| 48 | 48 |
| 49 ChannelThread::~ChannelThread() { | 49 ChannelThread::~ChannelThread() { |
| 50 Stop(); | 50 Stop(); |
| 51 } | 51 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 void MultiprocessMessagePipeTestBase::Init(RefPtr<ChannelEndpoint>&& ep) { | 111 void MultiprocessMessagePipeTestBase::Init(RefPtr<ChannelEndpoint>&& ep) { |
| 112 channel_thread_.Start(helper_.server_platform_handle.Pass(), std::move(ep)); | 112 channel_thread_.Start(helper_.server_platform_handle.Pass(), std::move(ep)); |
| 113 } | 113 } |
| 114 #endif // !defined(OS_IOS) | 114 #endif // !defined(OS_IOS) |
| 115 | 115 |
| 116 } // namespace test | 116 } // namespace test |
| 117 } // namespace system | 117 } // namespace system |
| 118 } // namespace mojo | 118 } // namespace mojo |
| OLD | NEW |