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 // TODO(yzshen): This (and the .cc file) contain C++ wrappers for things | 5 // TODO(yzshen): This (and the .cc file) contain C++ wrappers for things |
6 // in ppapi/c/private/ppb_flash_tcp_socket.h. This is currently not used in | 6 // in ppapi/c/private/ppb_flash_tcp_socket.h. This is currently not used in |
7 // (or even compiled with) Chromium. | 7 // (or even compiled with) Chromium. |
8 | 8 |
9 #ifndef PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_ | 9 #ifndef PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_ |
10 #define PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_ | 10 #define PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_ |
11 | 11 |
12 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
13 #include "ppapi/c/private/ppb_flash_tcp_socket.h" | 13 #include "ppapi/c/private/ppb_flash_tcp_socket.h" |
14 #include "ppapi/cpp/resource.h" | 14 #include "ppapi/cpp/resource.h" |
15 | 15 |
16 namespace pp { | 16 namespace pp { |
17 | 17 |
18 class CompletionCallback; | 18 class CompletionCallback; |
19 class Instance; | 19 class Instance; |
20 | 20 |
21 namespace flash { | 21 namespace flash { |
22 | 22 |
23 class TCPSocket : public Resource { | 23 class TCPSocket : public Resource { |
24 public: | 24 public: |
25 explicit TCPSocket(Instance* instance); | 25 explicit TCPSocket(Instance* instance); |
26 | 26 |
27 int32_t Connect(const char* host, | 27 int32_t Connect(const char* host, |
28 uint16_t port, | 28 uint16_t port, |
29 const CompletionCallback& callback); | 29 const CompletionCallback& callback); |
30 int32_t ConnectWithNetAddress(const PP_Flash_NetAddress* addr, | 30 int32_t ConnectWithNetAddress(const PP_NetAddress_Private* addr, |
31 const CompletionCallback& callback); | 31 const CompletionCallback& callback); |
32 bool GetLocalAddress(PP_Flash_NetAddress* local_addr); | 32 bool GetLocalAddress(PP_NetAddress_Private* local_addr); |
33 bool GetRemoteAddress(PP_Flash_NetAddress* remote_addr); | 33 bool GetRemoteAddress(PP_NetAddress_Private* remote_addr); |
34 int32_t SSLHandshake(const char* server_name, | 34 int32_t SSLHandshake(const char* server_name, |
35 uint16_t server_port, | 35 uint16_t server_port, |
36 const CompletionCallback& callback); | 36 const CompletionCallback& callback); |
37 int32_t Read(char* buffer, | 37 int32_t Read(char* buffer, |
38 int32_t bytes_to_read, | 38 int32_t bytes_to_read, |
39 const CompletionCallback& callback); | 39 const CompletionCallback& callback); |
40 int32_t Write(const char* buffer, | 40 int32_t Write(const char* buffer, |
41 int32_t bytes_to_write, | 41 int32_t bytes_to_write, |
42 const CompletionCallback& callback); | 42 const CompletionCallback& callback); |
43 void Disconnect(); | 43 void Disconnect(); |
44 }; | 44 }; |
45 | 45 |
46 } // namespace flash | 46 } // namespace flash |
47 } // namespace pp | 47 } // namespace pp |
48 | 48 |
49 #endif // PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_ | 49 #endif // PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_ |
OLD | NEW |