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

Unified Diff: mojo/common/message_pump_mojo.h

Issue 69883008: Implements HandleWatcher in terms of MessagePumpMojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 7 years, 1 month 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/common/message_pump_mojo.h
diff --git a/mojo/common/message_pump_mojo.h b/mojo/common/message_pump_mojo.h
index 4eba660294630be80082c6c0fd5c558ca4b1ce66..003e0500a009def441228e9f290430248a17ae72 100644
--- a/mojo/common/message_pump_mojo.h
+++ b/mojo/common/message_pump_mojo.h
@@ -8,6 +8,7 @@
#include <map>
#include "base/message_loop/message_pump.h"
+#include "base/time/time.h"
#include "mojo/common/mojo_common_export.h"
#include "mojo/public/system/core.h"
@@ -24,12 +25,13 @@ class MOJO_COMMON_EXPORT MessagePumpMojo : public base::MessagePump {
// Registers a MessagePumpMojoHandler for the specified handle. Only one
// handler can be registered for a specified handle. If there is an existing
- // handler registered it is clobbered and silently removed.
- // The handler is notified either when the handle is ready, or when it becomes
- // invalid. If the handle becomes invalid the handler is removed and notified.
+ // handler already registered the existing handler is notified it was removed
+ // (MOJO_RESULT_CANCELLED). If the handle becomes invalid the handler is
+ // removed and notified.
void AddHandler(MessagePumpMojoHandler* handler,
MojoHandle handle,
- MojoWaitFlags wait_flags);
+ MojoWaitFlags wait_flags,
+ base::TimeTicks deadline);
void RemoveHandler(MojoHandle handle);
@@ -51,6 +53,7 @@ class MOJO_COMMON_EXPORT MessagePumpMojo : public base::MessagePump {
MessagePumpMojoHandler* handler;
MojoWaitFlags wait_flags;
+ base::TimeTicks deadline;
};
typedef std::map<MojoHandle, Handler> HandleToHandler;
@@ -67,6 +70,9 @@ class MOJO_COMMON_EXPORT MessagePumpMojo : public base::MessagePump {
WaitState GetWaitState() const;
+ // Returns the deadline for the call to MojoWaitMany().
+ MojoDeadline GetDeadlineForWait() const;
+
// If non-NULL we're running (inside Run()). Member is reference to value on
// stack.
RunState* run_state_;

Powered by Google App Engine
This is Rietveld 408576698