| 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 #include "content/renderer/p2p/socket_dispatcher.h" | 5 #include "content/renderer/p2p/socket_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "content/child/child_process.h" | 10 #include "content/child/child_process.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 const net::NetworkInterfaceList& networks) { | 124 const net::NetworkInterfaceList& networks) { |
| 125 network_list_observers_->Notify( | 125 network_list_observers_->Notify( |
| 126 &NetworkListObserver::OnNetworkListChanged, networks); | 126 &NetworkListObserver::OnNetworkListChanged, networks); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void P2PSocketDispatcher::OnGetHostAddressResult( | 129 void P2PSocketDispatcher::OnGetHostAddressResult( |
| 130 int32 request_id, | 130 int32 request_id, |
| 131 const net::IPAddressList& addresses) { | 131 const net::IPAddressList& addresses) { |
| 132 P2PAsyncAddressResolver* request = host_address_requests_.Lookup(request_id); | 132 P2PAsyncAddressResolver* request = host_address_requests_.Lookup(request_id); |
| 133 if (!request) { | 133 if (!request) { |
| 134 VLOG(1) << "Received P2P message for socket that doesn't exist."; | 134 DVLOG(1) << "Received P2P message for socket that doesn't exist."; |
| 135 return; | 135 return; |
| 136 } | 136 } |
| 137 | 137 |
| 138 request->OnResponse(addresses); | 138 request->OnResponse(addresses); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void P2PSocketDispatcher::OnSocketCreated( | 141 void P2PSocketDispatcher::OnSocketCreated( |
| 142 int socket_id, | 142 int socket_id, |
| 143 const net::IPEndPoint& local_address, | 143 const net::IPEndPoint& local_address, |
| 144 const net::IPEndPoint& remote_address) { | 144 const net::IPEndPoint& remote_address) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 client->OnDataReceived(address, data, timestamp); | 179 client->OnDataReceived(address, data, timestamp); |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 | 182 |
| 183 P2PSocketClientImpl* P2PSocketDispatcher::GetClient(int socket_id) { | 183 P2PSocketClientImpl* P2PSocketDispatcher::GetClient(int socket_id) { |
| 184 P2PSocketClientImpl* client = clients_.Lookup(socket_id); | 184 P2PSocketClientImpl* client = clients_.Lookup(socket_id); |
| 185 if (client == NULL) { | 185 if (client == NULL) { |
| 186 // This may happen if the socket was closed, but the browser side | 186 // This may happen if the socket was closed, but the browser side |
| 187 // hasn't processed the close message by the time it sends the | 187 // hasn't processed the close message by the time it sends the |
| 188 // message to the renderer. | 188 // message to the renderer. |
| 189 VLOG(1) << "Received P2P message for socket that doesn't exist."; | 189 DVLOG(1) << "Received P2P message for socket that doesn't exist."; |
| 190 return NULL; | 190 return NULL; |
| 191 } | 191 } |
| 192 | 192 |
| 193 return client; | 193 return client; |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // namespace content | 196 } // namespace content |
| OLD | NEW |