summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 01:40:12 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 01:40:12 +0000
commita2fbebee62a76a9f6f75ea3231028454623c53e6 (patch)
tree1adc8b80982870b896b061e3891e9c74473cbf2d /net
parentb608d84596f658c901d2936aee107041ecf5e4cd (diff)
downloadchromium_src-a2fbebee62a76a9f6f75ea3231028454623c53e6.zip
chromium_src-a2fbebee62a76a9f6f75ea3231028454623c53e6.tar.gz
chromium_src-a2fbebee62a76a9f6f75ea3231028454623c53e6.tar.bz2
Add a dump of the currently outstanding jobs when enabling DNS tracing.
Before it would just output the count. Review URL: http://codereview.chromium.org/565051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/host_resolver_impl.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index 94c3857..64b8a03 100644
--- a/net/base/host_resolver_impl.cc
+++ b/net/base/host_resolver_impl.cc
@@ -267,6 +267,10 @@ class HostResolverImpl::Job
return key_;
}
+ int id() const {
+ return id_;
+ }
+
// Called from origin thread.
const RequestsList& requests() const {
return requests_;
@@ -721,6 +725,35 @@ void HostResolverImpl::EnableRequestsTracing(bool enable) {
"Current num outstanding jobs: %d",
static_cast<int>(jobs_.size())));
+ // Dump all of the outstanding jobs.
+ if (!jobs_.empty()) {
+ for (JobMap::iterator job_it = jobs_.begin();
+ job_it != jobs_.end(); ++job_it) {
+ Job* job = job_it->second;
+
+ requests_trace_->Add(StringPrintf(
+ "Outstanding job j%d for {host='%s', address_family=%d}",
+ job->id(),
+ job->key().hostname.c_str(),
+ static_cast<int>(job->key().address_family)));
+
+ // Dump all of the requests attached to this job.
+ for (RequestsList::const_iterator req_it = job->requests().begin();
+ req_it != job->requests().end(); ++req_it) {
+ Request* req = *req_it;
+ requests_trace_->Add(StringPrintf(
+ " %sOutstanding request r%d is attached to job j%d "
+ "{priority=%d, speculative=%d, referrer='%s'}",
+ req->was_cancelled() ? "[CANCELLED] " : "",
+ req->id(),
+ job->id(),
+ static_cast<int>(req->info().priority()),
+ static_cast<int>(req->info().is_speculative()),
+ req->info().referrer().spec().c_str()));
+ }
+ }
+ }
+
size_t total = 0u;
for (size_t i = 0; i < arraysize(job_pools_); ++i)
total += job_pools_[i]->GetNumPendingRequests();