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/base/host_resolver_impl.h" | 5 #include "net/base/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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 DNS_HISTOGRAM("DNS.ResolveSpeculativeFail", duration); | 547 DNS_HISTOGRAM("DNS.ResolveSpeculativeFail", duration); |
548 } | 548 } |
549 UMA_HISTOGRAM_CUSTOM_ENUMERATION(kOSErrorsForGetAddrinfoHistogramName, | 549 UMA_HISTOGRAM_CUSTOM_ENUMERATION(kOSErrorsForGetAddrinfoHistogramName, |
550 std::abs(os_error_), | 550 std::abs(os_error_), |
551 GetAllGetAddrinfoOSErrors()); | 551 GetAllGetAddrinfoOSErrors()); |
552 } | 552 } |
553 DCHECK_LT(category, static_cast<int>(RESOLVE_MAX)); // Be sure it was set. | 553 DCHECK_LT(category, static_cast<int>(RESOLVE_MAX)); // Be sure it was set. |
554 | 554 |
555 UMA_HISTOGRAM_ENUMERATION("DNS.ResolveCategory", category, RESOLVE_MAX); | 555 UMA_HISTOGRAM_ENUMERATION("DNS.ResolveCategory", category, RESOLVE_MAX); |
556 | 556 |
557 static bool show_speculative_experiment_histograms = | 557 static const bool show_speculative_experiment_histograms = |
558 base::FieldTrialList::Find("DnsImpact") && | 558 base::FieldTrialList::TrialExists("DnsImpact"); |
559 !base::FieldTrialList::Find("DnsImpact")->group_name().empty(); | |
560 if (show_speculative_experiment_histograms) { | 559 if (show_speculative_experiment_histograms) { |
561 UMA_HISTOGRAM_ENUMERATION( | 560 UMA_HISTOGRAM_ENUMERATION( |
562 base::FieldTrial::MakeName("DNS.ResolveCategory", "DnsImpact"), | 561 base::FieldTrial::MakeName("DNS.ResolveCategory", "DnsImpact"), |
563 category, RESOLVE_MAX); | 562 category, RESOLVE_MAX); |
564 if (RESOLVE_SUCCESS == category) { | 563 if (RESOLVE_SUCCESS == category) { |
565 DNS_HISTOGRAM(base::FieldTrial::MakeName("DNS.ResolveSuccess", | 564 DNS_HISTOGRAM(base::FieldTrial::MakeName("DNS.ResolveSuccess", |
566 "DnsImpact"), duration); | 565 "DnsImpact"), duration); |
567 } | 566 } |
568 } | 567 } |
569 static bool show_parallelism_experiment_histograms = | 568 static const bool show_parallelism_experiment_histograms = |
570 base::FieldTrialList::Find("DnsParallelism") && | 569 base::FieldTrialList::TrialExists("DnsParallelism"); |
571 !base::FieldTrialList::Find("DnsParallelism")->group_name().empty(); | |
572 if (show_parallelism_experiment_histograms) { | 570 if (show_parallelism_experiment_histograms) { |
573 UMA_HISTOGRAM_ENUMERATION( | 571 UMA_HISTOGRAM_ENUMERATION( |
574 base::FieldTrial::MakeName("DNS.ResolveCategory", "DnsParallelism"), | 572 base::FieldTrial::MakeName("DNS.ResolveCategory", "DnsParallelism"), |
575 category, RESOLVE_MAX); | 573 category, RESOLVE_MAX); |
576 if (RESOLVE_SUCCESS == category) { | 574 if (RESOLVE_SUCCESS == category) { |
577 DNS_HISTOGRAM(base::FieldTrial::MakeName("DNS.ResolveSuccess", | 575 DNS_HISTOGRAM(base::FieldTrial::MakeName("DNS.ResolveSuccess", |
578 "DnsParallelism"), duration); | 576 "DnsParallelism"), duration); |
579 } | 577 } |
580 } | 578 } |
581 } | 579 } |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1424 additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; | 1422 additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; |
1425 } else { | 1423 } else { |
1426 additional_resolver_flags_ &= ~HOST_RESOLVER_LOOPBACK_ONLY; | 1424 additional_resolver_flags_ &= ~HOST_RESOLVER_LOOPBACK_ONLY; |
1427 } | 1425 } |
1428 #endif | 1426 #endif |
1429 AbortAllInProgressJobs(); | 1427 AbortAllInProgressJobs(); |
1430 // |this| may be deleted inside AbortAllInProgressJobs(). | 1428 // |this| may be deleted inside AbortAllInProgressJobs(). |
1431 } | 1429 } |
1432 | 1430 |
1433 } // namespace net | 1431 } // namespace net |
OLD | NEW |