| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_NET_CONNECTOR_H_ | |
| 6 #define PPAPI_C_PRIVATE_PPB_FLASH_NET_CONNECTOR_H_ | |
| 7 | |
| 8 // TODO(viettrungluu): Remove this interface; it's on life-support right now. | |
| 9 | |
| 10 #include "ppapi/c/pp_bool.h" | |
| 11 #include "ppapi/c/pp_instance.h" | |
| 12 #include "ppapi/c/pp_resource.h" | |
| 13 #include "ppapi/c/private/ppb_flash_file.h" // For |PP_FileHandle|. | |
| 14 #include "ppapi/c/private/ppb_net_address_private.h" | |
| 15 | |
| 16 #define PPB_FLASH_NETCONNECTOR_INTERFACE_0_2 "PPB_Flash_NetConnector;0.2" | |
| 17 #define PPB_FLASH_NETCONNECTOR_INTERFACE PPB_FLASH_NETCONNECTOR_INTERFACE_0_2 | |
| 18 | |
| 19 struct PPB_Flash_NetConnector_0_2 { | |
| 20 PP_Resource (*Create)(PP_Instance instance_id); | |
| 21 PP_Bool (*IsFlashNetConnector)(PP_Resource resource_id); | |
| 22 | |
| 23 // Connect to a TCP port given as a host-port pair. The local and remote | |
| 24 // addresses of the connection (if successful) are returned in | |
| 25 // |local_addr_out| and |remote_addr_out|, respectively, if non-null. | |
| 26 int32_t (*ConnectTcp)(PP_Resource connector_id, | |
| 27 const char* host, | |
| 28 uint16_t port, | |
| 29 PP_FileHandle* socket_out, | |
| 30 struct PP_NetAddress_Private* local_addr_out, | |
| 31 struct PP_NetAddress_Private* remote_addr_out, | |
| 32 struct PP_CompletionCallback callback); | |
| 33 | |
| 34 // Same as |ConnectTcp()|, but connecting to the address given by |addr|. A | |
| 35 // typical use-case would be for reconnections. | |
| 36 int32_t (*ConnectTcpAddress)(PP_Resource connector_id, | |
| 37 const struct PP_NetAddress_Private* addr, | |
| 38 PP_FileHandle* socket_out, | |
| 39 struct PP_NetAddress_Private* local_addr_out, | |
| 40 struct PP_NetAddress_Private* remote_addr_out, | |
| 41 struct PP_CompletionCallback callback); | |
| 42 }; | |
| 43 | |
| 44 typedef struct PPB_Flash_NetConnector_0_2 PPB_Flash_NetConnector; | |
| 45 | |
| 46 #endif // PPAPI_C_PRIVATE_PPB_FLASH_NET_CONNECTOR_H_ | |
| OLD | NEW |