| 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/browser/renderer_host/p2p/socket_dispatcher_host.h" | 5 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "content/browser/renderer_host/p2p/socket_host.h" | 9 #include "content/browser/renderer_host/p2p/socket_host.h" |
| 10 #include "content/common/p2p_messages.h" | 10 #include "content/common/p2p_messages.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 if (it != sockets_.end()) { | 269 if (it != sockets_.end()) { |
| 270 delete it->second; | 270 delete it->second; |
| 271 sockets_.erase(it); | 271 sockets_.erase(it); |
| 272 } else { | 272 } else { |
| 273 LOG(ERROR) << "Received P2PHostMsg_DestroySocket for invalid socket_id."; | 273 LOG(ERROR) << "Received P2PHostMsg_DestroySocket for invalid socket_id."; |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 | 276 |
| 277 void P2PSocketDispatcherHost::DoGetNetworkList() { | 277 void P2PSocketDispatcherHost::DoGetNetworkList() { |
| 278 net::NetworkInterfaceList list; | 278 net::NetworkInterfaceList list; |
| 279 net::GetNetworkList(&list, net::EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES); | 279 net::GetNetworkList(&list, net::EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES | |
| 280 net::INCLUDE_IPV6_TEMP_ADDRESS_IF_AVAILABLE); |
| 280 BrowserThread::PostTask( | 281 BrowserThread::PostTask( |
| 281 BrowserThread::IO, FROM_HERE, base::Bind( | 282 BrowserThread::IO, FROM_HERE, base::Bind( |
| 282 &P2PSocketDispatcherHost::SendNetworkList, this, list)); | 283 &P2PSocketDispatcherHost::SendNetworkList, this, list)); |
| 283 } | 284 } |
| 284 | 285 |
| 285 void P2PSocketDispatcherHost::SendNetworkList( | 286 void P2PSocketDispatcherHost::SendNetworkList( |
| 286 const net::NetworkInterfaceList& list) { | 287 const net::NetworkInterfaceList& list) { |
| 287 Send(new P2PMsg_NetworkListChanged(list)); | 288 Send(new P2PMsg_NetworkListChanged(list)); |
| 288 } | 289 } |
| 289 | 290 |
| 290 void P2PSocketDispatcherHost::OnAddressResolved( | 291 void P2PSocketDispatcherHost::OnAddressResolved( |
| 291 DnsRequest* request, | 292 DnsRequest* request, |
| 292 const net::IPAddressList& addresses) { | 293 const net::IPAddressList& addresses) { |
| 293 Send(new P2PMsg_GetHostAddressResult(request->request_id(), addresses)); | 294 Send(new P2PMsg_GetHostAddressResult(request->request_id(), addresses)); |
| 294 | 295 |
| 295 dns_requests_.erase(request); | 296 dns_requests_.erase(request); |
| 296 delete request; | 297 delete request; |
| 297 } | 298 } |
| 298 | 299 |
| 299 } // namespace content | 300 } // namespace content |
| OLD | NEW |