| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" | 47 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
| 48 #include "chrome/browser/profiles/profile.h" | 48 #include "chrome/browser/profiles/profile.h" |
| 49 #include "chrome/browser/profiles/profile_manager.h" | 49 #include "chrome/browser/profiles/profile_manager.h" |
| 50 #include "chrome/browser/signin/signin_names_io_thread.h" | 50 #include "chrome/browser/signin/signin_names_io_thread.h" |
| 51 #include "chrome/common/chrome_paths.h" | 51 #include "chrome/common/chrome_paths.h" |
| 52 #include "chrome/common/chrome_switches.h" | 52 #include "chrome/common/chrome_switches.h" |
| 53 #include "chrome/common/pref_names.h" | 53 #include "chrome/common/pref_names.h" |
| 54 #include "chrome/common/url_constants.h" | 54 #include "chrome/common/url_constants.h" |
| 55 #include "components/content_settings/core/browser/content_settings_provider.h" | 55 #include "components/content_settings/core/browser/content_settings_provider.h" |
| 56 #include "components/content_settings/core/browser/host_content_settings_map.h" | 56 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 57 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw
ork_delegate.h" | 57 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
| 58 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" | |
| 59 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc
hes.h" | |
| 60 #include "components/dom_distiller/core/url_constants.h" | 58 #include "components/dom_distiller/core/url_constants.h" |
| 61 #include "components/startup_metric_utils/startup_metric_utils.h" | 59 #include "components/startup_metric_utils/startup_metric_utils.h" |
| 62 #include "components/sync_driver/pref_names.h" | 60 #include "components/sync_driver/pref_names.h" |
| 63 #include "components/url_fixer/url_fixer.h" | 61 #include "components/url_fixer/url_fixer.h" |
| 64 #include "content/public/browser/browser_thread.h" | 62 #include "content/public/browser/browser_thread.h" |
| 65 #include "content/public/browser/host_zoom_map.h" | 63 #include "content/public/browser/host_zoom_map.h" |
| 66 #include "content/public/browser/notification_service.h" | 64 #include "content/public/browser/notification_service.h" |
| 67 #include "content/public/browser/resource_context.h" | 65 #include "content/public/browser/resource_context.h" |
| 68 #include "net/base/keygen_handler.h" | 66 #include "net/base/keygen_handler.h" |
| 69 #include "net/cookies/canonical_cookie.h" | 67 #include "net/cookies/canonical_cookie.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 #include "extensions/common/constants.h" | 100 #include "extensions/common/constants.h" |
| 103 #endif | 101 #endif |
| 104 | 102 |
| 105 #if defined(ENABLE_SUPERVISED_USERS) | 103 #if defined(ENABLE_SUPERVISED_USERS) |
| 106 #include "chrome/browser/supervised_user/supervised_user_service.h" | 104 #include "chrome/browser/supervised_user/supervised_user_service.h" |
| 107 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 105 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
| 108 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" | 106 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" |
| 109 #endif | 107 #endif |
| 110 | 108 |
| 111 #if defined(OS_ANDROID) | 109 #if defined(OS_ANDROID) |
| 112 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | |
| 113 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | |
| 114 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc
hes.h" | |
| 115 #include "content/public/browser/android/content_protocol_handler.h" | 110 #include "content/public/browser/android/content_protocol_handler.h" |
| 116 #endif // defined(OS_ANDROID) | 111 #endif // defined(OS_ANDROID) |
| 117 | 112 |
| 118 #if defined(OS_CHROMEOS) | 113 #if defined(OS_CHROMEOS) |
| 119 #include "chrome/browser/chromeos/fileapi/external_file_protocol_handler.h" | 114 #include "chrome/browser/chromeos/fileapi/external_file_protocol_handler.h" |
| 120 #include "chrome/browser/chromeos/login/startup_utils.h" | 115 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 121 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" | 116 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" |
| 122 #include "chrome/browser/chromeos/net/client_cert_filter_chromeos.h" | 117 #include "chrome/browser/chromeos/net/client_cert_filter_chromeos.h" |
| 123 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 118 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 124 #include "chrome/browser/chromeos/policy/policy_cert_service.h" | 119 #include "chrome/browser/chromeos/policy/policy_cert_service.h" |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const { | 871 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const { |
| 877 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 872 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 878 #if defined(OS_CHROMEOS) | 873 #if defined(OS_CHROMEOS) |
| 879 return enable_metrics_; | 874 return enable_metrics_; |
| 880 #else | 875 #else |
| 881 return enable_metrics_.GetValue(); | 876 return enable_metrics_.GetValue(); |
| 882 #endif // defined(OS_CHROMEOS) | 877 #endif // defined(OS_CHROMEOS) |
| 883 } | 878 } |
| 884 | 879 |
| 885 bool ProfileIOData::IsDataReductionProxyEnabled() const { | 880 bool ProfileIOData::IsDataReductionProxyEnabled() const { |
| 886 return false; | 881 return data_reduction_proxy_io_data()->IsEnabled(); |
| 882 } |
| 883 |
| 884 void ProfileIOData::set_data_reduction_proxy_io_data( |
| 885 scoped_ptr<data_reduction_proxy::DataReductionProxyIOData> |
| 886 data_reduction_proxy_io_data) const { |
| 887 data_reduction_proxy_io_data_ = data_reduction_proxy_io_data.Pass(); |
| 887 } | 888 } |
| 888 | 889 |
| 889 base::WeakPtr<net::HttpServerProperties> | 890 base::WeakPtr<net::HttpServerProperties> |
| 890 ProfileIOData::http_server_properties() const { | 891 ProfileIOData::http_server_properties() const { |
| 891 return http_server_properties_->GetWeakPtr(); | 892 return http_server_properties_->GetWeakPtr(); |
| 892 } | 893 } |
| 893 | 894 |
| 894 void ProfileIOData::set_http_server_properties( | 895 void ProfileIOData::set_http_server_properties( |
| 895 scoped_ptr<net::HttpServerProperties> http_server_properties) const { | 896 scoped_ptr<net::HttpServerProperties> http_server_properties) const { |
| 896 http_server_properties_ = http_server_properties.Pass(); | 897 http_server_properties_ = http_server_properties.Pass(); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 #if !defined(OS_CHROMEOS) | 1247 #if !defined(OS_CHROMEOS) |
| 1247 enable_metrics_.Destroy(); | 1248 enable_metrics_.Destroy(); |
| 1248 #endif | 1249 #endif |
| 1249 safe_browsing_enabled_.Destroy(); | 1250 safe_browsing_enabled_.Destroy(); |
| 1250 sync_disabled_.Destroy(); | 1251 sync_disabled_.Destroy(); |
| 1251 signin_allowed_.Destroy(); | 1252 signin_allowed_.Destroy(); |
| 1252 network_prediction_options_.Destroy(); | 1253 network_prediction_options_.Destroy(); |
| 1253 quick_check_enabled_.Destroy(); | 1254 quick_check_enabled_.Destroy(); |
| 1254 if (media_device_id_salt_.get()) | 1255 if (media_device_id_salt_.get()) |
| 1255 media_device_id_salt_->ShutdownOnUIThread(); | 1256 media_device_id_salt_->ShutdownOnUIThread(); |
| 1256 if (data_reduction_proxy_statistics_prefs_.get()) | |
| 1257 data_reduction_proxy_statistics_prefs_->ShutdownOnUIThread(); | |
| 1258 session_startup_pref_.Destroy(); | 1257 session_startup_pref_.Destroy(); |
| 1259 #if defined(ENABLE_CONFIGURATION_POLICY) | 1258 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 1260 if (url_blacklist_manager_) | 1259 if (url_blacklist_manager_) |
| 1261 url_blacklist_manager_->ShutdownOnUIThread(); | 1260 url_blacklist_manager_->ShutdownOnUIThread(); |
| 1262 #endif | 1261 #endif |
| 1263 if (chrome_http_user_agent_settings_) | 1262 if (chrome_http_user_agent_settings_) |
| 1264 chrome_http_user_agent_settings_->CleanupOnUIThread(); | 1263 chrome_http_user_agent_settings_->CleanupOnUIThread(); |
| 1265 incognito_availibility_pref_.Destroy(); | 1264 incognito_availibility_pref_.Destroy(); |
| 1266 | 1265 |
| 1267 if (!context_getters->empty()) { | 1266 if (!context_getters->empty()) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 params.channel_id_service = context->channel_id_service(); | 1301 params.channel_id_service = context->channel_id_service(); |
| 1303 params.transport_security_state = context->transport_security_state(); | 1302 params.transport_security_state = context->transport_security_state(); |
| 1304 params.cert_transparency_verifier = context->cert_transparency_verifier(); | 1303 params.cert_transparency_verifier = context->cert_transparency_verifier(); |
| 1305 params.proxy_service = context->proxy_service(); | 1304 params.proxy_service = context->proxy_service(); |
| 1306 params.ssl_session_cache_shard = GetSSLSessionCacheShard(); | 1305 params.ssl_session_cache_shard = GetSSLSessionCacheShard(); |
| 1307 params.ssl_config_service = context->ssl_config_service(); | 1306 params.ssl_config_service = context->ssl_config_service(); |
| 1308 params.http_auth_handler_factory = context->http_auth_handler_factory(); | 1307 params.http_auth_handler_factory = context->http_auth_handler_factory(); |
| 1309 params.network_delegate = context->network_delegate(); | 1308 params.network_delegate = context->network_delegate(); |
| 1310 params.http_server_properties = context->http_server_properties(); | 1309 params.http_server_properties = context->http_server_properties(); |
| 1311 params.net_log = context->net_log(); | 1310 params.net_log = context->net_log(); |
| 1311 if (data_reduction_proxy_io_data_.get()) |
| 1312 params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate(); |
| 1312 | 1313 |
| 1313 network_controller_.reset(new DevToolsNetworkController()); | 1314 network_controller_.reset(new DevToolsNetworkController()); |
| 1314 | 1315 |
| 1315 net::HttpNetworkSession* session = new net::HttpNetworkSession(params); | 1316 net::HttpNetworkSession* session = new net::HttpNetworkSession(params); |
| 1316 return scoped_ptr<net::HttpCache>(new net::HttpCache( | 1317 return scoped_ptr<net::HttpCache>(new net::HttpCache( |
| 1317 new DevToolsNetworkTransactionFactory(network_controller_.get(), session), | 1318 new DevToolsNetworkTransactionFactory(network_controller_.get(), session), |
| 1318 context->net_log(), main_backend)); | 1319 context->net_log(), main_backend)); |
| 1319 } | 1320 } |
| 1320 | 1321 |
| 1321 scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory( | 1322 scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory( |
| 1322 net::HttpNetworkSession* shared_session, | 1323 net::HttpNetworkSession* shared_session, |
| 1323 net::HttpCache::BackendFactory* backend) const { | 1324 net::HttpCache::BackendFactory* backend) const { |
| 1324 return scoped_ptr<net::HttpCache>(new net::HttpCache( | 1325 return scoped_ptr<net::HttpCache>(new net::HttpCache( |
| 1325 new DevToolsNetworkTransactionFactory( | 1326 new DevToolsNetworkTransactionFactory( |
| 1326 network_controller_.get(), shared_session), | 1327 network_controller_.get(), shared_session), |
| 1327 shared_session->net_log(), backend)); | 1328 shared_session->net_log(), backend)); |
| 1328 } | 1329 } |
| 1329 | 1330 |
| 1330 void ProfileIOData::SetCookieSettingsForTesting( | 1331 void ProfileIOData::SetCookieSettingsForTesting( |
| 1331 CookieSettings* cookie_settings) { | 1332 CookieSettings* cookie_settings) { |
| 1332 DCHECK(!cookie_settings_.get()); | 1333 DCHECK(!cookie_settings_.get()); |
| 1333 cookie_settings_ = cookie_settings; | 1334 cookie_settings_ = cookie_settings; |
| 1334 } | 1335 } |
| 1335 | 1336 |
| 1336 void ProfileIOData::set_signin_names_for_testing( | 1337 void ProfileIOData::set_signin_names_for_testing( |
| 1337 SigninNamesOnIOThread* signin_names) { | 1338 SigninNamesOnIOThread* signin_names) { |
| 1338 signin_names_.reset(signin_names); | 1339 signin_names_.reset(signin_names); |
| 1339 } | 1340 } |
| OLD | NEW |