diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-17 23:53:09 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-17 23:53:09 +0000 |
commit | d17c865366e935a09158cbbbf0bf7b93c24668ad (patch) | |
tree | 0505c33de9b2d451d86825d1e6b3f79d049979b2 /net/url_request | |
parent | 3c094bab532487851f46419baf81d82604f64600 (diff) | |
download | chromium_src-d17c865366e935a09158cbbbf0bf7b93c24668ad.zip chromium_src-d17c865366e935a09158cbbbf0bf7b93c24668ad.tar.gz chromium_src-d17c865366e935a09158cbbbf0bf7b93c24668ad.tar.bz2 |
Fix the logging of URL_REQUEST_START, so the nesting is correct on redirects.
(It was possible to get unmatched start/end before).
Also renamed the event to URL_REQUEST_START_JOB, since it is really a superset of URLRequest::Start().
Review URL: http://codereview.chromium.org/2091009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47475 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/url_request.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc index 81144af..f32782c 100644 --- a/net/url_request/url_request.cc +++ b/net/url_request/url_request.cc @@ -267,7 +267,7 @@ void URLRequest::StartJob(URLRequestJob* job) { DCHECK(!job_); net_log_.BeginEvent( - net::NetLog::TYPE_URL_REQUEST_START, + net::NetLog::TYPE_URL_REQUEST_START_JOB, new URLRequestStartEventParameters(url_, method_, load_flags_)); job_ = job; @@ -374,13 +374,10 @@ void URLRequest::ReceivedRedirect(const GURL& location, bool* defer_redirect) { } void URLRequest::ResponseStarted() { - if (!status_.is_success()) { - net_log_.EndEvent( - net::NetLog::TYPE_URL_REQUEST_START, - new net::NetLogIntegerParameter("net_error", status_.os_error())); - } else { - net_log_.EndEvent(net::NetLog::TYPE_URL_REQUEST_START, NULL); - } + scoped_refptr<net::NetLog::EventParameters> params; + if (!status_.is_success()) + params = new net::NetLogIntegerParameter("net_error", status_.os_error()); + net_log_.EndEvent(net::NetLog::TYPE_URL_REQUEST_START_JOB, params); URLRequestJob* job = GetJobManager()->MaybeInterceptResponse(this); if (job) { @@ -426,6 +423,10 @@ void URLRequest::ContinueDespiteLastError() { void URLRequest::PrepareToRestart() { DCHECK(job_); + // Close the current URL_REQUEST_START_JOB, since we will be starting a new + // one. + net_log_.EndEvent(net::NetLog::TYPE_URL_REQUEST_START_JOB, NULL); + job_->Kill(); OrphanJob(); |