| 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/profiler/scoped_tracker.h" | |
| 9 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 10 #include "content/browser/renderer_host/p2p/socket_host.h" | 9 #include "content/browser/renderer_host/p2p/socket_host.h" |
| 11 #include "content/common/p2p_messages.h" | 10 #include "content/common/p2p_messages.h" |
| 12 #include "content/public/browser/resource_context.h" | 11 #include "content/public/browser/resource_context.h" |
| 13 #include "net/base/address_list.h" | 12 #include "net/base/address_list.h" |
| 14 #include "net/base/completion_callback.h" | 13 #include "net/base/completion_callback.h" |
| 15 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 16 #include "net/base/sys_addrinfo.h" | 15 #include "net/base/sys_addrinfo.h" |
| 17 #include "net/dns/single_request_host_resolver.h" | 16 #include "net/dns/single_request_host_resolver.h" |
| 18 #include "net/log/net_log.h" | 17 #include "net/log/net_log.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 base::Unretained(this)), | 61 base::Unretained(this)), |
| 63 net::BoundNetLog()); | 62 net::BoundNetLog()); |
| 64 if (result != net::ERR_IO_PENDING) | 63 if (result != net::ERR_IO_PENDING) |
| 65 OnDone(result); | 64 OnDone(result); |
| 66 } | 65 } |
| 67 | 66 |
| 68 int32 request_id() { return request_id_; } | 67 int32 request_id() { return request_id_; } |
| 69 | 68 |
| 70 private: | 69 private: |
| 71 void OnDone(int result) { | 70 void OnDone(int result) { |
| 72 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436634 is fixed. | |
| 73 tracked_objects::ScopedTracker tracking_profile( | |
| 74 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
| 75 "436634 P2PSocketDispatcherHost::DnsRequest::OnDone")); | |
| 76 | |
| 77 net::IPAddressList list; | 71 net::IPAddressList list; |
| 78 if (result != net::OK) { | 72 if (result != net::OK) { |
| 79 LOG(ERROR) << "Failed to resolve address for " << host_name_ | 73 LOG(ERROR) << "Failed to resolve address for " << host_name_ |
| 80 << ", errorcode: " << result; | 74 << ", errorcode: " << result; |
| 81 done_callback_.Run(list); | 75 done_callback_.Run(list); |
| 82 return; | 76 return; |
| 83 } | 77 } |
| 84 | 78 |
| 85 DCHECK(!addresses_.empty()); | 79 DCHECK(!addresses_.empty()); |
| 86 for (net::AddressList::iterator iter = addresses_.begin(); | 80 for (net::AddressList::iterator iter = addresses_.begin(); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 351 |
| 358 if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_) | 352 if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_) |
| 359 packet_callback_.Reset(); | 353 packet_callback_.Reset(); |
| 360 | 354 |
| 361 for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) | 355 for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) |
| 362 it->second->StopRtpDump(incoming, outgoing); | 356 it->second->StopRtpDump(incoming, outgoing); |
| 363 } | 357 } |
| 364 } | 358 } |
| 365 | 359 |
| 366 } // namespace content | 360 } // namespace content |
| OLD | NEW |