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 "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 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 const int error, | 873 const int error, |
874 const int os_error) const { | 874 const int os_error) const { |
875 DCHECK(network_task_runner_->BelongsToCurrentThread()); | 875 DCHECK(network_task_runner_->BelongsToCurrentThread()); |
876 enum Category { // Used in UMA_HISTOGRAM_ENUMERATION. | 876 enum Category { // Used in UMA_HISTOGRAM_ENUMERATION. |
877 RESOLVE_SUCCESS, | 877 RESOLVE_SUCCESS, |
878 RESOLVE_FAIL, | 878 RESOLVE_FAIL, |
879 RESOLVE_SPECULATIVE_SUCCESS, | 879 RESOLVE_SPECULATIVE_SUCCESS, |
880 RESOLVE_SPECULATIVE_FAIL, | 880 RESOLVE_SPECULATIVE_FAIL, |
881 RESOLVE_MAX, // Bounding value. | 881 RESOLVE_MAX, // Bounding value. |
882 }; | 882 }; |
883 int category = RESOLVE_MAX; // Illegal value for later DCHECK only. | 883 Category category = RESOLVE_MAX; // Illegal value for later DCHECK only. |
884 | 884 |
885 base::TimeDelta duration = base::TimeTicks::Now() - start_time; | 885 base::TimeDelta duration = base::TimeTicks::Now() - start_time; |
886 if (error == OK) { | 886 if (error == OK) { |
887 if (had_non_speculative_request_) { | 887 if (had_non_speculative_request_) { |
888 category = RESOLVE_SUCCESS; | 888 category = RESOLVE_SUCCESS; |
889 DNS_HISTOGRAM("DNS.ResolveSuccess", duration); | 889 DNS_HISTOGRAM("DNS.ResolveSuccess", duration); |
890 } else { | 890 } else { |
891 category = RESOLVE_SPECULATIVE_SUCCESS; | 891 category = RESOLVE_SPECULATIVE_SUCCESS; |
892 DNS_HISTOGRAM("DNS.ResolveSpeculativeSuccess", duration); | 892 DNS_HISTOGRAM("DNS.ResolveSpeculativeSuccess", duration); |
893 } | 893 } |
(...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2700 if (job_) | 2700 if (job_) |
2701 job_->CancelRequest(this); | 2701 job_->CancelRequest(this); |
2702 } | 2702 } |
2703 | 2703 |
2704 void HostResolverImpl::RequestImpl::ChangeRequestPriority( | 2704 void HostResolverImpl::RequestImpl::ChangeRequestPriority( |
2705 RequestPriority priority) { | 2705 RequestPriority priority) { |
2706 job_->ChangeRequestPriority(this, priority); | 2706 job_->ChangeRequestPriority(this, priority); |
2707 } | 2707 } |
2708 | 2708 |
2709 } // namespace net | 2709 } // namespace net |
OLD | NEW |