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

Side by Side Diff: chrome/browser/net/dns_host_info.cc

Issue 515033: Cleanup histogram classes mixing SetFlags into FactoryGet arguments... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 12 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/net/dns_host_info.h" 5 #include "chrome/browser/net/dns_host_info.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 state_ = old_prequeue_state_; 97 state_ = old_prequeue_state_;
98 DLogResultsStats("DNS Prefetch reset to prequeue"); 98 DLogResultsStats("DNS Prefetch reset to prequeue");
99 static const TimeDelta kBoundary = TimeDelta::FromSeconds(2); 99 static const TimeDelta kBoundary = TimeDelta::FromSeconds(2);
100 if (queue_duration_ > kBoundary) { 100 if (queue_duration_ > kBoundary) {
101 UMA_HISTOGRAM_MEDIUM_TIMES("DNS.QueueRecycledDeltaOver2", 101 UMA_HISTOGRAM_MEDIUM_TIMES("DNS.QueueRecycledDeltaOver2",
102 queue_duration_ - kBoundary); 102 queue_duration_ - kBoundary);
103 return; 103 return;
104 } 104 }
105 // Make a custom linear histogram for the region from 0 to boundary. 105 // Make a custom linear histogram for the region from 0 to boundary.
106 const size_t kBucketCount = 52; 106 const size_t kBucketCount = 52;
107 static scoped_refptr<Histogram> histogram = 107 static scoped_refptr<Histogram> histogram = LinearHistogram::FactoryGet(
108 LinearHistogram::LinearHistogramFactoryGet("DNS.QueueRecycledUnder2", 108 "DNS.QueueRecycledUnder2", TimeDelta(), kBoundary, kBucketCount,
109 TimeDelta(), kBoundary, kBucketCount); 109 Histogram::kUmaTargetedHistogramFlag);
110 histogram->SetFlags(kUmaTargetedHistogramFlag);
111 histogram->AddTime(queue_duration_); 110 histogram->AddTime(queue_duration_);
112 } 111 }
113 112
114 void DnsHostInfo::SetPendingDeleteState() { 113 void DnsHostInfo::SetPendingDeleteState() {
115 DCHECK(ASSIGNED == state_ || ASSIGNED_BUT_MARKED == state_); 114 DCHECK(ASSIGNED == state_ || ASSIGNED_BUT_MARKED == state_);
116 state_ = ASSIGNED_BUT_MARKED; 115 state_ = ASSIGNED_BUT_MARKED;
117 } 116 }
118 117
119 void DnsHostInfo::SetFoundState() { 118 void DnsHostInfo::SetFoundState() {
120 DCHECK(ASSIGNED == state_); 119 DCHECK(ASSIGNED == state_);
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 419
421 case LEARNED_REFERAL_MOTIVATED: 420 case LEARNED_REFERAL_MOTIVATED:
422 return RemoveJs(referring_hostname_); 421 return RemoveJs(referring_hostname_);
423 422
424 default: 423 default:
425 return ""; 424 return "";
426 } 425 }
427 } 426 }
428 427
429 } // namespace chrome_browser_net 428 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_service.cc ('k') | chrome/browser/net/websocket_experiment/websocket_experiment_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698