| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PPAPI_PROXY_PPB_FLASH_UDP_SOCKET_PROXY_H_ | |
| 6 #define PPAPI_PROXY_PPB_FLASH_UDP_SOCKET_PROXY_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 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_flash_udp_socket.h" | |
| 14 #include "ppapi/proxy/interface_proxy.h" | |
| 15 | |
| 16 namespace ppapi { | |
| 17 namespace proxy { | |
| 18 | |
| 19 // The maximum number of bytes that each PpapiHostMsg_PPBFlashUDPSocket_RecvFrom | |
| 20 // message is allowed to request. | |
| 21 extern const int32_t kFlashUDPSocketMaxReadSize; | |
| 22 // The maximum number of bytes that each PpapiHostMsg_PPBFlashUDPSocket_SendTo | |
| 23 // message is allowed to carry. | |
| 24 extern const int32_t kFlashUDPSocketMaxWriteSize; | |
| 25 | |
| 26 class PPB_Flash_UDPSocket_Proxy : public InterfaceProxy { | |
| 27 public: | |
| 28 PPB_Flash_UDPSocket_Proxy(Dispatcher* dispatcher); | |
| 29 virtual ~PPB_Flash_UDPSocket_Proxy(); | |
| 30 | |
| 31 static PP_Resource CreateProxyResource(PP_Instance instance); | |
| 32 | |
| 33 // InterfaceProxy implementation. | |
| 34 virtual bool OnMessageReceived(const IPC::Message& msg); | |
| 35 | |
| 36 private: | |
| 37 // Browser->plugin message handlers. | |
| 38 void OnMsgBindACK(uint32 plugin_dispatcher_id, | |
| 39 uint32 socket_id, | |
| 40 bool succeeded); | |
| 41 void OnMsgRecvFromACK(uint32 plugin_dispatcher_id, | |
| 42 uint32 socket_id, | |
| 43 bool succeeded, | |
| 44 const std::string& data, | |
| 45 const PP_NetAddress_Private& addr); | |
| 46 void OnMsgSendToACK(uint32 plugin_dispatcher_id, | |
| 47 uint32 socket_id, | |
| 48 bool succeeded, | |
| 49 int32_t bytes_written); | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_UDPSocket_Proxy); | |
| 52 }; | |
| 53 | |
| 54 } // namespace proxy | |
| 55 } // namespace ppapi | |
| 56 | |
| 57 #endif // PPAPI_PROXY_PPB_FLASH_UDP_SOCKET_PROXY_H_ | |
| 58 | |
| OLD | NEW |