| 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..c901c93efae7943dc4a8275080d48e7a0aa6a44b 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:
|
| @@ -76,7 +78,8 @@ URLRequestJob* URLRequestJobManager::CreateJob(
|
| //
|
|
|
| if (job_factory) {
|
| - URLRequestJob* job = job_factory->MaybeCreateJobWithInterceptor(request);
|
| + URLRequestJob* job = job_factory->MaybeCreateJobWithInterceptor(
|
| + request, network_delegate);
|
| if (job)
|
| return job;
|
| }
|
| @@ -85,15 +88,15 @@ URLRequestJob* URLRequestJobManager::CreateJob(
|
| if (!(request->load_flags() & LOAD_DISABLE_INTERCEPT)) {
|
| InterceptorList::const_iterator i;
|
| for (i = interceptors_.begin(); i != interceptors_.end(); ++i) {
|
| - URLRequestJob* job = (*i)->MaybeIntercept(request);
|
| + URLRequestJob* job = (*i)->MaybeIntercept(request, network_delegate);
|
| if (job)
|
| return job;
|
| }
|
| }
|
|
|
| if (job_factory) {
|
| - URLRequestJob* job =
|
| - job_factory->MaybeCreateJobWithProtocolHandler(scheme, request);
|
| + URLRequestJob* job = job_factory->MaybeCreateJobWithProtocolHandler(
|
| + scheme, request, network_delegate);
|
| if (job)
|
| return job;
|
| }
|
| @@ -105,7 +108,7 @@ URLRequestJob* URLRequestJobManager::CreateJob(
|
| // built-in protocol factory.
|
| FactoryMap::const_iterator i = factories_.find(scheme);
|
| if (i != factories_.end()) {
|
| - URLRequestJob* job = i->second(request, scheme);
|
| + URLRequestJob* job = i->second(request, network_delegate, scheme);
|
| if (job)
|
| return job;
|
| }
|
| @@ -113,7 +116,8 @@ URLRequestJob* URLRequestJobManager::CreateJob(
|
| // See if the request should be handled by a built-in protocol factory.
|
| for (size_t i = 0; i < arraysize(kBuiltinFactories); ++i) {
|
| if (scheme == kBuiltinFactories[i].scheme) {
|
| - URLRequestJob* job = (kBuiltinFactories[i].factory)(request, scheme);
|
| + URLRequestJob* job = (kBuiltinFactories[i].factory)(
|
| + request, network_delegate, scheme);
|
| DCHECK(job); // The built-in factories are not expected to fail!
|
| return job;
|
| }
|
| @@ -123,7 +127,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(
|
|
|