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 const Info* GetInfo(); |
| 32 |
| 33 static PP_Resource CreateProxyResource(PP_Instance instance); |
| 34 |
| 35 // InterfaceProxy implementation. |
| 36 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 37 |
| 38 private: |
| 39 // Browser->plugin message handlers. |
| 40 void OnMsgBindACK(uint32 plugin_dispatcher_id, |
| 41 uint32 socket_id, |
| 42 bool succeeded); |
| 43 void OnMsgRecvFromACK(uint32 plugin_dispatcher_id, |
| 44 uint32 socket_id, |
| 45 bool succeeded, |
| 46 const std::string& data, |
| 47 const PP_Flash_NetAddress& addr); |
| 48 void OnMsgSendToACK(uint32 plugin_dispatcher_id, |
| 49 uint32 socket_id, |
| 50 bool succeeded, |
| 51 int32_t bytes_written); |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_UDPSocket_Proxy); |
| 54 }; |
| 55 |
| 56 } // namespace proxy |
| 57 } // namespace ppapi |
| 58 |
| 59 #endif // PPAPI_PROXY_PPB_FLASH_UDP_SOCKET_PROXY_H_ |
| 60 |
OLD | NEW |