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

Unified Diff: net/http/http_cache_transaction.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/http/disk_cache_based_quic_server_info.cc ('k') | net/http/http_network_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_transaction.cc
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 896db76e1586ab01e41e74120ba83da8b6017633..23fb2d19b5e77b8691bc020d826f29046b60d11a 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -2883,15 +2883,16 @@ void HttpCache::Transaction::RecordHistograms() {
}
TimeDelta before_send_time = send_request_since_ - first_cache_access_since_;
- int before_send_percent =
- total_time.ToInternalValue() == 0 ? 0
- : before_send_time * 100 / total_time;
- DCHECK_LE(0, before_send_percent);
- DCHECK_GE(100, before_send_percent);
+ int64 before_send_percent = (total_time.ToInternalValue() == 0) ?
+ 0 : before_send_time * 100 / total_time;
+ DCHECK_GE(before_send_percent, 0);
+ DCHECK_LE(before_send_percent, 100);
+ base::HistogramBase::Sample before_send_sample =
+ static_cast<base::HistogramBase::Sample>(before_send_percent);
UMA_HISTOGRAM_TIMES("HttpCache.AccessToDone.SentRequest", total_time);
UMA_HISTOGRAM_TIMES("HttpCache.BeforeSend", before_send_time);
- UMA_HISTOGRAM_PERCENTAGE("HttpCache.PercentBeforeSend", before_send_percent);
+ UMA_HISTOGRAM_PERCENTAGE("HttpCache.PercentBeforeSend", before_send_sample);
// TODO(gavinp): Remove or minimize these histograms, particularly the ones
// below this comment after we have received initial data.
@@ -2900,25 +2901,25 @@ void HttpCache::Transaction::RecordHistograms() {
UMA_HISTOGRAM_TIMES("HttpCache.BeforeSend.CantConditionalize",
before_send_time);
UMA_HISTOGRAM_PERCENTAGE("HttpCache.PercentBeforeSend.CantConditionalize",
- before_send_percent);
+ before_send_sample);
break;
}
case PATTERN_ENTRY_NOT_CACHED: {
UMA_HISTOGRAM_TIMES("HttpCache.BeforeSend.NotCached", before_send_time);
UMA_HISTOGRAM_PERCENTAGE("HttpCache.PercentBeforeSend.NotCached",
- before_send_percent);
+ before_send_sample);
break;
}
case PATTERN_ENTRY_VALIDATED: {
UMA_HISTOGRAM_TIMES("HttpCache.BeforeSend.Validated", before_send_time);
UMA_HISTOGRAM_PERCENTAGE("HttpCache.PercentBeforeSend.Validated",
- before_send_percent);
+ before_send_sample);
break;
}
case PATTERN_ENTRY_UPDATED: {
UMA_HISTOGRAM_TIMES("HttpCache.BeforeSend.Updated", before_send_time);
UMA_HISTOGRAM_PERCENTAGE("HttpCache.PercentBeforeSend.Updated",
- before_send_percent);
+ before_send_sample);
break;
}
default:
« no previous file with comments | « net/http/disk_cache_based_quic_server_info.cc ('k') | net/http/http_network_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698