Chromium Code Reviews| 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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 875 | 870 |
| 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 void ProfileIOData::set_data_reduction_proxy_io_data( |
| 886 return false; | 881 scoped_ptr<data_reduction_proxy::DataReductionProxyIOData> |
| 882 data_reduction_proxy_io_data) const { | |
| 883 data_reduction_proxy_io_data_ = data_reduction_proxy_io_data.Pass(); | |
| 887 } | 884 } |
| 888 | 885 |
| 886 | |
|
sclittle
2015/01/14 22:54:46
nit: remove blank line
bengr
2015/01/15 00:30:31
Done.
| |
| 889 base::WeakPtr<net::HttpServerProperties> | 887 base::WeakPtr<net::HttpServerProperties> |
| 890 ProfileIOData::http_server_properties() const { | 888 ProfileIOData::http_server_properties() const { |
| 891 return http_server_properties_->GetWeakPtr(); | 889 return http_server_properties_->GetWeakPtr(); |
| 892 } | 890 } |
| 893 | 891 |
| 894 void ProfileIOData::set_http_server_properties( | 892 void ProfileIOData::set_http_server_properties( |
| 895 scoped_ptr<net::HttpServerProperties> http_server_properties) const { | 893 scoped_ptr<net::HttpServerProperties> http_server_properties) const { |
| 896 http_server_properties_ = http_server_properties.Pass(); | 894 http_server_properties_ = http_server_properties.Pass(); |
| 897 } | 895 } |
| 898 | 896 |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1246 #if !defined(OS_CHROMEOS) | 1244 #if !defined(OS_CHROMEOS) |
| 1247 enable_metrics_.Destroy(); | 1245 enable_metrics_.Destroy(); |
| 1248 #endif | 1246 #endif |
| 1249 safe_browsing_enabled_.Destroy(); | 1247 safe_browsing_enabled_.Destroy(); |
| 1250 sync_disabled_.Destroy(); | 1248 sync_disabled_.Destroy(); |
| 1251 signin_allowed_.Destroy(); | 1249 signin_allowed_.Destroy(); |
| 1252 network_prediction_options_.Destroy(); | 1250 network_prediction_options_.Destroy(); |
| 1253 quick_check_enabled_.Destroy(); | 1251 quick_check_enabled_.Destroy(); |
| 1254 if (media_device_id_salt_.get()) | 1252 if (media_device_id_salt_.get()) |
| 1255 media_device_id_salt_->ShutdownOnUIThread(); | 1253 media_device_id_salt_->ShutdownOnUIThread(); |
| 1256 if (data_reduction_proxy_statistics_prefs_.get()) | 1254 if (data_reduction_proxy_io_data()) |
| 1257 data_reduction_proxy_statistics_prefs_->ShutdownOnUIThread(); | 1255 data_reduction_proxy_io_data()->ShutdownStatisicsPrefsOnUIThread(); |
| 1258 session_startup_pref_.Destroy(); | 1256 session_startup_pref_.Destroy(); |
| 1259 #if defined(ENABLE_CONFIGURATION_POLICY) | 1257 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 1260 if (url_blacklist_manager_) | 1258 if (url_blacklist_manager_) |
| 1261 url_blacklist_manager_->ShutdownOnUIThread(); | 1259 url_blacklist_manager_->ShutdownOnUIThread(); |
| 1262 #endif | 1260 #endif |
| 1263 if (chrome_http_user_agent_settings_) | 1261 if (chrome_http_user_agent_settings_) |
| 1264 chrome_http_user_agent_settings_->CleanupOnUIThread(); | 1262 chrome_http_user_agent_settings_->CleanupOnUIThread(); |
| 1265 incognito_availibility_pref_.Destroy(); | 1263 incognito_availibility_pref_.Destroy(); |
| 1266 | 1264 |
| 1267 if (!context_getters->empty()) { | 1265 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(); | 1300 params.channel_id_service = context->channel_id_service(); |
| 1303 params.transport_security_state = context->transport_security_state(); | 1301 params.transport_security_state = context->transport_security_state(); |
| 1304 params.cert_transparency_verifier = context->cert_transparency_verifier(); | 1302 params.cert_transparency_verifier = context->cert_transparency_verifier(); |
| 1305 params.proxy_service = context->proxy_service(); | 1303 params.proxy_service = context->proxy_service(); |
| 1306 params.ssl_session_cache_shard = GetSSLSessionCacheShard(); | 1304 params.ssl_session_cache_shard = GetSSLSessionCacheShard(); |
| 1307 params.ssl_config_service = context->ssl_config_service(); | 1305 params.ssl_config_service = context->ssl_config_service(); |
| 1308 params.http_auth_handler_factory = context->http_auth_handler_factory(); | 1306 params.http_auth_handler_factory = context->http_auth_handler_factory(); |
| 1309 params.network_delegate = context->network_delegate(); | 1307 params.network_delegate = context->network_delegate(); |
| 1310 params.http_server_properties = context->http_server_properties(); | 1308 params.http_server_properties = context->http_server_properties(); |
| 1311 params.net_log = context->net_log(); | 1309 params.net_log = context->net_log(); |
| 1310 if (data_reduction_proxy_io_data_.get()) | |
| 1311 params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate(); | |
| 1312 | 1312 |
| 1313 network_controller_.reset(new DevToolsNetworkController()); | 1313 network_controller_.reset(new DevToolsNetworkController()); |
| 1314 | 1314 |
| 1315 net::HttpNetworkSession* session = new net::HttpNetworkSession(params); | 1315 net::HttpNetworkSession* session = new net::HttpNetworkSession(params); |
| 1316 return scoped_ptr<net::HttpCache>(new net::HttpCache( | 1316 return scoped_ptr<net::HttpCache>(new net::HttpCache( |
| 1317 new DevToolsNetworkTransactionFactory(network_controller_.get(), session), | 1317 new DevToolsNetworkTransactionFactory(network_controller_.get(), session), |
| 1318 context->net_log(), main_backend)); | 1318 context->net_log(), main_backend)); |
| 1319 } | 1319 } |
| 1320 | 1320 |
| 1321 scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory( | 1321 scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory( |
| 1322 net::HttpNetworkSession* shared_session, | 1322 net::HttpNetworkSession* shared_session, |
| 1323 net::HttpCache::BackendFactory* backend) const { | 1323 net::HttpCache::BackendFactory* backend) const { |
| 1324 return scoped_ptr<net::HttpCache>(new net::HttpCache( | 1324 return scoped_ptr<net::HttpCache>(new net::HttpCache( |
| 1325 new DevToolsNetworkTransactionFactory( | 1325 new DevToolsNetworkTransactionFactory( |
| 1326 network_controller_.get(), shared_session), | 1326 network_controller_.get(), shared_session), |
| 1327 shared_session->net_log(), backend)); | 1327 shared_session->net_log(), backend)); |
| 1328 } | 1328 } |
| 1329 | 1329 |
| 1330 void ProfileIOData::SetCookieSettingsForTesting( | 1330 void ProfileIOData::SetCookieSettingsForTesting( |
| 1331 CookieSettings* cookie_settings) { | 1331 CookieSettings* cookie_settings) { |
| 1332 DCHECK(!cookie_settings_.get()); | 1332 DCHECK(!cookie_settings_.get()); |
| 1333 cookie_settings_ = cookie_settings; | 1333 cookie_settings_ = cookie_settings; |
| 1334 } | 1334 } |
| 1335 | 1335 |
| 1336 void ProfileIOData::set_signin_names_for_testing( | 1336 void ProfileIOData::set_signin_names_for_testing( |
| 1337 SigninNamesOnIOThread* signin_names) { | 1337 SigninNamesOnIOThread* signin_names) { |
| 1338 signin_names_.reset(signin_names); | 1338 signin_names_.reset(signin_names); |
| 1339 } | 1339 } |
| OLD | NEW |