Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: net/url_request/url_request.cc

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: NetworkDelegate fixed almost everywhere Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 65dabe908c0f9cbc1cfe9a1095ec703e7e57759c..cbd097003479ec8effd830cb5832ffc1ad0404ec 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -428,7 +428,8 @@ void URLRequest::Start() {
return;
}
- StartJob(URLRequestJobManager::GetInstance()->CreateJob(this));
+ StartJob(URLRequestJobManager::GetInstance()->CreateJob(
+ this, context_->network_delegate()));
}
///////////////////////////////////////////////////////////////////////////////
@@ -447,18 +448,20 @@ void URLRequest::BeforeRequestComplete(int error) {
std::string source("delegate");
net_log_.AddEvent(NetLog::TYPE_CANCELLED,
NetLog::StringCallback("source", &source));
- StartJob(new URLRequestErrorJob(this, error));
+ StartJob(new URLRequestErrorJob(this, context_->network_delegate(), error));
} else if (!delegate_redirect_url_.is_empty()) {
GURL new_url;
new_url.Swap(&delegate_redirect_url_);
- URLRequestRedirectJob* job = new URLRequestRedirectJob(this, new_url);
+ URLRequestRedirectJob* job = new URLRequestRedirectJob(
+ this, context_->network_delegate(), new_url);
// Use status code 307 to preserve the method, so POST requests work.
job->set_redirect_code(
URLRequestRedirectJob::REDIRECT_307_TEMPORARY_REDIRECT);
StartJob(job);
} else {
- StartJob(URLRequestJobManager::GetInstance()->CreateJob(this));
+ StartJob(URLRequestJobManager::GetInstance()->CreateJob(
+ this, context_->network_delegate()));
}
}
@@ -491,7 +494,8 @@ void URLRequest::StartJob(URLRequestJob* job) {
void URLRequest::Restart() {
// Should only be called if the original job didn't make any progress.
DCHECK(job_ && !job_->has_response_started());
- RestartWithJob(URLRequestJobManager::GetInstance()->CreateJob(this));
+ RestartWithJob(URLRequestJobManager::GetInstance()->CreateJob(
+ this, context_->network_delegate()));
}
void URLRequest::RestartWithJob(URLRequestJob *job) {

Powered by Google App Engine
This is Rietveld 408576698