diff options
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/url_request.cc | 10 | ||||
-rw-r--r-- | net/url_request/url_request.h | 2 | ||||
-rw-r--r-- | net/url_request/url_request_unittest.cc | 5 |
3 files changed, 8 insertions, 9 deletions
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc index 0f19d69..d1d46bfb 100644 --- a/net/url_request/url_request.cc +++ b/net/url_request/url_request.cc @@ -371,7 +371,7 @@ void URLRequest::Start() { } } - StartInternal(); + StartJob(URLRequestJobManager::GetInstance()->CreateJob(this)); } /////////////////////////////////////////////////////////////////////////////// @@ -388,14 +388,10 @@ void URLRequest::BeforeRequestComplete(int error) { new_url.Swap(&delegate_redirect_url_); StartJob(new URLRequestRedirectJob(this, new_url)); } else { - StartInternal(); + StartJob(URLRequestJobManager::GetInstance()->CreateJob(this)); } } -void URLRequest::StartInternal() { - StartJob(URLRequestJobManager::GetInstance()->CreateJob(this)); -} - void URLRequest::StartJob(URLRequestJob* job) { DCHECK(!is_pending_); DCHECK(!job_); @@ -638,7 +634,7 @@ int URLRequest::Redirect(const GURL& location, int http_status_code) { final_upload_progress_ = job_->GetUploadProgress(); PrepareToRestart(); - StartInternal(); + Start(); return OK; } diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h index b6d58ce..2ad1162 100644 --- a/net/url_request/url_request.h +++ b/net/url_request/url_request.h @@ -587,8 +587,6 @@ class URLRequest : public base::NonThreadSafe { friend class URLRequestJob; typedef std::map<const void*, linked_ptr<UserData> > UserDataMap; - void StartInternal(); - // Resumes or blocks a request paused by the NetworkDelegate::OnBeforeRequest // handler. If |blocked| is true, the request is blocked and an error page is // returned indicating so. This should only be called after Start is called diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index f32af25..1c0987f 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -137,6 +137,11 @@ class BlockingNetworkDelegate : public TestNetworkDelegate { virtual int OnBeforeURLRequest(net::URLRequest* request, net::CompletionCallback* callback, GURL* new_url) { + if (redirect_url_ == request->url()) { + // We've already seen this request and redirected elsewhere. + return net::OK; + } + TestNetworkDelegate::OnBeforeURLRequest(request, callback, new_url); if (!redirect_url_.is_empty()) |