OLD | NEW |
---|---|
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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_Private</code> interface. | 7 * This file defines the <code>PPB_UDPSocket_Private</code> interface. |
8 */ | 8 */ |
9 | 9 |
10 label Chrome { | 10 label Chrome { |
11 M17 = 0.2 | 11 M17 = 0.2 |
12 }; | 12 }; |
13 | 13 |
14 interface PPB_UDPSocket_Private { | 14 interface PPB_UDPSocket_Private { |
15 /** | 15 /** |
16 * Creates a UDP socket resource. | 16 * Creates a UDP socket resource. |
17 */ | 17 */ |
18 PP_Resource Create([in] PP_Instance instance_id); | 18 PP_Resource Create([in] PP_Instance instance_id); |
19 | 19 |
20 /** | 20 /** |
21 * Determines if a given resource is a UDP socket. | 21 * Determines if a given resource is a UDP socket. |
22 */ | 22 */ |
23 PP_Bool IsUDPSocket([in] PP_Resource resource_id); | 23 PP_Bool IsUDPSocket([in] PP_Resource resource_id); |
24 | 24 |
25 /* Creates a socket and binds to the address given by |addr|. */ | 25 /* Creates a socket and binds to the address given by |addr|. */ |
26 int32_t Bind([in] PP_Resource udp_socket, | 26 int32_t Bind([in] PP_Resource udp_socket, |
27 [in] PP_NetAddress_Private addr, | 27 [in] PP_NetAddress_Private addr, |
28 [in] PP_CompletionCallback callback); | 28 [in] PP_CompletionCallback callback); |
29 | 29 |
30 /* Upon successful completion of Bind, the address that we have | |
31 * bound to is stored in |addr| | |
yzshen1
2012/02/06 06:51:27
Nit: This comment is inaccurate. The address is no
mtilburg1
2012/02/06 15:11:35
Done.
| |
32 */ | |
33 PP_Bool GetBoundAddress([in] PP_Resource udp_socket, | |
yzshen1
2012/02/06 06:51:27
You need to consider backward compatibility. This
mtilburg1
2012/02/06 15:11:35
I added M18 = 0.3.... is this correct? When I add
yzshen1
2012/02/06 18:12:50
Please use M19.
| |
34 [out] PP_NetAddress_Private addr); | |
35 | |
30 /* Performs a non-blocking recvfrom call on socket. | 36 /* Performs a non-blocking recvfrom call on socket. |
31 * Bind must be called first. |callback| is invoked when recvfrom | 37 * Bind must be called first. |callback| is invoked when recvfrom |
32 * reads data. You must call GetRecvFromAddress to recover the | 38 * reads data. You must call GetRecvFromAddress to recover the |
33 * address the data was retrieved from. | 39 * address the data was retrieved from. |
34 */ | 40 */ |
35 int32_t RecvFrom([in] PP_Resource udp_socket, | 41 int32_t RecvFrom([in] PP_Resource udp_socket, |
36 [out] str_t buffer, | 42 [out] str_t buffer, |
37 [in] int32_t num_bytes, | 43 [in] int32_t num_bytes, |
38 [in] PP_CompletionCallback callback); | 44 [in] PP_CompletionCallback callback); |
39 | 45 |
40 /* Upon successful completion of RecvFrom, the address that the data | 46 /* Upon successful completion of RecvFrom, the address that the data |
41 * was received from is stored in |addr|. | 47 * was received from is stored in |addr|. |
42 */ | 48 */ |
43 PP_Bool GetRecvFromAddress([in] PP_Resource udp_socket, | 49 PP_Bool GetRecvFromAddress([in] PP_Resource udp_socket, |
44 [out] PP_NetAddress_Private addr); | 50 [out] PP_NetAddress_Private addr); |
45 | 51 |
46 /* Performs a non-blocking sendto call on the socket created and | 52 /* Performs a non-blocking sendto call on the socket created and |
47 * bound(has already called Bind). The callback |callback| is | 53 * bound(has already called Bind). The callback |callback| is |
48 * invoked when sendto completes. | 54 * invoked when sendto completes. |
49 */ | 55 */ |
50 int32_t SendTo([in] PP_Resource udp_socket, | 56 int32_t SendTo([in] PP_Resource udp_socket, |
51 [in] str_t buffer, | 57 [in] str_t buffer, |
52 [in] int32_t num_bytes, | 58 [in] int32_t num_bytes, |
53 [in] PP_NetAddress_Private addr, | 59 [in] PP_NetAddress_Private addr, |
54 [in] PP_CompletionCallback callback); | 60 [in] PP_CompletionCallback callback); |
55 | 61 |
56 /* Cancels all pending reads and writes, and closes the socket. */ | 62 /* Cancels all pending reads and writes, and closes the socket. */ |
57 void Close([in] PP_Resource udp_socket); | 63 void Close([in] PP_Resource udp_socket); |
58 }; | 64 }; |
OLD | NEW |