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" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 // Proxy methods that deliver messages to the delegate thread. | 87 // Proxy methods that deliver messages to the delegate thread. |
88 void DeliverOnSocketCreated(const net::IPEndPoint& address); | 88 void DeliverOnSocketCreated(const net::IPEndPoint& address); |
89 void DeliverOnIncomingTcpConnection( | 89 void DeliverOnIncomingTcpConnection( |
90 const net::IPEndPoint& address, | 90 const net::IPEndPoint& address, |
91 scoped_refptr<P2PSocketClient> new_client); | 91 scoped_refptr<P2PSocketClient> new_client); |
92 void DeliverOnError(); | 92 void DeliverOnError(); |
93 void DeliverOnDataReceived(const net::IPEndPoint& address, | 93 void DeliverOnDataReceived(const net::IPEndPoint& address, |
94 const std::vector<char>& data); | 94 const std::vector<char>& data); |
95 | 95 |
| 96 // Scheduled on the IPC thread to finish initialization. |
| 97 void DoInit(P2PSocketType type, |
| 98 const net::IPEndPoint& local_address, |
| 99 const net::IPEndPoint& remote_address); |
| 100 |
96 // Scheduled on the IPC thread to finish closing the connection. | 101 // Scheduled on the IPC thread to finish closing the connection. |
97 void DoClose(); | 102 void DoClose(); |
98 | 103 |
99 // Called by the dispatcher when it is destroyed. | 104 // Called by the dispatcher when it is destroyed. |
100 void Detach(); | 105 void Detach(); |
101 | 106 |
102 P2PSocketDispatcher* dispatcher_; | 107 P2PSocketDispatcher* dispatcher_; |
103 scoped_refptr<base::MessageLoopProxy> ipc_message_loop_; | 108 scoped_refptr<base::MessageLoopProxy> ipc_message_loop_; |
104 scoped_refptr<base::MessageLoopProxy> delegate_message_loop_; | 109 scoped_refptr<base::MessageLoopProxy> delegate_message_loop_; |
105 int socket_id_; | 110 int socket_id_; |
106 Delegate* delegate_; | 111 Delegate* delegate_; |
107 State state_; | 112 State state_; |
108 | 113 |
109 DISALLOW_COPY_AND_ASSIGN(P2PSocketClient); | 114 DISALLOW_COPY_AND_ASSIGN(P2PSocketClient); |
110 }; | 115 }; |
111 | 116 |
112 } // namespace content | 117 } // namespace content |
113 | 118 |
114 #endif // CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ | 119 #endif // CONTENT_RENDERER_P2P_SOCKET_CLIENT_H_ |
OLD | NEW |