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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Called by DnsRequest. | 95 // Called by DnsRequest. |
96 int RegisterHostAddressRequest(P2PHostAddressRequest* request); | 96 int RegisterHostAddressRequest(P2PHostAddressRequest* request); |
97 void UnregisterHostAddressRequest(int id); | 97 void UnregisterHostAddressRequest(int id); |
98 | 98 |
99 // Incoming message handlers. | 99 // Incoming message handlers. |
100 void OnNetworkListChanged(const net::NetworkInterfaceList& networks); | 100 void OnNetworkListChanged(const net::NetworkInterfaceList& networks); |
101 void OnGetHostAddressResult(int32 request_id, | 101 void OnGetHostAddressResult(int32 request_id, |
102 const net::IPAddressNumber& address); | 102 const net::IPAddressNumber& address); |
103 void OnSocketCreated(int socket_id, const net::IPEndPoint& address); | 103 void OnSocketCreated(int socket_id, const net::IPEndPoint& address); |
104 void OnIncomingTcpConnection(int socket_id, const net::IPEndPoint& address); | 104 void OnIncomingTcpConnection(int socket_id, const net::IPEndPoint& address); |
| 105 void OnSendComplete(int socket_id); |
105 void OnError(int socket_id); | 106 void OnError(int socket_id); |
106 void OnDataReceived(int socket_id, const net::IPEndPoint& address, | 107 void OnDataReceived(int socket_id, const net::IPEndPoint& address, |
107 const std::vector<char>& data); | 108 const std::vector<char>& data); |
108 | 109 |
109 P2PSocketClient* GetClient(int socket_id); | 110 P2PSocketClient* GetClient(int socket_id); |
110 | 111 |
111 scoped_refptr<base::MessageLoopProxy> message_loop_; | 112 scoped_refptr<base::MessageLoopProxy> message_loop_; |
112 IDMap<P2PSocketClient> clients_; | 113 IDMap<P2PSocketClient> clients_; |
113 | 114 |
114 IDMap<P2PHostAddressRequest> host_address_requests_; | 115 IDMap<P2PHostAddressRequest> host_address_requests_; |
115 | 116 |
116 bool network_notifications_started_; | 117 bool network_notifications_started_; |
117 scoped_refptr<ObserverListThreadSafe<webkit_glue::NetworkListObserver> > | 118 scoped_refptr<ObserverListThreadSafe<webkit_glue::NetworkListObserver> > |
118 network_list_observers_; | 119 network_list_observers_; |
119 | 120 |
120 IPC::Channel* channel_; | 121 IPC::Channel* channel_; |
121 | 122 |
122 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher); | 123 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher); |
123 }; | 124 }; |
124 | 125 |
125 } // namespace content | 126 } // namespace content |
126 | 127 |
127 #endif // CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_ | 128 #endif // CONTENT_RENDERER_P2P_SOCKET_DISPATCHER_H_ |
OLD | NEW |