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

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

Issue 704133005: Pepper: Add support for multicast in PPB_UDPSocket API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests, thunk code auto generated Created 5 years, 9 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 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]
etrunko 2015/02/23 22:22:15 This was removed in a previous commit (Remove timi
bbudge 2015/03/02 16:03:08 OK
11
10 label Chrome { 12 label Chrome {
11 M29 = 1.0, 13 M29 = 1.0,
12 M41 = 1.1 14 M41 = 1.1,
15 [channel=dev] M42 = 1.2
13 }; 16 };
14 17
15 /** 18 /**
16 * Option names used by <code>SetOption()</code>. 19 * Option names used by <code>SetOption()</code>.
17 */ 20 */
18 [assert_size(4)] 21 [assert_size(4)]
19 enum PP_UDPSocket_Option { 22 enum PP_UDPSocket_Option {
20 /** 23 /**
21 * Allows the socket to share the local address to which it will be bound with 24 * Allows the socket to share the local address to which it will be bound with
22 * other processes. Value's type should be <code>PP_VARTYPE_BOOL</code>. 25 * other processes. Value's type should be <code>PP_VARTYPE_BOOL</code>.
(...skipping 26 matching lines...) Expand all
49 * Specifies the total per-socket buffer space reserved for receives. Value's 52 * Specifies the total per-socket buffer space reserved for receives. Value's
50 * type should be <code>PP_VARTYPE_INT32</code>. 53 * type should be <code>PP_VARTYPE_INT32</code>.
51 * On version 1.0, this option can only be set after a successful 54 * On version 1.0, this option can only be set after a successful
52 * <code>Bind()</code> call. On version 1.1 or later, there is no such 55 * <code>Bind()</code> call. On version 1.1 or later, there is no such
53 * limitation. 56 * limitation.
54 * 57 *
55 * Note: This is only treated as a hint for the browser to set the buffer 58 * Note: This is only treated as a hint for the browser to set the buffer
56 * size. Even if <code>SetOption()</code> succeeds, the browser doesn't 59 * size. Even if <code>SetOption()</code> succeeds, the browser doesn't
57 * guarantee it will conform to the size. 60 * guarantee it will conform to the size.
58 */ 61 */
59 PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3 62 PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3,
63
64 /**
65 * Specifies whether the packets sent from the host to the multicast group
66 * should be looped back to the host or not. Value's type should be
67 * <code>PP_VARTYPE_BOOL</code>.
68 * This option can only be set before calling <code>Bind()</code>.
69 *
70 * This is only supported in version 1.2 of the API (Chrome 42) and later.
71 */
72 PP_UDPSOCKET_OPTION_MULTICAST_LOOP = 4,
73
74 /**
75 * Specifies the time-to-live for packets sent to the multicast group. The
76 * value should be within 0 to 255 range. The default value is 1 and means
77 * that packets will not be routed beyond the local network. Value's type
78 * should be <code>PP_VARTYPE_INT32</code>.
79 * This option can only be set before calling <code>Bind()</code>.
80 *
81 * This is only supported in version 1.2 of the API (Chrome 42) and later.
82 */
83 PP_UDPSOCKET_OPTION_MULTICAST_TTL = 5
60 }; 84 };
61 85
62 /** 86 /**
63 * The <code>PPB_UDPSocket</code> interface provides UDP socket operations. 87 * The <code>PPB_UDPSocket</code> interface provides UDP socket operations.
64 * 88 *
65 * Permissions: Apps permission <code>socket</code> with subrule 89 * Permissions: Apps permission <code>socket</code> with subrule
66 * <code>udp-bind</code> is required for <code>Bind()</code>; subrule 90 * <code>udp-bind</code> is required for <code>Bind()</code>; subrule
67 * <code>udp-send-to</code> is required for <code>SendTo()</code>. 91 * <code>udp-send-to</code> is required for <code>SendTo()</code>.
68 * For more details about network communication permissions, please see: 92 * For more details about network communication permissions, please see:
69 * http://developer.chrome.com/apps/app_network.html 93 * http://developer.chrome.com/apps/app_network.html
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon 237 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
214 * completion. 238 * completion.
215 * 239 *
216 * @return An int32_t containing an error code from <code>pp_errors.h</code>. 240 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
217 */ 241 */
218 [version=1.1] 242 [version=1.1]
219 int32_t SetOption([in] PP_Resource udp_socket, 243 int32_t SetOption([in] PP_Resource udp_socket,
220 [in] PP_UDPSocket_Option name, 244 [in] PP_UDPSocket_Option name,
221 [in] PP_Var value, 245 [in] PP_Var value,
222 [in] PP_CompletionCallback callback); 246 [in] PP_CompletionCallback callback);
247
248 /**
249 * Sets a socket option on the UDP socket.
250 * Please see the <code>PP_UDPSocket_Option</code> description for option
251 * names, value types and allowed values.
252 *
253 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
254 * socket.
255 * @param[in] name The option to set.
256 * @param[in] value The option value to set.
257 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
258 * completion.
259 *
260 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
261 */
262 [version=1.2]
263 int32_t SetOption([in] PP_Resource udp_socket,
264 [in] PP_UDPSocket_Option name,
265 [in] PP_Var value,
266 [in] PP_CompletionCallback callback);
267
268 /**
269 * Joins the multicast group with address specified by <code>group</code>
270 * parameter, which is expected to be a <code>PPB_NetAddress</code> object.
271 *
272 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
273 * socket.
274 * @param[in] group A <code>PP_Resource</code> corresponding to the network
275 * address of the multicast group.
276 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
277 * completion.
278 *
279 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
280 */
281 [version=1.2]
282 int32_t JoinGroup([in] PP_Resource udp_socket,
283 [in] PP_Resource group,
284 [in] PP_CompletionCallback callback);
285
286 /**
287 * Leaves the multicast group with address specified by <code>group</code>
288 * parameter, which is expected to be a <code>PPB_NetAddress</code> object.
289 *
290 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
291 * socket.
292 * @param[in] group A <code>PP_Resource</code> corresponding to the network
293 * address of the multicast group.
294 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
295 * completion.
296 *
297 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
298 */
299 [version=1.2]
300 int32_t LeaveGroup([in] PP_Resource udp_socket,
301 [in] PP_Resource group,
302 [in] PP_CompletionCallback callback);
223 }; 303 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698