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

Side by Side Diff: third_party/mojo/src/mojo/edk/system/core.cc

Issue 1429553002: API definition for WaitSet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years 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
« no previous file with comments | « third_party/mojo/src/mojo/edk/system/core.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "third_party/mojo/src/mojo/edk/system/core.h" 5 #include "third_party/mojo/src/mojo/edk/system/core.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 &index, reinterpret_cast<HandleSignalsState*>( 178 &index, reinterpret_cast<HandleSignalsState*>(
179 signals_states_writer.GetPointer())); 179 signals_states_writer.GetPointer()));
180 if (rv != MOJO_RESULT_INVALID_ARGUMENT) 180 if (rv != MOJO_RESULT_INVALID_ARGUMENT)
181 signals_states_writer.Commit(); 181 signals_states_writer.Commit();
182 } 182 }
183 if (index != static_cast<uint32_t>(-1) && !result_index.IsNull()) 183 if (index != static_cast<uint32_t>(-1) && !result_index.IsNull())
184 result_index.Put(index); 184 result_index.Put(index);
185 return rv; 185 return rv;
186 } 186 }
187 187
188 MojoResult Core::CreateWaitSet(UserPointer<MojoHandle> wait_set_handle) {
189 if (wait_set_handle.IsNull())
190 return MOJO_RESULT_INVALID_ARGUMENT;
191
192 return MOJO_RESULT_UNIMPLEMENTED;
193 }
194
195 MojoResult Core::AddHandle(MojoHandle wait_set_handle,
196 MojoHandle handle,
197 MojoHandleSignals signals) {
198 scoped_refptr<Dispatcher> wait_set_dispatcher(GetDispatcher(wait_set_handle));
199 if (!wait_set_dispatcher)
200 return MOJO_RESULT_INVALID_ARGUMENT;
201
202 scoped_refptr<Dispatcher> dispatcher(GetDispatcher(handle));
203 if (!dispatcher)
204 return MOJO_RESULT_INVALID_ARGUMENT;
205
206 return MOJO_RESULT_UNIMPLEMENTED;
207 }
208
209 MojoResult Core::RemoveHandle(MojoHandle wait_set_handle,
210 MojoHandle handle) {
211 scoped_refptr<Dispatcher> wait_set_dispatcher(GetDispatcher(wait_set_handle));
212 if (!wait_set_dispatcher)
213 return MOJO_RESULT_INVALID_ARGUMENT;
214
215 scoped_refptr<Dispatcher> dispatcher(GetDispatcher(handle));
216 if (!dispatcher)
217 return MOJO_RESULT_INVALID_ARGUMENT;
218
219 return MOJO_RESULT_UNIMPLEMENTED;
220 }
221
222 MojoResult Core::GetReadyHandles(
223 MojoHandle wait_set_handle,
224 UserPointer<uint32_t> count,
225 UserPointer<MojoHandle> handles,
226 UserPointer<MojoResult> results,
227 UserPointer<MojoHandleSignalsState> signals_states) {
228 scoped_refptr<Dispatcher> wait_set_dispatcher(GetDispatcher(wait_set_handle));
229 if (!wait_set_dispatcher)
230 return MOJO_RESULT_INVALID_ARGUMENT;
231
232 if (count.IsNull() || !count.Get() || handles.IsNull() || results.IsNull())
233 return MOJO_RESULT_INVALID_ARGUMENT;
234
235 return MOJO_RESULT_UNIMPLEMENTED;
236 }
237
188 MojoResult Core::CreateMessagePipe( 238 MojoResult Core::CreateMessagePipe(
189 UserPointer<const MojoCreateMessagePipeOptions> options, 239 UserPointer<const MojoCreateMessagePipeOptions> options,
190 UserPointer<MojoHandle> message_pipe_handle0, 240 UserPointer<MojoHandle> message_pipe_handle0,
191 UserPointer<MojoHandle> message_pipe_handle1) { 241 UserPointer<MojoHandle> message_pipe_handle1) {
192 MojoCreateMessagePipeOptions validated_options = {}; 242 MojoCreateMessagePipeOptions validated_options = {};
193 MojoResult result = 243 MojoResult result =
194 MessagePipeDispatcher::ValidateCreateOptions(options, &validated_options); 244 MessagePipeDispatcher::ValidateCreateOptions(options, &validated_options);
195 if (result != MOJO_RESULT_OK) 245 if (result != MOJO_RESULT_OK)
196 return result; 246 return result;
197 247
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 if (signals_states) { 653 if (signals_states) {
604 for (; i < num_handles; i++) 654 for (; i < num_handles; i++)
605 signals_states[i] = dispatchers[i]->GetHandleSignalsState(); 655 signals_states[i] = dispatchers[i]->GetHandleSignalsState();
606 } 656 }
607 657
608 return rv; 658 return rv;
609 } 659 }
610 660
611 } // namespace system 661 } // namespace system
612 } // namespace mojo 662 } // namespace mojo
OLDNEW
« no previous file with comments | « third_party/mojo/src/mojo/edk/system/core.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698