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

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

Issue 9288084: Added Net logging to FileStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up year on licence text. Created 8 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
diff --git a/chrome/browser/net/passive_log_collector.cc b/chrome/browser/net/passive_log_collector.cc
index d7b93e0ba83beca6cba5f3c424afa0586d104861..2aab1f592581401c2f8bac1bfb2382c810337b9a 100644
--- a/chrome/browser/net/passive_log_collector.cc
+++ b/chrome/browser/net/passive_log_collector.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -85,6 +85,8 @@ PassiveLogCollector::PassiveLogCollector()
&cert_verifier_job_tracker_;
trackers_[net::NetLog::SOURCE_HTTP_PIPELINED_CONNECTION] =
&http_pipelined_connection_tracker_;
+ trackers_[net::NetLog::SOURCE_FILESTREAM] =
+ &file_stream_tracker_;
// Make sure our mapping is up-to-date.
for (size_t i = 0; i < arraysize(trackers_); ++i)
DCHECK(trackers_[i]) << "Unhandled SourceType: " << i;
@@ -814,3 +816,30 @@ PassiveLogCollector::HttpPipelinedConnectionTracker::DoAddEntry(
}
return ACTION_NONE;
}
+
+//----------------------------------------------------------------------------
+// FileStreamTracker
+//----------------------------------------------------------------------------
+
+const size_t
+PassiveLogCollector::FileStreamTracker::kMaxNumSources = 100;
+
+const size_t
+PassiveLogCollector::FileStreamTracker::kMaxGraveyardSize = 25;
+
+PassiveLogCollector::
+ FileStreamTracker::FileStreamTracker()
+ : SourceTracker(kMaxNumSources, kMaxGraveyardSize, NULL) {
+}
+
+PassiveLogCollector::SourceTracker::Action
+PassiveLogCollector::FileStreamTracker::DoAddEntry(
+ const ChromeNetLog::Entry& entry,
+ SourceInfo* out_info) {
+ AddEntryToSourceInfo(entry, out_info);
+ if (entry.type == net::NetLog::TYPE_FILE_STREAM_ALIVE &&
+ entry.phase == net::NetLog::PHASE_END) {
+ return ACTION_MOVE_TO_GRAVEYARD;
+ }
+ return ACTION_NONE;
+}

Powered by Google App Engine
This is Rietveld 408576698