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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 DNS_HISTOGRAM("DNS.ResolveSpeculativeFail", duration); | 558 DNS_HISTOGRAM("DNS.ResolveSpeculativeFail", duration); |
559 } | 559 } |
560 UMA_HISTOGRAM_CUSTOM_ENUMERATION(kOSErrorsForGetAddrinfoHistogramName, | 560 UMA_HISTOGRAM_CUSTOM_ENUMERATION(kOSErrorsForGetAddrinfoHistogramName, |
561 std::abs(os_error_), | 561 std::abs(os_error_), |
562 GetAllGetAddrinfoOSErrors()); | 562 GetAllGetAddrinfoOSErrors()); |
563 } | 563 } |
564 DCHECK_LT(category, static_cast<int>(RESOLVE_MAX)); // Be sure it was set. | 564 DCHECK_LT(category, static_cast<int>(RESOLVE_MAX)); // Be sure it was set. |
565 | 565 |
566 UMA_HISTOGRAM_ENUMERATION("DNS.ResolveCategory", category, RESOLVE_MAX); | 566 UMA_HISTOGRAM_ENUMERATION("DNS.ResolveCategory", category, RESOLVE_MAX); |
567 | 567 |
568 static bool show_speculative_experiment_histograms = | 568 static const bool show_speculative_experiment_histograms = |
569 base::FieldTrialList::Find("DnsImpact") && | 569 base::FieldTrialList::TrialExists("DnsImpact"); |
570 !base::FieldTrialList::Find("DnsImpact")->group_name().empty(); | |
571 if (show_speculative_experiment_histograms) { | 570 if (show_speculative_experiment_histograms) { |
572 UMA_HISTOGRAM_ENUMERATION( | 571 UMA_HISTOGRAM_ENUMERATION( |
573 base::FieldTrial::MakeName("DNS.ResolveCategory", "DnsImpact"), | 572 base::FieldTrial::MakeName("DNS.ResolveCategory", "DnsImpact"), |
574 category, RESOLVE_MAX); | 573 category, RESOLVE_MAX); |
575 if (RESOLVE_SUCCESS == category) { | 574 if (RESOLVE_SUCCESS == category) { |
576 DNS_HISTOGRAM(base::FieldTrial::MakeName("DNS.ResolveSuccess", | 575 DNS_HISTOGRAM(base::FieldTrial::MakeName("DNS.ResolveSuccess", |
577 "DnsImpact"), duration); | 576 "DnsImpact"), duration); |
578 } | 577 } |
579 } | 578 } |
580 static bool show_parallelism_experiment_histograms = | 579 static const bool show_parallelism_experiment_histograms = |
581 base::FieldTrialList::Find("DnsParallelism") && | 580 base::FieldTrialList::TrialExists("DnsParallelism"); |
582 !base::FieldTrialList::Find("DnsParallelism")->group_name().empty(); | |
583 if (show_parallelism_experiment_histograms) { | 581 if (show_parallelism_experiment_histograms) { |
584 UMA_HISTOGRAM_ENUMERATION( | 582 UMA_HISTOGRAM_ENUMERATION( |
585 base::FieldTrial::MakeName("DNS.ResolveCategory", "DnsParallelism"), | 583 base::FieldTrial::MakeName("DNS.ResolveCategory", "DnsParallelism"), |
586 category, RESOLVE_MAX); | 584 category, RESOLVE_MAX); |
587 if (RESOLVE_SUCCESS == category) { | 585 if (RESOLVE_SUCCESS == category) { |
588 DNS_HISTOGRAM(base::FieldTrial::MakeName("DNS.ResolveSuccess", | 586 DNS_HISTOGRAM(base::FieldTrial::MakeName("DNS.ResolveSuccess", |
589 "DnsParallelism"), duration); | 587 "DnsParallelism"), duration); |
590 } | 588 } |
591 } | 589 } |
592 } | 590 } |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1463 additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; | 1461 additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; |
1464 } else { | 1462 } else { |
1465 additional_resolver_flags_ &= ~HOST_RESOLVER_LOOPBACK_ONLY; | 1463 additional_resolver_flags_ &= ~HOST_RESOLVER_LOOPBACK_ONLY; |
1466 } | 1464 } |
1467 #endif | 1465 #endif |
1468 AbortAllInProgressJobs(); | 1466 AbortAllInProgressJobs(); |
1469 // |this| may be deleted inside AbortAllInProgressJobs(). | 1467 // |this| may be deleted inside AbortAllInProgressJobs(). |
1470 } | 1468 } |
1471 | 1469 |
1472 } // namespace net | 1470 } // namespace net |
OLD | NEW |