OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/dns/async_host_resolver.h" | 5 #include "net/dns/async_host_resolver.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 HostCache::Key key( | 390 HostCache::Key key( |
391 info.hostname(), info.address_family(), info.host_resolver_flags()); | 391 info.hostname(), info.address_family(), info.host_resolver_flags()); |
392 cache_->Set(key, result, addr_list, base::TimeTicks::Now()); | 392 cache_->Set(key, result, addr_list, base::TimeTicks::Now()); |
393 } | 393 } |
394 | 394 |
395 // Cleanup requests. | 395 // Cleanup requests. |
396 STLDeleteElements(&requests); | 396 STLDeleteElements(&requests); |
397 requestlist_map_.erase(rit); | 397 requestlist_map_.erase(rit); |
398 | 398 |
399 // Cleanup |dns_req| and start a new one if there are pending requests. | 399 // Cleanup |dns_req| and start a new one if there are pending requests. |
| 400 dns_requests_.remove(dns_req); |
400 delete dns_req; | 401 delete dns_req; |
401 dns_requests_.remove(dns_req); | |
402 ProcessPending(); | 402 ProcessPending(); |
403 } | 403 } |
404 | 404 |
405 AsyncHostResolver::Request* AsyncHostResolver::CreateNewRequest( | 405 AsyncHostResolver::Request* AsyncHostResolver::CreateNewRequest( |
406 const RequestInfo& info, | 406 const RequestInfo& info, |
407 const CompletionCallback& callback, | 407 const CompletionCallback& callback, |
408 AddressList* addresses, | 408 AddressList* addresses, |
409 const BoundNetLog& source_net_log) { | 409 const BoundNetLog& source_net_log) { |
410 BoundNetLog request_net_log = BoundNetLog::Make(net_log_, | 410 BoundNetLog request_net_log = BoundNetLog::Make(net_log_, |
411 NetLog::SOURCE_ASYNC_HOST_RESOLVER_REQUEST); | 411 NetLog::SOURCE_ASYNC_HOST_RESOLVER_REQUEST); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 it = requests.erase(it); | 506 it = requests.erase(it); |
507 } else { | 507 } else { |
508 ++it; | 508 ++it; |
509 } | 509 } |
510 } | 510 } |
511 } | 511 } |
512 StartNewDnsRequestFor(request); | 512 StartNewDnsRequestFor(request); |
513 } | 513 } |
514 | 514 |
515 } // namespace net | 515 } // namespace net |
OLD | NEW |