Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Side by Side Diff: mojo/edk/system/message_pipe_test_utils.cc

Issue 2075353002: Plumb the handle signals state out of Waiter::Wait(). (Closed) Base URL: https://github.com/domokit/mojo.git@work795_wait_set_4.3-x-work794_wait_set_4.2
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 18 matching lines...) Expand all
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, signals, false, 0, 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 = waiter.Wait(MOJO_DEADLINE_INDEFINITE, nullptr); 39 MojoResult wait_result =
40 waiter.Wait(MOJO_DEADLINE_INDEFINITE, nullptr, nullptr);
40 mp->RemoveAwakable(0, &waiter, signals_state); 41 mp->RemoveAwakable(0, &waiter, signals_state);
41 return wait_result; 42 return wait_result;
42 } 43 }
43 44
44 ChannelThread::ChannelThread(embedder::PlatformSupport* platform_support) 45 ChannelThread::ChannelThread(embedder::PlatformSupport* platform_support)
45 : platform_support_(platform_support), 46 : platform_support_(platform_support),
46 test_io_thread_(TestIOThread::StartMode::MANUAL) {} 47 test_io_thread_(TestIOThread::StartMode::MANUAL) {}
47 48
48 ChannelThread::~ChannelThread() { 49 ChannelThread::~ChannelThread() {
49 Stop(); 50 Stop();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 109 }
109 110
110 void MultiprocessMessagePipeTestBase::Init(RefPtr<ChannelEndpoint>&& ep) { 111 void MultiprocessMessagePipeTestBase::Init(RefPtr<ChannelEndpoint>&& ep) {
111 channel_thread_.Start(helper_.server_platform_handle.Pass(), std::move(ep)); 112 channel_thread_.Start(helper_.server_platform_handle.Pass(), std::move(ep));
112 } 113 }
113 #endif // !defined(OS_IOS) 114 #endif // !defined(OS_IOS)
114 115
115 } // namespace test 116 } // namespace test
116 } // namespace system 117 } // namespace system
117 } // namespace mojo 118 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698