| Index: net/url_request/url_request_http_job.cc
|
| ===================================================================
|
| --- net/url_request/url_request_http_job.cc (revision 199488)
|
| +++ net/url_request/url_request_http_job.cc (working copy)
|
| @@ -416,6 +416,7 @@
|
| DoneWithRequest(ABORTED);
|
| transaction_.reset();
|
| response_info_ = NULL;
|
| + receive_headers_end_ = base::TimeTicks();
|
| }
|
|
|
| void URLRequestHttpJob::StartTransaction() {
|
| @@ -819,6 +820,8 @@
|
| if (!transaction_.get())
|
| return;
|
|
|
| + receive_headers_end_ = base::TimeTicks::Now();
|
| +
|
| // Clear the IO_PENDING status
|
| SetStatus(URLRequestStatus());
|
|
|
| @@ -918,6 +921,7 @@
|
|
|
| // These will be reset in OnStartCompleted.
|
| response_info_ = NULL;
|
| + receive_headers_end_ = base::TimeTicks();
|
| response_cookies_.clear();
|
|
|
| ResetTimer();
|
| @@ -982,8 +986,12 @@
|
|
|
| void URLRequestHttpJob::GetLoadTimingInfo(
|
| LoadTimingInfo* load_timing_info) const {
|
| - if (transaction_)
|
| - transaction_->GetLoadTimingInfo(load_timing_info);
|
| + // If haven't made it far enough to receive any headers, don't return
|
| + // anything. This makes for more consistent behavior in the case of errors.
|
| + if (!transaction_ || receive_headers_end_.is_null())
|
| + return;
|
| + if (transaction_->GetLoadTimingInfo(load_timing_info))
|
| + load_timing_info->receive_headers_end = receive_headers_end_;
|
| }
|
|
|
| bool URLRequestHttpJob::GetResponseCookies(std::vector<std::string>* cookies) {
|
| @@ -1124,6 +1132,7 @@
|
|
|
| // These will be reset in OnStartCompleted.
|
| response_info_ = NULL;
|
| + receive_headers_end_ = base::TimeTicks::Now();
|
| response_cookies_.clear();
|
|
|
| ResetTimer();
|
| @@ -1147,6 +1156,7 @@
|
| DCHECK(transaction_.get());
|
|
|
| DCHECK(!response_info_) << "should not have a response yet";
|
| + receive_headers_end_ = base::TimeTicks();
|
|
|
| ResetTimer();
|
|
|
| @@ -1172,6 +1182,7 @@
|
| return;
|
|
|
| DCHECK(!response_info_) << "should not have a response yet";
|
| + receive_headers_end_ = base::TimeTicks();
|
|
|
| ResetTimer();
|
|
|
|
|