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

Unified Diff: net/url_request/url_request_job_manager.cc

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_job_manager.cc
diff --git a/net/url_request/url_request_job_manager.cc b/net/url_request/url_request_job_manager.cc
index b3456288540f82021a39138e7740b32528291cc9..665a6fe2774f9e3ea5fe47967974b3da6bf3a11f 100644
--- a/net/url_request/url_request_job_manager.cc
+++ b/net/url_request/url_request_job_manager.cc
@@ -48,12 +48,12 @@ URLRequestJobManager* URLRequestJobManager::GetInstance() {
}
URLRequestJob* URLRequestJobManager::CreateJob(
- URLRequest* request) const {
+ URLRequest* request, NetworkDelegate* network_delegate) const {
DCHECK(IsAllowedThread());
// If we are given an invalid URL, then don't even try to inspect the scheme.
if (!request->url().is_valid())
- return new URLRequestErrorJob(request, ERR_INVALID_URL);
+ return new URLRequestErrorJob(request, network_delegate, ERR_INVALID_URL);
// We do this here to avoid asking interceptors about unsupported schemes.
const URLRequestJobFactory* job_factory = NULL;
@@ -62,10 +62,12 @@ URLRequestJob* URLRequestJobManager::CreateJob(
const std::string& scheme = request->url().scheme(); // already lowercase
if (job_factory) {
if (!job_factory->IsHandledProtocol(scheme)) {
- return new URLRequestErrorJob(request, ERR_UNKNOWN_URL_SCHEME);
+ return new URLRequestErrorJob(
+ request, network_delegate, ERR_UNKNOWN_URL_SCHEME);
}
} else if (!SupportsScheme(scheme)) {
- return new URLRequestErrorJob(request, ERR_UNKNOWN_URL_SCHEME);
+ return new URLRequestErrorJob(
+ request, network_delegate, ERR_UNKNOWN_URL_SCHEME);
}
// THREAD-SAFETY NOTICE:
@@ -92,8 +94,8 @@ URLRequestJob* URLRequestJobManager::CreateJob(
}
if (job_factory) {
- URLRequestJob* job =
- job_factory->MaybeCreateJobWithProtocolHandler(scheme, request);
+ URLRequestJob* job = job_factory->MaybeCreateJobWithProtocolHandler(
+ scheme, request, network_delegate);
if (job)
return job;
}
@@ -123,7 +125,7 @@ URLRequestJob* URLRequestJobManager::CreateJob(
// wasn't interested in handling the URL. That is fairly unexpected, and we
// don't have a specific error to report here :-(
LOG(WARNING) << "Failed to map: " << request->url().spec();
- return new URLRequestErrorJob(request, ERR_FAILED);
+ return new URLRequestErrorJob(request, network_delegate, ERR_FAILED);
}
URLRequestJob* URLRequestJobManager::MaybeInterceptRedirect(

Powered by Google App Engine
This is Rietveld 408576698