Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: net/dns/host_resolver_impl.cc

Issue 623213004: replace OVERRIDE and FINAL with override and final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo unwanted change in comment Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/dns/host_resolver_impl.h ('k') | net/dns/host_resolver_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/dns/host_resolver_impl.h" 5 #include "net/dns/host_resolver_impl.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <Winsock2.h> 8 #include <Winsock2.h>
9 #elif defined(OS_POSIX) 9 #elif defined(OS_POSIX)
10 #include <netdb.h> 10 #include <netdb.h>
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 } 1417 }
1418 } 1418 }
1419 1419
1420 AddressList MakeAddressListForRequest(const AddressList& list) const { 1420 AddressList MakeAddressListForRequest(const AddressList& list) const {
1421 if (requests_.empty()) 1421 if (requests_.empty())
1422 return list; 1422 return list;
1423 return AddressList::CopyWithPort(list, requests_.front()->info().port()); 1423 return AddressList::CopyWithPort(list, requests_.front()->info().port());
1424 } 1424 }
1425 1425
1426 // PriorityDispatch::Job: 1426 // PriorityDispatch::Job:
1427 virtual void Start() OVERRIDE { 1427 virtual void Start() override {
1428 DCHECK_LE(num_occupied_job_slots_, 1u); 1428 DCHECK_LE(num_occupied_job_slots_, 1u);
1429 1429
1430 handle_.Reset(); 1430 handle_.Reset();
1431 ++num_occupied_job_slots_; 1431 ++num_occupied_job_slots_;
1432 1432
1433 if (num_occupied_job_slots_ == 2) { 1433 if (num_occupied_job_slots_ == 2) {
1434 StartSecondDnsTransaction(); 1434 StartSecondDnsTransaction();
1435 return; 1435 return;
1436 } 1436 }
1437 1437
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 CompleteRequestsWithError(net_error); 1583 CompleteRequestsWithError(net_error);
1584 } 1584 }
1585 } 1585 }
1586 1586
1587 1587
1588 // HostResolverImpl::DnsTask::Delegate implementation: 1588 // HostResolverImpl::DnsTask::Delegate implementation:
1589 1589
1590 virtual void OnDnsTaskComplete(base::TimeTicks start_time, 1590 virtual void OnDnsTaskComplete(base::TimeTicks start_time,
1591 int net_error, 1591 int net_error,
1592 const AddressList& addr_list, 1592 const AddressList& addr_list,
1593 base::TimeDelta ttl) OVERRIDE { 1593 base::TimeDelta ttl) override {
1594 DCHECK(is_dns_running()); 1594 DCHECK(is_dns_running());
1595 1595
1596 base::TimeDelta duration = base::TimeTicks::Now() - start_time; 1596 base::TimeDelta duration = base::TimeTicks::Now() - start_time;
1597 if (net_error != OK) { 1597 if (net_error != OK) {
1598 OnDnsTaskFailure(dns_task_->AsWeakPtr(), duration, net_error); 1598 OnDnsTaskFailure(dns_task_->AsWeakPtr(), duration, net_error);
1599 return; 1599 return;
1600 } 1600 }
1601 DNS_HISTOGRAM("AsyncDNS.ResolveSuccess", duration); 1601 DNS_HISTOGRAM("AsyncDNS.ResolveSuccess", duration);
1602 // Log DNS lookups based on |address_family|. 1602 // Log DNS lookups based on |address_family|.
1603 switch(key_.address_family) { 1603 switch(key_.address_family) {
(...skipping 14 matching lines...) Expand all
1618 resolver_->OnDnsTaskResolve(OK); 1618 resolver_->OnDnsTaskResolve(OK);
1619 1619
1620 base::TimeDelta bounded_ttl = 1620 base::TimeDelta bounded_ttl =
1621 std::max(ttl, base::TimeDelta::FromSeconds(kMinimumTTLSeconds)); 1621 std::max(ttl, base::TimeDelta::FromSeconds(kMinimumTTLSeconds));
1622 1622
1623 CompleteRequests( 1623 CompleteRequests(
1624 HostCache::Entry(net_error, MakeAddressListForRequest(addr_list), ttl), 1624 HostCache::Entry(net_error, MakeAddressListForRequest(addr_list), ttl),
1625 bounded_ttl); 1625 bounded_ttl);
1626 } 1626 }
1627 1627
1628 virtual void OnFirstDnsTransactionComplete() OVERRIDE { 1628 virtual void OnFirstDnsTransactionComplete() override {
1629 DCHECK(dns_task_->needs_two_transactions()); 1629 DCHECK(dns_task_->needs_two_transactions());
1630 DCHECK_EQ(dns_task_->needs_another_transaction(), is_queued()); 1630 DCHECK_EQ(dns_task_->needs_another_transaction(), is_queued());
1631 // No longer need to occupy two dispatcher slots. 1631 // No longer need to occupy two dispatcher slots.
1632 ReduceToOneJobSlot(); 1632 ReduceToOneJobSlot();
1633 1633
1634 // We already have a job slot at the dispatcher, so if the second 1634 // We already have a job slot at the dispatcher, so if the second
1635 // transaction hasn't started, reuse it now instead of waiting in the queue 1635 // transaction hasn't started, reuse it now instead of waiting in the queue
1636 // for the second slot. 1636 // for the second slot.
1637 if (dns_task_->needs_another_transaction()) 1637 if (dns_task_->needs_another_transaction())
1638 dns_task_->StartSecondTransaction(); 1638 dns_task_->StartSecondTransaction();
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
2359 dns_client_->SetConfig(dns_config); 2359 dns_client_->SetConfig(dns_config);
2360 num_dns_failures_ = 0; 2360 num_dns_failures_ = 0;
2361 if (dns_client_->GetConfig()) 2361 if (dns_client_->GetConfig())
2362 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true); 2362 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true);
2363 } 2363 }
2364 2364
2365 AbortDnsTasks(); 2365 AbortDnsTasks();
2366 } 2366 }
2367 2367
2368 } // namespace net 2368 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/host_resolver_impl.h ('k') | net/dns/host_resolver_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698