| 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 #ifndef PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_ |
| 6 #define PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "ppapi/c/pp_instance.h" | 11 #include "ppapi/c/pp_instance.h" |
| 12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
| 13 #include "ppapi/c/private/ppb_tcp_socket_private.h" | 13 #include "ppapi/c/private/ppb_tcp_socket_private.h" |
| 14 #include "ppapi/proxy/interface_proxy.h" | 14 #include "ppapi/proxy/interface_proxy.h" |
| 15 #include "ppapi/proxy/ppapi_proxy_export.h" | 15 #include "ppapi/proxy/ppapi_proxy_export.h" |
| 16 #include "ppapi/shared_impl/private/ppb_flash_x509_certificate_shared.h" |
| 16 | 17 |
| 17 namespace ppapi { | 18 namespace ppapi { |
| 18 namespace proxy { | 19 namespace proxy { |
| 19 | 20 |
| 20 class PPB_TCPSocket_Private_Proxy : public InterfaceProxy { | 21 class PPB_TCPSocket_Private_Proxy : public InterfaceProxy { |
| 21 public: | 22 public: |
| 22 PPB_TCPSocket_Private_Proxy(Dispatcher* dispatcher); | 23 PPB_TCPSocket_Private_Proxy(Dispatcher* dispatcher); |
| 23 virtual ~PPB_TCPSocket_Private_Proxy(); | 24 virtual ~PPB_TCPSocket_Private_Proxy(); |
| 24 | 25 |
| 25 static PP_Resource CreateProxyResource(PP_Instance instance); | 26 static PP_Resource CreateProxyResource(PP_Instance instance); |
| 26 | 27 |
| 27 // InterfaceProxy implementation. | 28 // InterfaceProxy implementation. |
| 28 virtual bool OnMessageReceived(const IPC::Message& msg); | 29 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 29 | 30 |
| 30 static const ApiID kApiID = API_ID_PPB_TCPSOCKET_PRIVATE; | 31 static const ApiID kApiID = API_ID_PPB_TCPSOCKET_PRIVATE; |
| 31 | 32 |
| 32 private: | 33 private: |
| 33 // Browser->plugin message handlers. | 34 // Browser->plugin message handlers. |
| 34 void OnMsgConnectACK(uint32 plugin_dispatcher_id, | 35 void OnMsgConnectACK(uint32 plugin_dispatcher_id, |
| 35 uint32 socket_id, | 36 uint32 socket_id, |
| 36 bool succeeded, | 37 bool succeeded, |
| 37 const PP_NetAddress_Private& local_addr, | 38 const PP_NetAddress_Private& local_addr, |
| 38 const PP_NetAddress_Private& remote_addr); | 39 const PP_NetAddress_Private& remote_addr); |
| 39 void OnMsgSSLHandshakeACK(uint32 plugin_dispatcher_id, | 40 void OnMsgSSLHandshakeACK( |
| 40 uint32 socket_id, | 41 uint32 plugin_dispatcher_id, |
| 41 bool succeeded); | 42 uint32 socket_id, |
| 43 bool succeeded, |
| 44 const PPB_X509Certificate_Fields& certificate_fields); |
| 42 void OnMsgReadACK(uint32 plugin_dispatcher_id, | 45 void OnMsgReadACK(uint32 plugin_dispatcher_id, |
| 43 uint32 socket_id, | 46 uint32 socket_id, |
| 44 bool succeeded, | 47 bool succeeded, |
| 45 const std::string& data); | 48 const std::string& data); |
| 46 void OnMsgWriteACK(uint32 plugin_dispatcher_id, | 49 void OnMsgWriteACK(uint32 plugin_dispatcher_id, |
| 47 uint32 socket_id, | 50 uint32 socket_id, |
| 48 bool succeeded, | 51 bool succeeded, |
| 49 int32_t bytes_written); | 52 int32_t bytes_written); |
| 50 | 53 |
| 51 DISALLOW_COPY_AND_ASSIGN(PPB_TCPSocket_Private_Proxy); | 54 DISALLOW_COPY_AND_ASSIGN(PPB_TCPSocket_Private_Proxy); |
| 52 }; | 55 }; |
| 53 | 56 |
| 54 } // namespace proxy | 57 } // namespace proxy |
| 55 } // namespace ppapi | 58 } // namespace ppapi |
| 56 | 59 |
| 57 #endif // PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_ | 60 #endif // PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_ |
| OLD | NEW |