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

Unified Diff: ppapi/c/private/ppb_udp_socket_private.h

Issue 9212047: Add GetBoundAddress to PPB_UDPSocket_Private (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: add a few more unit tests, updates from review Created 8 years, 10 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: ppapi/c/private/ppb_udp_socket_private.h
diff --git a/ppapi/c/private/ppb_udp_socket_private.h b/ppapi/c/private/ppb_udp_socket_private.h
index 78722e0998b558cdad81901ebb9c4f7361594d9e..ca3f8474c4dc7449e0f1dc33f43a59f476eac251 100644
--- a/ppapi/c/private/ppb_udp_socket_private.h
+++ b/ppapi/c/private/ppb_udp_socket_private.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From private/ppb_udp_socket_private.idl modified Wed Nov 16 15:27:20 2011. */
+/* From private/ppb_udp_socket_private.idl modified Wed Feb 8 14:07:18 2012. */
#ifndef PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_
#define PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_
@@ -17,7 +17,8 @@
#include "ppapi/c/private/ppb_net_address_private.h"
#define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_2 "PPB_UDPSocket_Private;0.2"
-#define PPB_UDPSOCKET_PRIVATE_INTERFACE PPB_UDPSOCKET_PRIVATE_INTERFACE_0_2
+#define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_3 "PPB_UDPSocket_Private;0.3"
+#define PPB_UDPSOCKET_PRIVATE_INTERFACE PPB_UDPSOCKET_PRIVATE_INTERFACE_0_3
/**
* @file
@@ -29,7 +30,7 @@
* @addtogroup Interfaces
* @{
*/
-struct PPB_UDPSocket_Private_0_2 {
+struct PPB_UDPSocket_Private_0_3 {
/**
* Creates a UDP socket resource.
*/
@@ -42,6 +43,12 @@ struct PPB_UDPSocket_Private_0_2 {
int32_t (*Bind)(PP_Resource udp_socket,
const struct PP_NetAddress_Private* addr,
struct PP_CompletionCallback callback);
+ /* Returns the address that the socket has bound to. A successful
+ * call to Bind must be called first. Returns false if Bind fails,
dmichael (off chromium) 2012/02/08 16:05:20 nit: false->PP_FALSE
mtilburg1 2012/02/09 11:08:06 Done.
+ * or if Close has been called.
+ */
+ PP_Bool (*GetBoundAddress)(PP_Resource udp_socket,
+ struct PP_NetAddress_Private* addr);
/* 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
@@ -69,7 +76,27 @@ struct PPB_UDPSocket_Private_0_2 {
void (*Close)(PP_Resource udp_socket);
};
-typedef struct PPB_UDPSocket_Private_0_2 PPB_UDPSocket_Private;
+typedef struct PPB_UDPSocket_Private_0_3 PPB_UDPSocket_Private;
+
+struct PPB_UDPSocket_Private_0_2 {
+ PP_Resource (*Create)(PP_Instance instance_id);
+ PP_Bool (*IsUDPSocket)(PP_Resource resource_id);
+ int32_t (*Bind)(PP_Resource udp_socket,
+ const struct PP_NetAddress_Private* addr,
+ struct PP_CompletionCallback callback);
+ int32_t (*RecvFrom)(PP_Resource udp_socket,
+ char* buffer,
+ int32_t num_bytes,
+ struct PP_CompletionCallback callback);
+ PP_Bool (*GetRecvFromAddress)(PP_Resource udp_socket,
+ struct PP_NetAddress_Private* addr);
+ int32_t (*SendTo)(PP_Resource udp_socket,
+ const char* buffer,
+ int32_t num_bytes,
+ const struct PP_NetAddress_Private* addr,
+ struct PP_CompletionCallback callback);
+ void (*Close)(PP_Resource udp_socket);
+};
/**
* @}
*/

Powered by Google App Engine
This is Rietveld 408576698