| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 class PepperUDPSocket { | 27 class PepperUDPSocket { |
| 28 public: | 28 public: |
| 29 PepperUDPSocket(PepperMessageFilter* manager, | 29 PepperUDPSocket(PepperMessageFilter* manager, |
| 30 int32 routing_id, | 30 int32 routing_id, |
| 31 uint32 plugin_dispatcher_id, | 31 uint32 plugin_dispatcher_id, |
| 32 uint32 socket_id); | 32 uint32 socket_id); |
| 33 ~PepperUDPSocket(); | 33 ~PepperUDPSocket(); |
| 34 | 34 |
| 35 int routing_id() { return routing_id_; } | 35 int routing_id() { return routing_id_; } |
| 36 | 36 |
| 37 void AllowAddressReuse(bool value); |
| 38 void AllowBroadcast(bool value); |
| 37 void Bind(const PP_NetAddress_Private& addr); | 39 void Bind(const PP_NetAddress_Private& addr); |
| 38 void RecvFrom(int32_t num_bytes); | 40 void RecvFrom(int32_t num_bytes); |
| 39 void SendTo(const std::string& data, const PP_NetAddress_Private& addr); | 41 void SendTo(const std::string& data, const PP_NetAddress_Private& addr); |
| 42 void SendSetSocketFeatureACK(bool succeeded); |
| 40 void SendBindACKError(); | 43 void SendBindACKError(); |
| 41 | 44 |
| 42 private: | 45 private: |
| 43 void SendRecvFromACKError(); | 46 void SendRecvFromACKError(); |
| 44 void SendSendToACKError(); | 47 void SendSendToACKError(); |
| 45 | 48 |
| 46 void OnBindCompleted(int result); | 49 void OnBindCompleted(int result); |
| 47 void OnRecvFromCompleted(int result); | 50 void OnRecvFromCompleted(int result); |
| 48 void OnSendToCompleted(int result); | 51 void OnSendToCompleted(int result); |
| 49 | 52 |
| 50 PepperMessageFilter* manager_; | 53 PepperMessageFilter* manager_; |
| 51 int32 routing_id_; | 54 int32 routing_id_; |
| 52 uint32 plugin_dispatcher_id_; | 55 uint32 plugin_dispatcher_id_; |
| 53 uint32 socket_id_; | 56 uint32 socket_id_; |
| 57 bool allow_address_reuse_; |
| 58 bool allow_broadcast_; |
| 54 | 59 |
| 55 scoped_ptr<net::UDPServerSocket> socket_; | 60 scoped_ptr<net::UDPServerSocket> socket_; |
| 56 | 61 |
| 57 scoped_refptr<net::IOBuffer> recvfrom_buffer_; | 62 scoped_refptr<net::IOBuffer> recvfrom_buffer_; |
| 58 scoped_refptr<net::IOBuffer> sendto_buffer_; | 63 scoped_refptr<net::IOBuffer> sendto_buffer_; |
| 59 | 64 |
| 60 net::IPEndPoint recvfrom_address_; | 65 net::IPEndPoint recvfrom_address_; |
| 61 net::IPEndPoint bound_address_; | 66 net::IPEndPoint bound_address_; |
| 62 | 67 |
| 63 DISALLOW_COPY_AND_ASSIGN(PepperUDPSocket); | 68 DISALLOW_COPY_AND_ASSIGN(PepperUDPSocket); |
| 64 }; | 69 }; |
| 65 | 70 |
| 66 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_H_ | 71 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_H_ |
| OLD | NEW |