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

Side by Side Diff: mojo/public/cpp/system/handle.h

Issue 835253002: Update mojo sdk to rev e3719475d5971283d1d2250533d53066b2ff9797 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 #ifndef MOJO_PUBLIC_CPP_SYSTEM_HANDLE_H_ 5 #ifndef MOJO_PUBLIC_CPP_SYSTEM_HANDLE_H_
6 #define MOJO_PUBLIC_CPP_SYSTEM_HANDLE_H_ 6 #define MOJO_PUBLIC_CPP_SYSTEM_HANDLE_H_
7 7
8 #include <assert.h> 8 #include <assert.h>
9 #include <limits> 9 #include <limits>
10 10
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 // constant can be converted to |std::nullptr_t| (which is a typedef for 294 // constant can be converted to |std::nullptr_t| (which is a typedef for
295 // |decltype(nullptr)|). The opposite direction is not allowed. 295 // |decltype(nullptr)|). The opposite direction is not allowed.
296 template <class HandleVectorType, class FlagsVectorType> 296 template <class HandleVectorType, class FlagsVectorType>
297 inline WaitManyResult WaitMany(const HandleVectorType& handles, 297 inline WaitManyResult WaitMany(const HandleVectorType& handles,
298 const FlagsVectorType& signals, 298 const FlagsVectorType& signals,
299 MojoDeadline deadline, 299 MojoDeadline deadline,
300 decltype(nullptr) signals_states) { 300 decltype(nullptr) signals_states) {
301 if (signals.size() != handles.size()) 301 if (signals.size() != handles.size())
302 return WaitManyResult(MOJO_RESULT_INVALID_ARGUMENT); 302 return WaitManyResult(MOJO_RESULT_INVALID_ARGUMENT);
303 if (handles.size() >= kInvalidWaitManyIndexValue) 303 if (handles.size() >= kInvalidWaitManyIndexValue)
304 return WaitManyResult(MOJO_RESULT_OUT_OF_RANGE); 304 return WaitManyResult(MOJO_RESULT_RESOURCE_EXHAUSTED);
305 305
306 if (handles.size() == 0) { 306 if (handles.size() == 0) {
307 return WaitManyResult( 307 return WaitManyResult(
308 MojoNewWaitMany(nullptr, nullptr, 0, deadline, nullptr, nullptr)); 308 MojoNewWaitMany(nullptr, nullptr, 0, deadline, nullptr, nullptr));
309 } 309 }
310 310
311 uint32_t result_index = kInvalidWaitManyIndexValue; 311 uint32_t result_index = kInvalidWaitManyIndexValue;
312 const Handle& first_handle = handles[0]; 312 const Handle& first_handle = handles[0];
313 const MojoHandleSignals& first_signals = signals[0]; 313 const MojoHandleSignals& first_signals = signals[0];
314 MojoResult result = MojoNewWaitMany( 314 MojoResult result = MojoNewWaitMany(
(...skipping 15 matching lines...) Expand all
330 } 330 }
331 331
332 // Strict weak ordering, so that |Handle|s can be used as keys in |std::map|s, 332 // Strict weak ordering, so that |Handle|s can be used as keys in |std::map|s,
333 inline bool operator<(const Handle a, const Handle b) { 333 inline bool operator<(const Handle a, const Handle b) {
334 return a.value() < b.value(); 334 return a.value() < b.value();
335 } 335 }
336 336
337 } // namespace mojo 337 } // namespace mojo
338 338
339 #endif // MOJO_PUBLIC_CPP_SYSTEM_HANDLE_H_ 339 #endif // MOJO_PUBLIC_CPP_SYSTEM_HANDLE_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/application/lazy_interface_ptr.h ('k') | mojo/public/interfaces/bindings/tests/test_structs.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698