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

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: Latest merge 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
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_about_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index a63171e5b194e7ef37b8ce362b774c73840f4063..ec48c6a22d65b53b6de6480412760be746f0e9d4 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -96,12 +96,13 @@ void URLRequest::Deprecated::UnregisterRequestInterceptor(
URLRequestJob* URLRequest::Interceptor::MaybeInterceptRedirect(
URLRequest* request,
+ NetworkDelegate* network_delegate,
const GURL& location) {
return NULL;
}
URLRequestJob* URLRequest::Interceptor::MaybeInterceptResponse(
- URLRequest* request) {
+ URLRequest* request, NetworkDelegate* network_delegate) {
return NULL;
}
@@ -428,7 +429,8 @@ void URLRequest::Start() {
return;
}
- StartJob(URLRequestJobManager::GetInstance()->CreateJob(this));
+ StartJob(URLRequestJobManager::GetInstance()->CreateJob(
+ this, context_->network_delegate()));
}
///////////////////////////////////////////////////////////////////////////////
@@ -447,18 +449,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 +495,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) {
@@ -586,8 +591,8 @@ void URLRequest::StopCaching() {
void URLRequest::NotifyReceivedRedirect(const GURL& location,
bool* defer_redirect) {
URLRequestJob* job =
- URLRequestJobManager::GetInstance()->MaybeInterceptRedirect(this,
- location);
+ URLRequestJobManager::GetInstance()->MaybeInterceptRedirect(
+ this, context_->network_delegate(), location);
if (job) {
RestartWithJob(job);
} else if (delegate_) {
@@ -603,7 +608,8 @@ void URLRequest::NotifyResponseStarted() {
net_error);
URLRequestJob* job =
- URLRequestJobManager::GetInstance()->MaybeInterceptResponse(this);
+ URLRequestJobManager::GetInstance()->MaybeInterceptResponse(
+ this, context_->network_delegate());
if (job) {
RestartWithJob(job);
} else {
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_about_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698