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

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

Issue 6592027: Update NetLog in preparation for late binding of HttpStream jobs to requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits. Created 9 years, 10 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
« no previous file with comments | « chrome/browser/net/passive_log_collector.h ('k') | chrome/browser/net/passive_log_collector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8ac8e5321ea20cc2c6d6d8a9d840190f5bfb7319..a4f8b5b89dd52d254e7e6be0b083d1fa5bd0e09c 100644
--- a/chrome/browser/net/passive_log_collector.cc
+++ b/chrome/browser/net/passive_log_collector.cc
@@ -54,6 +54,7 @@ PassiveLogCollector::PassiveLogCollector()
ALLOW_THIS_IN_INITIALIZER_LIST(connect_job_tracker_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(url_request_tracker_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(socket_stream_tracker_(this)),
+ ALLOW_THIS_IN_INITIALIZER_LIST(http_stream_job_tracker_(this)),
num_events_seen_(0) {
// Define the mapping between source types and the tracker objects.
@@ -70,6 +71,7 @@ PassiveLogCollector::PassiveLogCollector()
&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_;
+ trackers_[net::NetLog::SOURCE_HTTP_STREAM_JOB] = &http_stream_job_tracker_;
// Make sure our mapping is up-to-date.
for (size_t i = 0; i < arraysize(trackers_); ++i)
DCHECK(trackers_[i]) << "Unhandled SourceType: " << i;
@@ -345,8 +347,7 @@ void PassiveLogCollector::SourceTracker::AddReferenceToSourceDependency(
info->dependencies.push_back(source);
}
-void
-PassiveLogCollector::SourceTracker::ReleaseAllReferencesToDependencies(
+void PassiveLogCollector::SourceTracker::ReleaseAllReferencesToDependencies(
SourceInfo* info) {
// Release all references |info| was holding to other sources.
for (SourceDependencyList::const_iterator it = info->dependencies.begin();
@@ -445,8 +446,7 @@ PassiveLogCollector::RequestTracker::RequestTracker(PassiveLogCollector* parent)
PassiveLogCollector::SourceTracker::Action
PassiveLogCollector::RequestTracker::DoAddEntry(
const ChromeNetLog::Entry& entry, SourceInfo* out_info) {
- if (entry.type == net::NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB ||
- entry.type == net::NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET) {
+ if (entry.type == net::NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_JOB) {
const net::NetLog::Source& source_dependency =
static_cast<net::NetLogSourceParameter*>(entry.params.get())->value();
AddReferenceToSourceDependency(source_dependency, out_info);
@@ -585,3 +585,36 @@ PassiveLogCollector::DiskCacheEntryTracker::DoAddEntry(
return ACTION_NONE;
}
+
+//----------------------------------------------------------------------------
+// HttpStreamJobTracker
+//----------------------------------------------------------------------------
+
+const size_t PassiveLogCollector::HttpStreamJobTracker::kMaxNumSources = 100;
+const size_t PassiveLogCollector::HttpStreamJobTracker::kMaxGraveyardSize = 25;
+
+PassiveLogCollector::HttpStreamJobTracker::HttpStreamJobTracker(
+ PassiveLogCollector* parent)
+ : SourceTracker(kMaxNumSources, kMaxGraveyardSize, parent) {
+}
+
+PassiveLogCollector::SourceTracker::Action
+PassiveLogCollector::HttpStreamJobTracker::DoAddEntry(
+ const ChromeNetLog::Entry& entry, SourceInfo* out_info) {
+ if (entry.type == net::NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB ||
+ entry.type == net::NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET) {
+ const net::NetLog::Source& source_dependency =
+ static_cast<net::NetLogSourceParameter*>(entry.params.get())->value();
+ AddReferenceToSourceDependency(source_dependency, out_info);
+ }
+
+ AddEntryToSourceInfo(entry, out_info);
+
+ // If the request has ended, move it to the graveyard.
+ if (entry.type == net::NetLog::TYPE_HTTP_STREAM_JOB &&
+ 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/net/passive_log_collector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698