| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/profiles/profile_impl_io_data.h" | 5 #include "chrome/browser/profiles/profile_impl_io_data.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "chrome/browser/io_thread.h" | 12 #include "chrome/browser/io_thread.h" |
| 13 #include "chrome/browser/net/chrome_net_log.h" | 13 #include "chrome/browser/net/chrome_net_log.h" |
| 14 #include "chrome/browser/net/chrome_network_delegate.h" | 14 #include "chrome/browser/net/chrome_network_delegate.h" |
| 15 #include "chrome/browser/net/connect_interceptor.h" | 15 #include "chrome/browser/net/connect_interceptor.h" |
| 16 #include "chrome/browser/net/http_server_properties_manager.h" | 16 #include "chrome/browser/net/http_server_properties_manager.h" |
| 17 #include "chrome/browser/net/predictor.h" | 17 #include "chrome/browser/net/predictor.h" |
| 18 #include "chrome/browser/net/sqlite_origin_bound_cert_store.h" | 18 #include "chrome/browser/net/sqlite_origin_bound_cert_store.h" |
| 19 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" | 19 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" |
| 20 #include "chrome/browser/prefs/pref_member.h" | 20 #include "chrome/browser/prefs/pref_member.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/browser/transport_security_persister.h" |
| 22 #include "chrome/common/chrome_constants.h" | 23 #include "chrome/common/chrome_constants.h" |
| 23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
| 25 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
| 26 #include "content/browser/resource_context.h" | 27 #include "content/browser/resource_context.h" |
| 27 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
| 28 #include "net/base/origin_bound_cert_service.h" | 29 #include "net/base/origin_bound_cert_service.h" |
| 29 #include "net/ftp/ftp_network_layer.h" | 30 #include "net/ftp/ftp_network_layer.h" |
| 30 #include "net/http/http_cache.h" | 31 #include "net/http/http_cache.h" |
| 31 #include "net/url_request/url_request_job_factory.h" | 32 #include "net/url_request/url_request_job_factory.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 256 |
| 256 // Initialize context members. | 257 // Initialize context members. |
| 257 | 258 |
| 258 ApplyProfileParamsToContext(main_context); | 259 ApplyProfileParamsToContext(main_context); |
| 259 ApplyProfileParamsToContext(media_request_context_); | 260 ApplyProfileParamsToContext(media_request_context_); |
| 260 ApplyProfileParamsToContext(extensions_context); | 261 ApplyProfileParamsToContext(extensions_context); |
| 261 | 262 |
| 262 if (http_server_properties_manager_.get()) | 263 if (http_server_properties_manager_.get()) |
| 263 http_server_properties_manager_->InitializeOnIOThread(); | 264 http_server_properties_manager_->InitializeOnIOThread(); |
| 264 | 265 |
| 266 transport_security_state_.reset(new net::TransportSecurityState( |
| 267 command_line.GetSwitchValueASCII(switches::kHstsHosts))); |
| 268 transport_security_persister_.reset( |
| 269 new TransportSecurityPersister(transport_security_state_.get(), |
| 270 profile_params->path, |
| 271 profile_params->is_incognito)); |
| 272 |
| 265 main_context->set_transport_security_state(transport_security_state()); | 273 main_context->set_transport_security_state(transport_security_state()); |
| 266 media_request_context_->set_transport_security_state( | 274 media_request_context_->set_transport_security_state( |
| 267 transport_security_state()); | 275 transport_security_state()); |
| 268 extensions_context->set_transport_security_state(transport_security_state()); | 276 extensions_context->set_transport_security_state(transport_security_state()); |
| 269 | 277 |
| 270 main_context->set_net_log(io_thread->net_log()); | 278 main_context->set_net_log(io_thread->net_log()); |
| 271 media_request_context_->set_net_log(io_thread->net_log()); | 279 media_request_context_->set_net_log(io_thread->net_log()); |
| 272 extensions_context->set_net_log(io_thread->net_log()); | 280 extensions_context->set_net_log(io_thread->net_log()); |
| 273 | 281 |
| 274 main_context->set_network_delegate(network_delegate()); | 282 main_context->set_network_delegate(network_delegate()); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 scoped_refptr<ChromeURLRequestContext> | 497 scoped_refptr<ChromeURLRequestContext> |
| 490 ProfileImplIOData::AcquireIsolatedAppRequestContext( | 498 ProfileImplIOData::AcquireIsolatedAppRequestContext( |
| 491 scoped_refptr<ChromeURLRequestContext> main_context, | 499 scoped_refptr<ChromeURLRequestContext> main_context, |
| 492 const std::string& app_id) const { | 500 const std::string& app_id) const { |
| 493 // We create per-app contexts on demand, unlike the others above. | 501 // We create per-app contexts on demand, unlike the others above. |
| 494 scoped_refptr<ChromeURLRequestContext> app_request_context = | 502 scoped_refptr<ChromeURLRequestContext> app_request_context = |
| 495 InitializeAppRequestContext(main_context, app_id); | 503 InitializeAppRequestContext(main_context, app_id); |
| 496 DCHECK(app_request_context); | 504 DCHECK(app_request_context); |
| 497 return app_request_context; | 505 return app_request_context; |
| 498 } | 506 } |
| OLD | NEW |