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); |
40 void SendBindACKError(); | 42 void SendBindACKError(); |
41 | 43 |
42 private: | 44 private: |
43 void SendRecvFromACKError(); | 45 void SendRecvFromACKError(); |
44 void SendSendToACKError(); | 46 void SendSendToACKError(); |
45 | 47 |
46 void OnBindCompleted(int result); | 48 void OnBindCompleted(int result); |
47 void OnRecvFromCompleted(int result); | 49 void OnRecvFromCompleted(int result); |
48 void OnSendToCompleted(int result); | 50 void OnSendToCompleted(int result); |
49 | 51 |
50 PepperMessageFilter* manager_; | 52 PepperMessageFilter* manager_; |
51 int32 routing_id_; | 53 int32 routing_id_; |
52 uint32 plugin_dispatcher_id_; | 54 uint32 plugin_dispatcher_id_; |
53 uint32 socket_id_; | 55 uint32 socket_id_; |
| 56 bool allow_address_reuse_; |
| 57 bool allow_broadcast_; |
54 | 58 |
55 scoped_ptr<net::UDPServerSocket> socket_; | 59 scoped_ptr<net::UDPServerSocket> socket_; |
56 | 60 |
57 scoped_refptr<net::IOBuffer> recvfrom_buffer_; | 61 scoped_refptr<net::IOBuffer> recvfrom_buffer_; |
58 scoped_refptr<net::IOBuffer> sendto_buffer_; | 62 scoped_refptr<net::IOBuffer> sendto_buffer_; |
59 | 63 |
60 net::IPEndPoint recvfrom_address_; | 64 net::IPEndPoint recvfrom_address_; |
61 net::IPEndPoint bound_address_; | 65 net::IPEndPoint bound_address_; |
62 | 66 |
63 DISALLOW_COPY_AND_ASSIGN(PepperUDPSocket); | 67 DISALLOW_COPY_AND_ASSIGN(PepperUDPSocket); |
64 }; | 68 }; |
65 | 69 |
66 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_H_ | 70 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_H_ |
OLD | NEW |