Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3794)

Unified Diff: chrome/browser/net/passive_log_collector.cc

Issue 6125001: Fixed first pass at adding http/backend cache events to the NetLog. ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/passive_log_collector.cc
===================================================================
--- chrome/browser/net/passive_log_collector.cc (revision 70619)
+++ chrome/browser/net/passive_log_collector.cc (working copy)
@@ -70,6 +70,7 @@
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 @@
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;
+}
« no previous file with comments | « chrome/browser/net/passive_log_collector.h ('k') | chrome/browser/resources/net_internals/logviewpainter.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698