Commit 5fa3e0f6 authored by eroman's avatar eroman Committed by Commit bot

Add jank instrumentation for HostResolverImpl::Resolve().

BUG=455942

Review URL: https://codereview.chromium.org/1109263002

Cr-Commit-Position: refs/heads/master@{#327405}
parent 1f59a1ea
...@@ -1873,8 +1873,8 @@ int HostResolverImpl::Resolve(const RequestInfo& info, ...@@ -1873,8 +1873,8 @@ int HostResolverImpl::Resolve(const RequestInfo& info,
RequestHandle* out_req, RequestHandle* out_req,
const BoundNetLog& source_net_log) { const BoundNetLog& source_net_log) {
// TODO(eroman): Remove ScopedTracker below once crbug.com/455942 is fixed. // TODO(eroman): Remove ScopedTracker below once crbug.com/455942 is fixed.
tracked_objects::ScopedTracker tracking_profile( tracked_objects::ScopedTracker tracking_profile_1(
FROM_HERE_WITH_EXPLICIT_FUNCTION("455942 HostResolverImpl::Resolve")); FROM_HERE_WITH_EXPLICIT_FUNCTION("455942 HostResolverImpl::Resolve 1"));
DCHECK(addresses); DCHECK(addresses);
DCHECK(CalledOnValidThread()); DCHECK(CalledOnValidThread());
...@@ -1896,6 +1896,10 @@ int HostResolverImpl::Resolve(const RequestInfo& info, ...@@ -1896,6 +1896,10 @@ int HostResolverImpl::Resolve(const RequestInfo& info,
// outstanding jobs map. // outstanding jobs map.
Key key = GetEffectiveKeyForRequest(info, ip_number_ptr, source_net_log); Key key = GetEffectiveKeyForRequest(info, ip_number_ptr, source_net_log);
// TODO(eroman): Remove ScopedTracker below once crbug.com/455942 is fixed.
tracked_objects::ScopedTracker tracking_profile_2(
FROM_HERE_WITH_EXPLICIT_FUNCTION("455942 HostResolverImpl::Resolve 2"));
int rv = ResolveHelper(key, info, ip_number_ptr, addresses, source_net_log); int rv = ResolveHelper(key, info, ip_number_ptr, addresses, source_net_log);
if (rv != ERR_DNS_CACHE_MISS) { if (rv != ERR_DNS_CACHE_MISS) {
LogFinishRequest(source_net_log, info, rv); LogFinishRequest(source_net_log, info, rv);
...@@ -1903,16 +1907,27 @@ int HostResolverImpl::Resolve(const RequestInfo& info, ...@@ -1903,16 +1907,27 @@ int HostResolverImpl::Resolve(const RequestInfo& info,
return rv; return rv;
} }
// TODO(eroman): Remove ScopedTracker below once crbug.com/455942 is fixed.
tracked_objects::ScopedTracker tracking_profile_3(
FROM_HERE_WITH_EXPLICIT_FUNCTION("455942 HostResolverImpl::Resolve 3"));
// Next we need to attach our request to a "job". This job is responsible for // Next we need to attach our request to a "job". This job is responsible for
// calling "getaddrinfo(hostname)" on a worker thread. // calling "getaddrinfo(hostname)" on a worker thread.
JobMap::iterator jobit = jobs_.find(key); JobMap::iterator jobit = jobs_.find(key);
Job* job; Job* job;
if (jobit == jobs_.end()) { if (jobit == jobs_.end()) {
// TODO(eroman): Remove ScopedTracker below once crbug.com/455942 is fixed.
tracked_objects::ScopedTracker tracking_profile_4(
FROM_HERE_WITH_EXPLICIT_FUNCTION("455942 HostResolverImpl::Resolve 4"));
job = job =
new Job(weak_ptr_factory_.GetWeakPtr(), key, priority, source_net_log); new Job(weak_ptr_factory_.GetWeakPtr(), key, priority, source_net_log);
job->Schedule(false); job->Schedule(false);
// TODO(eroman): Remove ScopedTracker below once crbug.com/455942 is fixed.
tracked_objects::ScopedTracker tracking_profile_5(
FROM_HERE_WITH_EXPLICIT_FUNCTION("455942 HostResolverImpl::Resolve 5"));
// Check for queue overflow. // Check for queue overflow.
if (dispatcher_->num_queued_jobs() > max_queued_jobs_) { if (dispatcher_->num_queued_jobs() > max_queued_jobs_) {
Job* evicted = static_cast<Job*>(dispatcher_->EvictOldestLowest()); Job* evicted = static_cast<Job*>(dispatcher_->EvictOldestLowest());
...@@ -1929,6 +1944,10 @@ int HostResolverImpl::Resolve(const RequestInfo& info, ...@@ -1929,6 +1944,10 @@ int HostResolverImpl::Resolve(const RequestInfo& info,
job = jobit->second; job = jobit->second;
} }
// TODO(eroman): Remove ScopedTracker below once crbug.com/455942 is fixed.
tracked_objects::ScopedTracker tracking_profile_6(
FROM_HERE_WITH_EXPLICIT_FUNCTION("455942 HostResolverImpl::Resolve 6"));
// Can't complete synchronously. Create and attach request. // Can't complete synchronously. Create and attach request.
scoped_ptr<Request> req(new Request( scoped_ptr<Request> req(new Request(
source_net_log, info, priority, callback, addresses)); source_net_log, info, priority, callback, addresses));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment