OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_P2P_SOCKET_HOST_UDP_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_UDP_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_UDP_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_UDP_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 | 24 |
25 class P2PMessageThrottler; | 25 class P2PMessageThrottler; |
26 | 26 |
27 class CONTENT_EXPORT P2PSocketHostUdp : public P2PSocketHost { | 27 class CONTENT_EXPORT P2PSocketHostUdp : public P2PSocketHost { |
28 public: | 28 public: |
29 P2PSocketHostUdp(IPC::Sender* message_sender, | 29 P2PSocketHostUdp(IPC::Sender* message_sender, |
30 int socket_id, | 30 int socket_id, |
31 P2PMessageThrottler* throttler); | 31 P2PMessageThrottler* throttler); |
32 virtual ~P2PSocketHostUdp(); | 32 ~P2PSocketHostUdp() override; |
33 | 33 |
34 // P2PSocketHost overrides. | 34 // P2PSocketHost overrides. |
35 virtual bool Init(const net::IPEndPoint& local_address, | 35 bool Init(const net::IPEndPoint& local_address, |
36 const P2PHostAndIPEndPoint& remote_address) override; | 36 const P2PHostAndIPEndPoint& remote_address) override; |
37 virtual void Send(const net::IPEndPoint& to, | 37 void Send(const net::IPEndPoint& to, |
38 const std::vector<char>& data, | 38 const std::vector<char>& data, |
39 const rtc::PacketOptions& options, | 39 const rtc::PacketOptions& options, |
40 uint64 packet_id) override; | 40 uint64 packet_id) override; |
41 virtual P2PSocketHost* AcceptIncomingTcpConnection( | 41 P2PSocketHost* AcceptIncomingTcpConnection( |
42 const net::IPEndPoint& remote_address, int id) override; | 42 const net::IPEndPoint& remote_address, |
43 virtual bool SetOption(P2PSocketOption option, int value) override; | 43 int id) override; |
| 44 bool SetOption(P2PSocketOption option, int value) override; |
44 | 45 |
45 private: | 46 private: |
46 friend class P2PSocketHostUdpTest; | 47 friend class P2PSocketHostUdpTest; |
47 | 48 |
48 typedef std::set<net::IPEndPoint> ConnectedPeerSet; | 49 typedef std::set<net::IPEndPoint> ConnectedPeerSet; |
49 | 50 |
50 struct PendingPacket { | 51 struct PendingPacket { |
51 PendingPacket(const net::IPEndPoint& to, | 52 PendingPacket(const net::IPEndPoint& to, |
52 const std::vector<char>& content, | 53 const std::vector<char>& content, |
53 const rtc::PacketOptions& options, | 54 const rtc::PacketOptions& options, |
(...skipping 28 matching lines...) Expand all Loading... |
82 // response or relay allocation request or response. | 83 // response or relay allocation request or response. |
83 ConnectedPeerSet connected_peers_; | 84 ConnectedPeerSet connected_peers_; |
84 P2PMessageThrottler* throttler_; | 85 P2PMessageThrottler* throttler_; |
85 | 86 |
86 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostUdp); | 87 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostUdp); |
87 }; | 88 }; |
88 | 89 |
89 } // namespace content | 90 } // namespace content |
90 | 91 |
91 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_UDP_H_ | 92 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_UDP_H_ |
OLD | NEW |