Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
|
viettrungluu
2011/11/09 18:50:19
Please keep the existing Flash TCP stuff working.
Dmitry Polukhin
2011/11/09 19:00:31
It would be good to be able to test what is actual
Dmitry Polukhin
2011/11/10 15:10:11
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 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 | |
| 7 // (or even compiled with) Chromium. | |
| 8 | |
| 9 #ifndef PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_ | |
| 10 #define PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_ | |
| 11 | |
| 12 #include "ppapi/c/pp_stdint.h" | |
| 13 #include "ppapi/c/private/ppb_flash_tcp_socket.h" | |
| 14 #include "ppapi/cpp/resource.h" | |
| 15 | |
| 16 namespace pp { | |
| 17 | |
| 18 class CompletionCallback; | |
| 19 class Instance; | |
| 20 | |
| 21 namespace flash { | |
| 22 | |
| 23 class TCPSocket : public Resource { | |
| 24 public: | |
| 25 explicit TCPSocket(Instance* instance); | |
| 26 | |
| 27 int32_t Connect(const char* host, | |
| 28 uint16_t port, | |
| 29 const CompletionCallback& callback); | |
| 30 int32_t ConnectWithNetAddress(const PP_Flash_NetAddress* addr, | |
| 31 const CompletionCallback& callback); | |
| 32 bool GetLocalAddress(PP_Flash_NetAddress* local_addr); | |
| 33 bool GetRemoteAddress(PP_Flash_NetAddress* remote_addr); | |
| 34 int32_t SSLHandshake(const char* server_name, | |
| 35 uint16_t server_port, | |
| 36 const CompletionCallback& callback); | |
| 37 int32_t Read(char* buffer, | |
| 38 int32_t bytes_to_read, | |
| 39 const CompletionCallback& callback); | |
| 40 int32_t Write(const char* buffer, | |
| 41 int32_t bytes_to_write, | |
| 42 const CompletionCallback& callback); | |
| 43 void Disconnect(); | |
| 44 }; | |
| 45 | |
| 46 } // namespace flash | |
| 47 } // namespace pp | |
| 48 | |
| 49 #endif // PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_ | |
| OLD | NEW |