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

Unified Diff: mojo/public/environment/async_waiter.h

Issue 134253004: Mojo: AsyncWaiter and mojo/public/environment (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: improve README.md Created 6 years, 11 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
Index: mojo/public/environment/async_waiter.h
diff --git a/mojo/public/environment/async_waiter.h b/mojo/public/environment/async_waiter.h
new file mode 100644
index 0000000000000000000000000000000000000000..c59957f2775d53f49130ca0d5abf848aa9c75db6
--- /dev/null
+++ b/mojo/public/environment/async_waiter.h
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PUBLIC_ENVIRONMENT_ASYNC_WAITER_H_
+#define MOJO_PUBLIC_ENVIRONMENT_ASYNC_WAITER_H_
+
+#include "mojo/public/system/core.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef uintptr_t MojoAsyncWaitID;
+
+typedef void (*MojoAsyncWaitCallback)(uintptr_t user_data, MojoResult result);
+
+struct MojoAsyncWaiter {
+ // Asynchronously call MojoWait on a background thread, and pass the result
+ // of MojoWait to the given MojoAsyncWaitCallback on the current thread.
+ // Returns a non-zero MojoAsyncWaitID that can be used with CancelWait to
+ // stop waiting. This identifier becomes invalid once the callback runs.
+ MojoAsyncWaitID (*AsyncWait)(MojoAsyncWaiter* waiter,
+ MojoHandle handle,
+ MojoWaitFlags flags,
+ MojoDeadline deadline,
+ MojoAsyncWaitCallback callback,
+ uintptr_t user_data);
+
+ // Cancel an existing call to AsyncWait with the given MojoAsyncWaitID. The
+ // corresponding MojoAsyncWaitCallback will not be called in this case.
+ void (*CancelWait)(MojoAsyncWaiter* waiter,
+ MojoAsyncWaitID wait_id);
+};
+
+// Returns the default MojoAsyncWaiter implementation.
+MojoAsyncWaiter* MojoGetDefaultAsyncWaiter();
viettrungluu 2014/01/13 21:47:44 Will this be needed by the GL library? (As in, wil
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // MOJO_PUBLIC_ENVIRONMENT_ASYNC_WAITER_H_

Powered by Google App Engine
This is Rietveld 408576698