| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | 223 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
| 224 if (!dispatcher) | 224 if (!dispatcher) |
| 225 return 0; | 225 return 0; |
| 226 | 226 |
| 227 HostResource result; | 227 HostResource result; |
| 228 dispatcher->Send(new PpapiHostMsg_PPBFlashNetConnector_Create( | 228 dispatcher->Send(new PpapiHostMsg_PPBFlashNetConnector_Create( |
| 229 INTERFACE_ID_PPB_FLASH_NETCONNECTOR, instance, &result)); | 229 INTERFACE_ID_PPB_FLASH_NETCONNECTOR, instance, &result)); |
| 230 if (result.is_null()) | 230 if (result.is_null()) |
| 231 return 0; | 231 return 0; |
| 232 | 232 |
| 233 linked_ptr<FlashNetConnector> object(new FlashNetConnector(result)); | 233 return PluginResourceTracker::GetInstance()->AddResource( |
| 234 return PluginResourceTracker::GetInstance()->AddResource(object); | 234 new FlashNetConnector(result)); |
| 235 } | 235 } |
| 236 | 236 |
| 237 bool PPB_Flash_NetConnector_Proxy::OnMessageReceived(const IPC::Message& msg) { | 237 bool PPB_Flash_NetConnector_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 238 bool handled = true; | 238 bool handled = true; |
| 239 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_NetConnector_Proxy, msg) | 239 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_NetConnector_Proxy, msg) |
| 240 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashNetConnector_Create, | 240 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashNetConnector_Create, |
| 241 OnMsgCreate) | 241 OnMsgCreate) |
| 242 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashNetConnector_ConnectTcp, | 242 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashNetConnector_ConnectTcp, |
| 243 OnMsgConnectTcp) | 243 OnMsgConnectTcp) |
| 244 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashNetConnector_ConnectTcpAddress, | 244 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashNetConnector_ConnectTcpAddress, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 } else { | 336 } else { |
| 337 dispatcher()->Send(new PpapiMsg_PPBFlashNetConnector_ConnectACK( | 337 dispatcher()->Send(new PpapiMsg_PPBFlashNetConnector_ConnectACK( |
| 338 INTERFACE_ID_PPB_FLASH_NETCONNECTOR, | 338 INTERFACE_ID_PPB_FLASH_NETCONNECTOR, |
| 339 info->resource, result, | 339 info->resource, result, |
| 340 IPC::InvalidPlatformFileForTransit(), std::string(), std::string())); | 340 IPC::InvalidPlatformFileForTransit(), std::string(), std::string())); |
| 341 } | 341 } |
| 342 } | 342 } |
| 343 | 343 |
| 344 } // namespace proxy | 344 } // namespace proxy |
| 345 } // namespace pp | 345 } // namespace pp |
| OLD | NEW |