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

Unified Diff: net/url_request/url_request_job_manager.cc

Issue 332833003: net: Make URLRequestJobFactories mandatory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch some tests to TestURLRequestContext Created 6 years, 6 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4a91fd40e9d905a04b8b7436d26b1d086a40703e..0fe557b14418b54ee437845aa9b481973f9e3adb 100644
--- a/net/url_request/url_request_job_manager.cc
+++ b/net/url_request/url_request_job_manager.cc
@@ -57,12 +57,7 @@ URLRequestJob* URLRequestJobManager::CreateJob(
job_factory = request->context()->job_factory();
const std::string& scheme = request->url().scheme(); // already lowercase
- if (job_factory) {
- if (!job_factory->IsHandledProtocol(scheme)) {
- return new URLRequestErrorJob(
- request, network_delegate, ERR_UNKNOWN_URL_SCHEME);
- }
- } else if (!SupportsScheme(scheme)) {
+ if (!job_factory->IsHandledProtocol(scheme)) {
return new URLRequestErrorJob(
request, network_delegate, ERR_UNKNOWN_URL_SCHEME);
}
@@ -85,12 +80,10 @@ URLRequestJob* URLRequestJobManager::CreateJob(
}
}
- if (job_factory) {
- URLRequestJob* job = job_factory->MaybeCreateJobWithProtocolHandler(
- scheme, request, network_delegate);
- if (job)
- return job;
- }
+ URLRequestJob* job = job_factory->MaybeCreateJobWithProtocolHandler(
+ scheme, request, network_delegate);
+ if (job)
+ return job;
// See if the request should be handled by a built-in protocol factory.
for (size_t i = 0; i < arraysize(kBuiltinFactories); ++i) {
@@ -124,13 +117,8 @@ URLRequestJob* URLRequestJobManager::MaybeInterceptRedirect(
job_factory = request->context()->job_factory();
const std::string& scheme = request->url().scheme(); // already lowercase
- if (job_factory) {
- if (!job_factory->IsHandledProtocol(scheme)) {
- return NULL;
- }
- } else if (!SupportsScheme(scheme)) {
+ if (!job_factory->IsHandledProtocol(scheme))
return NULL;
- }
InterceptorList::const_iterator i;
for (i = interceptors_.begin(); i != interceptors_.end(); ++i) {
@@ -156,13 +144,8 @@ URLRequestJob* URLRequestJobManager::MaybeInterceptResponse(
job_factory = request->context()->job_factory();
const std::string& scheme = request->url().scheme(); // already lowercase
- if (job_factory) {
- if (!job_factory->IsHandledProtocol(scheme)) {
- return NULL;
- }
- } else if (!SupportsScheme(scheme)) {
+ if (!job_factory->IsHandledProtocol(scheme))
return NULL;
- }
InterceptorList::const_iterator i;
for (i = interceptors_.begin(); i != interceptors_.end(); ++i) {
« no previous file with comments | « net/url_request/url_request.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698