summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/base/net_log_event_type_list.h8
-rw-r--r--net/url_request/url_request.cc17
2 files changed, 14 insertions, 11 deletions
diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h
index 6b4a7e2..123d2fd 100644
--- a/net/base/net_log_event_type_list.h
+++ b/net/base/net_log_event_type_list.h
@@ -258,8 +258,10 @@ EVENT_TYPE(SOCKET_POOL_SOCKET_ID)
// URLRequest
// ------------------------------------------------------------------------
-// Measures the time between URLRequest::Start() and
-// URLRequest::ResponseStarted().
+// Measures the time it took a URLRequestJob to start. For the most part this
+// corresponds with the time between URLRequest::Start() and
+// URLRequest::ResponseStarted(), however it is also repeated for every
+// redirect, and every intercepted job that handles the request.
//
// For the BEGIN phase, the following parameters are attached:
// {
@@ -273,7 +275,7 @@ EVENT_TYPE(SOCKET_POOL_SOCKET_ID)
// {
// "net_error": <Net error code of the failure>
// }
-EVENT_TYPE(URL_REQUEST_START)
+EVENT_TYPE(URL_REQUEST_START_JOB)
// This event is sent once a URLRequest receives a redirect. The parameters
// attached to the event are:
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();