Index: mojo/public/cpp/utility/run_loop.h |
diff --git a/mojo/public/cpp/utility/run_loop.h b/mojo/public/cpp/utility/run_loop.h |
index cba28629bd03b0711e4a33cdf8136c4714de92dc..0ecc8297603b5237510f5bfbf614d5de7b177435 100644 |
--- a/mojo/public/cpp/utility/run_loop.h |
+++ b/mojo/public/cpp/utility/run_loop.h |
@@ -40,12 +40,12 @@ class RunLoop { |
void RemoveHandler(const Handle& handle); |
bool HasHandler(const Handle& handle) const; |
- // Runs the loop servicing handles as they are ready. This returns when Quit() |
- // is invoked, or there no more handles. |
+ // Runs the loop servicing handles and tasks as they are ready. This returns |
+ // when Quit() is invoked, or there are no more handles nor tasks. |
void Run(); |
- // Runs the loop servicing any handles that are ready. Does not wait for |
- // handles to become ready before returning. Returns early if Quit() is |
+ // Runs the loop servicing any handles and tasks that are ready. Does not wait |
+ // for handles to become ready before returning. Returns early if Quit() is |
// invoked. |
void RunUntilIdle(); |
@@ -83,13 +83,19 @@ class RunLoop { |
IGNORE_DEADLINE |
}; |
+ // Runs the loop servicing any handles that are ready. If |until_idle| is |
+ // true, does not wait for handles to become ready before returning. Returns |
+ // early if Quit() is invoked. |
+ void RunInternal(bool until_idle); |
+ |
// Do one unit of delayed work, if eligible. |
void DoDelayedWork(); |
- // Waits for a handle to be ready. Returns after servicing at least one |
- // handle (or there are no more handles) unless |non_blocking| is true, |
- // in which case it will also return if servicing at least one handle |
- // would require blocking. Returns true if a RunLoopHandler was notified. |
+ // Waits for a handle to be ready or until the next task must be run. Returns |
+ // after servicing at least one handle (or there are no more handles) unless |
+ // a task must be run or |non_blocking| is true, in which case it will also |
+ // return if no task is registered and servicing at least one handle would |
+ // require blocking. Returns true if a RunLoopHandler was notified. |
bool Wait(bool non_blocking); |
// Notifies handlers of |error|. If |check| == CHECK_DEADLINE, this will |