| Index: chrome/browser/profiles/profile_impl_io_data.cc
|
| diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
|
| index be8c593be601e339808c325d3f8fc065273f4423..b703c5b0f2494dcf6e6e4758dc759adbe099d3a0 100644
|
| --- a/chrome/browser/profiles/profile_impl_io_data.cc
|
| +++ b/chrome/browser/profiles/profile_impl_io_data.cc
|
| @@ -202,10 +202,10 @@ ProfileImplIOData::Handle::GetIsolatedAppRequestContextGetter(
|
| if (iter != app_request_context_getter_map_.end())
|
| return iter->second;
|
|
|
| - scoped_ptr<net::URLRequestJobFactory::Interceptor>
|
| + scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
|
| protocol_handler_interceptor(
|
| ProtocolHandlerRegistryFactory::GetForProfile(profile_)->
|
| - CreateURLInterceptor());
|
| + CreateJobInterceptorFactory());
|
| ChromeURLRequestContextGetter* context =
|
| ChromeURLRequestContextGetter::CreateOriginalForIsolatedApp(
|
| profile_, io_data_, descriptor,
|
| @@ -423,12 +423,12 @@ void ProfileImplIOData::LazyInitializeInternal(
|
|
|
| scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory(
|
| new net::URLRequestJobFactoryImpl());
|
| - SetUpJobFactoryDefaults(main_job_factory.get(),
|
| - profile_params->protocol_handler_interceptor.Pass(),
|
| - network_delegate(),
|
| - main_context->ftp_transaction_factory(),
|
| - main_context->ftp_auth_cache());
|
| - main_job_factory_ = main_job_factory.Pass();
|
| + main_job_factory_ = SetUpJobFactoryDefaults(
|
| + main_job_factory.Pass(),
|
| + profile_params->protocol_handler_interceptor.Pass(),
|
| + network_delegate(),
|
| + main_context->ftp_transaction_factory(),
|
| + main_context->ftp_auth_cache());
|
| main_context->set_job_factory(main_job_factory_.get());
|
|
|
| #if defined(ENABLE_EXTENSIONS)
|
| @@ -482,13 +482,12 @@ void ProfileImplIOData::
|
| // job_factory::IsHandledProtocol return true, which prevents attempts to
|
| // handle the protocol externally. We pass NULL in to
|
| // SetUpJobFactory() to get this effect.
|
| - SetUpJobFactoryDefaults(
|
| - extensions_job_factory.get(),
|
| - scoped_ptr<net::URLRequestJobFactoryImpl::Interceptor>(NULL),
|
| + extensions_job_factory_ = SetUpJobFactoryDefaults(
|
| + extensions_job_factory.Pass(),
|
| + scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>(NULL),
|
| NULL,
|
| extensions_context->ftp_transaction_factory(),
|
| extensions_context->ftp_auth_cache());
|
| - extensions_job_factory_ = extensions_job_factory.Pass();
|
| extensions_context->set_job_factory(extensions_job_factory_.get());
|
| }
|
|
|
| @@ -496,7 +495,7 @@ ChromeURLRequestContext*
|
| ProfileImplIOData::InitializeAppRequestContext(
|
| ChromeURLRequestContext* main_context,
|
| const StoragePartitionDescriptor& partition_descriptor,
|
| - scoped_ptr<net::URLRequestJobFactory::Interceptor>
|
| + scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
|
| protocol_handler_interceptor) const {
|
| // Copy most state from the main context.
|
| AppRequestContext* context = new AppRequestContext(load_time_stats());
|
| @@ -560,20 +559,23 @@ ProfileImplIOData::InitializeAppRequestContext(
|
| context->SetHttpTransactionFactory(
|
| scoped_ptr<net::HttpTransactionFactory>(app_http_cache));
|
|
|
| + scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
|
| + new net::URLRequestJobFactoryImpl());
|
| + scoped_ptr<net::URLRequestJobFactory> top_job_factory;
|
| // Overwrite the job factory that we inherit from the main context so
|
| // that we can later provide our own handlers for storage related protocols.
|
| // Install all the usual protocol handlers unless we are in a browser plugin
|
| // guest process, in which case only web-safe schemes are allowed.
|
| - scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
|
| - new net::URLRequestJobFactoryImpl());
|
| if (!partition_descriptor.in_memory) {
|
| - SetUpJobFactoryDefaults(
|
| - job_factory.get(), protocol_handler_interceptor.Pass(),
|
| + top_job_factory = SetUpJobFactoryDefaults(
|
| + job_factory.Pass(), protocol_handler_interceptor.Pass(),
|
| network_delegate(),
|
| context->ftp_transaction_factory(),
|
| context->ftp_auth_cache());
|
| + } else {
|
| + top_job_factory = job_factory.PassAs<net::URLRequestJobFactory>();
|
| }
|
| - context->SetJobFactory(job_factory.PassAs<net::URLRequestJobFactory>());
|
| + context->SetJobFactory(top_job_factory.Pass());
|
|
|
| return context;
|
| }
|
| @@ -636,7 +638,7 @@ ChromeURLRequestContext*
|
| ProfileImplIOData::AcquireIsolatedAppRequestContext(
|
| ChromeURLRequestContext* main_context,
|
| const StoragePartitionDescriptor& partition_descriptor,
|
| - scoped_ptr<net::URLRequestJobFactory::Interceptor>
|
| + scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
|
| protocol_handler_interceptor) const {
|
| // We create per-app contexts on demand, unlike the others above.
|
| ChromeURLRequestContext* app_request_context =
|
|
|