summaryrefslogtreecommitdiffstats
path: root/ppapi/api
diff options
context:
space:
mode:
authormtilburg@adobe.com <mtilburg@adobe.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-26 22:12:56 +0000
committermtilburg@adobe.com <mtilburg@adobe.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-26 22:12:56 +0000
commit7813eb0bc4ed845c361493ef3e1f0290fe16c3b0 (patch)
treef0c740d8a536c7a4c120016af0c99c43a9ae83e8 /ppapi/api
parenta3e2de75e309b527cd694b16d23100bbec1710d9 (diff)
downloadchromium_src-7813eb0bc4ed845c361493ef3e1f0290fe16c3b0.zip
chromium_src-7813eb0bc4ed845c361493ef3e1f0290fe16c3b0.tar.gz
chromium_src-7813eb0bc4ed845c361493ef3e1f0290fe16c3b0.tar.bz2
Add Pepper API to use UDP
author: mtilburg@adobe.com BUG=none TEST=tested with pepper flash Review URL: http://codereview.chromium.org/8036036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102817 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/api')
-rw-r--r--ppapi/api/private/ppb_flash_udp_socket.idl59
1 files changed, 59 insertions, 0 deletions
diff --git a/ppapi/api/private/ppb_flash_udp_socket.idl b/ppapi/api/private/ppb_flash_udp_socket.idl
new file mode 100644
index 0000000..7328db8
--- /dev/null
+++ b/ppapi/api/private/ppb_flash_udp_socket.idl
@@ -0,0 +1,59 @@
+/* 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 <code>PPB_Flash_UDPSocket</code> interface.
+ */
+
+label Chrome {
+ M16 = 0.1
+};
+
+interface PPB_Flash_UDPSocket {
+ /**
+ * Creates a UDP socket resource.
+ */
+ PP_Resource Create([in] PP_Instance instance_id);
+
+ /**
+ * Determines if a given resource is a UDP socket.
+ */
+ PP_Bool IsFlashUDPSocket([in] PP_Resource resource_id);
+
+ /* Creates a socket and binds to the address given by |addr|. */
+ int32_t Bind([in] PP_Resource udp_socket,
+ [in] PP_Flash_NetAddress addr,
+ [in] PP_CompletionCallback callback);
+
+ /* Performs a non-blocking recvfrom call on socket.
+ * Bind must be called first. |callback| is invoked when recvfrom
+ * reads data. You must call GetRecvFromAddress to recover the
+ * address the data was retrieved from.
+ */
+ int32_t RecvFrom([in] PP_Resource udp_socket,
+ [out] str_t buffer,
+ [in] int32_t num_bytes,
+ [in] PP_CompletionCallback callback);
+
+ /* Upon successful completion of RecvFrom, the address that the data
+ * was received from is stored in |addr|.
+ */
+ PP_Bool GetRecvFromAddress([in] PP_Resource udp_socket,
+ [out] PP_Flash_NetAddress addr);
+
+ /* Performs a non-blocking sendto call on the socket created and
+ * bound(has already called Bind). The callback |callback| is
+ * invoked when sendto completes.
+ */
+ int32_t SendTo([in] PP_Resource udp_socket,
+ [in] str_t buffer,
+ [in] int32_t num_bytes,
+ [in] PP_Flash_NetAddress addr,
+ [in] PP_CompletionCallback callback);
+
+ /* Cancels all pending reads and writes, and closes the socket. */
+ void Close([in] PP_Resource udp_socket);
+};
+