Commit e39cf535 authored by François Degros's avatar François Degros Committed by Commit Bot

Avoided calls to AddRef and Release by moving scoped_refptrs.

Used RepeatingCallback instead of deprecated Callback.

Change-Id: I36a1079c5a5c2c0341d85e1e7230ac9055347349
Reviewed-on: https://chromium-review.googlesource.com/894962
Commit-Queue: François Degros <fdegros@chromium.org>
Reviewed-by: default avatarBernhard Bauer <bauerb@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534877}
parent 40b0b565
...@@ -1082,7 +1082,7 @@ void BrowserProcessImpl::CreateLocalState() { ...@@ -1082,7 +1082,7 @@ void BrowserProcessImpl::CreateLocalState() {
delegate->InitPrefRegistry(pref_registry.get()); delegate->InitPrefRegistry(pref_registry.get());
local_state_ = chrome_prefs::CreateLocalState( local_state_ = chrome_prefs::CreateLocalState(
local_state_path, local_state_task_runner_.get(), policy_service(), local_state_path, local_state_task_runner_.get(), policy_service(),
pref_registry, false, std::move(delegate)); std::move(pref_registry), false, std::move(delegate));
DCHECK(local_state_); DCHECK(local_state_);
} }
......
...@@ -389,12 +389,14 @@ void InitializeLocalState(base::SequencedTaskRunner* local_state_task_runner) { ...@@ -389,12 +389,14 @@ void InitializeLocalState(base::SequencedTaskRunner* local_state_task_runner) {
if (!local_state_file_exists) { if (!local_state_file_exists) {
base::FilePath parent_profile = base::FilePath parent_profile =
command_line->GetSwitchValuePath(switches::kParentProfile); command_line->GetSwitchValuePath(switches::kParentProfile);
scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple(); scoped_refptr<PrefRegistrySimple> registry =
std::unique_ptr<PrefService> parent_local_state( base::MakeRefCounted<PrefRegistrySimple>();
chrome_prefs::CreateLocalState(
parent_profile, local_state_task_runner,
g_browser_process->policy_service(), registry, false, nullptr));
registry->RegisterStringPref(prefs::kApplicationLocale, std::string()); registry->RegisterStringPref(prefs::kApplicationLocale, std::string());
const std::unique_ptr<PrefService> parent_local_state =
chrome_prefs::CreateLocalState(parent_profile,
local_state_task_runner,
g_browser_process->policy_service(),
std::move(registry), false, nullptr);
// Right now, we only inherit the locale setting from the parent profile. // Right now, we only inherit the locale setting from the parent profile.
local_state->SetString( local_state->SetString(
prefs::kApplicationLocale, prefs::kApplicationLocale,
......
...@@ -369,7 +369,7 @@ void PrepareFactory(sync_preferences::PrefServiceSyncableFactory* factory, ...@@ -369,7 +369,7 @@ void PrepareFactory(sync_preferences::PrefServiceSyncableFactory* factory,
policy::PolicyService* policy_service, policy::PolicyService* policy_service,
SupervisedUserSettingsService* supervised_user_settings, SupervisedUserSettingsService* supervised_user_settings,
scoped_refptr<PersistentPrefStore> user_pref_store, scoped_refptr<PersistentPrefStore> user_pref_store,
const scoped_refptr<PrefStore>& extension_prefs, scoped_refptr<PrefStore> extension_prefs,
bool async) { bool async) {
policy::BrowserPolicyConnector* policy_connector = policy::BrowserPolicyConnector* policy_connector =
g_browser_process->browser_policy_connector(); g_browser_process->browser_policy_connector();
...@@ -386,12 +386,12 @@ void PrepareFactory(sync_preferences::PrefServiceSyncableFactory* factory, ...@@ -386,12 +386,12 @@ void PrepareFactory(sync_preferences::PrefServiceSyncableFactory* factory,
#endif #endif
factory->set_async(async); factory->set_async(async);
factory->set_extension_prefs(extension_prefs); factory->set_extension_prefs(std::move(extension_prefs));
factory->set_command_line_prefs( factory->set_command_line_prefs(
base::MakeRefCounted<ChromeCommandLinePrefStore>( base::MakeRefCounted<ChromeCommandLinePrefStore>(
base::CommandLine::ForCurrentProcess())); base::CommandLine::ForCurrentProcess()));
factory->set_read_error_callback(base::Bind(&HandleReadError, pref_filename)); factory->set_read_error_callback(base::Bind(&HandleReadError, pref_filename));
factory->set_user_prefs(user_pref_store); factory->set_user_prefs(std::move(user_pref_store));
factory->SetPrefModelAssociatorClient( factory->SetPrefModelAssociatorClient(
ChromePrefModelAssociatorClient::GetInstance()); ChromePrefModelAssociatorClient::GetInstance());
} }
...@@ -440,17 +440,17 @@ std::unique_ptr<PrefService> CreateLocalState( ...@@ -440,17 +440,17 @@ std::unique_ptr<PrefService> CreateLocalState(
const base::FilePath& pref_filename, const base::FilePath& pref_filename,
base::SequencedTaskRunner* pref_io_task_runner, base::SequencedTaskRunner* pref_io_task_runner,
policy::PolicyService* policy_service, policy::PolicyService* policy_service,
const scoped_refptr<PrefRegistry>& pref_registry, scoped_refptr<PrefRegistry> pref_registry,
bool async, bool async,
std::unique_ptr<PrefValueStore::Delegate> delegate) { std::unique_ptr<PrefValueStore::Delegate> delegate) {
sync_preferences::PrefServiceSyncableFactory factory; sync_preferences::PrefServiceSyncableFactory factory;
PrepareFactory(&factory, pref_filename, policy_service, PrepareFactory(&factory, pref_filename, policy_service,
NULL, // supervised_user_settings nullptr, // supervised_user_settings
new JsonPrefStore(pref_filename, pref_io_task_runner, new JsonPrefStore(pref_filename, pref_io_task_runner,
std::unique_ptr<PrefFilter>()), std::unique_ptr<PrefFilter>()),
NULL, // extension_prefs nullptr, // extension_prefs
async); async);
return factory.Create(pref_registry.get(), std::move(delegate)); return factory.Create(std::move(pref_registry), std::move(delegate));
} }
std::unique_ptr<sync_preferences::PrefServiceSyncable> CreateProfilePrefs( std::unique_ptr<sync_preferences::PrefServiceSyncable> CreateProfilePrefs(
...@@ -458,8 +458,8 @@ std::unique_ptr<sync_preferences::PrefServiceSyncable> CreateProfilePrefs( ...@@ -458,8 +458,8 @@ std::unique_ptr<sync_preferences::PrefServiceSyncable> CreateProfilePrefs(
prefs::mojom::TrackedPreferenceValidationDelegatePtr validation_delegate, prefs::mojom::TrackedPreferenceValidationDelegatePtr validation_delegate,
policy::PolicyService* policy_service, policy::PolicyService* policy_service,
SupervisedUserSettingsService* supervised_user_settings, SupervisedUserSettingsService* supervised_user_settings,
const scoped_refptr<PrefStore>& extension_prefs, scoped_refptr<PrefStore> extension_prefs,
const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry, scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry,
bool async, bool async,
scoped_refptr<base::SequencedTaskRunner> io_task_runner, scoped_refptr<base::SequencedTaskRunner> io_task_runner,
std::unique_ptr<PrefValueStore::Delegate> delegate) { std::unique_ptr<PrefValueStore::Delegate> delegate) {
...@@ -471,19 +471,16 @@ std::unique_ptr<sync_preferences::PrefServiceSyncable> CreateProfilePrefs( ...@@ -471,19 +471,16 @@ std::unique_ptr<sync_preferences::PrefServiceSyncable> CreateProfilePrefs(
base::MakeUnique<ResetOnLoadObserverImpl>(profile_path), base::MakeUnique<ResetOnLoadObserverImpl>(profile_path),
mojo::MakeRequest(&reset_on_load_observer)); mojo::MakeRequest(&reset_on_load_observer));
sync_preferences::PrefServiceSyncableFactory factory; sync_preferences::PrefServiceSyncableFactory factory;
scoped_refptr<PersistentPrefStore> user_pref_store( scoped_refptr<PersistentPrefStore> user_pref_store =
CreateProfilePrefStoreManager(profile_path) CreateProfilePrefStoreManager(profile_path)
->CreateProfilePrefStore( ->CreateProfilePrefStore(
GetTrackingConfiguration(), kTrackedPrefsReportingIDsCount, GetTrackingConfiguration(), kTrackedPrefsReportingIDsCount,
std::move(io_task_runner), std::move(reset_on_load_observer), std::move(io_task_runner), std::move(reset_on_load_observer),
std::move(validation_delegate))); std::move(validation_delegate));
PrepareFactory(&factory, profile_path, policy_service, PrepareFactory(&factory, profile_path, policy_service,
supervised_user_settings, user_pref_store, extension_prefs, supervised_user_settings, std::move(user_pref_store),
async); std::move(extension_prefs), async);
std::unique_ptr<sync_preferences::PrefServiceSyncable> pref_service = return factory.CreateSyncable(std::move(pref_registry), std::move(delegate));
factory.CreateSyncable(pref_registry.get(), std::move(delegate));
return pref_service;
} }
void DisableDomainCheckForTesting() { void DisableDomainCheckForTesting() {
......
...@@ -68,7 +68,7 @@ std::unique_ptr<PrefService> CreateLocalState( ...@@ -68,7 +68,7 @@ std::unique_ptr<PrefService> CreateLocalState(
const base::FilePath& pref_filename, const base::FilePath& pref_filename,
base::SequencedTaskRunner* pref_io_task_runner, base::SequencedTaskRunner* pref_io_task_runner,
policy::PolicyService* policy_service, policy::PolicyService* policy_service,
const scoped_refptr<PrefRegistry>& pref_registry, scoped_refptr<PrefRegistry> pref_registry,
bool async, bool async,
std::unique_ptr<PrefValueStore::Delegate> delegate); std::unique_ptr<PrefValueStore::Delegate> delegate);
...@@ -77,8 +77,8 @@ std::unique_ptr<sync_preferences::PrefServiceSyncable> CreateProfilePrefs( ...@@ -77,8 +77,8 @@ std::unique_ptr<sync_preferences::PrefServiceSyncable> CreateProfilePrefs(
prefs::mojom::TrackedPreferenceValidationDelegatePtr validation_delegate, prefs::mojom::TrackedPreferenceValidationDelegatePtr validation_delegate,
policy::PolicyService* policy_service, policy::PolicyService* policy_service,
SupervisedUserSettingsService* supervised_user_settings, SupervisedUserSettingsService* supervised_user_settings,
const scoped_refptr<PrefStore>& extension_prefs, scoped_refptr<PrefStore> extension_prefs,
const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry, scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry,
bool async, bool async,
scoped_refptr<base::SequencedTaskRunner> io_task_runner, scoped_refptr<base::SequencedTaskRunner> io_task_runner,
std::unique_ptr<PrefValueStore::Delegate> delegate); std::unique_ptr<PrefValueStore::Delegate> delegate);
......
...@@ -30,7 +30,7 @@ namespace { ...@@ -30,7 +30,7 @@ namespace {
class ReadErrorHandler : public PersistentPrefStore::ReadErrorDelegate { class ReadErrorHandler : public PersistentPrefStore::ReadErrorDelegate {
public: public:
using ErrorCallback = using ErrorCallback =
base::Callback<void(PersistentPrefStore::PrefReadError)>; base::RepeatingCallback<void(PersistentPrefStore::PrefReadError)>;
explicit ReadErrorHandler(ErrorCallback cb) : callback_(cb) {} explicit ReadErrorHandler(ErrorCallback cb) : callback_(cb) {}
void OnError(PersistentPrefStore::PrefReadError error) override { void OnError(PersistentPrefStore::PrefReadError error) override {
...@@ -61,16 +61,16 @@ uint32_t GetWriteFlags(const PrefService::Preference* pref) { ...@@ -61,16 +61,16 @@ uint32_t GetWriteFlags(const PrefService::Preference* pref) {
PrefService::PrefService( PrefService::PrefService(
std::unique_ptr<PrefNotifierImpl> pref_notifier, std::unique_ptr<PrefNotifierImpl> pref_notifier,
std::unique_ptr<PrefValueStore> pref_value_store, std::unique_ptr<PrefValueStore> pref_value_store,
PersistentPrefStore* user_prefs, scoped_refptr<PersistentPrefStore> user_prefs,
PrefRegistry* pref_registry, scoped_refptr<PrefRegistry> pref_registry,
base::Callback<void(PersistentPrefStore::PrefReadError)> base::RepeatingCallback<void(PersistentPrefStore::PrefReadError)>
read_error_callback, read_error_callback,
bool async) bool async)
: pref_notifier_(std::move(pref_notifier)), : pref_notifier_(std::move(pref_notifier)),
pref_value_store_(std::move(pref_value_store)), pref_value_store_(std::move(pref_value_store)),
pref_registry_(pref_registry), pref_registry_(std::move(pref_registry)),
user_pref_store_(user_prefs), user_pref_store_(std::move(user_prefs)),
read_error_callback_(read_error_callback) { read_error_callback_(std::move(read_error_callback)) {
pref_notifier_->SetPrefService(this); pref_notifier_->SetPrefService(this);
// TODO(battre): This is a check for crbug.com/435208 to make sure that // TODO(battre): This is a check for crbug.com/435208 to make sure that
......
...@@ -166,9 +166,9 @@ class COMPONENTS_PREFS_EXPORT PrefService { ...@@ -166,9 +166,9 @@ class COMPONENTS_PREFS_EXPORT PrefService {
// for simplified construction. // for simplified construction.
PrefService(std::unique_ptr<PrefNotifierImpl> pref_notifier, PrefService(std::unique_ptr<PrefNotifierImpl> pref_notifier,
std::unique_ptr<PrefValueStore> pref_value_store, std::unique_ptr<PrefValueStore> pref_value_store,
PersistentPrefStore* user_prefs, scoped_refptr<PersistentPrefStore> user_prefs,
PrefRegistry* pref_registry, scoped_refptr<PrefRegistry> pref_registry,
base::Callback<void(PersistentPrefStore::PrefReadError)> base::RepeatingCallback<void(PersistentPrefStore::PrefReadError)>
read_error_callback, read_error_callback,
bool async); bool async);
virtual ~PrefService(); virtual ~PrefService();
...@@ -359,7 +359,8 @@ class COMPONENTS_PREFS_EXPORT PrefService { ...@@ -359,7 +359,8 @@ class COMPONENTS_PREFS_EXPORT PrefService {
scoped_refptr<PersistentPrefStore> user_pref_store_; scoped_refptr<PersistentPrefStore> user_pref_store_;
// Callback to call when a read error occurs. // Callback to call when a read error occurs.
base::Callback<void(PersistentPrefStore::PrefReadError)> read_error_callback_; const base::RepeatingCallback<void(PersistentPrefStore::PrefReadError)>
read_error_callback_;
private: private:
// Hash map expected to be fastest here since it minimises expensive // Hash map expected to be fastest here since it minimises expensive
......
...@@ -37,7 +37,7 @@ void PrefServiceFactory::SetUserPrefsFile( ...@@ -37,7 +37,7 @@ void PrefServiceFactory::SetUserPrefsFile(
} }
std::unique_ptr<PrefService> PrefServiceFactory::Create( std::unique_ptr<PrefService> PrefServiceFactory::Create(
PrefRegistry* pref_registry, scoped_refptr<PrefRegistry> pref_registry,
std::unique_ptr<PrefValueStore::Delegate> delegate) { std::unique_ptr<PrefValueStore::Delegate> delegate) {
auto pref_notifier = std::make_unique<PrefNotifierImpl>(); auto pref_notifier = std::make_unique<PrefNotifierImpl>();
auto pref_value_store = std::make_unique<PrefValueStore>( auto pref_value_store = std::make_unique<PrefValueStore>(
...@@ -47,5 +47,5 @@ std::unique_ptr<PrefService> PrefServiceFactory::Create( ...@@ -47,5 +47,5 @@ std::unique_ptr<PrefService> PrefServiceFactory::Create(
pref_notifier.get(), std::move(delegate)); pref_notifier.get(), std::move(delegate));
return std::make_unique<PrefService>( return std::make_unique<PrefService>(
std::move(pref_notifier), std::move(pref_value_store), user_prefs_.get(), std::move(pref_notifier), std::move(pref_value_store), user_prefs_.get(),
pref_registry, read_error_callback_, async_); std::move(pref_registry), read_error_callback_, async_);
} }
...@@ -55,9 +55,9 @@ class COMPONENTS_PREFS_EXPORT PrefServiceFactory { ...@@ -55,9 +55,9 @@ class COMPONENTS_PREFS_EXPORT PrefServiceFactory {
// Sets up error callback for the PrefService. A do-nothing default // Sets up error callback for the PrefService. A do-nothing default
// is provided if this is not called. // is provided if this is not called.
void set_read_error_callback( void set_read_error_callback(
const base::Callback<void(PersistentPrefStore::PrefReadError)>& base::RepeatingCallback<void(PersistentPrefStore::PrefReadError)>
read_error_callback) { read_error_callback) {
read_error_callback_ = read_error_callback; read_error_callback_ = std::move(read_error_callback);
} }
// Specifies to use an actual file-backed user pref store. // Specifies to use an actual file-backed user pref store.
...@@ -71,7 +71,7 @@ class COMPONENTS_PREFS_EXPORT PrefServiceFactory { ...@@ -71,7 +71,7 @@ class COMPONENTS_PREFS_EXPORT PrefServiceFactory {
// Creates a PrefService object initialized with the parameters from // Creates a PrefService object initialized with the parameters from
// this factory. // this factory.
std::unique_ptr<PrefService> Create( std::unique_ptr<PrefService> Create(
PrefRegistry* registry, scoped_refptr<PrefRegistry> pref_registry,
std::unique_ptr<PrefValueStore::Delegate> delegate = nullptr); std::unique_ptr<PrefValueStore::Delegate> delegate = nullptr);
protected: protected:
...@@ -82,7 +82,8 @@ class COMPONENTS_PREFS_EXPORT PrefServiceFactory { ...@@ -82,7 +82,8 @@ class COMPONENTS_PREFS_EXPORT PrefServiceFactory {
scoped_refptr<PersistentPrefStore> user_prefs_; scoped_refptr<PersistentPrefStore> user_prefs_;
scoped_refptr<PrefStore> recommended_prefs_; scoped_refptr<PrefStore> recommended_prefs_;
base::Callback<void(PersistentPrefStore::PrefReadError)> read_error_callback_; base::RepeatingCallback<void(PersistentPrefStore::PrefReadError)>
read_error_callback_;
// Defaults to false. // Defaults to false.
bool async_; bool async_;
......
...@@ -30,17 +30,17 @@ namespace sync_preferences { ...@@ -30,17 +30,17 @@ namespace sync_preferences {
PrefServiceSyncable::PrefServiceSyncable( PrefServiceSyncable::PrefServiceSyncable(
std::unique_ptr<PrefNotifierImpl> pref_notifier, std::unique_ptr<PrefNotifierImpl> pref_notifier,
std::unique_ptr<PrefValueStore> pref_value_store, std::unique_ptr<PrefValueStore> pref_value_store,
PersistentPrefStore* user_prefs, scoped_refptr<PersistentPrefStore> user_prefs,
user_prefs::PrefRegistrySyncable* pref_registry, scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry,
const PrefModelAssociatorClient* pref_model_associator_client, const PrefModelAssociatorClient* pref_model_associator_client,
base::Callback<void(PersistentPrefStore::PrefReadError)> base::RepeatingCallback<void(PersistentPrefStore::PrefReadError)>
read_error_callback, read_error_callback,
bool async) bool async)
: PrefService(std::move(pref_notifier), : PrefService(std::move(pref_notifier),
std::move(pref_value_store), std::move(pref_value_store),
user_prefs, std::move(user_prefs),
pref_registry, std::move(pref_registry),
read_error_callback, std::move(read_error_callback),
async), async),
pref_service_forked_(false), pref_service_forked_(false),
pref_sync_associator_(pref_model_associator_client, syncer::PREFERENCES), pref_sync_associator_(pref_model_associator_client, syncer::PREFERENCES),
...@@ -54,17 +54,17 @@ PrefServiceSyncable::PrefServiceSyncable( ...@@ -54,17 +54,17 @@ PrefServiceSyncable::PrefServiceSyncable(
&PrefServiceSyncable::ProcessPrefChange, base::Unretained(this))); &PrefServiceSyncable::ProcessPrefChange, base::Unretained(this)));
// Add already-registered syncable preferences to PrefModelAssociator. // Add already-registered syncable preferences to PrefModelAssociator.
for (PrefRegistry::const_iterator it = pref_registry->begin(); for (const auto& entry : *pref_registry_) {
it != pref_registry->end(); ++it) { const std::string& path = entry.first;
const std::string& path = it->first;
AddRegisteredSyncablePreference(path, AddRegisteredSyncablePreference(path,
pref_registry_->GetRegistrationFlags(path)); pref_registry_->GetRegistrationFlags(path));
} }
// Watch for syncable preferences registered after this point. // Watch for syncable preferences registered after this point.
pref_registry->SetSyncableRegistrationCallback( static_cast<user_prefs::PrefRegistrySyncable*>(pref_registry_.get())
base::Bind(&PrefServiceSyncable::AddRegisteredSyncablePreference, ->SetSyncableRegistrationCallback(base::BindRepeating(
base::Unretained(this))); &PrefServiceSyncable::AddRegisteredSyncablePreference,
base::Unretained(this)));
} }
PrefServiceSyncable::~PrefServiceSyncable() { PrefServiceSyncable::~PrefServiceSyncable() {
...@@ -110,7 +110,7 @@ PrefServiceSyncable::CreateIncognitoPrefService( ...@@ -110,7 +110,7 @@ PrefServiceSyncable::CreateIncognitoPrefService(
std::move(delegate)); std::move(delegate));
return std::make_unique<PrefServiceSyncable>( return std::make_unique<PrefServiceSyncable>(
std::move(pref_notifier), std::move(pref_value_store), std::move(pref_notifier), std::move(pref_value_store),
incognito_pref_store.get(), forked_registry.get(), std::move(incognito_pref_store), std::move(forked_registry),
pref_sync_associator_.client(), read_error_callback_, false); pref_sync_associator_.client(), read_error_callback_, false);
} }
......
...@@ -38,10 +38,10 @@ class PrefServiceSyncable : public PrefService { ...@@ -38,10 +38,10 @@ class PrefServiceSyncable : public PrefService {
PrefServiceSyncable( PrefServiceSyncable(
std::unique_ptr<PrefNotifierImpl> pref_notifier, std::unique_ptr<PrefNotifierImpl> pref_notifier,
std::unique_ptr<PrefValueStore> pref_value_store, std::unique_ptr<PrefValueStore> pref_value_store,
PersistentPrefStore* user_prefs, scoped_refptr<PersistentPrefStore> user_prefs,
user_prefs::PrefRegistrySyncable* pref_registry, scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry,
const PrefModelAssociatorClient* pref_model_associato_client, const PrefModelAssociatorClient* pref_model_associato_client,
base::Callback<void(PersistentPrefStore::PrefReadError)> base::RepeatingCallback<void(PersistentPrefStore::PrefReadError)>
read_error_callback, read_error_callback,
bool async); bool async);
~PrefServiceSyncable() override; ~PrefServiceSyncable() override;
......
...@@ -57,7 +57,7 @@ void PrefServiceSyncableFactory::SetPrefModelAssociatorClient( ...@@ -57,7 +57,7 @@ void PrefServiceSyncableFactory::SetPrefModelAssociatorClient(
} }
std::unique_ptr<PrefServiceSyncable> PrefServiceSyncableFactory::CreateSyncable( std::unique_ptr<PrefServiceSyncable> PrefServiceSyncableFactory::CreateSyncable(
user_prefs::PrefRegistrySyncable* pref_registry, scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry,
std::unique_ptr<PrefValueStore::Delegate> delegate) { std::unique_ptr<PrefValueStore::Delegate> delegate) {
TRACE_EVENT0("browser", "PrefServiceSyncableFactory::CreateSyncable"); TRACE_EVENT0("browser", "PrefServiceSyncableFactory::CreateSyncable");
auto pref_notifier = std::make_unique<PrefNotifierImpl>(); auto pref_notifier = std::make_unique<PrefNotifierImpl>();
...@@ -68,8 +68,8 @@ std::unique_ptr<PrefServiceSyncable> PrefServiceSyncableFactory::CreateSyncable( ...@@ -68,8 +68,8 @@ std::unique_ptr<PrefServiceSyncable> PrefServiceSyncableFactory::CreateSyncable(
pref_notifier.get(), std::move(delegate)); pref_notifier.get(), std::move(delegate));
return std::make_unique<PrefServiceSyncable>( return std::make_unique<PrefServiceSyncable>(
std::move(pref_notifier), std::move(pref_value_store), user_prefs_.get(), std::move(pref_notifier), std::move(pref_value_store), user_prefs_.get(),
pref_registry, pref_model_associator_client_, read_error_callback_, std::move(pref_registry), pref_model_associator_client_,
async_); read_error_callback_, async_);
} }
} // namespace sync_preferences } // namespace sync_preferences
...@@ -46,7 +46,7 @@ class PrefServiceSyncableFactory : public PrefServiceFactory { ...@@ -46,7 +46,7 @@ class PrefServiceSyncableFactory : public PrefServiceFactory {
// |delegate| might be null during test or if we're not using the Mojo pref // |delegate| might be null during test or if we're not using the Mojo pref
// service. // service.
std::unique_ptr<PrefServiceSyncable> CreateSyncable( std::unique_ptr<PrefServiceSyncable> CreateSyncable(
user_prefs::PrefRegistrySyncable* registry, scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry,
std::unique_ptr<PrefValueStore::Delegate> delegate = nullptr); std::unique_ptr<PrefValueStore::Delegate> delegate = nullptr);
private: private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment