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/cpp/private/flash_net_connector.h" | 5 #include "ppapi/cpp/private/flash_net_connector.h" |
6 | 6 |
7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/cpp/completion_callback.h" | 8 #include "ppapi/cpp/completion_callback.h" |
9 #include "ppapi/cpp/instance.h" | 9 #include "ppapi/cpp/instance_handle.h" |
10 #include "ppapi/cpp/module.h" | 10 #include "ppapi/cpp/module.h" |
11 #include "ppapi/cpp/module_impl.h" | 11 #include "ppapi/cpp/module_impl.h" |
12 | 12 |
13 namespace pp { | 13 namespace pp { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 template <> const char* interface_name<PPB_Flash_NetConnector>() { | 17 template <> const char* interface_name<PPB_Flash_NetConnector>() { |
18 return PPB_FLASH_NETCONNECTOR_INTERFACE; | 18 return PPB_FLASH_NETCONNECTOR_INTERFACE; |
19 } | 19 } |
20 | 20 |
21 } // namespace | 21 } // namespace |
22 | 22 |
23 namespace flash { | 23 namespace flash { |
24 | 24 |
25 NetConnector::NetConnector(const Instance& instance) { | 25 NetConnector::NetConnector(const InstanceHandle& instance) { |
26 if (has_interface<PPB_Flash_NetConnector>()) { | 26 if (has_interface<PPB_Flash_NetConnector>()) { |
27 PassRefFromConstructor(get_interface<PPB_Flash_NetConnector>()->Create( | 27 PassRefFromConstructor(get_interface<PPB_Flash_NetConnector>()->Create( |
28 instance.pp_instance())); | 28 instance.pp_instance())); |
29 } | 29 } |
30 } | 30 } |
31 | 31 |
32 int32_t NetConnector::ConnectTcp(const char* host, | 32 int32_t NetConnector::ConnectTcp(const char* host, |
33 uint16_t port, | 33 uint16_t port, |
34 PP_FileHandle* socket_out, | 34 PP_FileHandle* socket_out, |
35 PP_NetAddress_Private* local_addr_out, | 35 PP_NetAddress_Private* local_addr_out, |
(...skipping 17 matching lines...) Expand all Loading... |
53 return cc.MayForce(PP_ERROR_NOINTERFACE); | 53 return cc.MayForce(PP_ERROR_NOINTERFACE); |
54 return get_interface<PPB_Flash_NetConnector>()->ConnectTcpAddress( | 54 return get_interface<PPB_Flash_NetConnector>()->ConnectTcpAddress( |
55 pp_resource(), | 55 pp_resource(), |
56 addr, | 56 addr, |
57 socket_out, local_addr_out, remote_addr_out, | 57 socket_out, local_addr_out, remote_addr_out, |
58 cc.pp_completion_callback()); | 58 cc.pp_completion_callback()); |
59 } | 59 } |
60 | 60 |
61 } // namespace flash | 61 } // namespace flash |
62 } // namespace pp | 62 } // namespace pp |
OLD | NEW |