| 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_sockets.h" | 9 #include "content/common/p2p_sockets.h" |
| 10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
| 11 #include "net/udp/datagram_socket.h" |
| 11 | 12 |
| 12 namespace IPC { | 13 namespace IPC { |
| 13 class Sender; | 14 class Sender; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace net { | 17 namespace net { |
| 17 class URLRequestContextGetter; | 18 class URLRequestContextGetter; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 31 P2PMessageThrottler* throttler); | 32 P2PMessageThrottler* throttler); |
| 32 | 33 |
| 33 virtual ~P2PSocketHost(); | 34 virtual ~P2PSocketHost(); |
| 34 | 35 |
| 35 // Initalizes the socket. Returns false when initiazations fails. | 36 // Initalizes the socket. Returns false when initiazations fails. |
| 36 virtual bool Init(const net::IPEndPoint& local_address, | 37 virtual bool Init(const net::IPEndPoint& local_address, |
| 37 const net::IPEndPoint& remote_address) = 0; | 38 const net::IPEndPoint& remote_address) = 0; |
| 38 | 39 |
| 39 // Sends |data| on the socket to |to|. | 40 // Sends |data| on the socket to |to|. |
| 40 virtual void Send(const net::IPEndPoint& to, | 41 virtual void Send(const net::IPEndPoint& to, |
| 41 const std::vector<char>& data) = 0; | 42 const std::vector<char>& data, |
| 43 net::DiffServCodePoint dscp) = 0; |
| 42 | 44 |
| 43 virtual P2PSocketHost* AcceptIncomingTcpConnection( | 45 virtual P2PSocketHost* AcceptIncomingTcpConnection( |
| 44 const net::IPEndPoint& remote_address, int id) = 0; | 46 const net::IPEndPoint& remote_address, int id) = 0; |
| 45 | 47 |
| 46 protected: | 48 protected: |
| 47 friend class P2PSocketHostTcpTestBase; | 49 friend class P2PSocketHostTcpTestBase; |
| 48 | 50 |
| 49 // TODO(mallinath) - Remove this below enum and use one defined in | 51 // TODO(mallinath) - Remove this below enum and use one defined in |
| 50 // libjingle/souce/talk/p2p/base/stun.h | 52 // libjingle/souce/talk/p2p/base/stun.h |
| 51 enum StunMessageType { | 53 enum StunMessageType { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 IPC::Sender* message_sender_; | 93 IPC::Sender* message_sender_; |
| 92 int id_; | 94 int id_; |
| 93 State state_; | 95 State state_; |
| 94 | 96 |
| 95 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); | 97 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); |
| 96 }; | 98 }; |
| 97 | 99 |
| 98 } // namespace content | 100 } // namespace content |
| 99 | 101 |
| 100 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 102 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
| OLD | NEW |