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

Side by Side Diff: ppapi/api/ppb_udp_socket.idl

Issue 690903002: Remove timing limitation of SetOption invocation for PPAPI sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fixed implementation. Created 6 years 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 unified diff | Download patch
OLDNEW
1 /* Copyright 2013 The Chromium Authors. All rights reserved. 1 /* Copyright 2013 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 /** 6 /**
7 * This file defines the <code>PPB_UDPSocket</code> interface. 7 * This file defines the <code>PPB_UDPSocket</code> interface.
8 */ 8 */
9 9
10 [generate_thunk]
11
12 label Chrome { 10 label Chrome {
13 M29 = 1.0 11 M29 = 1.0,
12 M41 = 1.1
14 }; 13 };
15 14
16 /** 15 /**
17 * Option names used by <code>SetOption()</code>. 16 * Option names used by <code>SetOption()</code>.
18 */ 17 */
19 [assert_size(4)] 18 [assert_size(4)]
20 enum PP_UDPSocket_Option { 19 enum PP_UDPSocket_Option {
21 /** 20 /**
22 * Allows the socket to share the local address to which it will be bound with 21 * Allows the socket to share the local address to which it will be bound with
23 * other processes. Value's type should be <code>PP_VARTYPE_BOOL</code>. 22 * other processes. Value's type should be <code>PP_VARTYPE_BOOL</code>.
24 * This option can only be set before calling <code>Bind()</code>. 23 * This option can only be set before calling <code>Bind()</code>.
bbudge 2014/12/09 18:37:38 Looking at the UDP resource base implementation, A
hidehiko 2014/12/09 19:51:42 The comment is correct. Please see my reply in the
25 */ 24 */
26 PP_UDPSOCKET_OPTION_ADDRESS_REUSE = 0, 25 PP_UDPSOCKET_OPTION_ADDRESS_REUSE = 0,
27 26
28 /** 27 /**
29 * Allows sending and receiving packets to and from broadcast addresses. 28 * Allows sending and receiving packets to and from broadcast addresses.
30 * Value's type should be <code>PP_VARTYPE_BOOL</code>. 29 * Value's type should be <code>PP_VARTYPE_BOOL</code>.
31 * This option can only be set before calling <code>Bind()</code>. 30 * On version 1.0, this option can only be set before calling
31 * <code>Bind()</code>. On version 1.1 or later, there is no such limitation.
32 */ 32 */
33 PP_UDPSOCKET_OPTION_BROADCAST = 1, 33 PP_UDPSOCKET_OPTION_BROADCAST = 1,
34 34
35 /** 35 /**
36 * Specifies the total per-socket buffer space reserved for sends. Value's 36 * Specifies the total per-socket buffer space reserved for sends. Value's
37 * type should be <code>PP_VARTYPE_INT32</code>. 37 * type should be <code>PP_VARTYPE_INT32</code>.
38 * This option can only be set after a successful <code>Bind()</code> call. 38 * On version 1.0, this option can only be set before calling
bbudge 2014/12/09 18:37:38 Option can be set only *after* Bind(). And below.
hidehiko 2014/12/09 19:51:42 Oops, good catch. I wrongly updated the comment. R
39 * <code>Bind()</code>. On version 1.1 or later, there is no such limitation.
39 * 40 *
40 * Note: This is only treated as a hint for the browser to set the buffer 41 * Note: This is only treated as a hint for the browser to set the buffer
41 * size. Even if <code>SetOption()</code> succeeds, the browser doesn't 42 * size. Even if <code>SetOption()</code> succeeds, the browser doesn't
42 * guarantee it will conform to the size. 43 * guarantee it will conform to the size.
43 */ 44 */
44 PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE = 2, 45 PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE = 2,
45 46
46 /** 47 /**
47 * Specifies the total per-socket buffer space reserved for receives. Value's 48 * Specifies the total per-socket buffer space reserved for receives. Value's
48 * type should be <code>PP_VARTYPE_INT32</code>. 49 * type should be <code>PP_VARTYPE_INT32</code>.
49 * This option can only be set after a successful <code>Bind()</code> call. 50 * On version 1.0, this option can only be set before calling
51 * <code>Bind()</code>. On version 1.1 or later, there is no such limitation.
50 * 52 *
51 * Note: This is only treated as a hint for the browser to set the buffer 53 * Note: This is only treated as a hint for the browser to set the buffer
52 * size. Even if <code>SetOption()</code> succeeds, the browser doesn't 54 * size. Even if <code>SetOption()</code> succeeds, the browser doesn't
53 * guarantee it will conform to the size. 55 * guarantee it will conform to the size.
54 */ 56 */
55 PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3 57 PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3
56 }; 58 };
57 59
58 /** 60 /**
59 * The <code>PPB_UDPSocket</code> interface provides UDP socket operations. 61 * The <code>PPB_UDPSocket</code> interface provides UDP socket operations.
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 * @param[in] value The option value to set. 188 * @param[in] value The option value to set.
187 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon 189 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
188 * completion. 190 * completion.
189 * 191 *
190 * @return An int32_t containing an error code from <code>pp_errors.h</code>. 192 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
191 */ 193 */
192 int32_t SetOption([in] PP_Resource udp_socket, 194 int32_t SetOption([in] PP_Resource udp_socket,
193 [in] PP_UDPSocket_Option name, 195 [in] PP_UDPSocket_Option name,
194 [in] PP_Var value, 196 [in] PP_Var value,
195 [in] PP_CompletionCallback callback); 197 [in] PP_CompletionCallback callback);
198
199 /**
200 * Sets a socket option on the UDP socket.
201 * Please see the <code>PP_UDPSocket_Option</code> description for option
202 * names, value types and allowed values.
203 *
204 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
205 * socket.
206 * @param[in] name The option to set.
207 * @param[in] value The option value to set.
208 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
209 * completion.
210 *
211 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
212 */
213 [version=1.1]
214 int32_t SetOption([in] PP_Resource udp_socket,
215 [in] PP_UDPSocket_Option name,
216 [in] PP_Var value,
217 [in] PP_CompletionCallback callback);
196 }; 218 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698