| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 static P2PSocketHost* Create(IPC::Sender* message_sender, | 39 static P2PSocketHost* Create(IPC::Sender* message_sender, |
| 40 int socket_id, | 40 int socket_id, |
| 41 P2PSocketType type, | 41 P2PSocketType type, |
| 42 net::URLRequestContextGetter* url_context, | 42 net::URLRequestContextGetter* url_context, |
| 43 P2PMessageThrottler* throttler); | 43 P2PMessageThrottler* throttler); |
| 44 | 44 |
| 45 virtual ~P2PSocketHost(); | 45 virtual ~P2PSocketHost(); |
| 46 | 46 |
| 47 // Initalizes the socket. Returns false when initiazations fails. | 47 // Initalizes the socket. Returns false when initiazations fails. |
| 48 virtual bool Init(const net::IPEndPoint& local_address, | 48 virtual bool Init(const net::IPEndPoint& local_address, |
| 49 uint16_t min_port, |
| 50 uint16_t max_port, |
| 49 const P2PHostAndIPEndPoint& remote_address) = 0; | 51 const P2PHostAndIPEndPoint& remote_address) = 0; |
| 50 | 52 |
| 51 // Sends |data| on the socket to |to|. | 53 // Sends |data| on the socket to |to|. |
| 52 virtual void Send(const net::IPEndPoint& to, | 54 virtual void Send(const net::IPEndPoint& to, |
| 53 const std::vector<char>& data, | 55 const std::vector<char>& data, |
| 54 const rtc::PacketOptions& options, | 56 const rtc::PacketOptions& options, |
| 55 uint64_t packet_id) = 0; | 57 uint64_t packet_id) = 0; |
| 56 | 58 |
| 57 virtual P2PSocketHost* AcceptIncomingTcpConnection( | 59 virtual P2PSocketHost* AcceptIncomingTcpConnection( |
| 58 const net::IPEndPoint& remote_address, int id) = 0; | 60 const net::IPEndPoint& remote_address, int id) = 0; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 int32_t send_bytes_delayed_cur_; | 153 int32_t send_bytes_delayed_cur_; |
| 152 | 154 |
| 153 base::WeakPtrFactory<P2PSocketHost> weak_ptr_factory_; | 155 base::WeakPtrFactory<P2PSocketHost> weak_ptr_factory_; |
| 154 | 156 |
| 155 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); | 157 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); |
| 156 }; | 158 }; |
| 157 | 159 |
| 158 } // namespace content | 160 } // namespace content |
| 159 | 161 |
| 160 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 162 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
| OLD | NEW |