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

Side by Side Diff: ppapi/c/private/ppb_flash_udp_socket.h

Issue 8511032: Make the Pepper Flash net address just private, not Flash-specific. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 (c) 2011 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2011 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 /* From private/ppb_flash_udp_socket.idl modified Mon Oct 17 15:55:01 2011. */ 6 /* From private/ppb_flash_udp_socket.idl modified Wed Nov 9 12:53:35 2011. */
7 7
8 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_UDP_SOCKET_H_ 8 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_UDP_SOCKET_H_
9 #define PPAPI_C_PRIVATE_PPB_FLASH_UDP_SOCKET_H_ 9 #define PPAPI_C_PRIVATE_PPB_FLASH_UDP_SOCKET_H_
10 10
11 #include "ppapi/c/pp_bool.h" 11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_completion_callback.h" 12 #include "ppapi/c/pp_completion_callback.h"
13 #include "ppapi/c/pp_instance.h" 13 #include "ppapi/c/pp_instance.h"
14 #include "ppapi/c/pp_macros.h" 14 #include "ppapi/c/pp_macros.h"
15 #include "ppapi/c/pp_resource.h" 15 #include "ppapi/c/pp_resource.h"
16 #include "ppapi/c/pp_stdint.h" 16 #include "ppapi/c/pp_stdint.h"
17 #include "ppapi/c/private/ppb_flash_net_address.h" 17 #include "ppapi/c/private/ppb_net_address_private.h"
18 18
19 #define PPB_FLASH_UDPSOCKET_INTERFACE_0_1 "PPB_Flash_UDPSocket;0.1" 19 #define PPB_FLASH_UDPSOCKET_INTERFACE_0_1 "PPB_Flash_UDPSocket;0.1"
20 #define PPB_FLASH_UDPSOCKET_INTERFACE PPB_FLASH_UDPSOCKET_INTERFACE_0_1 20 #define PPB_FLASH_UDPSOCKET_INTERFACE PPB_FLASH_UDPSOCKET_INTERFACE_0_1
21 21
22 /** 22 /**
23 * @file 23 * @file
24 * This file defines the <code>PPB_Flash_UDPSocket</code> interface. 24 * This file defines the <code>PPB_Flash_UDPSocket</code> interface.
25 */ 25 */
26 26
27 27
28 /** 28 /**
29 * @addtogroup Interfaces 29 * @addtogroup Interfaces
30 * @{ 30 * @{
31 */ 31 */
32 struct PPB_Flash_UDPSocket { 32 struct PPB_Flash_UDPSocket {
33 /** 33 /**
34 * Creates a UDP socket resource. 34 * Creates a UDP socket resource.
35 */ 35 */
36 PP_Resource (*Create)(PP_Instance instance_id); 36 PP_Resource (*Create)(PP_Instance instance_id);
37 /** 37 /**
38 * Determines if a given resource is a UDP socket. 38 * Determines if a given resource is a UDP socket.
39 */ 39 */
40 PP_Bool (*IsFlashUDPSocket)(PP_Resource resource_id); 40 PP_Bool (*IsFlashUDPSocket)(PP_Resource resource_id);
41 /* Creates a socket and binds to the address given by |addr|. */ 41 /* Creates a socket and binds to the address given by |addr|. */
42 int32_t (*Bind)(PP_Resource udp_socket, 42 int32_t (*Bind)(PP_Resource udp_socket,
43 const struct PP_Flash_NetAddress* addr, 43 const struct PP_NetAddress_Private* addr,
44 struct PP_CompletionCallback callback); 44 struct PP_CompletionCallback callback);
45 /* Performs a non-blocking recvfrom call on socket. 45 /* Performs a non-blocking recvfrom call on socket.
46 * Bind must be called first. |callback| is invoked when recvfrom 46 * Bind must be called first. |callback| is invoked when recvfrom
47 * reads data. You must call GetRecvFromAddress to recover the 47 * reads data. You must call GetRecvFromAddress to recover the
48 * address the data was retrieved from. 48 * address the data was retrieved from.
49 */ 49 */
50 int32_t (*RecvFrom)(PP_Resource udp_socket, 50 int32_t (*RecvFrom)(PP_Resource udp_socket,
51 char* buffer, 51 char* buffer,
52 int32_t num_bytes, 52 int32_t num_bytes,
53 struct PP_CompletionCallback callback); 53 struct PP_CompletionCallback callback);
54 /* Upon successful completion of RecvFrom, the address that the data 54 /* Upon successful completion of RecvFrom, the address that the data
55 * was received from is stored in |addr|. 55 * was received from is stored in |addr|.
56 */ 56 */
57 PP_Bool (*GetRecvFromAddress)(PP_Resource udp_socket, 57 PP_Bool (*GetRecvFromAddress)(PP_Resource udp_socket,
58 struct PP_Flash_NetAddress* addr); 58 struct PP_NetAddress_Private* addr);
59 /* Performs a non-blocking sendto call on the socket created and 59 /* Performs a non-blocking sendto call on the socket created and
60 * bound(has already called Bind). The callback |callback| is 60 * bound(has already called Bind). The callback |callback| is
61 * invoked when sendto completes. 61 * invoked when sendto completes.
62 */ 62 */
63 int32_t (*SendTo)(PP_Resource udp_socket, 63 int32_t (*SendTo)(PP_Resource udp_socket,
64 const char* buffer, 64 const char* buffer,
65 int32_t num_bytes, 65 int32_t num_bytes,
66 const struct PP_Flash_NetAddress* addr, 66 const struct PP_NetAddress_Private* addr,
67 struct PP_CompletionCallback callback); 67 struct PP_CompletionCallback callback);
68 /* Cancels all pending reads and writes, and closes the socket. */ 68 /* Cancels all pending reads and writes, and closes the socket. */
69 void (*Close)(PP_Resource udp_socket); 69 void (*Close)(PP_Resource udp_socket);
70 }; 70 };
71 /** 71 /**
72 * @} 72 * @}
73 */ 73 */
74 74
75 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_UDP_SOCKET_H_ */ 75 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_UDP_SOCKET_H_ */
76 76
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698