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

Unified Diff: net/dns/dns_session.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/dns/dns_session.h ('k') | net/dns/dns_transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_session.cc
diff --git a/net/dns/dns_session.cc b/net/dns/dns_session.cc
index d6992f1c72aacf1f17103478093ebaa77e68f256..0b6292e8e36c67f4a53adb7c34572c8111cc8ebe 100644
--- a/net/dns/dns_session.cc
+++ b/net/dns/dns_session.cc
@@ -39,7 +39,9 @@ struct DnsSession::ServerStats {
: 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);
+ rtt_histogram->Accumulate(
+ static_cast<base::HistogramBase::Sample>(rtt_estimate.InMilliseconds()),
+ 2);
}
// Count of consecutive failures after last success.
@@ -100,7 +102,9 @@ DnsSession::~DnsSession() {
RecordServerStats();
}
-int DnsSession::NextQueryId() const { return rand_callback_.Run(); }
+uint16 DnsSession::NextQueryId() const {
+ return static_cast<uint16>(rand_callback_.Run());
+}
unsigned DnsSession::NextFirstServerIndex() {
unsigned index = NextGoodServerIndex(server_index_);
@@ -182,8 +186,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(
+ static_cast<base::HistogramBase::Sample>(rtt.InMilliseconds()), 1);
}
void DnsSession::RecordLostPacket(unsigned server_index, int attempt) {
« no previous file with comments | « net/dns/dns_session.h ('k') | net/dns/dns_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698