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

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: Merge to head. 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
« no previous file with comments | « content/renderer/renderer_main.cc ('k') | net/http/http_cache_transaction.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) 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
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
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
OLDNEW
« no previous file with comments | « content/renderer/renderer_main.cc ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698