Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_x509_certificate_private_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 static PP_Resource CreateProxyResourceForConnectedSocket( | 27 static PP_Resource CreateProxyResourceForConnectedSocket( |
| 27 PP_Instance instance, | 28 PP_Instance instance, |
| 28 uint32 socket_id, | 29 uint32 socket_id, |
| 29 const PP_NetAddress_Private& local_addr, | 30 const PP_NetAddress_Private& local_addr, |
| 30 const PP_NetAddress_Private& remote_addr); | 31 const PP_NetAddress_Private& remote_addr); |
| 31 | 32 |
| 32 // InterfaceProxy implementation. | 33 // InterfaceProxy implementation. |
| 33 virtual bool OnMessageReceived(const IPC::Message& msg); | 34 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 34 | 35 |
| 35 static const ApiID kApiID = API_ID_PPB_TCPSOCKET_PRIVATE; | 36 static const ApiID kApiID = API_ID_PPB_TCPSOCKET_PRIVATE; |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 // Browser->plugin message handlers. | 39 // Browser->plugin message handlers. |
| 39 void OnMsgConnectACK(uint32 plugin_dispatcher_id, | 40 void OnMsgConnectACK(uint32 plugin_dispatcher_id, |
| 40 uint32 socket_id, | 41 uint32 socket_id, |
| 41 bool succeeded, | 42 bool succeeded, |
| 42 const PP_NetAddress_Private& local_addr, | 43 const PP_NetAddress_Private& local_addr, |
| 43 const PP_NetAddress_Private& remote_addr); | 44 const PP_NetAddress_Private& remote_addr); |
| 44 void OnMsgSSLHandshakeACK(uint32 plugin_dispatcher_id, | 45 void OnMsgSSLHandshakeACK( |
| 45 uint32 socket_id, | 46 uint32 plugin_dispatcher_id, |
| 46 bool succeeded); | 47 uint32 socket_id, |
| 48 bool succeeded, | |
| 49 const PPB_X509Certificate_Fields& certificate_fields); | |
|
yzshen1
2012/04/06 19:24:33
You could forward declare this class, right?
raymes
2012/04/06 23:22:47
Done.
| |
| 47 void OnMsgReadACK(uint32 plugin_dispatcher_id, | 50 void OnMsgReadACK(uint32 plugin_dispatcher_id, |
| 48 uint32 socket_id, | 51 uint32 socket_id, |
| 49 bool succeeded, | 52 bool succeeded, |
| 50 const std::string& data); | 53 const std::string& data); |
| 51 void OnMsgWriteACK(uint32 plugin_dispatcher_id, | 54 void OnMsgWriteACK(uint32 plugin_dispatcher_id, |
| 52 uint32 socket_id, | 55 uint32 socket_id, |
| 53 bool succeeded, | 56 bool succeeded, |
| 54 int32_t bytes_written); | 57 int32_t bytes_written); |
| 55 | 58 |
| 56 DISALLOW_COPY_AND_ASSIGN(PPB_TCPSocket_Private_Proxy); | 59 DISALLOW_COPY_AND_ASSIGN(PPB_TCPSocket_Private_Proxy); |
| 57 }; | 60 }; |
| 58 | 61 |
| 59 } // namespace proxy | 62 } // namespace proxy |
| 60 } // namespace ppapi | 63 } // namespace ppapi |
| 61 | 64 |
| 62 #endif // PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_ | 65 #endif // PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_ |
| OLD | NEW |