| 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_TCP_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 net::URLRequestContextGetter* url_context); | 34 net::URLRequestContextGetter* url_context); |
| 35 virtual ~P2PSocketHostTcpBase(); | 35 virtual ~P2PSocketHostTcpBase(); |
| 36 | 36 |
| 37 bool InitAccepted(const net::IPEndPoint& remote_address, | 37 bool InitAccepted(const net::IPEndPoint& remote_address, |
| 38 net::StreamSocket* socket); | 38 net::StreamSocket* socket); |
| 39 | 39 |
| 40 // P2PSocketHost overrides. | 40 // P2PSocketHost overrides. |
| 41 virtual bool Init(const net::IPEndPoint& local_address, | 41 virtual bool Init(const net::IPEndPoint& local_address, |
| 42 const net::IPEndPoint& remote_address) OVERRIDE; | 42 const net::IPEndPoint& remote_address) OVERRIDE; |
| 43 virtual void Send(const net::IPEndPoint& to, | 43 virtual void Send(const net::IPEndPoint& to, |
| 44 const std::vector<char>& data) OVERRIDE; | 44 const std::vector<char>& data, |
| 45 net::DiffServCodePoint dscp) OVERRIDE; |
| 45 virtual P2PSocketHost* AcceptIncomingTcpConnection( | 46 virtual P2PSocketHost* AcceptIncomingTcpConnection( |
| 46 const net::IPEndPoint& remote_address, int id) OVERRIDE; | 47 const net::IPEndPoint& remote_address, int id) OVERRIDE; |
| 47 | 48 |
| 48 protected: | 49 protected: |
| 49 // Derived classes will provide the implementation. | 50 // Derived classes will provide the implementation. |
| 50 virtual int ProcessInput(char* input, int input_len) = 0; | 51 virtual int ProcessInput(char* input, int input_len) = 0; |
| 51 virtual void DoSend(const net::IPEndPoint& to, | 52 virtual void DoSend(const net::IPEndPoint& to, |
| 52 const std::vector<char>& data) = 0; | 53 const std::vector<char>& data) = 0; |
| 53 | 54 |
| 54 void WriteOrQueue(scoped_refptr<net::DrainableIOBuffer>& buffer); | 55 void WriteOrQueue(scoped_refptr<net::DrainableIOBuffer>& buffer); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 private: | 123 private: |
| 123 int GetExpectedPacketSize(const char* data, int len, int* pad_bytes); | 124 int GetExpectedPacketSize(const char* data, int len, int* pad_bytes); |
| 124 | 125 |
| 125 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostStunTcp); | 126 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostStunTcp); |
| 126 }; | 127 }; |
| 127 | 128 |
| 128 | 129 |
| 129 } // namespace content | 130 } // namespace content |
| 130 | 131 |
| 131 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ | 132 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ |
| OLD | NEW |