| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 if (result != net::OK) { | 88 if (result != net::OK) { |
| 89 LOG(ERROR) << "Failed to resolve address for " << host_name_ | 89 LOG(ERROR) << "Failed to resolve address for " << host_name_ |
| 90 << ", errorcode: " << result; | 90 << ", errorcode: " << result; |
| 91 done_callback_.Run(list); | 91 done_callback_.Run(list); |
| 92 return; | 92 return; |
| 93 } | 93 } |
| 94 | 94 |
| 95 DCHECK(!addresses_.empty()); | 95 DCHECK(!addresses_.empty()); |
| 96 for (net::AddressList::iterator iter = addresses_.begin(); | 96 for (net::AddressList::iterator iter = addresses_.begin(); |
| 97 iter != addresses_.end(); ++iter) { | 97 iter != addresses_.end(); ++iter) { |
| 98 list.push_back(iter->address()); | 98 list.push_back(iter->address_number()); |
| 99 } | 99 } |
| 100 done_callback_.Run(list); | 100 done_callback_.Run(list); |
| 101 } | 101 } |
| 102 | 102 |
| 103 int32_t request_id_; | 103 int32_t request_id_; |
| 104 net::AddressList addresses_; | 104 net::AddressList addresses_; |
| 105 | 105 |
| 106 std::string host_name_; | 106 std::string host_name_; |
| 107 net::SingleRequestHostResolver resolver_; | 107 net::SingleRequestHostResolver resolver_; |
| 108 | 108 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 375 |
| 376 if (socket->Connect(net::IPEndPoint(ip_address_number, kPublicPort)) != | 376 if (socket->Connect(net::IPEndPoint(ip_address_number, kPublicPort)) != |
| 377 net::OK) { | 377 net::OK) { |
| 378 return net::IPAddressNumber(); | 378 return net::IPAddressNumber(); |
| 379 } | 379 } |
| 380 | 380 |
| 381 net::IPEndPoint local_address; | 381 net::IPEndPoint local_address; |
| 382 if (socket->GetLocalAddress(&local_address) != net::OK) | 382 if (socket->GetLocalAddress(&local_address) != net::OK) |
| 383 return net::IPAddressNumber(); | 383 return net::IPAddressNumber(); |
| 384 | 384 |
| 385 return local_address.address(); | 385 return local_address.address_number(); |
| 386 } | 386 } |
| 387 | 387 |
| 388 void P2PSocketDispatcherHost::OnAddressResolved( | 388 void P2PSocketDispatcherHost::OnAddressResolved( |
| 389 DnsRequest* request, | 389 DnsRequest* request, |
| 390 const net::IPAddressList& addresses) { | 390 const net::IPAddressList& addresses) { |
| 391 Send(new P2PMsg_GetHostAddressResult(request->request_id(), addresses)); | 391 Send(new P2PMsg_GetHostAddressResult(request->request_id(), addresses)); |
| 392 | 392 |
| 393 dns_requests_.erase(request); | 393 dns_requests_.erase(request); |
| 394 delete request; | 394 delete request; |
| 395 } | 395 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 406 | 406 |
| 407 if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_) | 407 if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_) |
| 408 packet_callback_.Reset(); | 408 packet_callback_.Reset(); |
| 409 | 409 |
| 410 for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) | 410 for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) |
| 411 it->second->StopRtpDump(incoming, outgoing); | 411 it->second->StopRtpDump(incoming, outgoing); |
| 412 } | 412 } |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace content | 415 } // namespace content |
| OLD | NEW |