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_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 } | 489 } |
490 | 490 |
491 content::BrowserContext::Initialize(this, path_); | 491 content::BrowserContext::Initialize(this, path_); |
492 | 492 |
493 { | 493 { |
494 service_manager::Connector* connector = nullptr; | 494 service_manager::Connector* connector = nullptr; |
495 if (base::FeatureList::IsEnabled(features::kPrefService)) { | 495 if (base::FeatureList::IsEnabled(features::kPrefService)) { |
496 connector = content::BrowserContext::GetConnectorFor(this); | 496 connector = content::BrowserContext::GetConnectorFor(this); |
497 } | 497 } |
498 prefs_ = chrome_prefs::CreateProfilePrefs( | 498 prefs_ = chrome_prefs::CreateProfilePrefs( |
499 path_, sequenced_task_runner, pref_validation_delegate_.get(), | 499 path_, sequenced_task_runner, &pref_validation_delegate_, |
500 profile_policy_connector_->policy_service(), supervised_user_settings, | 500 profile_policy_connector_->policy_service(), supervised_user_settings, |
501 CreateExtensionPrefStore(this, false), pref_registry_, async_prefs, | 501 CreateExtensionPrefStore(this, false), pref_registry_, async_prefs, |
502 connector); | 502 connector); |
503 // Register on BrowserContext. | 503 // Register on BrowserContext. |
504 user_prefs::UserPrefs::Set(this, prefs_.get()); | 504 user_prefs::UserPrefs::Set(this, prefs_.get()); |
505 } | 505 } |
506 | 506 |
507 if (async_prefs) { | 507 if (async_prefs) { |
508 // Wait for the notification that prefs has been loaded | 508 // Wait for the notification that prefs has been loaded |
509 // (successfully or not). Note that we can use base::Unretained | 509 // (successfully or not). Note that we can use base::Unretained |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 | 1063 |
1064 void ProfileImpl::RegisterInProcessServices(StaticServiceMap* services) { | 1064 void ProfileImpl::RegisterInProcessServices(StaticServiceMap* services) { |
1065 if (base::FeatureList::IsEnabled(features::kPrefService)) { | 1065 if (base::FeatureList::IsEnabled(features::kPrefService)) { |
1066 content::ServiceInfo info; | 1066 content::ServiceInfo info; |
1067 info.factory = | 1067 info.factory = |
1068 base::Bind([]() -> std::unique_ptr<service_manager::Service> { | 1068 base::Bind([]() -> std::unique_ptr<service_manager::Service> { |
1069 return base::MakeUnique<prefs::PrefStoreManagerImpl>( | 1069 return base::MakeUnique<prefs::PrefStoreManagerImpl>( |
1070 prefs::PrefStoreManagerImpl::PrefStoreTypes(), | 1070 prefs::PrefStoreManagerImpl::PrefStoreTypes(), |
1071 content::BrowserThread::GetBlockingPool()); | 1071 content::BrowserThread::GetBlockingPool()); |
1072 }); | 1072 }); |
| 1073 info.task_runner = content::BrowserThread::GetTaskRunnerForThread( |
| 1074 content::BrowserThread::IO); |
1073 services->insert(std::make_pair(prefs::mojom::kPrefStoreServiceName, info)); | 1075 services->insert(std::make_pair(prefs::mojom::kPrefStoreServiceName, info)); |
1074 } | 1076 } |
1075 } | 1077 } |
1076 | 1078 |
1077 bool ProfileImpl::IsSameProfile(Profile* profile) { | 1079 bool ProfileImpl::IsSameProfile(Profile* profile) { |
1078 if (profile == static_cast<Profile*>(this)) | 1080 if (profile == static_cast<Profile*>(this)) |
1079 return true; | 1081 return true; |
1080 Profile* otr_profile = off_the_record_profile_.get(); | 1082 Profile* otr_profile = off_the_record_profile_.get(); |
1081 return otr_profile && profile == otr_profile; | 1083 return otr_profile && profile == otr_profile; |
1082 } | 1084 } |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1325 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1324 domain_reliability::DomainReliabilityService* service = | 1326 domain_reliability::DomainReliabilityService* service = |
1325 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1327 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1326 GetForBrowserContext(this); | 1328 GetForBrowserContext(this); |
1327 if (!service) | 1329 if (!service) |
1328 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1330 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1329 | 1331 |
1330 return service->CreateMonitor( | 1332 return service->CreateMonitor( |
1331 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 1333 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
1332 } | 1334 } |
OLD | NEW |