| Index: components/precache/core/precache_database.cc
|
| diff --git a/components/precache/core/precache_database.cc b/components/precache/core/precache_database.cc
|
| index 80be637060b9e7e14a6a46f79c814ddf640de01d..aba25dbb09c8697d51d998bf58a0570646a162a3 100644
|
| --- a/components/precache/core/precache_database.cc
|
| +++ b/components/precache/core/precache_database.cc
|
| @@ -100,7 +100,8 @@ void PrecacheDatabase::RecordURLPrecached(const GURL& url,
|
| if (!was_cached) {
|
| // The precache only counts as overhead if it was downloaded over the
|
| // network.
|
| - UMA_HISTOGRAM_COUNTS("Precache.DownloadedPrecacheMotivated", size);
|
| + UMA_HISTOGRAM_COUNTS("Precache.DownloadedPrecacheMotivated",
|
| + static_cast<base::HistogramBase::Sample>(size));
|
| }
|
|
|
| // Use the URL table to keep track of URLs that are in the cache thanks to
|
| @@ -133,21 +134,24 @@ void PrecacheDatabase::RecordURLFetched(const GURL& url,
|
| return;
|
| }
|
|
|
| + base::HistogramBase::Sample size_sample =
|
| + static_cast<base::HistogramBase::Sample>(size);
|
| if (!was_cached) {
|
| // The fetch was served over the network during user browsing, so count it
|
| // as downloaded non-precache bytes.
|
| - UMA_HISTOGRAM_COUNTS("Precache.DownloadedNonPrecache", size);
|
| + UMA_HISTOGRAM_COUNTS("Precache.DownloadedNonPrecache", size_sample);
|
| if (is_connection_cellular) {
|
| - UMA_HISTOGRAM_COUNTS("Precache.DownloadedNonPrecache.Cellular", size);
|
| + UMA_HISTOGRAM_COUNTS("Precache.DownloadedNonPrecache.Cellular",
|
| + size_sample);
|
| }
|
| } else {
|
| // The fetch was served from the cache, and since there's an entry for this
|
| // URL in the URL table, this means that the resource was served from the
|
| // cache only because precaching put it there. Thus, precaching was helpful,
|
| // so count the fetch as saved bytes.
|
| - UMA_HISTOGRAM_COUNTS("Precache.Saved", size);
|
| + UMA_HISTOGRAM_COUNTS("Precache.Saved", size_sample);
|
| if (is_connection_cellular) {
|
| - UMA_HISTOGRAM_COUNTS("Precache.Saved.Cellular", size);
|
| + UMA_HISTOGRAM_COUNTS("Precache.Saved.Cellular", size_sample);
|
| }
|
| }
|
|
|
|
|