| OLD | NEW |
| 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 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_H_ | 5 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_H_ |
| 6 #define PPAPI_C_PRIVATE_PPB_FLASH_H_ | 6 #define PPAPI_C_PRIVATE_PPB_FLASH_H_ |
| 7 | 7 |
| 8 #ifdef _WIN32 | 8 #ifdef _WIN32 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #include "ppapi/c/pp_bool.h" | 12 #include "ppapi/c/pp_bool.h" |
| 13 #include "ppapi/c/pp_errors.h" | |
| 14 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
| 15 #include "ppapi/c/pp_point.h" | 14 #include "ppapi/c/pp_point.h" |
| 16 #include "ppapi/c/pp_rect.h" | 15 #include "ppapi/c/pp_rect.h" |
| 17 #include "ppapi/c/pp_resource.h" | 16 #include "ppapi/c/pp_resource.h" |
| 18 #include "ppapi/c/pp_var.h" | 17 #include "ppapi/c/pp_var.h" |
| 19 | 18 |
| 20 // PPB_Flash ------------------------------------------------------------------- | |
| 21 | |
| 22 #define PPB_FLASH_INTERFACE "PPB_Flash;6" | 19 #define PPB_FLASH_INTERFACE "PPB_Flash;6" |
| 23 | 20 |
| 24 #ifdef _WIN32 | 21 #ifdef _WIN32 |
| 25 typedef HANDLE PP_FileHandle; | 22 typedef HANDLE PP_FileHandle; |
| 26 static const PP_FileHandle PP_kInvalidFileHandle = NULL; | 23 static const PP_FileHandle PP_kInvalidFileHandle = NULL; |
| 27 #else | 24 #else |
| 28 typedef int PP_FileHandle; | 25 typedef int PP_FileHandle; |
| 29 static const PP_FileHandle PP_kInvalidFileHandle = -1; | 26 static const PP_FileHandle PP_kInvalidFileHandle = -1; |
| 30 #endif | 27 #endif |
| 31 | 28 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // message loop (e.g., when displaying context menus), but Pepper provides | 119 // message loop (e.g., when displaying context menus), but Pepper provides |
| 123 // only an asynchronous call. After performing that asynchronous call, call | 120 // only an asynchronous call. After performing that asynchronous call, call |
| 124 // |RunMessageLoop()|. In the callback, call |QuitMessageLoop()|. | 121 // |RunMessageLoop()|. In the callback, call |QuitMessageLoop()|. |
| 125 void (*RunMessageLoop)(PP_Instance instance); | 122 void (*RunMessageLoop)(PP_Instance instance); |
| 126 | 123 |
| 127 // Posts a quit message for the outermost nested message loop. Use this to | 124 // Posts a quit message for the outermost nested message loop. Use this to |
| 128 // exit and return back to the caller after you call RunMessageLoop. | 125 // exit and return back to the caller after you call RunMessageLoop. |
| 129 void (*QuitMessageLoop)(PP_Instance instance); | 126 void (*QuitMessageLoop)(PP_Instance instance); |
| 130 }; | 127 }; |
| 131 | 128 |
| 132 // PPB_Flash_NetConnector ------------------------------------------------------ | |
| 133 | |
| 134 #define PPB_FLASH_NETCONNECTOR_INTERFACE "PPB_Flash_NetConnector;1" | |
| 135 | |
| 136 // This is an opaque type holding a network address. | |
| 137 struct PP_Flash_NetAddress { | |
| 138 size_t size; | |
| 139 char data[128]; | |
| 140 }; | |
| 141 | |
| 142 struct PPB_Flash_NetConnector { | |
| 143 PP_Resource (*Create)(PP_Instance instance_id); | |
| 144 PP_Bool (*IsFlashNetConnector)(PP_Resource resource_id); | |
| 145 | |
| 146 // Connect to a TCP port given as a host-port pair. The local and remote | |
| 147 // addresses of the connection (if successful) are returned in | |
| 148 // |local_addr_out| and |remote_addr_out|, respectively, if non-null. | |
| 149 int32_t (*ConnectTcp)(PP_Resource connector_id, | |
| 150 const char* host, | |
| 151 uint16_t port, | |
| 152 PP_FileHandle* socket_out, | |
| 153 struct PP_Flash_NetAddress* local_addr_out, | |
| 154 struct PP_Flash_NetAddress* remote_addr_out, | |
| 155 struct PP_CompletionCallback callback); | |
| 156 | |
| 157 // Same as |ConnectTcp()|, but connecting to the address given by |addr|. A | |
| 158 // typical use-case would be for reconnections. | |
| 159 int32_t (*ConnectTcpAddress)(PP_Resource connector_id, | |
| 160 const struct PP_Flash_NetAddress* addr, | |
| 161 PP_FileHandle* socket_out, | |
| 162 struct PP_Flash_NetAddress* local_addr_out, | |
| 163 struct PP_Flash_NetAddress* remote_addr_out, | |
| 164 struct PP_CompletionCallback callback); | |
| 165 }; | |
| 166 | |
| 167 #endif // PPAPI_C_PRIVATE_PPB_FLASH_H_ | 129 #endif // PPAPI_C_PRIVATE_PPB_FLASH_H_ |
| OLD | NEW |