| Index: chrome/browser/profiles/off_the_record_profile_io_data.cc
|
| diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc
|
| index d614370cbff69c95d463acdc8954b53f0ea2aefd..6cc3ca722b1c026d5a1628ec592c773e8c129cb9 100644
|
| --- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
|
| +++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
|
| @@ -71,7 +71,8 @@ OffTheRecordProfileIOData::Handle::GetResourceContextNoInit() const {
|
|
|
| scoped_refptr<ChromeURLRequestContextGetter>
|
| OffTheRecordProfileIOData::Handle::CreateMainRequestContextGetter(
|
| - content::ProtocolHandlerMap* protocol_handlers) const {
|
| + content::ProtocolHandlerMap* protocol_handlers,
|
| + content::ProtocolHandlerScopedVector protocol_interceptors) const {
|
| // TODO(oshima): Re-enable when ChromeOS only accesses the profile on the UI
|
| // thread.
|
| #if !defined(OS_CHROMEOS)
|
| @@ -81,7 +82,7 @@ OffTheRecordProfileIOData::Handle::CreateMainRequestContextGetter(
|
| 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());
|
| return main_request_context_getter_;
|
| }
|
|
|
| @@ -116,7 +117,8 @@ scoped_refptr<ChromeURLRequestContextGetter>
|
| OffTheRecordProfileIOData::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));
|
| DCHECK(!partition_path.empty());
|
| LazyInitialize();
|
| @@ -132,7 +134,7 @@ OffTheRecordProfileIOData::Handle::CreateIsolatedAppRequestContextGetter(
|
| ChromeURLRequestContextGetter* context =
|
| 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;
|
| @@ -162,7 +164,8 @@ OffTheRecordProfileIOData::~OffTheRecordProfileIOData() {
|
|
|
| void OffTheRecordProfileIOData::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;
|
| @@ -229,6 +232,7 @@ void OffTheRecordProfileIOData::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());
|
| @@ -276,6 +280,7 @@ void OffTheRecordProfileIOData::
|
| // SetUpJobFactoryDefaults() to get this effect.
|
| extensions_job_factory_ = SetUpJobFactoryDefaults(
|
| extensions_job_factory.Pass(),
|
| + content::ProtocolHandlerScopedVector(),
|
| scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>(),
|
| NULL,
|
| ftp_factory_.get());
|
| @@ -288,7 +293,8 @@ OffTheRecordProfileIOData::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 {
|
| AppRequestContext* context = new AppRequestContext();
|
|
|
| // Copy most state from the main context.
|
| @@ -315,6 +321,7 @@ OffTheRecordProfileIOData::InitializeAppRequestContext(
|
| InstallProtocolHandlers(job_factory.get(), protocol_handlers);
|
| scoped_ptr<net::URLRequestJobFactory> top_job_factory;
|
| top_job_factory = SetUpJobFactoryDefaults(job_factory.Pass(),
|
| + protocol_interceptors.Pass(),
|
| protocol_handler_interceptor.Pass(),
|
| network_delegate(),
|
| ftp_factory_.get());
|
| @@ -342,12 +349,14 @@ OffTheRecordProfileIOData::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;
|
| }
|
|
|