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

Side by Side Diff: net/dns/dns_session.cc

Issue 17451016: [UMA] Remove redundant bucket_count variable from base::Histogram. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename variables to be clearer Created 7 years, 5 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 | « net/disk_cache/stats_histogram.cc ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/dns/dns_session.h" 5 #include "net/dns/dns_session.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 scoped_ptr<base::SampleVector> rtt_histogram; 57 scoped_ptr<base::SampleVector> rtt_histogram;
58 58
59 DISALLOW_COPY_AND_ASSIGN(ServerStats); 59 DISALLOW_COPY_AND_ASSIGN(ServerStats);
60 }; 60 };
61 61
62 // static 62 // static
63 base::LazyInstance<DnsSession::RttBuckets>::Leaky DnsSession::rtt_buckets_ = 63 base::LazyInstance<DnsSession::RttBuckets>::Leaky DnsSession::rtt_buckets_ =
64 LAZY_INSTANCE_INITIALIZER; 64 LAZY_INSTANCE_INITIALIZER;
65 65
66 DnsSession::RttBuckets::RttBuckets() : base::BucketRanges(kRTTBucketCount + 1) { 66 DnsSession::RttBuckets::RttBuckets() : base::BucketRanges(kRTTBucketCount + 1) {
67 base::Histogram::InitializeBucketRanges(1, 5000, kRTTBucketCount, this); 67 base::Histogram::InitializeBucketRanges(1, 5000, this);
68 } 68 }
69 69
70 DnsSession::SocketLease::SocketLease(scoped_refptr<DnsSession> session, 70 DnsSession::SocketLease::SocketLease(scoped_refptr<DnsSession> session,
71 unsigned server_index, 71 unsigned server_index,
72 scoped_ptr<DatagramClientSocket> socket) 72 scoped_ptr<DatagramClientSocket> socket)
73 : session_(session), server_index_(server_index), socket_(socket.Pass()) {} 73 : session_(session), server_index_(server_index), socket_(socket.Pass()) {}
74 74
75 DnsSession::SocketLease::~SocketLease() { 75 DnsSession::SocketLease::~SocketLease() {
76 session_->FreeSocket(server_index_, socket_.Pass()); 76 session_->FreeSocket(server_index_, socket_.Pass());
77 } 77 }
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 timeout = std::max(timeout, base::TimeDelta::FromMilliseconds(kMinTimeoutMs)); 295 timeout = std::max(timeout, base::TimeDelta::FromMilliseconds(kMinTimeoutMs));
296 296
297 // The timeout still doubles every full round. 297 // The timeout still doubles every full round.
298 unsigned num_backoffs = attempt / config_.nameservers.size(); 298 unsigned num_backoffs = attempt / config_.nameservers.size();
299 299
300 return std::min(timeout * (1 << num_backoffs), 300 return std::min(timeout * (1 << num_backoffs),
301 base::TimeDelta::FromMilliseconds(kMaxTimeoutMs)); 301 base::TimeDelta::FromMilliseconds(kMaxTimeoutMs));
302 } 302 }
303 303
304 } // namespace net 304 } // namespace net
OLDNEW
« no previous file with comments | « net/disk_cache/stats_histogram.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698