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_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "content/common/p2p_socket_type.h" | 9 #include "content/common/p2p_socket_type.h" |
10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // Creates P2PSocketHost of the specific type. | 32 // Creates P2PSocketHost of the specific type. |
33 static P2PSocketHost* Create(IPC::Sender* message_sender, | 33 static P2PSocketHost* Create(IPC::Sender* message_sender, |
34 int id, P2PSocketType type, | 34 int id, P2PSocketType type, |
35 net::URLRequestContextGetter* url_context, | 35 net::URLRequestContextGetter* url_context, |
36 P2PMessageThrottler* throttler); | 36 P2PMessageThrottler* throttler); |
37 | 37 |
38 virtual ~P2PSocketHost(); | 38 virtual ~P2PSocketHost(); |
39 | 39 |
40 // Initalizes the socket. Returns false when initiazations fails. | 40 // Initalizes the socket. Returns false when initiazations fails. |
41 virtual bool Init(const net::IPEndPoint& local_address, | 41 virtual bool Init(const net::IPEndPoint& local_address, |
42 const net::IPEndPoint& remote_address) = 0; | 42 const P2PHostAndIPEndPoint& remote_address) = 0; |
43 | 43 |
44 // Sends |data| on the socket to |to|. | 44 // Sends |data| on the socket to |to|. |
45 virtual void Send(const net::IPEndPoint& to, | 45 virtual void Send(const net::IPEndPoint& to, |
46 const std::vector<char>& data, | 46 const std::vector<char>& data, |
47 const talk_base::PacketOptions& options, | 47 const talk_base::PacketOptions& options, |
48 uint64 packet_id) = 0; | 48 uint64 packet_id) = 0; |
49 | 49 |
50 virtual P2PSocketHost* AcceptIncomingTcpConnection( | 50 virtual P2PSocketHost* AcceptIncomingTcpConnection( |
51 const net::IPEndPoint& remote_address, int id) = 0; | 51 const net::IPEndPoint& remote_address, int id) = 0; |
52 | 52 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 IPC::Sender* message_sender_; | 100 IPC::Sender* message_sender_; |
101 int id_; | 101 int id_; |
102 State state_; | 102 State state_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); | 104 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace content | 107 } // namespace content |
108 | 108 |
109 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 109 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
OLD | NEW |