summaryrefslogtreecommitdiffstats
path: root/ppapi/api/pp_completion_callback.idl
diff options
context:
space:
mode:
authorneb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-30 17:37:54 +0000
committerneb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-30 17:37:54 +0000
commit2272ed3505a36c7d1543f24b770ea85dcfee8640 (patch)
tree91bc7c2235c7d07b65f16e2b78f49382d863fb0b /ppapi/api/pp_completion_callback.idl
parentf917b80b0878fe92ca856696af2dc47a0f5e1c55 (diff)
downloadchromium_src-2272ed3505a36c7d1543f24b770ea85dcfee8640.zip
chromium_src-2272ed3505a36c7d1543f24b770ea85dcfee8640.tar.gz
chromium_src-2272ed3505a36c7d1543f24b770ea85dcfee8640.tar.bz2
IDL version of PPAPI interfaces.
BUG=none TEST=none yet... soon. Review URL: http://codereview.chromium.org/6726041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79857 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/api/pp_completion_callback.idl')
-rw-r--r--ppapi/api/pp_completion_callback.idl29
1 files changed, 29 insertions, 0 deletions
diff --git a/ppapi/api/pp_completion_callback.idl b/ppapi/api/pp_completion_callback.idl
new file mode 100644
index 0000000..b1fb8b3
--- /dev/null
+++ b/ppapi/api/pp_completion_callback.idl
@@ -0,0 +1,29 @@
+/* Copyright (c) 2011 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.
+ */
+
+/* This file defines the completion callback type. */
+
+/* The callback function. */
+typedef void PP_CompletionCallback_Func([in] mem_t user_data,
+ [in] int32_t result);
+
+/* Any method that takes a PP_CompletionCallback has the option of completing
+ * asynchronously if the operation would block. Such a method should return
+ * PP_Error_WouldBlock to indicate when the method will complete
+ * asynchronously. If the completion callback is NULL, then the operation
+ * will block if necessary to complete its work. PP_BlockUntilComplete()
+ * provides a convenient way to specify blocking behavior.
+ *
+ * The result parameter passes an int32_t that if negative indicates an error
+ * code. Otherwise the result value indicates success. If it is a positive
+ * value then it may carry additional information.
+ */
+[passByValue] struct PP_CompletionCallback {
+ /* Function to call during callback. */
+ PP_CompletionCallback_Func func;
+
+ /* Data to pass into callback. */
+ mem_t user_data;
+};