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

Unified Diff: third_party/mojo/src/mojo/public/cpp/utility/run_loop.h

Issue 901843003: Update mojo sdk to rev 8d45c89c30b230843c5bd6dd0693a555750946c0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Partial revert of https://codereview.chromium.org/899993002/ Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/mojo/src/mojo/public/cpp/utility/DEPS ('k') | third_party/mojo/src/mojo/public/dart/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/mojo/src/mojo/public/cpp/utility/run_loop.h
diff --git a/third_party/mojo/src/mojo/public/cpp/utility/run_loop.h b/third_party/mojo/src/mojo/public/cpp/utility/run_loop.h
index 5ebe63e1146aec021ff68701c1b87d2301e21fc9..4673eaa874a72e6deca7779278e9734106b9e976 100644
--- a/third_party/mojo/src/mojo/public/cpp/utility/run_loop.h
+++ b/third_party/mojo/src/mojo/public/cpp/utility/run_loop.h
@@ -15,6 +15,8 @@ namespace mojo {
class RunLoopHandler;
+// Watches handles for signals and calls event handlers when they occur. Also
+// executes delayed tasks. This class should only be used by a single thread.
class RunLoop {
public:
RunLoop();
@@ -31,8 +33,17 @@ class RunLoop {
// created.
static RunLoop* current();
- // Registers a RunLoopHandler for the specified handle. Only one handler can
- // be registered for a specified handle.
+ // Registers a RunLoopHandler for the specified handle. It is an error to
+ // register more than one handler for a handle, and crashes the process.
+ //
+ // The handler's OnHandleReady() method is invoked after one of the signals in
+ // |handle_signals| occurs. Note that the handler remains registered until
+ // explicitly removed or an error occurs.
+ //
+ // The handler's OnHandleError() method is invoked if the deadline elapses, an
+ // error is detected, or the RunLoop is being destroyed. The handler is
+ // automatically unregistered before calling OnHandleError(), so it will not
+ // receive any further notifications.
void AddHandler(RunLoopHandler* handler,
const Handle& handle,
MojoHandleSignals handle_signals,
« no previous file with comments | « third_party/mojo/src/mojo/public/cpp/utility/DEPS ('k') | third_party/mojo/src/mojo/public/dart/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698