| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FLASH_NET_CONNECTOR_IMPL_H_ | |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_FLASH_NET_CONNECTOR_IMPL_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "base/memory/ref_counted.h" | |
| 11 #include "ppapi/c/private/ppb_flash_net_connector.h" | |
| 12 #include "ppapi/shared_impl/resource.h" | |
| 13 #include "ppapi/shared_impl/tracked_callback.h" | |
| 14 #include "ppapi/thunk/ppb_flash_net_connector_api.h" | |
| 15 #include "webkit/plugins/webkit_plugins_export.h" | |
| 16 | |
| 17 namespace webkit { | |
| 18 namespace ppapi { | |
| 19 | |
| 20 class PPB_Flash_NetConnector_Impl | |
| 21 : public ::ppapi::Resource, | |
| 22 public ::ppapi::thunk::PPB_Flash_NetConnector_API { | |
| 23 public: | |
| 24 explicit PPB_Flash_NetConnector_Impl(PP_Instance instance); | |
| 25 virtual ~PPB_Flash_NetConnector_Impl(); | |
| 26 | |
| 27 // Resource override. | |
| 28 virtual ::ppapi::thunk::PPB_Flash_NetConnector_API* | |
| 29 AsPPB_Flash_NetConnector_API() OVERRIDE; | |
| 30 | |
| 31 // PPB_Flash_NetConnector implementation. | |
| 32 virtual int32_t ConnectTcp(const char* host, | |
| 33 uint16_t port, | |
| 34 PP_FileHandle* socket_out, | |
| 35 PP_NetAddress_Private* local_addr_out, | |
| 36 PP_NetAddress_Private* remote_addr_out, | |
| 37 PP_CompletionCallback callback) OVERRIDE; | |
| 38 virtual int32_t ConnectTcpAddress(const PP_NetAddress_Private* addr, | |
| 39 PP_FileHandle* socket_out, | |
| 40 PP_NetAddress_Private* local_addr_out, | |
| 41 PP_NetAddress_Private* remote_addr_out, | |
| 42 PP_CompletionCallback callback) OVERRIDE; | |
| 43 | |
| 44 // Called to complete |ConnectTcp()| and |ConnectTcpAddress()|. | |
| 45 WEBKIT_PLUGINS_EXPORT void CompleteConnectTcp( | |
| 46 PP_FileHandle socket, | |
| 47 const PP_NetAddress_Private& local_addr, | |
| 48 const PP_NetAddress_Private& remote_addr); | |
| 49 | |
| 50 private: | |
| 51 // Any pending callback (for |ConnectTcp()| or |ConnectTcpAddress()|). | |
| 52 scoped_refptr< ::ppapi::TrackedCallback> callback_; | |
| 53 | |
| 54 // Output buffers to be filled in when the callback is completed successfully | |
| 55 // (|{local,remote}_addr_out| are optional and may be null). | |
| 56 PP_FileHandle* socket_out_; | |
| 57 PP_NetAddress_Private* local_addr_out_; | |
| 58 PP_NetAddress_Private* remote_addr_out_; | |
| 59 | |
| 60 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_NetConnector_Impl); | |
| 61 }; | |
| 62 | |
| 63 } // namespace ppapi | |
| 64 } // namespace webkit | |
| 65 | |
| 66 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FLASH_NET_CONNECTOR_IMPL_H_ | |
| OLD | NEW |