Index: net/url_request/url_request.cc |
=================================================================== |
--- net/url_request/url_request.cc (revision 21335) |
+++ net/url_request/url_request.cc (working copy) |
@@ -252,6 +252,7 @@ |
job_->SetUpload(upload_.get()); |
is_pending_ = true; |
+ |
response_info_.request_time = Time::Now(); |
response_info_.was_cached = false; |
@@ -270,6 +271,7 @@ |
void URLRequest::RestartWithJob(URLRequestJob *job) { |
DCHECK(job->request() == this); |
+ job_->Kill(); |
OrphanJob(); |
status_ = URLRequestStatus(); |
is_pending_ = false; |
@@ -335,12 +337,12 @@ |
return job_->Read(dest, dest_size, bytes_read); |
} |
-void URLRequest::ReceivedRedirect(const GURL& location) { |
+void URLRequest::ReceivedRedirect(const GURL& location, bool* defer_redirect) { |
URLRequestJob* job = GetJobManager()->MaybeInterceptRedirect(this, location); |
if (job) { |
RestartWithJob(job); |
} else if (delegate_) { |
- delegate_->OnReceivedRedirect(this, location); |
+ delegate_->OnReceivedRedirect(this, location, defer_redirect); |
} |
} |
@@ -353,6 +355,12 @@ |
} |
} |
+void URLRequest::FollowDeferredRedirect() { |
+ DCHECK(job_); |
+ |
+ job_->FollowDeferredRedirect(); |
+} |
+ |
void URLRequest::SetAuth(const wstring& username, const wstring& password) { |
DCHECK(job_); |
DCHECK(job_->NeedsAuth()); |
@@ -423,7 +431,6 @@ |
} |
url_ = location; |
upload_ = NULL; |
- status_ = URLRequestStatus(); |
--redirect_limit_; |
if (strip_post_specific_headers) { |
@@ -442,8 +449,10 @@ |
final_upload_progress_ = job_->GetUploadProgress(); |
} |
+ job_->Kill(); |
OrphanJob(); |
+ status_ = URLRequestStatus(); |
is_pending_ = false; |
Start(); |
return net::OK; |