| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 ProfileIOData::ChromeURLRequestContextGetterVector::iterator iter; | 380 ProfileIOData::ChromeURLRequestContextGetterVector::iterator iter; |
| 381 for (auto& chrome_context_getter : *getters) | 381 for (auto& chrome_context_getter : *getters) |
| 382 chrome_context_getter->NotifyContextShuttingDown(); | 382 chrome_context_getter->NotifyContextShuttingDown(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 } // namespace | 385 } // namespace |
| 386 | 386 |
| 387 void ProfileIOData::InitializeOnUIThread(Profile* profile) { | 387 void ProfileIOData::InitializeOnUIThread(Profile* profile) { |
| 388 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 388 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 389 PrefService* pref_service = profile->GetPrefs(); | 389 PrefService* pref_service = profile->GetPrefs(); |
| 390 PrefService* local_state_pref_service = g_browser_process->local_state(); | |
| 391 | 390 |
| 392 std::unique_ptr<ProfileParams> params(new ProfileParams); | 391 std::unique_ptr<ProfileParams> params(new ProfileParams); |
| 393 params->path = profile->GetPath(); | 392 params->path = profile->GetPath(); |
| 394 | 393 |
| 395 params->io_thread = g_browser_process->io_thread(); | 394 params->io_thread = g_browser_process->io_thread(); |
| 396 | 395 |
| 397 params->cookie_settings = CookieSettingsFactory::GetForProfile(profile); | 396 params->cookie_settings = CookieSettingsFactory::GetForProfile(profile); |
| 398 params->host_content_settings_map = | 397 params->host_content_settings_map = |
| 399 HostContentSettingsMapFactory::GetForProfile(profile); | 398 HostContentSettingsMapFactory::GetForProfile(profile); |
| 400 params->ssl_config_service = profile->GetSSLConfigService(); | 399 params->ssl_config_service = profile->GetSSLConfigService(); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 prefs::kGoogleServicesUserAccountId, pref_service); | 492 prefs::kGoogleServicesUserAccountId, pref_service); |
| 494 google_services_user_account_id_.MoveToThread(io_task_runner); | 493 google_services_user_account_id_.MoveToThread(io_task_runner); |
| 495 | 494 |
| 496 sync_disabled_.Init(sync_driver::prefs::kSyncManaged, pref_service); | 495 sync_disabled_.Init(sync_driver::prefs::kSyncManaged, pref_service); |
| 497 sync_disabled_.MoveToThread(io_task_runner); | 496 sync_disabled_.MoveToThread(io_task_runner); |
| 498 | 497 |
| 499 signin_allowed_.Init(prefs::kSigninAllowed, pref_service); | 498 signin_allowed_.Init(prefs::kSigninAllowed, pref_service); |
| 500 signin_allowed_.MoveToThread(io_task_runner); | 499 signin_allowed_.MoveToThread(io_task_runner); |
| 501 } | 500 } |
| 502 | 501 |
| 503 quick_check_enabled_.Init(prefs::kQuickCheckEnabled, | |
| 504 local_state_pref_service); | |
| 505 quick_check_enabled_.MoveToThread(io_task_runner); | |
| 506 | |
| 507 media_device_id_salt_ = new MediaDeviceIDSalt(pref_service, IsOffTheRecord()); | 502 media_device_id_salt_ = new MediaDeviceIDSalt(pref_service, IsOffTheRecord()); |
| 508 | 503 |
| 509 network_prediction_options_.Init(prefs::kNetworkPredictionOptions, | 504 network_prediction_options_.Init(prefs::kNetworkPredictionOptions, |
| 510 pref_service); | 505 pref_service); |
| 511 | 506 |
| 512 network_prediction_options_.MoveToThread(io_task_runner); | 507 network_prediction_options_.MoveToThread(io_task_runner); |
| 513 | 508 |
| 514 #if defined(OS_CHROMEOS) | 509 #if defined(OS_CHROMEOS) |
| 515 std::unique_ptr<policy::PolicyCertVerifier> verifier = | 510 std::unique_ptr<policy::PolicyCertVerifier> verifier = |
| 516 policy::PolicyCertServiceFactory::CreateForProfile(profile); | 511 policy::PolicyCertServiceFactory::CreateForProfile(profile); |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 network_delegate->set_data_use_aggregator( | 1057 network_delegate->set_data_use_aggregator( |
| 1063 io_thread_globals->data_use_aggregator.get(), IsOffTheRecord()); | 1058 io_thread_globals->data_use_aggregator.get(), IsOffTheRecord()); |
| 1064 | 1059 |
| 1065 // NOTE: Proxy service uses the default io thread network delegate, not the | 1060 // NOTE: Proxy service uses the default io thread network delegate, not the |
| 1066 // delegate just created. | 1061 // delegate just created. |
| 1067 proxy_service_ = ProxyServiceFactory::CreateProxyService( | 1062 proxy_service_ = ProxyServiceFactory::CreateProxyService( |
| 1068 io_thread->net_log(), | 1063 io_thread->net_log(), |
| 1069 io_thread_globals->proxy_script_fetcher_context.get(), | 1064 io_thread_globals->proxy_script_fetcher_context.get(), |
| 1070 io_thread_globals->system_network_delegate.get(), | 1065 io_thread_globals->system_network_delegate.get(), |
| 1071 std::move(profile_params_->proxy_config_service), command_line, | 1066 std::move(profile_params_->proxy_config_service), command_line, |
| 1072 quick_check_enabled_.GetValue()); | 1067 io_thread->WpadQuickCheckEnabled(), |
| 1068 io_thread->PacHttpsUrlStrippingEnabled()); |
| 1073 transport_security_state_.reset(new net::TransportSecurityState()); | 1069 transport_security_state_.reset(new net::TransportSecurityState()); |
| 1074 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); | 1070 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); |
| 1075 transport_security_persister_.reset( | 1071 transport_security_persister_.reset( |
| 1076 new net::TransportSecurityPersister( | 1072 new net::TransportSecurityPersister( |
| 1077 transport_security_state_.get(), | 1073 transport_security_state_.get(), |
| 1078 profile_params_->path, | 1074 profile_params_->path, |
| 1079 pool->GetSequencedTaskRunnerWithShutdownBehavior( | 1075 pool->GetSequencedTaskRunnerWithShutdownBehavior( |
| 1080 pool->GetSequenceToken(), | 1076 pool->GetSequenceToken(), |
| 1081 base::SequencedWorkerPool::BLOCK_SHUTDOWN), | 1077 base::SequencedWorkerPool::BLOCK_SHUTDOWN), |
| 1082 IsOffTheRecord())); | 1078 IsOffTheRecord())); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 enable_referrers_.Destroy(); | 1268 enable_referrers_.Destroy(); |
| 1273 enable_do_not_track_.Destroy(); | 1269 enable_do_not_track_.Destroy(); |
| 1274 force_google_safesearch_.Destroy(); | 1270 force_google_safesearch_.Destroy(); |
| 1275 force_youtube_safety_mode_.Destroy(); | 1271 force_youtube_safety_mode_.Destroy(); |
| 1276 allowed_domains_for_apps_.Destroy(); | 1272 allowed_domains_for_apps_.Destroy(); |
| 1277 enable_metrics_.Destroy(); | 1273 enable_metrics_.Destroy(); |
| 1278 safe_browsing_enabled_.Destroy(); | 1274 safe_browsing_enabled_.Destroy(); |
| 1279 sync_disabled_.Destroy(); | 1275 sync_disabled_.Destroy(); |
| 1280 signin_allowed_.Destroy(); | 1276 signin_allowed_.Destroy(); |
| 1281 network_prediction_options_.Destroy(); | 1277 network_prediction_options_.Destroy(); |
| 1282 quick_check_enabled_.Destroy(); | |
| 1283 if (media_device_id_salt_.get()) | 1278 if (media_device_id_salt_.get()) |
| 1284 media_device_id_salt_->ShutdownOnUIThread(); | 1279 media_device_id_salt_->ShutdownOnUIThread(); |
| 1285 session_startup_pref_.Destroy(); | 1280 session_startup_pref_.Destroy(); |
| 1286 if (url_blacklist_manager_) | 1281 if (url_blacklist_manager_) |
| 1287 url_blacklist_manager_->ShutdownOnUIThread(); | 1282 url_blacklist_manager_->ShutdownOnUIThread(); |
| 1288 if (chrome_http_user_agent_settings_) | 1283 if (chrome_http_user_agent_settings_) |
| 1289 chrome_http_user_agent_settings_->CleanupOnUIThread(); | 1284 chrome_http_user_agent_settings_->CleanupOnUIThread(); |
| 1290 incognito_availibility_pref_.Destroy(); | 1285 incognito_availibility_pref_.Destroy(); |
| 1291 | 1286 |
| 1292 if (!context_getters->empty()) { | 1287 if (!context_getters->empty()) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 void ProfileIOData::SetCookieSettingsForTesting( | 1356 void ProfileIOData::SetCookieSettingsForTesting( |
| 1362 content_settings::CookieSettings* cookie_settings) { | 1357 content_settings::CookieSettings* cookie_settings) { |
| 1363 DCHECK(!cookie_settings_.get()); | 1358 DCHECK(!cookie_settings_.get()); |
| 1364 cookie_settings_ = cookie_settings; | 1359 cookie_settings_ = cookie_settings; |
| 1365 } | 1360 } |
| 1366 | 1361 |
| 1367 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( | 1362 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( |
| 1368 const GURL& url) const { | 1363 const GURL& url) const { |
| 1369 return url_blacklist_manager_->GetURLBlacklistState(url); | 1364 return url_blacklist_manager_->GetURLBlacklistState(url); |
| 1370 } | 1365 } |
| OLD | NEW |