OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // P2PSocketDispatcher is a per-renderer object that dispatchers all | 5 // P2PSocketDispatcher is a per-renderer object that dispatchers all |
6 // P2P messages received from the browser and relays all P2P messages | 6 // P2P messages received from the browser and relays all P2P messages |
7 // sent to the browser. P2PSocketClient instances register themselves | 7 // sent to the browser. P2PSocketClient instances register themselves |
8 // with the dispatcher using RegisterClient() and UnregisterClient(). | 8 // with the dispatcher using RegisterClient() and UnregisterClient(). |
9 // | 9 // |
10 // Relationship of classes. | 10 // Relationship of classes. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 void OnIncomingTcpConnection(int socket_id, const net::IPEndPoint& address); | 105 void OnIncomingTcpConnection(int socket_id, const net::IPEndPoint& address); |
106 void OnSendComplete(int socket_id, const P2PSendPacketMetrics& send_metrics); | 106 void OnSendComplete(int socket_id, const P2PSendPacketMetrics& send_metrics); |
107 void OnError(int socket_id); | 107 void OnError(int socket_id); |
108 void OnDataReceived(int socket_id, const net::IPEndPoint& address, | 108 void OnDataReceived(int socket_id, const net::IPEndPoint& address, |
109 const std::vector<char>& data, | 109 const std::vector<char>& data, |
110 const base::TimeTicks& timestamp); | 110 const base::TimeTicks& timestamp); |
111 | 111 |
112 P2PSocketClientImpl* GetClient(int socket_id); | 112 P2PSocketClientImpl* GetClient(int socket_id); |
113 | 113 |
114 scoped_refptr<base::SingleThreadTaskRunner> ipc_task_runner_; | 114 scoped_refptr<base::SingleThreadTaskRunner> ipc_task_runner_; |
115 IDMap<P2PSocketClientImpl> clients_; | 115 IDMap<P2PSocketClientImpl*> clients_; |
116 | 116 |
117 IDMap<P2PAsyncAddressResolver> host_address_requests_; | 117 IDMap<P2PAsyncAddressResolver*> host_address_requests_; |
118 | 118 |
119 bool network_notifications_started_; | 119 bool network_notifications_started_; |
120 scoped_refptr<base::ObserverListThreadSafe<NetworkListObserver>> | 120 scoped_refptr<base::ObserverListThreadSafe<NetworkListObserver>> |
121 network_list_observers_; | 121 network_list_observers_; |
122 | 122 |
123 IPC::Sender* sender_; | 123 IPC::Sender* sender_; |
124 | 124 |
125 // To indicate whether IPC could be invoked on this dispatcher. | 125 // To indicate whether IPC could be invoked on this dispatcher. |
126 bool connected_ = false; | 126 bool connected_ = false; |
127 | 127 |
128 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher); | 128 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher); |
129 }; | 129 }; |
130 | 130 |
131 } // namespace content | 131 } // namespace content |
132 | 132 |
133 #endif // CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_ | 133 #endif // CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_ |
OLD | NEW |