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_Read |
| 20 // message is allowed to request. |
| 21 extern const int32_t kFlashUDPSocketMaxReadSize; |
| 22 // The maximum number of bytes that each PpapiHostMsg_PPBFlashUDPSocket_Write |
| 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 const void* target_interface); |
| 30 virtual ~PPB_Flash_UDPSocket_Proxy(); |
| 31 |
| 32 static const Info* GetInfo(); |
| 33 |
| 34 static PP_Resource CreateProxyResource(PP_Instance instance, int32_t family); |
| 35 |
| 36 // InterfaceProxy implementation. |
| 37 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 38 |
| 39 private: |
| 40 // Browser->plugin message handlers. |
| 41 void OnReadPendingACK(uint32 plugin_dispatcher_id, |
| 42 uint32 socket_id, |
| 43 bool succeeded); |
| 44 void OnMsgRecvFromACK(uint32 plugin_dispatcher_id, |
| 45 uint32 socket_id, |
| 46 bool succeeded, |
| 47 const std::string& data, |
| 48 const PP_Flash_NetAddress& addr); |
| 49 void OnMsgSendToACK(uint32 plugin_dispatcher_id, |
| 50 uint32 socket_id, |
| 51 bool succeeded, |
| 52 int32_t bytes_written); |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_UDPSocket_Proxy); |
| 55 }; |
| 56 |
| 57 } // namespace proxy |
| 58 } // namespace ppapi |
| 59 |
| 60 #endif // PPAPI_PROXY_PPB_FLASH_UDP_SOCKET_PROXY_H_ |
| 61 |
OLD | NEW |