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

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

Issue 6883102: Add one-time randomization support for FieldTrial, and the ability to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responding to review comments. Fix initialization in browser_main. Created 9 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 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>
11 #endif 11 #endif
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 DNS_HISTOGRAM("DNS.ResolveSpeculativeFail", duration); 559 DNS_HISTOGRAM("DNS.ResolveSpeculativeFail", duration);
560 } 560 }
561 UMA_HISTOGRAM_CUSTOM_ENUMERATION(kOSErrorsForGetAddrinfoHistogramName, 561 UMA_HISTOGRAM_CUSTOM_ENUMERATION(kOSErrorsForGetAddrinfoHistogramName,
562 std::abs(os_error_), 562 std::abs(os_error_),
563 GetAllGetAddrinfoOSErrors()); 563 GetAllGetAddrinfoOSErrors());
564 } 564 }
565 DCHECK_LT(category, static_cast<int>(RESOLVE_MAX)); // Be sure it was set. 565 DCHECK_LT(category, static_cast<int>(RESOLVE_MAX)); // Be sure it was set.
566 566
567 UMA_HISTOGRAM_ENUMERATION("DNS.ResolveCategory", category, RESOLVE_MAX); 567 UMA_HISTOGRAM_ENUMERATION("DNS.ResolveCategory", category, RESOLVE_MAX);
568 568
569 static bool show_speculative_experiment_histograms = 569 static const bool show_speculative_experiment_histograms =
570 base::FieldTrialList::Find("DnsImpact") && 570 base::FieldTrialList::TrialExists("DnsImpact");
571 !base::FieldTrialList::Find("DnsImpact")->group_name().empty();
572 if (show_speculative_experiment_histograms) { 571 if (show_speculative_experiment_histograms) {
573 UMA_HISTOGRAM_ENUMERATION( 572 UMA_HISTOGRAM_ENUMERATION(
574 base::FieldTrial::MakeName("DNS.ResolveCategory", "DnsImpact"), 573 base::FieldTrial::MakeName("DNS.ResolveCategory", "DnsImpact"),
575 category, RESOLVE_MAX); 574 category, RESOLVE_MAX);
576 if (RESOLVE_SUCCESS == category) { 575 if (RESOLVE_SUCCESS == category) {
577 DNS_HISTOGRAM(base::FieldTrial::MakeName("DNS.ResolveSuccess", 576 DNS_HISTOGRAM(base::FieldTrial::MakeName("DNS.ResolveSuccess",
578 "DnsImpact"), duration); 577 "DnsImpact"), duration);
579 } 578 }
580 } 579 }
581 static bool show_parallelism_experiment_histograms = 580 static const bool show_parallelism_experiment_histograms =
582 base::FieldTrialList::Find("DnsParallelism") && 581 base::FieldTrialList::TrialExists("DnsParallelism");
583 !base::FieldTrialList::Find("DnsParallelism")->group_name().empty();
584 if (show_parallelism_experiment_histograms) { 582 if (show_parallelism_experiment_histograms) {
585 UMA_HISTOGRAM_ENUMERATION( 583 UMA_HISTOGRAM_ENUMERATION(
586 base::FieldTrial::MakeName("DNS.ResolveCategory", "DnsParallelism"), 584 base::FieldTrial::MakeName("DNS.ResolveCategory", "DnsParallelism"),
587 category, RESOLVE_MAX); 585 category, RESOLVE_MAX);
588 if (RESOLVE_SUCCESS == category) { 586 if (RESOLVE_SUCCESS == category) {
589 DNS_HISTOGRAM(base::FieldTrial::MakeName("DNS.ResolveSuccess", 587 DNS_HISTOGRAM(base::FieldTrial::MakeName("DNS.ResolveSuccess",
590 "DnsParallelism"), duration); 588 "DnsParallelism"), duration);
591 } 589 }
592 } 590 }
593 } 591 }
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; 1462 additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY;
1465 } else { 1463 } else {
1466 additional_resolver_flags_ &= ~HOST_RESOLVER_LOOPBACK_ONLY; 1464 additional_resolver_flags_ &= ~HOST_RESOLVER_LOOPBACK_ONLY;
1467 } 1465 }
1468 #endif 1466 #endif
1469 AbortAllInProgressJobs(); 1467 AbortAllInProgressJobs();
1470 // |this| may be deleted inside AbortAllInProgressJobs(). 1468 // |this| may be deleted inside AbortAllInProgressJobs().
1471 } 1469 }
1472 1470
1473 } // namespace net 1471 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698