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..a92d94224ec11b8a479f5f0b5699e8dd7db74ea7 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); |
+ const char* label = HistogramLabel(entry->GetKey()); |
if (!label) |
return; |
+ EntryStore* info = entry->entry()->Data(); |
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) |
+ const char* label = HistogramLabel(entry->GetKey()); |
+ if (!label) |
return; |
+ EntryStore* info = entry->entry()->Data(); |
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 |