| 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 7d2e1826ba0c2309268cfced6a2719be763e9129..3e1f8cf739aab58e39845f7fd68e650dea19e344 100644
|
| --- a/chrome/browser/profiles/profile_impl_io_data.cc
|
| +++ b/chrome/browser/profiles/profile_impl_io_data.cc
|
| @@ -175,13 +175,14 @@ ProfileImplIOData::Handle::GetResourceContextNoInit() const {
|
| scoped_refptr<ChromeURLRequestContextGetter>
|
| ProfileImplIOData::Handle::CreateMainRequestContextGetter(
|
| content::ProtocolHandlerMap* protocol_handlers,
|
| + content::ProtocolHandlerScopedVector protocol_interceptors,
|
| PrefService* local_state,
|
| IOThread* io_thread) const {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| LazyInitialize();
|
| DCHECK(!main_request_context_getter_.get());
|
| main_request_context_getter_ = ChromeURLRequestContextGetter::Create(
|
| - profile_, io_data_, protocol_handlers);
|
| + profile_, io_data_, protocol_handlers, protocol_interceptors.Pass());
|
|
|
| io_data_->predictor_
|
| ->InitNetworkPredictor(profile_->GetPrefs(),
|
| @@ -222,7 +223,8 @@ scoped_refptr<ChromeURLRequestContextGetter>
|
| ProfileImplIOData::Handle::CreateIsolatedAppRequestContextGetter(
|
| const base::FilePath& partition_path,
|
| bool in_memory,
|
| - content::ProtocolHandlerMap* protocol_handlers) const {
|
| + content::ProtocolHandlerMap* protocol_handlers,
|
| + content::ProtocolHandlerScopedVector protocol_interceptors) const {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| // Check that the partition_path is not the same as the base profile path. We
|
| // expect isolated partition, which will never go to the default profile path.
|
| @@ -244,7 +246,8 @@ ProfileImplIOData::Handle::CreateIsolatedAppRequestContextGetter(
|
| ChromeURLRequestContextGetter::CreateForIsolatedApp(
|
| profile_, io_data_, descriptor,
|
| protocol_handler_interceptor.Pass(),
|
| - protocol_handlers);
|
| + protocol_handlers,
|
| + protocol_interceptors.Pass());
|
| app_request_context_getter_map_[descriptor] = context;
|
|
|
| return context;
|
| @@ -346,7 +349,8 @@ ProfileImplIOData::~ProfileImplIOData() {
|
|
|
| void ProfileImplIOData::InitializeInternal(
|
| ProfileParams* profile_params,
|
| - content::ProtocolHandlerMap* protocol_handlers) const {
|
| + content::ProtocolHandlerMap* protocol_handlers,
|
| + content::ProtocolHandlerScopedVector protocol_interceptors) const {
|
| ChromeURLRequestContext* main_context = main_request_context();
|
|
|
| IOThread* const io_thread = profile_params->io_thread;
|
| @@ -473,6 +477,7 @@ void ProfileImplIOData::InitializeInternal(
|
| InstallProtocolHandlers(main_job_factory.get(), protocol_handlers);
|
| main_job_factory_ = SetUpJobFactoryDefaults(
|
| main_job_factory.Pass(),
|
| + protocol_interceptors.Pass(),
|
| profile_params->protocol_handler_interceptor.Pass(),
|
| network_delegate(),
|
| ftp_factory_.get());
|
| @@ -529,6 +534,7 @@ void ProfileImplIOData::
|
| // SetUpJobFactory() to get this effect.
|
| extensions_job_factory_ = SetUpJobFactoryDefaults(
|
| extensions_job_factory.Pass(),
|
| + content::ProtocolHandlerScopedVector(),
|
| scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>(),
|
| NULL,
|
| ftp_factory_.get());
|
| @@ -541,7 +547,8 @@ ProfileImplIOData::InitializeAppRequestContext(
|
| const StoragePartitionDescriptor& partition_descriptor,
|
| scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
|
| protocol_handler_interceptor,
|
| - content::ProtocolHandlerMap* protocol_handlers) const {
|
| + content::ProtocolHandlerMap* protocol_handlers,
|
| + content::ProtocolHandlerScopedVector protocol_interceptors) const {
|
| // Copy most state from the main context.
|
| AppRequestContext* context = new AppRequestContext();
|
| context->CopyFrom(main_context);
|
| @@ -604,12 +611,15 @@ ProfileImplIOData::InitializeAppRequestContext(
|
| context->SetHttpTransactionFactory(
|
| scoped_ptr<net::HttpTransactionFactory>(app_http_cache));
|
|
|
| + // TODO TODOTODO_kinuko
|
| scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
|
| new net::URLRequestJobFactoryImpl());
|
| InstallProtocolHandlers(job_factory.get(), protocol_handlers);
|
| scoped_ptr<net::URLRequestJobFactory> top_job_factory(
|
| SetUpJobFactoryDefaults(
|
| - job_factory.Pass(), protocol_handler_interceptor.Pass(),
|
| + job_factory.Pass(),
|
| + protocol_interceptors.Pass(),
|
| + protocol_handler_interceptor.Pass(),
|
| network_delegate(),
|
| ftp_factory_.get()));
|
| context->SetJobFactory(top_job_factory.Pass());
|
| @@ -681,12 +691,14 @@ ProfileImplIOData::AcquireIsolatedAppRequestContext(
|
| const StoragePartitionDescriptor& partition_descriptor,
|
| scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
|
| protocol_handler_interceptor,
|
| - content::ProtocolHandlerMap* protocol_handlers) const {
|
| + content::ProtocolHandlerMap* protocol_handlers,
|
| + content::ProtocolHandlerScopedVector protocol_interceptors) const {
|
| // We create per-app contexts on demand, unlike the others above.
|
| ChromeURLRequestContext* app_request_context =
|
| InitializeAppRequestContext(main_context, partition_descriptor,
|
| protocol_handler_interceptor.Pass(),
|
| - protocol_handlers);
|
| + protocol_handlers,
|
| + protocol_interceptors.Pass());
|
| DCHECK(app_request_context);
|
| return app_request_context;
|
| }
|
|
|