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 9ccf1d4e352606eb483df898d7f7a32b83e7560d..de95c8fb14b7e3a0f96531cfb0e504b30fe6161d 100644 |
--- a/net/url_request/url_request_job_manager.cc |
+++ b/net/url_request/url_request_job_manager.cc |
@@ -55,9 +55,15 @@ URLRequestJob* URLRequestJobManager::CreateJob( |
// We do this here to avoid asking interceptors about unsupported schemes. |
const URLRequestJobFactory* job_factory = NULL; |
- job_factory = request->context()->job_factory(); |
- |
const std::string& scheme = request->url().scheme(); // already lowercase |
+ |
+ // Use request-specific job factory if it is given. |
+ job_factory = request->job_factory(); |
+ if (!job_factory || !job_factory->IsHandledProtocol(scheme)) { |
+ // Otherwise use the request context's factory. |
+ job_factory = request->context()->job_factory(); |
+ } |
+ |
if (job_factory) { |
if (!job_factory->IsHandledProtocol(scheme)) { |
return new URLRequestErrorJob( |