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/p2p_sockets.h" | 9 #include "content/common/p2p_sockets.h" |
9 | 10 |
10 #include "ipc/ipc_message.h" | 11 #include "ipc/ipc_message.h" |
11 #include "net/base/ip_endpoint.h" | 12 #include "net/base/ip_endpoint.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 | 15 |
15 // Base class for P2P sockets. | 16 // Base class for P2P sockets. |
16 class P2PSocketHost { | 17 class CONTENT_EXPORT P2PSocketHost { |
17 public: | 18 public: |
18 // Creates P2PSocketHost of the specific type. | 19 // Creates P2PSocketHost of the specific type. |
19 static P2PSocketHost* Create(IPC::Message::Sender* message_sender, | 20 static P2PSocketHost* Create(IPC::Message::Sender* message_sender, |
20 int routing_id, int id, P2PSocketType type); | 21 int routing_id, int id, P2PSocketType type); |
21 | 22 |
22 virtual ~P2PSocketHost(); | 23 virtual ~P2PSocketHost(); |
23 | 24 |
24 // Initalizes the socket. Returns false when initiazations fails. | 25 // Initalizes the socket. Returns false when initiazations fails. |
25 virtual bool Init(const net::IPEndPoint& local_address, | 26 virtual bool Init(const net::IPEndPoint& local_address, |
26 const net::IPEndPoint& remote_address) = 0; | 27 const net::IPEndPoint& remote_address) = 0; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 int routing_id_; | 71 int routing_id_; |
71 int id_; | 72 int id_; |
72 State state_; | 73 State state_; |
73 | 74 |
74 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); | 75 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); |
75 }; | 76 }; |
76 | 77 |
77 } // namespace content | 78 } // namespace content |
78 | 79 |
79 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 80 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
OLD | NEW |