Chromium Code Reviews| Index: net/disk_cache/blockfile/webfonts_histogram.cc |
| diff --git a/net/disk_cache/blockfile/webfonts_histogram.cc b/net/disk_cache/blockfile/webfonts_histogram.cc |
| index ad157176cd8250b58963a2d85c91aff73c9eddc7..d24df362763fe174449212b67ec2769fed7ef846 100644 |
| --- a/net/disk_cache/blockfile/webfonts_histogram.cc |
| +++ b/net/disk_cache/blockfile/webfonts_histogram.cc |
| @@ -78,21 +78,27 @@ void RecordEvictedEntry(const std::string& key) { |
| } |
| void RecordCacheHit(EntryImpl* entry) { |
| - const char* label = HistogramLabel(entry->entry()->Data()->key); |
| + EntryStore* info = entry->entry()->Data(); |
| + const char* label = HistogramLabel(info->key); |
|
rvargas (doing something else)
2014/06/10 23:15:33
I just realized that this is wrong. This should no
Kunihiko Sakamoto
2014/06/11 01:50:10
Done.
|
| if (!label) |
| return; |
| CACHE_HISTOGRAM_COUNTS_10000(HistogramName("DiskCache.ReuseCount.Hit", label), |
| - entry->entry()->Data()->reuse_count); |
| + info->reuse_count); |
| + CACHE_HISTOGRAM_AGE(HistogramName("DiskCache.EntryAge.Hit", label), |
| + base::Time::FromInternalValue(info->creation_time)); |
| RecordCacheEvent(CACHE_EVENT_HIT, label); |
| } |
| void RecordEviction(EntryImpl* entry) { |
| - const char* label = HistogramLabel(entry->entry()->Data()->key); |
| - if (label) |
| + EntryStore* info = entry->entry()->Data(); |
| + const char* label = HistogramLabel(info->key); |
| + if (!label) |
| return; |
| CACHE_HISTOGRAM_COUNTS_10000( |
| HistogramName("DiskCache.ReuseCount.Evict", label), |
| - entry->entry()->Data()->reuse_count); |
| + info->reuse_count); |
| + CACHE_HISTOGRAM_AGE(HistogramName("DiskCache.EntryAge.Evict", label), |
| + base::Time::FromInternalValue(info->creation_time)); |
| } |
| } // namespace web_fonts_histogram |