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_SERVER_SOCKET_PRIVATE_PROXY_H_
6 #define PPAPI_PROXY_PPB_TCP_SERVER_SOCKET_PRIVATE_PROXY_H_
11 #include "base/basictypes.h"
12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_resource.h"
14 #include "ppapi/c/private/ppb_net_address_private.h"
15 #include "ppapi/proxy/interface_proxy.h"
19 class PPB_TCPServerSocket_Shared
;
23 class PPB_TCPServerSocket_Private_Proxy
: public InterfaceProxy
{
25 explicit PPB_TCPServerSocket_Private_Proxy(Dispatcher
* dispatcher
);
26 virtual ~PPB_TCPServerSocket_Private_Proxy();
28 static PP_Resource
CreateProxyResource(PP_Instance instance
);
30 void ObjectDestroyed(uint32 socket_id
);
32 // InterfaceProxy implementation.
33 virtual bool OnMessageReceived(const IPC::Message
& msg
);
35 static const ApiID kApiID
= API_ID_PPB_TCPSERVERSOCKET_PRIVATE
;
38 typedef std::map
<uint32
, PPB_TCPServerSocket_Shared
*>
41 void OnMsgListenACK(uint32 plugin_dispatcher_id
,
42 PP_Resource socket_resource
,
45 void OnMsgAcceptACK(uint32 plugin_dispatcher_id
,
46 uint32 server_socket_id
,
47 uint32 accepted_socket_id
,
48 const PP_NetAddress_Private
& local_addr
,
49 const PP_NetAddress_Private
& remote_addr
);
51 IDToServerSocketMap id_to_server_socket_
;
53 DISALLOW_COPY_AND_ASSIGN(PPB_TCPServerSocket_Private_Proxy
);
59 #endif // PPAPI_PROXY_PPB_TCP_SERVER_SOCKET_PRIVATE_PROXY_H_