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

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: In response to Cris's suggestions: not using base::ListValue; check conversoin in NetErrorToPepperE… 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 // It should be set before calling Bind().
bbudge 2013/06/18 14:54:37 s/It/This option/ Here and below...
yzshen1 2013/06/18 16:39:16 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 // It should be set before calling 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.
31 // It should be set after a successful Bind() call.
29 // Note: This is only treated as a hint for the browser to set the buffer 32 // 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 33 // size. Even if SetOption() reports that this option has been successfully
31 // set, the browser doesn't guarantee it will conform to it. 34 // set, the browser doesn't guarantee it will conform to it.
32 PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE = 2, 35 PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE = 2,
33 36
34 // Specifies the total per-socket buffer space reserved for receives. Value's 37 // Specifies the total per-socket buffer space reserved for receives. Value's
35 // type should be PP_VARTYPE_INT32. 38 // type should be PP_VARTYPE_INT32.
39 // It should be set after a successful Bind() call.
36 // Note: This is only treated as a hint for the browser to set the buffer 40 // Note: This is only treated as a hint for the browser to set the buffer
37 // size. Even if SetOption() reports that this option has been successfully 41 // size. Even if SetOption() reports that this option has been successfully
38 // set, the browser doesn't guarantee it will conform to it. 42 // set, the browser doesn't guarantee it will conform to it.
39 PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3 43 PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3
40 }; 44 };
41 45
42 interface PPB_UDPSocket_Dev { 46 interface PPB_UDPSocket_Dev {
43 /** 47 /**
44 * Creates a UDP socket resource. 48 * Creates a UDP socket resource.
45 */ 49 */
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 [in] int32_t num_bytes, 90 [in] int32_t num_bytes,
87 [in] PP_Resource addr, 91 [in] PP_Resource addr,
88 [in] PP_CompletionCallback callback); 92 [in] PP_CompletionCallback callback);
89 93
90 /** 94 /**
91 * Cancels all pending reads and writes, and closes the socket. 95 * Cancels all pending reads and writes, and closes the socket.
92 */ 96 */
93 void Close([in] PP_Resource udp_socket); 97 void Close([in] PP_Resource udp_socket);
94 98
95 /** 99 /**
96 * Sets a socket option to |udp_socket|. Should be called before Bind(). 100 * Sets a socket option to |udp_socket|.
bbudge 2013/06/18 14:54:37 s/to/on
yzshen1 2013/06/18 16:39:16 Done.
97 * See the PP_UDPSocket_Option_Dev description for option names, value types 101 * See the PP_UDPSocket_Option_Dev description for option names, value types
98 * and allowed values. 102 * and allowed values.
99 * Returns PP_OK on success. Otherwise, returns PP_ERROR_BADRESOURCE (if bad 103 * 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 104 * |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. 105 * type provided) or PP_ERROR_FAILED in the case of internal errors.
102 */ 106 */
103 int32_t SetOption([in] PP_Resource udp_socket, 107 int32_t SetOption([in] PP_Resource udp_socket,
104 [in] PP_UDPSocket_Option_Dev name, 108 [in] PP_UDPSocket_Option_Dev name,
105 [in] PP_Var value, 109 [in] PP_Var value,
106 [in] PP_CompletionCallback callback); 110 [in] PP_CompletionCallback callback);
107 }; 111 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698