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

Unified Diff: mojo/public/bindings/lib/bindings_support.h

Issue 62773003: Mojo: Add BindingsSupportImpl on top of HandleWatcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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/public/bindings/lib/bindings_support.h
diff --git a/mojo/public/bindings/lib/bindings_support.h b/mojo/public/bindings/lib/bindings_support.h
index 15aa65b98bd194e52de31af00b262da458e177d4..a1979f648c036663250fc4221969d409ba8f9904 100644
--- a/mojo/public/bindings/lib/bindings_support.h
+++ b/mojo/public/bindings/lib/bindings_support.h
@@ -15,22 +15,30 @@ class BindingsSupport {
public:
class AsyncWaitCallback {
public:
+ virtual ~AsyncWaitCallback() {}
virtual void OnHandleReady(MojoResult result) = 0;
};
- // Asynchronously call MojoWait on a background thread, and return the result
- // to the current thread via the given AsyncWaitCallback.
- virtual bool AsyncWait(Handle handle,
- MojoWaitFlags flags,
- MojoDeadline deadline,
- AsyncWaitCallback* callback) = 0;
-
- // Cancel an existing call to AsyncWait with the given callback. The
- // callback's OnHandleReady method should not be called in this case.
- virtual void CancelWait(AsyncWaitCallback* callback) = 0;
+ typedef void* AsyncWaitID;
static void Set(BindingsSupport* support);
static BindingsSupport* Get();
+
+ // Asynchronously call MojoWait on a background thread, and pass the result
+ // of MojoWait to the given AsyncWaitCallback on the current thread. Returns
+ // an AsyncWaitID that can be used with CancelWait to stop waiting. This
+ // identifier becomes invalid once the callback runs.
+ virtual AsyncWaitID AsyncWait(Handle handle,
+ MojoWaitFlags flags,
+ AsyncWaitCallback* callback) = 0;
+
+ // Cancel an existing call to AsyncWait with the given AsyncWaitID. The
+ // corresponding AsyncWaitCallback's OnHandleReady method will not be called
+ // in this case.
+ virtual void CancelWait(AsyncWaitID id) = 0;
+
+ protected:
+ virtual ~BindingsSupport() {}
};
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698