Index: net/dns/dns_session.cc |
diff --git a/net/dns/dns_session.cc b/net/dns/dns_session.cc |
index ea8b6a142746bcc391b60e7ba20952e45e1636f6..52c384d127a1ba18fa689837c357a6e6db6173ef 100644 |
--- a/net/dns/dns_session.cc |
+++ b/net/dns/dns_session.cc |
@@ -36,7 +36,7 @@ const unsigned kRTOPercentile = 99; |
// Runtime statistics of DNS server. |
struct DnsSession::ServerStats { |
ServerStats(base::TimeDelta rtt_estimate_param, RttBuckets* buckets) |
- : last_failure_count(0), rtt_estimate(rtt_estimate_param) { |
+ : last_failure_count(0), rtt_estimate(rtt_estimate_param) { |
rtt_histogram.reset(new base::SampleVector(buckets)); |
// Seed histogram with 2 samples at |rtt_estimate| timeout. |
rtt_histogram->Accumulate(rtt_estimate.InMilliseconds(), 2); |
@@ -72,7 +72,8 @@ DnsSession::RttBuckets::RttBuckets() : base::BucketRanges(kRTTBucketCount + 1) { |
DnsSession::SocketLease::SocketLease(scoped_refptr<DnsSession> session, |
unsigned server_index, |
scoped_ptr<DatagramClientSocket> socket) |
- : session_(session), server_index_(server_index), socket_(socket.Pass()) {} |
+ : session_(session), server_index_(server_index), socket_(socket.Pass()) { |
+} |
DnsSession::SocketLease::~SocketLease() { |
session_->FreeSocket(server_index_, socket_.Pass()); |
@@ -91,8 +92,8 @@ DnsSession::DnsSession(const DnsConfig& config, |
UMA_HISTOGRAM_CUSTOM_COUNTS( |
"AsyncDNS.ServerCount", config_.nameservers.size(), 0, 10, 10); |
for (size_t i = 0; i < config_.nameservers.size(); ++i) { |
- server_stats_.push_back(new ServerStats(config_.timeout, |
- rtt_buckets_.Pointer())); |
+ server_stats_.push_back( |
+ new ServerStats(config_.timeout, rtt_buckets_.Pointer())); |
} |
} |
@@ -100,7 +101,9 @@ DnsSession::~DnsSession() { |
RecordServerStats(); |
} |
-int DnsSession::NextQueryId() const { return rand_callback_.Run(); } |
+int DnsSession::NextQueryId() const { |
+ return rand_callback_.Run(); |
+} |
unsigned DnsSession::NextFirstServerIndex() { |
unsigned index = NextGoodServerIndex(server_index_); |
@@ -147,10 +150,10 @@ void DnsSession::RecordServerFailure(unsigned server_index) { |
void DnsSession::RecordServerSuccess(unsigned server_index) { |
if (server_stats_[server_index]->last_success.is_null()) { |
UMA_HISTOGRAM_COUNTS_100("AsyncDNS.ServerFailuresAfterNetworkChange", |
- server_stats_[server_index]->last_failure_count); |
+ server_stats_[server_index]->last_failure_count); |
} else { |
UMA_HISTOGRAM_COUNTS_100("AsyncDNS.ServerFailuresBeforeSuccess", |
- server_stats_[server_index]->last_failure_count); |
+ server_stats_[server_index]->last_failure_count); |
} |
server_stats_[server_index]->last_failure_count = 0; |
server_stats_[server_index]->last_failure = base::Time(); |
@@ -182,8 +185,8 @@ void DnsSession::RecordRTT(unsigned server_index, base::TimeDelta rtt) { |
deviation += (abs_error - deviation) / 4; // * delta |
// Histogram-based method. |
- server_stats_[server_index]->rtt_histogram |
- ->Accumulate(rtt.InMilliseconds(), 1); |
+ server_stats_[server_index]->rtt_histogram->Accumulate(rtt.InMilliseconds(), |
+ 1); |
} |
void DnsSession::RecordLostPacket(unsigned server_index, int attempt) { |
@@ -209,7 +212,6 @@ void DnsSession::RecordServerStats() { |
} |
} |
- |
base::TimeDelta DnsSession::NextTimeout(unsigned server_index, int attempt) { |
// Respect config timeout if it exceeds |kMaxTimeoutMs|. |
if (config_.timeout.InMilliseconds() >= kMaxTimeoutMs) |
@@ -219,7 +221,8 @@ base::TimeDelta DnsSession::NextTimeout(unsigned server_index, int attempt) { |
// Allocate a socket, already connected to the server address. |
scoped_ptr<DnsSession::SocketLease> DnsSession::AllocateSocket( |
- unsigned server_index, const NetLog::Source& source) { |
+ unsigned server_index, |
+ const NetLog::Source& source) { |
scoped_ptr<DatagramClientSocket> socket; |
socket = socket_pool_->AllocateSocket(server_index); |
@@ -234,7 +237,8 @@ scoped_ptr<DnsSession::SocketLease> DnsSession::AllocateSocket( |
} |
scoped_ptr<StreamSocket> DnsSession::CreateTCPSocket( |
- unsigned server_index, const NetLog::Source& source) { |
+ unsigned server_index, |
+ const NetLog::Source& source) { |
return socket_pool_->CreateTCPSocket(server_index, source); |
} |