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

Side by Side Diff: ppapi/api/dev/ppb_udp_socket_dev.idl

Issue 16959005: Implement PPB_UDPSocket_Dev: part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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_Dev</code> interface. 7 * This file defines the <code>PPB_UDPSocket_Dev</code> interface.
8 * TODO(yzshen): Tidy up the document. 8 * TODO(yzshen): Tidy up the document.
9 */ 9 */
10 10
11 [generate_thunk] 11 [generate_thunk]
12 12
13 label Chrome { 13 label Chrome {
14 M29 = 0.1 14 M29 = 0.1
15 }; 15 };
16 16
17 [assert_size(4)] 17 [assert_size(4)]
18 enum PP_UDPSocket_Option_Dev { 18 enum PP_UDPSocket_Option_Dev {
19 // Allows the socket to share the local address to which it will be bound with 19 // Allows the socket to share the local address to which it will be bound with
20 // other processes. Value's type should be PP_VARTYPE_BOOL. 20 // other processes. Value's type should be PP_VARTYPE_BOOL.
21 // Takes effect if set before Bind().
bbudge 2013/06/17 18:29:45 Isn't it an error to set it after Bind?
yzshen1 2013/06/17 21:33:39 Done.
21 PP_UDPSOCKET_OPTION_ADDRESS_REUSE = 0, 22 PP_UDPSOCKET_OPTION_ADDRESS_REUSE = 0,
22 23
23 // Allows sending and receiving packets to and from broadcast addresses. 24 // Allows sending and receiving packets to and from broadcast addresses.
24 // Value's type should be PP_VARTYPE_BOOL. 25 // Value's type should be PP_VARTYPE_BOOL.
26 // Takes effect if set before Bind().
25 PP_UDPSOCKET_OPTION_BROADCAST = 1, 27 PP_UDPSOCKET_OPTION_BROADCAST = 1,
26 28
27 // Specifies the total per-socket buffer space reserved for sends. Value's 29 // Specifies the total per-socket buffer space reserved for sends. Value's
28 // type should be PP_VARTYPE_INT32. 30 // type should be PP_VARTYPE_INT32.
29 // Note: This is only treated as a hint for the browser to set the buffer 31 // Note: This is only treated as a hint for the browser to set the buffer
30 // size. Even if SetOption() reports that this option has been successfully 32 // size. Even if SetOption() reports that this option has been successfully
31 // set, the browser doesn't guarantee it will conform to it. 33 // set, the browser doesn't guarantee it will conform to it.
32 PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE = 2, 34 PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE = 2,
33 35
34 // Specifies the total per-socket buffer space reserved for receives. Value's 36 // Specifies the total per-socket buffer space reserved for receives. Value's
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 [in] int32_t num_bytes, 88 [in] int32_t num_bytes,
87 [in] PP_Resource addr, 89 [in] PP_Resource addr,
88 [in] PP_CompletionCallback callback); 90 [in] PP_CompletionCallback callback);
89 91
90 /** 92 /**
91 * Cancels all pending reads and writes, and closes the socket. 93 * Cancels all pending reads and writes, and closes the socket.
92 */ 94 */
93 void Close([in] PP_Resource udp_socket); 95 void Close([in] PP_Resource udp_socket);
94 96
95 /** 97 /**
96 * Sets a socket option to |udp_socket|. Should be called before Bind(). 98 * Sets a socket option to |udp_socket|.
97 * See the PP_UDPSocket_Option_Dev description for option names, value types 99 * See the PP_UDPSocket_Option_Dev description for option names, value types
98 * and allowed values. 100 * and allowed values.
99 * Returns PP_OK on success. Otherwise, returns PP_ERROR_BADRESOURCE (if bad 101 * Returns PP_OK on success. Otherwise, returns PP_ERROR_BADRESOURCE (if bad
100 * |udp_socket| provided), PP_ERROR_BADARGUMENT (if bad name/value/value's 102 * |udp_socket| provided), PP_ERROR_BADARGUMENT (if bad name/value/value's
101 * type provided) or PP_ERROR_FAILED in the case of internal errors. 103 * type provided) or PP_ERROR_FAILED in the case of internal errors.
102 */ 104 */
103 int32_t SetOption([in] PP_Resource udp_socket, 105 int32_t SetOption([in] PP_Resource udp_socket,
104 [in] PP_UDPSocket_Option_Dev name, 106 [in] PP_UDPSocket_Option_Dev name,
105 [in] PP_Var value, 107 [in] PP_Var value,
106 [in] PP_CompletionCallback callback); 108 [in] PP_CompletionCallback callback);
107 }; 109 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698