diff options
author | hidehiko <hidehiko@chromium.org> | 2014-12-10 22:01:47 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-11 06:02:17 +0000 |
commit | fd305c12b3fe8b4d2496f67aed089ff703f19b6d (patch) | |
tree | 62ebe93e5ab611439d846f5144c8ef85b3b43e29 /ppapi/api | |
parent | bb210728ae285f574b55877a97a82cc202ff704f (diff) | |
download | chromium_src-fd305c12b3fe8b4d2496f67aed089ff703f19b6d.zip chromium_src-fd305c12b3fe8b4d2496f67aed089ff703f19b6d.tar.gz chromium_src-fd305c12b3fe8b4d2496f67aed089ff703f19b6d.tar.bz2 |
Remove timing limitation of SetOption invocation for PPAPI sockets.
Currently PPAPI has timing limitation for sockets' SetOption.
NODELAY, and BROADCAST need to be before Connect() or Bind(),
while RCVBUF_SIZE and SNFBUF_SIZE need to be after it.
This CL removes such a limitation.
Along with the change, pepper_udp_socket_message_filter starts to use UDPSocket instead of UDPServerSocket, so that the implementation direction gets closer to TCP message filter a little bit.
BUG=425563, 420697
TEST=Ran trybots.
Review URL: https://codereview.chromium.org/690903002
Cr-Commit-Position: refs/heads/master@{#307867}
Diffstat (limited to 'ppapi/api')
-rw-r--r-- | ppapi/api/ppb_tcp_socket.idl | 35 | ||||
-rw-r--r-- | ppapi/api/ppb_udp_socket.idl | 36 |
2 files changed, 61 insertions, 10 deletions
diff --git a/ppapi/api/ppb_tcp_socket.idl b/ppapi/api/ppb_tcp_socket.idl index 543cd30..5851f1d 100644 --- a/ppapi/api/ppb_tcp_socket.idl +++ b/ppapi/api/ppb_tcp_socket.idl @@ -9,7 +9,8 @@ label Chrome { M29 = 1.0, - M31 = 1.1 + M31 = 1.1, + M41 = 1.2 }; /** @@ -20,14 +21,18 @@ enum PP_TCPSocket_Option { /** * Disables coalescing of small writes to make TCP segments, and instead * delivers data immediately. Value's type is <code>PP_VARTYPE_BOOL</code>. - * This option can only be set after a successful <code>Connect()</code> call. + * On version 1.1 or earlier, this option can only be set after a successful + * <code>Connect()</code> call. On version 1.2 or later, there is no such + * limitation. */ PP_TCPSOCKET_OPTION_NO_DELAY = 0, /** * Specifies the total per-socket buffer space reserved for sends. Value's * type should be <code>PP_VARTYPE_INT32</code>. - * This option can only be set after a successful <code>Connect()</code> call. + * On version 1.1 or earlier, this option can only be set after a successful + * <code>Connect()</code> call. On version 1.2 or later, there is no such + * limitation. * * Note: This is only treated as a hint for the browser to set the buffer * size. Even if <code>SetOption()</code> succeeds, the browser doesn't @@ -38,7 +43,9 @@ enum PP_TCPSocket_Option { /** * Specifies the total per-socket buffer space reserved for receives. Value's * type should be <code>PP_VARTYPE_INT32</code>. - * This option can only be set after a successful <code>Connect()</code> call. + * On version 1.1 or earlier, this option can only be set after a successful + * <code>Connect()</code> call. On version 1.2 or later, there is no such + * limitation. * * Note: This is only treated as a hint for the browser to set the buffer * size. Even if <code>SetOption()</code> succeeds, the browser doesn't @@ -261,4 +268,24 @@ interface PPB_TCPSocket { [in] PP_TCPSocket_Option name, [in] PP_Var value, [in] PP_CompletionCallback callback); + + /** + * Sets a socket option on the TCP socket. + * Please see the <code>PP_TCPSocket_Option</code> description for option + * names, value types and allowed values. + * + * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP + * socket. + * @param[in] name The option to set. + * @param[in] value The option value to set. + * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon + * completion. + * + * @return An int32_t containing an error code from <code>pp_errors.h</code>. + */ + [version=1.2] + int32_t SetOption([in] PP_Resource tcp_socket, + [in] PP_TCPSocket_Option name, + [in] PP_Var value, + [in] PP_CompletionCallback callback); }; diff --git a/ppapi/api/ppb_udp_socket.idl b/ppapi/api/ppb_udp_socket.idl index e4c87b2..8226c00 100644 --- a/ppapi/api/ppb_udp_socket.idl +++ b/ppapi/api/ppb_udp_socket.idl @@ -7,10 +7,9 @@ * This file defines the <code>PPB_UDPSocket</code> interface. */ -[generate_thunk] - label Chrome { - M29 = 1.0 + M29 = 1.0, + M41 = 1.1 }; /** @@ -28,14 +27,17 @@ enum PP_UDPSocket_Option { /** * Allows sending and receiving packets to and from broadcast addresses. * Value's type should be <code>PP_VARTYPE_BOOL</code>. - * This option can only be set before calling <code>Bind()</code>. + * On version 1.0, this option can only be set before calling + * <code>Bind()</code>. On version 1.1 or later, there is no such limitation. */ PP_UDPSOCKET_OPTION_BROADCAST = 1, /** * Specifies the total per-socket buffer space reserved for sends. Value's * type should be <code>PP_VARTYPE_INT32</code>. - * This option can only be set after a successful <code>Bind()</code> call. + * On version 1.0, this option can only be set after a successful + * <code>Bind()</code> call. On version 1.1 or later, there is no such + * limitation. * * Note: This is only treated as a hint for the browser to set the buffer * size. Even if <code>SetOption()</code> succeeds, the browser doesn't @@ -46,7 +48,9 @@ enum PP_UDPSocket_Option { /** * Specifies the total per-socket buffer space reserved for receives. Value's * type should be <code>PP_VARTYPE_INT32</code>. - * This option can only be set after a successful <code>Bind()</code> call. + * On version 1.0, this option can only be set after a successful + * <code>Bind()</code> call. On version 1.1 or later, there is no such + * limitation. * * Note: This is only treated as a hint for the browser to set the buffer * size. Even if <code>SetOption()</code> succeeds, the browser doesn't @@ -193,4 +197,24 @@ interface PPB_UDPSocket { [in] PP_UDPSocket_Option name, [in] PP_Var value, [in] PP_CompletionCallback callback); + + /** + * Sets a socket option on the UDP socket. + * Please see the <code>PP_UDPSocket_Option</code> description for option + * names, value types and allowed values. + * + * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP + * socket. + * @param[in] name The option to set. + * @param[in] value The option value to set. + * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon + * completion. + * + * @return An int32_t containing an error code from <code>pp_errors.h</code>. + */ + [version=1.1] + int32_t SetOption([in] PP_Resource udp_socket, + [in] PP_UDPSocket_Option name, + [in] PP_Var value, + [in] PP_CompletionCallback callback); }; |