Index: third_party/mojo/src/mojo/edk/system/dispatcher.h |
diff --git a/third_party/mojo/src/mojo/edk/system/dispatcher.h b/third_party/mojo/src/mojo/edk/system/dispatcher.h |
index c0bb69ba2d6fe8720c74b74749bf789d0a907679..e9af1c00cefd17ff7749e7ba23df3e49cea8d9e6 100644 |
--- a/third_party/mojo/src/mojo/edk/system/dispatcher.h |
+++ b/third_party/mojo/src/mojo/edk/system/dispatcher.h |
@@ -66,6 +66,7 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher |
DATA_PIPE_PRODUCER, |
DATA_PIPE_CONSUMER, |
SHARED_BUFFER, |
+ WAIT_SET, |
// "Private" types (not exposed via the public interface): |
PLATFORM_HANDLE = -1 |
@@ -153,6 +154,25 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher |
// |*signals_state| will be set to the current handle signals state. |
void RemoveAwakable(Awakable* awakable, HandleSignalsState* signals_state); |
+ // Adds a dispatcher to wait on. When the dispatcher satisfies |signals|, it |
+ // will be returned in the next call to |GetReadyDispatchers()|. If |
+ // |dispatcher| has been added, it must be removed before adding again, |
+ // otherwise |MOJO_RESULT_ALREADY_EXISTS| will be returned. |
+ MojoResult AddWaitingDispatcher(const scoped_refptr<Dispatcher>& dispatcher, |
+ MojoHandleSignals signals, |
+ uintptr_t context); |
+ // Removes a dispatcher to wait on. If |dispatcher| has not been added, |
+ // |MOJO_RESULT_NOT_FOUND| will be returned. |
+ MojoResult RemoveWaitingDispatcher( |
+ const scoped_refptr<Dispatcher>& dispatcher); |
+ // Returns a set of ready dispatchers. |*count| is the maximum number of |
+ // dispatchers to return, and will contain the number of dispatchers returned |
+ // in |dispatchers| on completion. |
+ MojoResult GetReadyDispatchers(UserPointer<uint32_t> count, |
+ DispatcherVector* dispatchers, |
+ UserPointer<MojoResult> results, |
+ UserPointer<uintptr_t> contexts); |
+ |
// A dispatcher must be put into a special state in order to be sent across a |
// message pipe. Outside of tests, only |HandleTableAccess| is allowed to do |
// this, since there are requirements on the handle table (see below). |
@@ -284,6 +304,18 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher |
virtual void RemoveAwakableImplNoLock(Awakable* awakable, |
HandleSignalsState* signals_state) |
MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); |
+ virtual MojoResult AddWaitingDispatcherImplNoLock( |
+ const scoped_refptr<Dispatcher>& dispatcher, |
+ MojoHandleSignals signals, |
+ uintptr_t context) MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); |
+ virtual MojoResult RemoveWaitingDispatcherImplNoLock( |
+ const scoped_refptr<Dispatcher>& dispatcher) |
+ MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); |
+ virtual MojoResult GetReadyDispatchersImplNoLock( |
+ UserPointer<uint32_t> count, |
+ DispatcherVector* dispatchers, |
+ UserPointer<MojoResult> results, |
+ UserPointer<uintptr_t> contexts) MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_); |
// These implement the API used to serialize dispatchers to a |Channel| |
// (described below). They will only be called on a dispatcher that's attached |