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
3 // found in the LICENSE file.
5 #ifndef PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_
6 #define PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_
10 #include "base/basictypes.h"
11 #include "ppapi/c/pp_instance.h"
12 #include "ppapi/c/pp_resource.h"
13 #include "ppapi/c/private/ppb_tcp_socket_private.h"
14 #include "ppapi/proxy/interface_proxy.h"
15 #include "ppapi/proxy/ppapi_proxy_export.h"
19 class PPB_X509Certificate_Fields
;
23 class PPB_TCPSocket_Private_Proxy
: public InterfaceProxy
{
25 PPB_TCPSocket_Private_Proxy(Dispatcher
* dispatcher
);
26 virtual ~PPB_TCPSocket_Private_Proxy();
28 static PP_Resource
CreateProxyResource(PP_Instance instance
);
29 static PP_Resource
CreateProxyResourceForConnectedSocket(
32 const PP_NetAddress_Private
& local_addr
,
33 const PP_NetAddress_Private
& remote_addr
);
35 // InterfaceProxy implementation.
36 virtual bool OnMessageReceived(const IPC::Message
& msg
);
38 static const ApiID kApiID
= API_ID_PPB_TCPSOCKET_PRIVATE
;
41 // Browser->plugin message handlers.
42 void OnMsgConnectACK(uint32 plugin_dispatcher_id
,
45 const PP_NetAddress_Private
& local_addr
,
46 const PP_NetAddress_Private
& remote_addr
);
47 void OnMsgSSLHandshakeACK(
48 uint32 plugin_dispatcher_id
,
51 const PPB_X509Certificate_Fields
& certificate_fields
);
52 void OnMsgReadACK(uint32 plugin_dispatcher_id
,
55 const std::string
& data
);
56 void OnMsgWriteACK(uint32 plugin_dispatcher_id
,
59 int32_t bytes_written
);
61 DISALLOW_COPY_AND_ASSIGN(PPB_TCPSocket_Private_Proxy
);
67 #endif // PPAPI_PROXY_PPB_TCP_SOCKET_PRIVATE_PROXY_H_