OLD | NEW |
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] | 10 [generate_thunk] |
11 | 11 |
12 label Chrome { | 12 label Chrome { |
13 M29 = 1.0 | 13 M29 = 1.0 |
14 }; | 14 }; |
15 | 15 |
16 /** | 16 /** |
17 * Option names used by <code>SetOption()</code>. | 17 * Option names used by <code>SetOption()</code>. |
18 */ | 18 */ |
19 [assert_size(4)] | 19 [assert_size(4)] |
20 enum PP_UDPSocket_Option { | 20 enum PP_UDPSocket_Option { |
21 /** | 21 /** |
22 * Allows the socket to share the local address to which it will be bound with | 22 * 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>. | 23 * other processes. Value's type should be <code>PP_VARTYPE_BOOL</code>. |
24 * This option can only be set before calling <code>Bind()</code>. | |
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>. | |
32 */ | 30 */ |
33 PP_UDPSOCKET_OPTION_BROADCAST = 1, | 31 PP_UDPSOCKET_OPTION_BROADCAST = 1, |
34 | 32 |
35 /** | 33 /** |
36 * Specifies the total per-socket buffer space reserved for sends. Value's | 34 * Specifies the total per-socket buffer space reserved for sends. Value's |
37 * type should be <code>PP_VARTYPE_INT32</code>. | 35 * type should be <code>PP_VARTYPE_INT32</code>. |
38 * This option can only be set after a successful <code>Bind()</code> call. | |
39 * | 36 * |
40 * Note: This is only treated as a hint for the browser to set the buffer | 37 * 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 | 38 * size. Even if <code>SetOption()</code> succeeds, the browser doesn't |
42 * guarantee it will conform to the size. | 39 * guarantee it will conform to the size. |
43 */ | 40 */ |
44 PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE = 2, | 41 PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE = 2, |
45 | 42 |
46 /** | 43 /** |
47 * Specifies the total per-socket buffer space reserved for receives. Value's | 44 * Specifies the total per-socket buffer space reserved for receives. Value's |
48 * type should be <code>PP_VARTYPE_INT32</code>. | 45 * type should be <code>PP_VARTYPE_INT32</code>. |
49 * This option can only be set after a successful <code>Bind()</code> call. | |
50 * | 46 * |
51 * Note: This is only treated as a hint for the browser to set the buffer | 47 * 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 | 48 * size. Even if <code>SetOption()</code> succeeds, the browser doesn't |
53 * guarantee it will conform to the size. | 49 * guarantee it will conform to the size. |
54 */ | 50 */ |
55 PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3 | 51 PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3 |
56 }; | 52 }; |
57 | 53 |
58 /** | 54 /** |
59 * The <code>PPB_UDPSocket</code> interface provides UDP socket operations. | 55 * The <code>PPB_UDPSocket</code> interface provides UDP socket operations. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 183 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
188 * completion. | 184 * completion. |
189 * | 185 * |
190 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 186 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
191 */ | 187 */ |
192 int32_t SetOption([in] PP_Resource udp_socket, | 188 int32_t SetOption([in] PP_Resource udp_socket, |
193 [in] PP_UDPSocket_Option name, | 189 [in] PP_UDPSocket_Option name, |
194 [in] PP_Var value, | 190 [in] PP_Var value, |
195 [in] PP_CompletionCallback callback); | 191 [in] PP_CompletionCallback callback); |
196 }; | 192 }; |
OLD | NEW |