Index: chrome/browser/net/passive_log_collector.cc |
diff --git a/chrome/browser/net/passive_log_collector.cc b/chrome/browser/net/passive_log_collector.cc |
index 0d414792299dc63b669af5aff47b4dc8c2e9a9c4..21e2935a8bf17bc0c873fccf1de7f63d7a3221bb 100644 |
--- a/chrome/browser/net/passive_log_collector.cc |
+++ b/chrome/browser/net/passive_log_collector.cc |
@@ -70,6 +70,7 @@ PassiveLogCollector::PassiveLogCollector() |
trackers_[net::NetLog::SOURCE_HOST_RESOLVER_IMPL_REQUEST] = |
&dns_request_tracker_; |
trackers_[net::NetLog::SOURCE_HOST_RESOLVER_IMPL_JOB] = &dns_job_tracker_; |
+ trackers_[net::NetLog::SOURCE_DISK_CACHE_ENTRY] = &disk_cache_entry_tracker_; |
// Make sure our mapping is up-to-date. |
for (size_t i = 0; i < arraysize(trackers_); ++i) |
DCHECK(trackers_[i]) << "Unhandled SourceType: " << i; |
@@ -560,3 +561,28 @@ PassiveLogCollector::DNSJobTracker::DoAddEntry(const ChromeNetLog::Entry& entry, |
return ACTION_NONE; |
} |
} |
+ |
+//---------------------------------------------------------------------------- |
+// DiskCacheEntryTracker |
+//---------------------------------------------------------------------------- |
+ |
+const size_t PassiveLogCollector::DiskCacheEntryTracker::kMaxNumSources = 100; |
+const size_t PassiveLogCollector::DiskCacheEntryTracker::kMaxGraveyardSize = 25; |
+ |
+PassiveLogCollector::DiskCacheEntryTracker::DiskCacheEntryTracker() |
+ : SourceTracker(kMaxNumSources, kMaxGraveyardSize, NULL) { |
+} |
+ |
+PassiveLogCollector::SourceTracker::Action |
+PassiveLogCollector::DiskCacheEntryTracker::DoAddEntry( |
+ const ChromeNetLog::Entry& entry, SourceInfo* out_info) { |
+ AddEntryToSourceInfo(entry, out_info); |
+ |
+ // If the request has ended, move it to the graveyard. |
+ if (entry.type == net::NetLog::TYPE_DISK_CACHE_ENTRY && |
+ entry.phase == net::NetLog::PHASE_END) { |
+ return ACTION_MOVE_TO_GRAVEYARD; |
+ } |
+ |
+ return ACTION_NONE; |
+} |