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_RENDERER_P2P_SOCKET_CLIENT_H_ | 5 #ifndef CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ |
6 #define CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ | 6 #define CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "content/common/p2p_sockets.h" | 11 #include "content/common/p2p_sockets.h" |
12 #include "net/base/ip_endpoint.h" | 12 #include "net/base/ip_endpoint.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class MessageLoopProxy; | 15 class MessageLoopProxy; |
16 } // namespace base | 16 } // namespace base |
17 | 17 |
| 18 namespace content { |
| 19 |
18 class P2PSocketDispatcher; | 20 class P2PSocketDispatcher; |
19 | 21 |
20 // P2P socket that rountes all calls over IPC. | 22 // P2P socket that rountes all calls over IPC. |
21 // | 23 // |
22 // The object runs on two threads: IPC thread and delegate thread. The | 24 // The object runs on two threads: IPC thread and delegate thread. The |
23 // IPC thread is used to interact with P2PSocketDispatcher. All | 25 // IPC thread is used to interact with P2PSocketDispatcher. All |
24 // callbacks to the user of this class are called on the delegate | 26 // callbacks to the user of this class are called on the delegate |
25 // thread which is specified in Init(). | 27 // thread which is specified in Init(). |
26 class P2PSocketClient : public base::RefCountedThreadSafe<P2PSocketClient> { | 28 class P2PSocketClient : public base::RefCountedThreadSafe<P2PSocketClient> { |
27 public: | 29 public: |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 P2PSocketDispatcher* dispatcher_; | 102 P2PSocketDispatcher* dispatcher_; |
101 scoped_refptr<base::MessageLoopProxy> ipc_message_loop_; | 103 scoped_refptr<base::MessageLoopProxy> ipc_message_loop_; |
102 scoped_refptr<base::MessageLoopProxy> delegate_message_loop_; | 104 scoped_refptr<base::MessageLoopProxy> delegate_message_loop_; |
103 int socket_id_; | 105 int socket_id_; |
104 Delegate* delegate_; | 106 Delegate* delegate_; |
105 State state_; | 107 State state_; |
106 | 108 |
107 DISALLOW_COPY_AND_ASSIGN(P2PSocketClient); | 109 DISALLOW_COPY_AND_ASSIGN(P2PSocketClient); |
108 }; | 110 }; |
109 | 111 |
| 112 } // namespace content |
| 113 |
110 #endif // CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ | 114 #endif // CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ |
OLD | NEW |