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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "content/browser/renderer_host/p2p/socket_host.h" | 14 #include "content/browser/renderer_host/p2p/socket_host.h" |
15 #include "content/common/p2p_sockets.h" | 15 #include "content/common/p2p_sockets.h" |
16 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
17 #include "net/base/ip_endpoint.h" | 17 #include "net/base/ip_endpoint.h" |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 class DrainableIOBuffer; | 20 class DrainableIOBuffer; |
21 class GrowableIOBuffer; | 21 class GrowableIOBuffer; |
22 class StreamSocket; | 22 class StreamSocket; |
23 } // namespace net | 23 } // namespace net |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 | 26 |
27 class CONTENT_EXPORT P2PSocketHostTcp : public P2PSocketHost { | 27 class CONTENT_EXPORT P2PSocketHostTcp : public P2PSocketHost { |
28 public: | 28 public: |
29 P2PSocketHostTcp(IPC::Message::Sender* message_sender, | 29 P2PSocketHostTcp(IPC::Sender* message_sender, int routing_id, int id); |
30 int routing_id, int id); | |
31 virtual ~P2PSocketHostTcp(); | 30 virtual ~P2PSocketHostTcp(); |
32 | 31 |
33 bool InitAccepted(const net::IPEndPoint& remote_address, | 32 bool InitAccepted(const net::IPEndPoint& remote_address, |
34 net::StreamSocket* socket); | 33 net::StreamSocket* socket); |
35 | 34 |
36 // P2PSocketHost overrides. | 35 // P2PSocketHost overrides. |
37 virtual bool Init(const net::IPEndPoint& local_address, | 36 virtual bool Init(const net::IPEndPoint& local_address, |
38 const net::IPEndPoint& remote_address) OVERRIDE; | 37 const net::IPEndPoint& remote_address) OVERRIDE; |
39 virtual void Send(const net::IPEndPoint& to, | 38 virtual void Send(const net::IPEndPoint& to, |
40 const std::vector<char>& data) OVERRIDE; | 39 const std::vector<char>& data) OVERRIDE; |
(...skipping 24 matching lines...) Expand all Loading... |
65 scoped_refptr<net::DrainableIOBuffer> write_buffer_; | 64 scoped_refptr<net::DrainableIOBuffer> write_buffer_; |
66 | 65 |
67 bool connected_; | 66 bool connected_; |
68 | 67 |
69 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostTcp); | 68 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostTcp); |
70 }; | 69 }; |
71 | 70 |
72 } // namespace content | 71 } // namespace content |
73 | 72 |
74 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ | 73 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ |
OLD | NEW |