OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef PPAPI_PROXY_PPB_TCP_SERVER_SOCKET_PRIVATE_PROXY_H_ |
| 6 #define PPAPI_PROXY_PPB_TCP_SERVER_SOCKET_PRIVATE_PROXY_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 |
| 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" |
| 16 |
| 17 namespace ppapi { |
| 18 |
| 19 class PPB_TCPServerSocket_Shared; |
| 20 |
| 21 namespace proxy { |
| 22 |
| 23 class PPB_TCPServerSocket_Private_Proxy : public InterfaceProxy { |
| 24 public: |
| 25 explicit PPB_TCPServerSocket_Private_Proxy(Dispatcher* dispatcher); |
| 26 virtual ~PPB_TCPServerSocket_Private_Proxy(); |
| 27 |
| 28 static PP_Resource CreateProxyResource(PP_Instance instance); |
| 29 |
| 30 void ObjectDestroyed(uint32 socket_id); |
| 31 |
| 32 // InterfaceProxy implementation. |
| 33 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 34 |
| 35 static const ApiID kApiID = API_ID_PPB_TCPSERVERSOCKET_PRIVATE; |
| 36 |
| 37 private: |
| 38 typedef std::map<uint32, PPB_TCPServerSocket_Shared*> |
| 39 IDToServerSocketMap; |
| 40 |
| 41 void OnMsgListenACK(uint32 plugin_dispatcher_id, |
| 42 PP_Resource socket_resource, |
| 43 uint32 socket_id, |
| 44 int32_t status); |
| 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); |
| 50 |
| 51 IDToServerSocketMap id_to_server_socket_; |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(PPB_TCPServerSocket_Private_Proxy); |
| 54 }; |
| 55 |
| 56 } // namespace proxy |
| 57 } // namespace ppapi |
| 58 |
| 59 #endif // PPAPI_PROXY_PPB_TCP_SERVER_SOCKET_PRIVATE_PROXY_H_ |
OLD | NEW |