Chromium Code Reviews| Index: chrome/browser/profiles/profile_io_data.cc |
| diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc |
| index 7d6f2a0fa55281ecb459a4eb5ccdba83955ef172..e73d11f3bd09c906d44368ef92481ce6161ae63a 100644 |
| --- a/chrome/browser/profiles/profile_io_data.cc |
| +++ b/chrome/browser/profiles/profile_io_data.cc |
| @@ -172,10 +172,10 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) { |
| DCHECK(protocol_handler_registry); |
| // The profile instance is only available here in the InitializeOnUIThread |
| - // method, so we create the url interceptor here, then save it for |
| + // method, so we create the url job factory here, then save it for |
| // later delivery to the job factory in LazyInitialize. |
| - params->protocol_handler_interceptor.reset( |
| - protocol_handler_registry->CreateURLInterceptor()); |
| + params->protocol_handler_interceptor = |
| + protocol_handler_registry->CreateURLRequestJobFactory(); |
| ChromeProxyConfigService* proxy_config_service = |
| ProxyServiceFactory::CreateProxyConfigService(true); |
| @@ -394,7 +394,7 @@ ChromeURLRequestContext* |
| ProfileIOData::GetIsolatedAppRequestContext( |
| ChromeURLRequestContext* main_context, |
| const StoragePartitionDescriptor& partition_descriptor, |
| - scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| + scoped_ptr<ProtocolHandlerRegistry::JobFactory> |
| protocol_handler_interceptor) const { |
| LazyInitialize(); |
| ChromeURLRequestContext* context = NULL; |
| @@ -604,9 +604,9 @@ void ProfileIOData::ApplyProfileParamsToContext( |
| context->set_ssl_config_service(profile_params_->ssl_config_service); |
| } |
| -void ProfileIOData::SetUpJobFactoryDefaults( |
| - net::URLRequestJobFactoryImpl* job_factory, |
| - scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| +scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( |
| + scoped_ptr<net::URLRequestJobFactoryImpl> job_factory, |
| + scoped_ptr<ProtocolHandlerRegistry::JobFactory> |
| protocol_handler_interceptor, |
| net::NetworkDelegate* network_delegate, |
| net::FtpTransactionFactory* ftp_transaction_factory, |
| @@ -622,11 +622,6 @@ void ProfileIOData::SetUpJobFactoryDefaults( |
| CreateDevToolsProtocolHandler(chrome_url_data_manager_backend(), |
| network_delegate)); |
| DCHECK(set_protocol); |
| - |
| - if (protocol_handler_interceptor.get()) { |
| - job_factory->AddInterceptor(protocol_handler_interceptor.release()); |
| - } |
| - |
| set_protocol = job_factory->SetProtocolHandler( |
| extensions::kExtensionScheme, |
| CreateExtensionProtocolHandler(is_incognito(), GetExtensionInfoMap())); |
| @@ -661,6 +656,14 @@ void ProfileIOData::SetUpJobFactoryDefaults( |
| new net::FtpProtocolHandler(ftp_transaction_factory, |
| ftp_auth_cache)); |
| #endif // !defined(DISABLE_FTP_SUPPORT) |
| + |
| + if (protocol_handler_interceptor.get()) { |
| + protocol_handler_interceptor->Chain( |
|
erikwright (departed)
2013/01/02 16:29:36
Passing a custom type around, and configuring the
pauljensen
2013/01/02 22:13:35
I agree, I think if this code occurs again we shou
|
| + job_factory.PassAs<net::URLRequestJobFactory>()); |
| + return protocol_handler_interceptor.PassAs<net::URLRequestJobFactory>(); |
| + } else { |
| + return job_factory.PassAs<net::URLRequestJobFactory>(); |
| + } |
| } |
| void ProfileIOData::ShutdownOnUIThread() { |