| 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:
|
|
|