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

Unified Diff: mojo/edk/system/dispatcher.h

Issue 779503003: Extract Awakable from Waiter (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: mojo/edk/system/dispatcher.h
diff --git a/mojo/edk/system/dispatcher.h b/mojo/edk/system/dispatcher.h
index b17bfae10e4fb665a11d60bd36f29d9c3e2ec05d..e4226209451ae9edd57be7bdf420854364e9a439 100644
--- a/mojo/edk/system/dispatcher.h
+++ b/mojo/edk/system/dispatcher.h
@@ -39,7 +39,7 @@ class HandleTable;
class LocalMessagePipeEndpoint;
class ProxyMessagePipeEndpoint;
class TransportData;
-class Waiter;
+class Awakable;
typedef std::vector<scoped_refptr<Dispatcher>> DispatcherVector;
@@ -128,7 +128,7 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher
// threads.
HandleSignalsState GetHandleSignalsState() const;
- // Adds a waiter to this dispatcher. The waiter will be woken up when this
+ // Adds an awakable to this dispatcher. The waiter will be woken up when this
viettrungluu 2014/12/03 21:18:13 "... dispatcher. The waiter ..." -> "... dispatche
Hajime Morrita 2014/12/03 21:44:09 Done.
// object changes state to satisfy |signals| with context |context|. It will
// also be woken up when it becomes impossible for the object to ever satisfy
// |signals| with a suitable error status.
@@ -142,15 +142,16 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher
// - |MOJO_RESULT_INVALID_ARGUMENT| if the dispatcher has been closed; and
// - |MOJO_RESULT_FAILED_PRECONDITION| if it is not (or no longer) possible
// that |signals| will ever be satisfied.
- MojoResult AddWaiter(Waiter* waiter,
- MojoHandleSignals signals,
- uint32_t context,
- HandleSignalsState* signals_state);
- // Removes a waiter from this dispatcher. (It is valid to call this multiple
+ MojoResult AddAwakable(Awakable* awakable,
+ MojoHandleSignals signals,
+ uint32_t context,
+ HandleSignalsState* signals_state);
+ // Removes an awakable from this dispatcher. (It is valid to call this
+ // multiple
viettrungluu 2014/12/03 21:18:13 please properly rewrap everywhere
Hajime Morrita 2014/12/03 21:44:09 Done.
// times for the same |waiter| on the same object, so long as |AddWaiter()|
viettrungluu 2014/12/03 21:18:13 waiter -> awakable Update AddWaiter.
Hajime Morrita 2014/12/03 21:44:09 Done.
// was called at most once.) If |signals_state| is non-null, |*signals_state|
// will be set to the current handle signals state.
- void RemoveWaiter(Waiter* waiter, HandleSignalsState* signals_state);
+ void RemoveAwakable(Awakable* awakable, HandleSignalsState* signals_state);
// 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
@@ -222,7 +223,7 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher
// These are to be overridden by subclasses (if necessary). They are called
// exactly once -- first |CancelAllWaitersNoLock()|, then |CloseImplNoLock()|,
// when the dispatcher is being closed. They are called under |lock_|.
- virtual void CancelAllWaitersNoLock();
+ virtual void CancelAllAwakablesNoLock();
virtual void CloseImplNoLock();
virtual scoped_refptr<Dispatcher>
CreateEquivalentDispatcherAndCloseImplNoLock() = 0;
@@ -266,12 +267,12 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher
MojoMapBufferFlags flags,
scoped_ptr<embedder::PlatformSharedBufferMapping>* mapping);
virtual HandleSignalsState GetHandleSignalsStateImplNoLock() const;
- virtual MojoResult AddWaiterImplNoLock(Waiter* waiter,
- MojoHandleSignals signals,
- uint32_t context,
- HandleSignalsState* signals_state);
- virtual void RemoveWaiterImplNoLock(Waiter* waiter,
- HandleSignalsState* signals_state);
+ virtual MojoResult AddAwakableImplNoLock(Awakable* awakable,
+ MojoHandleSignals signals,
+ uint32_t context,
+ HandleSignalsState* signals_state);
+ virtual void RemoveAwakableImplNoLock(Awakable* awakable,
+ HandleSignalsState* signals_state);
// These implement the API used to serialize dispatchers to a |Channel|
// (described below). They will only be called on a dispatcher that's attached

Powered by Google App Engine
This is Rietveld 408576698