summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-28 22:25:59 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-28 22:25:59 +0000
commit7b496b3cc7299672eaeff93fba4a444576c60214 (patch)
treecf178fa966eff186b2918b40fc1ddb9d038287ac /chrome/browser/net
parent5d97aa4302484c9fd7b78395f30dd4b063731861 (diff)
downloadchromium_src-7b496b3cc7299672eaeff93fba4a444576c60214.zip
chromium_src-7b496b3cc7299672eaeff93fba4a444576c60214.tar.gz
chromium_src-7b496b3cc7299672eaeff93fba4a444576c60214.tar.bz2
Update NetLog in preparation for late binding of HttpStream jobs to requests.
BUG=54371,42669 TEST=Open up about:net-internals#Events and make sure HTTP_STREAM_JOBs appear and are tied together to URL_REQUESTs. Review URL: http://codereview.chromium.org/6592027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76287 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/passive_log_collector.cc41
-rw-r--r--chrome/browser/net/passive_log_collector.h39
-rw-r--r--chrome/browser/net/passive_log_collector_unittest.cc158
3 files changed, 139 insertions, 99 deletions
diff --git a/chrome/browser/net/passive_log_collector.cc b/chrome/browser/net/passive_log_collector.cc
index 8ac8e53..a4f8b5b 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;
+}
diff --git a/chrome/browser/net/passive_log_collector.h b/chrome/browser/net/passive_log_collector.h
index a415d59..6c39ae9 100644
--- a/chrome/browser/net/passive_log_collector.h
+++ b/chrome/browser/net/passive_log_collector.h
@@ -200,10 +200,9 @@ class PassiveLogCollector : public ChromeNetLog::ThreadSafeObserver {
explicit ConnectJobTracker(PassiveLogCollector* parent);
- protected:
+ private:
virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
SourceInfo* out_info);
- private:
DISALLOW_COPY_AND_ASSIGN(ConnectJobTracker);
};
@@ -215,11 +214,10 @@ class PassiveLogCollector : public ChromeNetLog::ThreadSafeObserver {
SocketTracker();
- protected:
+ private:
virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
SourceInfo* out_info);
- private:
DISALLOW_COPY_AND_ASSIGN(SocketTracker);
};
@@ -231,11 +229,10 @@ class PassiveLogCollector : public ChromeNetLog::ThreadSafeObserver {
explicit RequestTracker(PassiveLogCollector* parent);
- protected:
+ private:
virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
SourceInfo* out_info);
- private:
DISALLOW_COPY_AND_ASSIGN(RequestTracker);
};
@@ -248,11 +245,10 @@ class PassiveLogCollector : public ChromeNetLog::ThreadSafeObserver {
InitProxyResolverTracker();
- protected:
+ private:
virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
SourceInfo* out_info);
- private:
DISALLOW_COPY_AND_ASSIGN(InitProxyResolverTracker);
};
@@ -264,11 +260,10 @@ class PassiveLogCollector : public ChromeNetLog::ThreadSafeObserver {
SpdySessionTracker();
- protected:
+ private:
virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
SourceInfo* out_info);
- private:
DISALLOW_COPY_AND_ASSIGN(SpdySessionTracker);
};
@@ -280,11 +275,10 @@ class PassiveLogCollector : public ChromeNetLog::ThreadSafeObserver {
DNSRequestTracker();
- protected:
+ private:
virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
SourceInfo* out_info);
- private:
DISALLOW_COPY_AND_ASSIGN(DNSRequestTracker);
};
@@ -296,11 +290,10 @@ class PassiveLogCollector : public ChromeNetLog::ThreadSafeObserver {
DNSJobTracker();
- protected:
+ private:
virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
SourceInfo* out_info);
- private:
DISALLOW_COPY_AND_ASSIGN(DNSJobTracker);
};
@@ -312,14 +305,27 @@ class PassiveLogCollector : public ChromeNetLog::ThreadSafeObserver {
DiskCacheEntryTracker();
- protected:
+ private:
virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
SourceInfo* out_info);
- private:
DISALLOW_COPY_AND_ASSIGN(DiskCacheEntryTracker);
};
+ class HttpStreamJobTracker : public SourceTracker {
+ public:
+ static const size_t kMaxNumSources;
+ static const size_t kMaxGraveyardSize;
+
+ explicit HttpStreamJobTracker(PassiveLogCollector* parent);
+
+ private:
+ virtual Action DoAddEntry(const ChromeNetLog::Entry& entry,
+ SourceInfo* out_info);
+ DISALLOW_COPY_AND_ASSIGN(HttpStreamJobTracker);
+ };
+
+
PassiveLogCollector();
~PassiveLogCollector();
@@ -357,6 +363,7 @@ class PassiveLogCollector : public ChromeNetLog::ThreadSafeObserver {
DNSRequestTracker dns_request_tracker_;
DNSJobTracker dns_job_tracker_;
DiskCacheEntryTracker disk_cache_entry_tracker_;
+ HttpStreamJobTracker http_stream_job_tracker_;
// This array maps each NetLog::SourceType to one of the tracker instances
// defined above. Use of this array avoid duplicating the list of trackers
diff --git a/chrome/browser/net/passive_log_collector_unittest.cc b/chrome/browser/net/passive_log_collector_unittest.cc
index c948baa..91f238f 100644
--- a/chrome/browser/net/passive_log_collector_unittest.cc
+++ b/chrome/browser/net/passive_log_collector_unittest.cc
@@ -15,6 +15,7 @@ namespace {
typedef PassiveLogCollector::RequestTracker RequestTracker;
typedef PassiveLogCollector::SourceInfoList SourceInfoList;
typedef PassiveLogCollector::SocketTracker SocketTracker;
+typedef PassiveLogCollector::HttpStreamJobTracker HttpStreamJobTracker;
using net::NetLog;
const NetLog::SourceType kSourceType = NetLog::SOURCE_NONE;
@@ -201,29 +202,29 @@ TEST(SpdySessionTracker, MovesToGraveyard) {
EXPECT_EQ(1u, GetDeadSources(tracker).size());
}
-// Test that when a SOURCE_SOCKET is connected to a SOURCE_URL_REQUEST
-// (via the TYPE_SOCKET_POOL_BOUND_TO_SOCKET event), it holds a reference
-// to the SOURCE_SOCKET preventing it from getting deleted as long as the
-// SOURCE_URL_REQUEST is still around.
+// Test that when a SOURCE_HTTP_STREAM_JOB is connected to a SOURCE_URL_REQUEST
+// (via the TYPE_HTTP_STREAM_REQUEST_BOUND_TO_JOB event), it holds a reference
+// to the SOURCE_HTTP_STREAM_JOB preventing it from getting deleted as long as
+// the SOURCE_URL_REQUEST is still around.
TEST(PassiveLogCollectorTest, HoldReferenceToDependentSource) {
PassiveLogCollector log;
EXPECT_EQ(0u, GetLiveSources(log.url_request_tracker_).size());
- EXPECT_EQ(0u, GetLiveSources(log.socket_tracker_).size());
+ EXPECT_EQ(0u, GetLiveSources(log.http_stream_job_tracker_).size());
uint32 next_id = 0;
- NetLog::Source socket_source(NetLog::SOURCE_SOCKET, next_id++);
+ NetLog::Source stream_job_source(NetLog::SOURCE_HTTP_STREAM_JOB, next_id++);
NetLog::Source url_request_source(NetLog::SOURCE_URL_REQUEST, next_id++);
- // Start a SOURCE_SOCKET.
- log.OnAddEntry(NetLog::TYPE_SOCKET_ALIVE,
+ // Start a SOURCE_HTTP_STREAM_JOB.
+ log.OnAddEntry(NetLog::TYPE_HTTP_STREAM_JOB,
base::TimeTicks(),
- socket_source,
+ stream_job_source,
NetLog::PHASE_BEGIN,
NULL);
EXPECT_EQ(0u, GetLiveSources(log.url_request_tracker_).size());
- EXPECT_EQ(1u, GetLiveSources(log.socket_tracker_).size());
+ EXPECT_EQ(1u, GetLiveSources(log.http_stream_job_tracker_).size());
// Start a SOURCE_URL_REQUEST.
log.OnAddEntry(NetLog::TYPE_REQUEST_ALIVE,
@@ -233,7 +234,7 @@ TEST(PassiveLogCollectorTest, HoldReferenceToDependentSource) {
NULL);
// Check that there is no association between the SOURCE_URL_REQUEST and the
- // SOURCE_SOCKET yet.
+ // SOURCE_HTTP_STREAM_JOB yet.
ASSERT_EQ(1u, GetLiveSources(log.url_request_tracker_).size());
{
PassiveLogCollector::SourceInfo info =
@@ -241,40 +242,40 @@ TEST(PassiveLogCollectorTest, HoldReferenceToDependentSource) {
EXPECT_EQ(0, info.reference_count);
EXPECT_EQ(0u, info.dependencies.size());
}
- ASSERT_EQ(1u, GetLiveSources(log.socket_tracker_).size());
+ ASSERT_EQ(1u, GetLiveSources(log.http_stream_job_tracker_).size());
{
PassiveLogCollector::SourceInfo info =
- GetLiveSources(log.socket_tracker_)[0];
+ GetLiveSources(log.http_stream_job_tracker_)[0];
EXPECT_EQ(0, info.reference_count);
EXPECT_EQ(0u, info.dependencies.size());
}
- // Associate the SOURCE_SOCKET with the SOURCE_URL_REQUEST.
- log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET,
+ // Associate the SOURCE_HTTP_STREAM_JOB with the SOURCE_URL_REQUEST.
+ log.OnAddEntry(NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_JOB,
base::TimeTicks(),
url_request_source,
NetLog::PHASE_NONE,
- new net::NetLogSourceParameter("x", socket_source));
+ new net::NetLogSourceParameter("x", stream_job_source));
// Check that an associate was made -- the SOURCE_URL_REQUEST should have
- // added a reference to the SOURCE_SOCKET.
+ // added a reference to the SOURCE_HTTP_STREAM_JOB.
ASSERT_EQ(1u, GetLiveSources(log.url_request_tracker_).size());
{
PassiveLogCollector::SourceInfo info =
GetLiveSources(log.url_request_tracker_)[0];
EXPECT_EQ(0, info.reference_count);
EXPECT_EQ(1u, info.dependencies.size());
- EXPECT_EQ(socket_source.id, info.dependencies[0].id);
+ EXPECT_EQ(stream_job_source.id, info.dependencies[0].id);
}
- ASSERT_EQ(1u, GetLiveSources(log.socket_tracker_).size());
+ ASSERT_EQ(1u, GetLiveSources(log.http_stream_job_tracker_).size());
{
PassiveLogCollector::SourceInfo info =
- GetLiveSources(log.socket_tracker_)[0];
+ GetLiveSources(log.http_stream_job_tracker_)[0];
EXPECT_EQ(1, info.reference_count);
EXPECT_EQ(0u, info.dependencies.size());
}
- // Now end both |source_socket| and |source_url_request|. This sends them
+ // Now end both |stream_job_source| and |url_request_source|. This sends them
// to deletion queue, and they will be deleted once space runs out.
log.OnAddEntry(NetLog::TYPE_REQUEST_ALIVE,
@@ -283,14 +284,14 @@ TEST(PassiveLogCollectorTest, HoldReferenceToDependentSource) {
NetLog::PHASE_END,
NULL);
- log.OnAddEntry(NetLog::TYPE_SOCKET_ALIVE,
+ log.OnAddEntry(NetLog::TYPE_HTTP_STREAM_JOB,
base::TimeTicks(),
- socket_source,
+ stream_job_source,
NetLog::PHASE_END,
NULL);
- // Verify that both sources are in fact dead, and that |source_url_request|
- // still holds a reference to |source_socket|.
+ // Verify that both sources are in fact dead, and that |url_request_source|
+ // still holds a reference to |stream_job_source|.
ASSERT_EQ(0u, GetLiveSources(log.url_request_tracker_).size());
ASSERT_EQ(1u, GetDeadSources(log.url_request_tracker_).size());
{
@@ -298,41 +299,41 @@ TEST(PassiveLogCollectorTest, HoldReferenceToDependentSource) {
GetDeadSources(log.url_request_tracker_)[0];
EXPECT_EQ(0, info.reference_count);
EXPECT_EQ(1u, info.dependencies.size());
- EXPECT_EQ(socket_source.id, info.dependencies[0].id);
+ EXPECT_EQ(stream_job_source.id, info.dependencies[0].id);
}
- EXPECT_EQ(0u, GetLiveSources(log.socket_tracker_).size());
- ASSERT_EQ(1u, GetDeadSources(log.socket_tracker_).size());
+ EXPECT_EQ(0u, GetLiveSources(log.http_stream_job_tracker_).size());
+ ASSERT_EQ(1u, GetDeadSources(log.http_stream_job_tracker_).size());
{
PassiveLogCollector::SourceInfo info =
- GetDeadSources(log.socket_tracker_)[0];
+ GetDeadSources(log.http_stream_job_tracker_)[0];
EXPECT_EQ(1, info.reference_count);
EXPECT_EQ(0u, info.dependencies.size());
}
- // Cycle through a bunch of SOURCE_SOCKET -- if it were not referenced, this
- // loop will have deleted it.
- for (size_t i = 0; i < SocketTracker::kMaxGraveyardSize; ++i) {
- log.OnAddEntry(NetLog::TYPE_SOCKET_ALIVE,
+ // Cycle through a bunch of SOURCE_HTTP_STREAM_JOB -- if it were not
+ // referenced, this loop will have deleted it.
+ for (size_t i = 0; i < HttpStreamJobTracker::kMaxGraveyardSize; ++i) {
+ log.OnAddEntry(NetLog::TYPE_HTTP_STREAM_JOB,
base::TimeTicks(),
- NetLog::Source(NetLog::SOURCE_SOCKET, next_id++),
+ NetLog::Source(NetLog::SOURCE_HTTP_STREAM_JOB, next_id++),
NetLog::PHASE_END,
NULL);
}
- EXPECT_EQ(0u, GetLiveSources(log.socket_tracker_).size());
- ASSERT_EQ(SocketTracker::kMaxGraveyardSize + 1,
- GetDeadSources(log.socket_tracker_).size());
+ EXPECT_EQ(0u, GetLiveSources(log.http_stream_job_tracker_).size());
+ ASSERT_EQ(HttpStreamJobTracker::kMaxGraveyardSize + 1,
+ GetDeadSources(log.http_stream_job_tracker_).size());
{
PassiveLogCollector::SourceInfo info =
- GetDeadSources(log.socket_tracker_)[0];
- EXPECT_EQ(socket_source.id, info.source_id);
+ GetDeadSources(log.http_stream_job_tracker_)[0];
+ EXPECT_EQ(stream_job_source.id, info.source_id);
EXPECT_EQ(1, info.reference_count);
EXPECT_EQ(0u, info.dependencies.size());
}
// Cycle through a bunch of SOURCE_URL_REQUEST -- this will cause
- // |source_url_request| to be freed, which in turn should release the final
- // reference to |source_socket| cause it to be freed as well.
+ // |url_request_source| to be freed, which in turn should release the final
+ // reference to |stream_job_source| cause it to be freed as well.
for (size_t i = 0; i < RequestTracker::kMaxGraveyardSize; ++i) {
log.OnAddEntry(NetLog::TYPE_REQUEST_ALIVE,
base::TimeTicks(),
@@ -345,25 +346,25 @@ TEST(PassiveLogCollectorTest, HoldReferenceToDependentSource) {
EXPECT_EQ(RequestTracker::kMaxGraveyardSize,
GetDeadSources(log.url_request_tracker_).size());
- EXPECT_EQ(0u, GetLiveSources(log.socket_tracker_).size());
- EXPECT_EQ(SocketTracker::kMaxGraveyardSize,
- GetDeadSources(log.socket_tracker_).size());
+ EXPECT_EQ(0u, GetLiveSources(log.http_stream_job_tracker_).size());
+ EXPECT_EQ(HttpStreamJobTracker::kMaxGraveyardSize,
+ GetDeadSources(log.http_stream_job_tracker_).size());
}
-// Have a URL_REQUEST hold a reference to a SOCKET. Then cause the SOCKET to
-// get evicted (by exceeding maximum sources limit). Now the URL_REQUEST is
-// referencing a non-existant SOCKET. Lastly, evict the URL_REQUEST so it
+// Have a HTTP_STREAM_JOB hold a reference to a SOCKET. Then cause the SOCKET to
+// get evicted (by exceeding maximum sources limit). Now the HTTP_STREAM_JOB is
+// referencing a non-existant SOCKET. Lastly, evict the HTTP_STREAM_JOB so it
// tries to drop all of its references. Make sure that in releasing its
// non-existant reference it doesn't trip any DCHECKs.
TEST(PassiveLogCollectorTest, HoldReferenceToDeletedSource) {
PassiveLogCollector log;
- EXPECT_EQ(0u, GetLiveSources(log.url_request_tracker_).size());
+ EXPECT_EQ(0u, GetLiveSources(log.http_stream_job_tracker_).size());
EXPECT_EQ(0u, GetLiveSources(log.socket_tracker_).size());
uint32 next_id = 0;
NetLog::Source socket_source(NetLog::SOURCE_SOCKET, next_id++);
- NetLog::Source url_request_source(NetLog::SOURCE_URL_REQUEST, next_id++);
+ NetLog::Source stream_job_source(NetLog::SOURCE_HTTP_STREAM_JOB, next_id++);
// Start a SOURCE_SOCKET.
log.OnAddEntry(NetLog::TYPE_SOCKET_ALIVE,
@@ -372,29 +373,29 @@ TEST(PassiveLogCollectorTest, HoldReferenceToDeletedSource) {
NetLog::PHASE_BEGIN,
NULL);
- EXPECT_EQ(0u, GetLiveSources(log.url_request_tracker_).size());
+ EXPECT_EQ(0u, GetLiveSources(log.http_stream_job_tracker_).size());
EXPECT_EQ(1u, GetLiveSources(log.socket_tracker_).size());
- // Start a SOURCE_URL_REQUEST.
- log.OnAddEntry(NetLog::TYPE_REQUEST_ALIVE,
+ // Start a SOURCE_HTTP_STREAM_JOB.
+ log.OnAddEntry(NetLog::TYPE_HTTP_STREAM_JOB,
base::TimeTicks(),
- url_request_source,
+ stream_job_source,
NetLog::PHASE_BEGIN,
NULL);
- // Associate the SOURCE_SOCKET with the SOURCE_URL_REQUEST.
+ // Associate the SOURCE_SOCKET with the SOURCE_HTTP_STREAM_JOB.
log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET,
base::TimeTicks(),
- url_request_source,
+ stream_job_source,
NetLog::PHASE_NONE,
new net::NetLogSourceParameter("x", socket_source));
- // Check that an associate was made -- the SOURCE_URL_REQUEST should have
+ // Check that an associate was made -- the SOURCE_HTTP_STREAM_JOB should have
// added a reference to the SOURCE_SOCKET.
- ASSERT_EQ(1u, GetLiveSources(log.url_request_tracker_).size());
+ ASSERT_EQ(1u, GetLiveSources(log.http_stream_job_tracker_).size());
{
PassiveLogCollector::SourceInfo info =
- GetLiveSources(log.url_request_tracker_)[0];
+ GetLiveSources(log.http_stream_job_tracker_)[0];
EXPECT_EQ(0, info.reference_count);
EXPECT_EQ(1u, info.dependencies.size());
EXPECT_EQ(socket_source.id, info.dependencies[0].id);
@@ -422,20 +423,20 @@ TEST(PassiveLogCollectorTest, HoldReferenceToDeletedSource) {
// requests to cause it to be deleted. Once that source is deleted, it will
// try to give up its reference to the SOCKET. However that socket_id no
// longer exists -- should not DCHECK().
- log.OnAddEntry(NetLog::TYPE_REQUEST_ALIVE,
+ log.OnAddEntry(NetLog::TYPE_HTTP_STREAM_JOB,
base::TimeTicks(),
- url_request_source,
+ stream_job_source,
NetLog::PHASE_END,
NULL);
- for (size_t i = 0; i < RequestTracker::kMaxGraveyardSize; ++i) {
- log.OnAddEntry(NetLog::TYPE_REQUEST_ALIVE,
+ for (size_t i = 0; i < HttpStreamJobTracker::kMaxGraveyardSize; ++i) {
+ log.OnAddEntry(NetLog::TYPE_HTTP_STREAM_JOB,
base::TimeTicks(),
- NetLog::Source(NetLog::SOURCE_URL_REQUEST, next_id++),
+ NetLog::Source(NetLog::SOURCE_HTTP_STREAM_JOB, next_id++),
NetLog::PHASE_END,
NULL);
}
- EXPECT_EQ(RequestTracker::kMaxGraveyardSize,
- GetDeadSources(log.url_request_tracker_).size());
+ EXPECT_EQ(HttpStreamJobTracker::kMaxGraveyardSize,
+ GetDeadSources(log.http_stream_job_tracker_).size());
}
// Regression test for http://crbug.com/58847
@@ -443,17 +444,17 @@ TEST(PassiveLogCollectorTest, ReleaseDependencyToUnreferencedSource) {
PassiveLogCollector log;
// If these constants are weird, the test won't be testing the right thing.
- EXPECT_LT(PassiveLogCollector::RequestTracker::kMaxGraveyardSize,
- PassiveLogCollector::RequestTracker::kMaxNumSources);
+ EXPECT_LT(PassiveLogCollector::HttpStreamJobTracker::kMaxGraveyardSize,
+ PassiveLogCollector::HttpStreamJobTracker::kMaxNumSources);
- // Add a "reference" to a non-existant source (sourceID=1706 does not exist).
+ // Add a "reference" to a non-existant source (sourceID=1263 does not exist).
scoped_refptr<net::NetLog::EventParameters> params =
new net::NetLogSourceParameter(
"source_dependency",
net::NetLog::Source(net::NetLog::SOURCE_SOCKET, 1263));
log.OnAddEntry(net::NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET,
base::TimeTicks(),
- net::NetLog::Source(net::NetLog::SOURCE_URL_REQUEST, 1706),
+ net::NetLog::Source(net::NetLog::SOURCE_HTTP_STREAM_JOB, 1706),
net::NetLog::PHASE_NONE,
params);
@@ -461,9 +462,9 @@ TEST(PassiveLogCollectorTest, ReleaseDependencyToUnreferencedSource) {
// reference count for 1263 was not adjusted since it doesn't actually exist.
// Move source 1706 to the graveyard.
- log.OnAddEntry(net::NetLog::TYPE_REQUEST_ALIVE,
+ log.OnAddEntry(net::NetLog::TYPE_HTTP_STREAM_JOB,
base::TimeTicks(),
- net::NetLog::Source(net::NetLog::SOURCE_URL_REQUEST, 1706),
+ net::NetLog::Source(net::NetLog::SOURCE_HTTP_STREAM_JOB, 1706),
net::NetLog::PHASE_END,
NULL);
@@ -474,21 +475,20 @@ TEST(PassiveLogCollectorTest, ReleaseDependencyToUnreferencedSource) {
net::NetLog::Source(net::NetLog::SOURCE_SOCKET, 1263),
net::NetLog::PHASE_END, NULL);
- // Add kMaxGraveyardSize unreferenced URL_REQUESTS, so the circular buffer
- // containing source 1706. After adding kMaxGraveyardSize - 1 the buffer
- // will be full. Now when we add one more more source it will now evict the
- // oldest item, which is 1706. In doing so, 1706 will try to release the
+ // Add kMaxGraveyardSize unreferenced HTTP_STREAM_JOBS, so the circular
+ // buffer containing source 1706. After adding kMaxGraveyardSize - 1 the
+ // buffer will be full. Now when we add one more more source it will now evict
+ // the oldest item, which is 1706. In doing so, 1706 will try to release the
// reference it *thinks* it has on 1263. However 1263 has a reference count
// of 0 and is already in a graveyard.
for (size_t i = 0;
- i < PassiveLogCollector::RequestTracker::kMaxGraveyardSize; ++i) {
- log.OnAddEntry(net::NetLog::TYPE_REQUEST_ALIVE,
+ i < PassiveLogCollector::HttpStreamJobTracker::kMaxGraveyardSize; ++i) {
+ log.OnAddEntry(net::NetLog::TYPE_HTTP_STREAM_JOB,
base::TimeTicks(),
- net::NetLog::Source(net::NetLog::SOURCE_URL_REQUEST, i),
+ net::NetLog::Source(net::NetLog::SOURCE_HTTP_STREAM_JOB, i),
net::NetLog::PHASE_END,
NULL);
}
// To pass, this should simply not have DCHECK-ed above.
}
-