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 6881c225d4b07596013457c40d031c35e88d97bf..2dc481eb3fb7246ab11da966b5c87ee6da21e4fe 100644 |
--- a/chrome/browser/profiles/profile_io_data.cc |
+++ b/chrome/browser/profiles/profile_io_data.cc |
@@ -499,35 +499,61 @@ void ProfileIOData::LazyInitialize() const { |
command_line.GetSwitchValueASCII(switches::kHstsHosts); |
transport_security_persister_.get()->DeserializeFromCommandLine(serialized); |
+ // Take ownership over these parameters. |
+ cookie_settings_ = profile_params_->cookie_settings; |
+#if defined(ENABLE_NOTIFICATIONS) |
+ notification_service_ = profile_params_->notification_service; |
+#endif |
+ extension_info_map_ = profile_params_->extension_info_map; |
+ |
+ resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); |
+ resource_context_->request_context_ = main_request_context_.get(); |
+ |
+ LazyInitializeInternal(profile_params_.get()); |
+ |
+ profile_params_.reset(); |
+ initialized_ = true; |
+} |
+ |
+void ProfileIOData::ApplyProfileParamsToContext( |
+ ChromeURLRequestContext* context) const { |
+ context->set_is_incognito(is_incognito()); |
+ context->set_accept_language(profile_params_->accept_language); |
+ context->set_accept_charset(profile_params_->accept_charset); |
+ context->set_referrer_charset(profile_params_->referrer_charset); |
+ context->set_ssl_config_service(profile_params_->ssl_config_service); |
+} |
+ |
+void ProfileIOData::SetUpJobFactoryDefaults( |
+ net::URLRequestJobFactory* job_factory) const { |
// NOTE(willchan): Keep these protocol handlers in sync with |
// ProfileIOData::IsHandledProtocol(). |
- job_factory_.reset(new net::URLRequestJobFactory); |
if (profile_params_->protocol_handler_registry) { |
- job_factory_->AddInterceptor( |
+ job_factory->AddInterceptor( |
new ProtocolHandlerRegistryInterceptor( |
profile_params_->protocol_handler_registry)); |
} |
- bool set_protocol = job_factory_->SetProtocolHandler( |
+ bool set_protocol = job_factory->SetProtocolHandler( |
chrome::kExtensionScheme, |
CreateExtensionProtocolHandler(is_incognito(), |
profile_params_->extension_info_map)); |
DCHECK(set_protocol); |
- set_protocol = job_factory_->SetProtocolHandler( |
+ set_protocol = job_factory->SetProtocolHandler( |
chrome::kExtensionResourceScheme, |
CreateExtensionResourceProtocolHandler()); |
DCHECK(set_protocol); |
- set_protocol = job_factory_->SetProtocolHandler( |
+ set_protocol = job_factory->SetProtocolHandler( |
chrome::kChromeUIScheme, |
ChromeURLDataManagerBackend::CreateProtocolHandler( |
chrome_url_data_manager_backend_.get())); |
DCHECK(set_protocol); |
- set_protocol = job_factory_->SetProtocolHandler( |
+ set_protocol = job_factory->SetProtocolHandler( |
chrome::kChromeDevToolsScheme, |
CreateDevToolsProtocolHandler(chrome_url_data_manager_backend_.get())); |
DCHECK(set_protocol); |
#if defined(OS_CHROMEOS) |
if (!is_incognito()) { |
- set_protocol = job_factory_->SetProtocolHandler( |
+ set_protocol = job_factory->SetProtocolHandler( |
chrome::kDriveScheme, new gdata::GDataProtocolHandler()); |
DCHECK(set_protocol); |
} |
@@ -536,33 +562,9 @@ void ProfileIOData::LazyInitialize() const { |
// of compatible documents (PDF, etc) to the GView document viewer. |
const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
if (parsed_command_line.HasSwitch(switches::kEnableGView)) |
- job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); |
+ job_factory->AddInterceptor(new chromeos::GViewRequestInterceptor); |
#endif // !defined(GOOGLE_CHROME_BUILD) |
#endif // defined(OS_CHROMEOS) |
- |
- // Take ownership over these parameters. |
- cookie_settings_ = profile_params_->cookie_settings; |
-#if defined(ENABLE_NOTIFICATIONS) |
- notification_service_ = profile_params_->notification_service; |
-#endif |
- extension_info_map_ = profile_params_->extension_info_map; |
- |
- resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); |
- resource_context_->request_context_ = main_request_context_.get(); |
- |
- LazyInitializeInternal(profile_params_.get()); |
- |
- profile_params_.reset(); |
- initialized_ = true; |
-} |
- |
-void ProfileIOData::ApplyProfileParamsToContext( |
- ChromeURLRequestContext* context) const { |
- context->set_is_incognito(is_incognito()); |
- context->set_accept_language(profile_params_->accept_language); |
- context->set_accept_charset(profile_params_->accept_charset); |
- context->set_referrer_charset(profile_params_->referrer_charset); |
- context->set_ssl_config_service(profile_params_->ssl_config_service); |
} |
void ProfileIOData::ShutdownOnUIThread() { |