Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 2743463002: WIP: Pref service user prefs. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/profiles/profile_browsertest.cc ('k') | components/sync_preferences/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 return io_data_ 1050 return io_data_
1051 .GetIsolatedMediaRequestContextGetter(partition_path, in_memory).get(); 1051 .GetIsolatedMediaRequestContextGetter(partition_path, in_memory).get();
1052 } 1052 }
1053 1053
1054 void ProfileImpl::RegisterInProcessServices(StaticServiceMap* services) { 1054 void ProfileImpl::RegisterInProcessServices(StaticServiceMap* services) {
1055 if (base::FeatureList::IsEnabled(features::kPrefService)) { 1055 if (base::FeatureList::IsEnabled(features::kPrefService)) {
1056 content::ServiceInfo info; 1056 content::ServiceInfo info;
1057 info.factory = 1057 info.factory =
1058 base::Bind([]() -> std::unique_ptr<service_manager::Service> { 1058 base::Bind([]() -> std::unique_ptr<service_manager::Service> {
1059 return base::MakeUnique<prefs::PrefStoreManagerImpl>( 1059 return base::MakeUnique<prefs::PrefStoreManagerImpl>(
1060 prefs::PrefStoreManagerImpl::PrefStoreTypes()); 1060 prefs::PrefStoreManagerImpl::PrefStoreTypes(),
1061 content::BrowserThread::GetBlockingPool());
1061 }); 1062 });
1063 info.task_runner = content::BrowserThread::GetTaskRunnerForThread(
1064 content::BrowserThread::IO);
1062 services->insert(std::make_pair(prefs::mojom::kPrefStoreServiceName, info)); 1065 services->insert(std::make_pair(prefs::mojom::kPrefStoreServiceName, info));
1063 } 1066 }
1064 } 1067 }
1065 1068
1066 bool ProfileImpl::IsSameProfile(Profile* profile) { 1069 bool ProfileImpl::IsSameProfile(Profile* profile) {
1067 if (profile == static_cast<Profile*>(this)) 1070 if (profile == static_cast<Profile*>(this))
1068 return true; 1071 return true;
1069 Profile* otr_profile = off_the_record_profile_.get(); 1072 Profile* otr_profile = off_the_record_profile_.get();
1070 return otr_profile && profile == otr_profile; 1073 return otr_profile && profile == otr_profile;
1071 } 1074 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { 1315 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) {
1313 domain_reliability::DomainReliabilityService* service = 1316 domain_reliability::DomainReliabilityService* service =
1314 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1317 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1315 GetForBrowserContext(this); 1318 GetForBrowserContext(this);
1316 if (!service) 1319 if (!service)
1317 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); 1320 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>();
1318 1321
1319 return service->CreateMonitor( 1322 return service->CreateMonitor(
1320 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 1323 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
1321 } 1324 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_browsertest.cc ('k') | components/sync_preferences/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698