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 #include "ppapi/proxy/ppb_flash_net_connector_proxy.h" | 5 #include "ppapi/proxy/ppb_flash_net_connector_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/private/ppb_flash_net_connector.h" | 10 #include "ppapi/c/private/ppb_flash_net_connector.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 memset(&remote_addr, 0, sizeof(remote_addr)); | 180 memset(&remote_addr, 0, sizeof(remote_addr)); |
181 } | 181 } |
182 | 182 |
183 HostResource resource; | 183 HostResource resource; |
184 | 184 |
185 PP_FileHandle handle; | 185 PP_FileHandle handle; |
186 PP_Flash_NetAddress local_addr; | 186 PP_Flash_NetAddress local_addr; |
187 PP_Flash_NetAddress remote_addr; | 187 PP_Flash_NetAddress remote_addr; |
188 }; | 188 }; |
189 | 189 |
190 namespace { | |
191 | |
192 InterfaceProxy* CreateFlashNetConnectorProxy(Dispatcher* dispatcher) { | |
193 return new PPB_Flash_NetConnector_Proxy(dispatcher); | |
194 } | |
195 | |
196 } // namespace | |
197 | |
198 PPB_Flash_NetConnector_Proxy::PPB_Flash_NetConnector_Proxy( | 190 PPB_Flash_NetConnector_Proxy::PPB_Flash_NetConnector_Proxy( |
199 Dispatcher* dispatcher) | 191 Dispatcher* dispatcher) |
200 : InterfaceProxy(dispatcher), | 192 : InterfaceProxy(dispatcher), |
201 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 193 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
202 } | 194 } |
203 | 195 |
204 PPB_Flash_NetConnector_Proxy::~PPB_Flash_NetConnector_Proxy() { | 196 PPB_Flash_NetConnector_Proxy::~PPB_Flash_NetConnector_Proxy() { |
205 } | 197 } |
206 | 198 |
207 // static | 199 // static |
208 const InterfaceProxy::Info* PPB_Flash_NetConnector_Proxy::GetInfo() { | |
209 static const Info info = { | |
210 ppapi::thunk::GetPPB_Flash_NetConnector_Thunk(), | |
211 PPB_FLASH_NETCONNECTOR_INTERFACE, | |
212 API_ID_PPB_FLASH_NETCONNECTOR, | |
213 false, | |
214 &CreateFlashNetConnectorProxy | |
215 }; | |
216 return &info; | |
217 } | |
218 | |
219 // static | |
220 PP_Resource PPB_Flash_NetConnector_Proxy::CreateProxyResource( | 200 PP_Resource PPB_Flash_NetConnector_Proxy::CreateProxyResource( |
221 PP_Instance instance) { | 201 PP_Instance instance) { |
222 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | 202 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
223 if (!dispatcher) | 203 if (!dispatcher) |
224 return 0; | 204 return 0; |
225 | 205 |
226 HostResource result; | 206 HostResource result; |
227 dispatcher->Send(new PpapiHostMsg_PPBFlashNetConnector_Create( | 207 dispatcher->Send(new PpapiHostMsg_PPBFlashNetConnector_Create( |
228 API_ID_PPB_FLASH_NETCONNECTOR, instance, &result)); | 208 API_ID_PPB_FLASH_NETCONNECTOR, instance, &result)); |
229 if (result.is_null()) | 209 if (result.is_null()) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 } else { | 313 } else { |
334 dispatcher()->Send(new PpapiMsg_PPBFlashNetConnector_ConnectACK( | 314 dispatcher()->Send(new PpapiMsg_PPBFlashNetConnector_ConnectACK( |
335 API_ID_PPB_FLASH_NETCONNECTOR, | 315 API_ID_PPB_FLASH_NETCONNECTOR, |
336 info->resource, result, | 316 info->resource, result, |
337 IPC::InvalidPlatformFileForTransit(), std::string(), std::string())); | 317 IPC::InvalidPlatformFileForTransit(), std::string(), std::string())); |
338 } | 318 } |
339 } | 319 } |
340 | 320 |
341 } // namespace proxy | 321 } // namespace proxy |
342 } // namespace ppapi | 322 } // namespace ppapi |
OLD | NEW |