diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-29 19:11:18 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-29 19:11:18 +0000 |
commit | 3860209812b3c57373dcd33c17cf31a1786d554b (patch) | |
tree | 2f3b63995b1f41a36c4f6549ea437e741d157938 /ppapi/c/private | |
parent | 155399dd35c53dddae3d9dbcd7200c8f3999e6ef (diff) | |
download | chromium_src-3860209812b3c57373dcd33c17cf31a1786d554b.zip chromium_src-3860209812b3c57373dcd33c17cf31a1786d554b.tar.gz chromium_src-3860209812b3c57373dcd33c17cf31a1786d554b.tar.bz2 |
Revert 191401 "Implemented queued UDP SendTo/RecvFrom requests. ..."
Broken on Linux ChromiumOS
> Implemented queued UDP SendTo/RecvFrom requests. Exposed SO_SNDBUF and SO_RVFBUF socket options.
>
> BUG=154338
> TEST=browser_tests:*UDPSocketPrivate*
> TBR=jschuh
>
> Review URL: https://chromiumcodereview.appspot.com/12316095
TBR=ygorshenin@chromium.org
Review URL: https://codereview.chromium.org/13154008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191415 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c/private')
-rw-r--r-- | ppapi/c/private/ppb_udp_socket_private.h | 88 |
1 files changed, 28 insertions, 60 deletions
diff --git a/ppapi/c/private/ppb_udp_socket_private.h b/ppapi/c/private/ppb_udp_socket_private.h index c1438a1..27770b1 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 Thu Mar 28 15:59:15 2013. */ +/* From private/ppb_udp_socket_private.idl modified Thu Aug 23 12:32:12 2012. */ #ifndef PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ #define PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ @@ -20,8 +20,7 @@ #define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_2 "PPB_UDPSocket_Private;0.2" #define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_3 "PPB_UDPSocket_Private;0.3" #define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_4 "PPB_UDPSocket_Private;0.4" -#define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_5 "PPB_UDPSocket_Private;0.5" -#define PPB_UDPSOCKET_PRIVATE_INTERFACE PPB_UDPSOCKET_PRIVATE_INTERFACE_0_5 +#define PPB_UDPSOCKET_PRIVATE_INTERFACE PPB_UDPSOCKET_PRIVATE_INTERFACE_0_4 /** * @file @@ -36,23 +35,14 @@ typedef enum { /* Allow the socket to share the local address to which socket will * be bound with other processes. Value's type should be - * PP_VARTYPE_BOOL. Takes effect if set before Bind(). */ + * PP_VARTYPE_BOOL. */ PP_UDPSOCKETFEATURE_ADDRESS_REUSE = 0, - /* Allow sending and receiving packets to and from broadcast - * addresses. Value's type should be PP_VARTYPE_BOOL. Takes effect - * if set before Bind(). */ + /* Allow sending and receiving packets sent to and from broadcast + * addresses. Value's type should be PP_VARTYPE_BOOL. */ PP_UDPSOCKETFEATURE_BROADCAST = 1, - /* Specifies the total per-socket buffer space reserved for - * sends. Value's type should be PP_VARTYPE_INT32. Supported in v0.5 - * and above. */ - PP_UDPSOCKETFEATURE_SEND_BUFFER_SIZE = 2, - /* Specifies the total per-socket buffer space reserved for - * receives. Value's type should be PP_VARTYPE_INT32. Supported in - * v0.5 and above. */ - PP_UDPSOCKETFEATURE_RECV_BUFFER_SIZE = 3, /* Special value for counting the number of available * features. Should not be passed to SetSocketFeature(). */ - PP_UDPSOCKETFEATURE_COUNT = 4 + PP_UDPSOCKETFEATURE_COUNT = 2 } PP_UDPSocketFeature_Private; PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_UDPSocketFeature_Private, 4); /** @@ -63,7 +53,7 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_UDPSocketFeature_Private, 4); * @addtogroup Interfaces * @{ */ -struct PPB_UDPSocket_Private_0_5 { +struct PPB_UDPSocket_Private_0_4 { /** * Creates a UDP socket resource. */ @@ -73,13 +63,13 @@ struct PPB_UDPSocket_Private_0_5 { */ PP_Bool (*IsUDPSocket)(PP_Resource resource_id); /** - * Sets a socket feature to |udp_socket|. Possible values for - * |name|, |value| and |value|'s type are described in - * PP_UDPSocketFeature_Private description. If no error occurs, - * returns PP_OK. Otherwise, returns PP_ERROR_BADRESOURCE (if bad - * |udp_socket| provided), PP_ERROR_BADARGUMENT (if bad - * name/value/value's type provided) or PP_ERROR_FAILED in the case - * of internal errors. + * Sets a socket feature to |udp_socket|. Should be called before + * Bind(). Possible values for |name|, |value| and |value|'s type + * are described in PP_UDPSocketFeature_Private description. If no + * error occurs, returns PP_OK. Otherwise, returns + * PP_ERROR_BADRESOURCE (if bad |udp_socket| provided), + * PP_ERROR_BADARGUMENT (if bad name/value/value's type provided) + * or PP_ERROR_FAILED in the case of internal errors. */ int32_t (*SetSocketFeature)(PP_Resource udp_socket, PP_UDPSocketFeature_Private name, @@ -89,25 +79,28 @@ struct PPB_UDPSocket_Private_0_5 { 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 PP_FALSE if Bind - * fails, or if Close() has been called. + * call to Bind must be called first. Returns PP_FALSE if Bind + * fails, 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. It - * is possible to call RecvFrom() again on the same socket before - * completion of the previous call. + /* 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)(PP_Resource udp_socket, char* buffer, int32_t num_bytes, - struct PP_NetAddress_Private* addr, struct PP_CompletionCallback callback); + /* Upon successful completion of RecvFrom, the address that the data + * was received from is stored in |addr|. + */ + PP_Bool (*GetRecvFromAddress)(PP_Resource udp_socket, + struct PP_NetAddress_Private* 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. |buffer| and |addr| don't need to - * persist until |callback| is called. + * bound(has already called Bind). The callback |callback| is + * invoked when sendto completes. */ int32_t (*SendTo)(PP_Resource udp_socket, const char* buffer, @@ -118,7 +111,7 @@ struct PPB_UDPSocket_Private_0_5 { void (*Close)(PP_Resource udp_socket); }; -typedef struct PPB_UDPSocket_Private_0_5 PPB_UDPSocket_Private; +typedef struct PPB_UDPSocket_Private_0_4 PPB_UDPSocket_Private; struct PPB_UDPSocket_Private_0_2 { PP_Resource (*Create)(PP_Instance instance_id); @@ -161,31 +154,6 @@ struct PPB_UDPSocket_Private_0_3 { struct PP_CompletionCallback callback); void (*Close)(PP_Resource udp_socket); }; - -struct PPB_UDPSocket_Private_0_4 { - PP_Resource (*Create)(PP_Instance instance_id); - PP_Bool (*IsUDPSocket)(PP_Resource resource_id); - int32_t (*SetSocketFeature)(PP_Resource udp_socket, - PP_UDPSocketFeature_Private name, - struct PP_Var value); - int32_t (*Bind)(PP_Resource udp_socket, - const struct PP_NetAddress_Private* addr, - struct PP_CompletionCallback callback); - PP_Bool (*GetBoundAddress)(PP_Resource udp_socket, - struct PP_NetAddress_Private* addr); - 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); -}; /** * @} */ |