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

Unified Diff: services/preferences/public/cpp/pref_observer_store.cc

Issue 2635093002: Switch Preferences to use Factory (Closed)
Patch Set: Missed test Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: services/preferences/public/cpp/pref_observer_store.cc
diff --git a/services/preferences/public/cpp/pref_observer_store.cc b/services/preferences/public/cpp/pref_observer_store.cc
index 7b38fe81351d1b456d6e77650583ca4bb7d41a0b..2b553d57af805a515f891a58c0f8a1900a9d9cd1 100644
--- a/services/preferences/public/cpp/pref_observer_store.cc
+++ b/services/preferences/public/cpp/pref_observer_store.cc
@@ -11,14 +11,15 @@
namespace preferences {
PrefObserverStore::PrefObserverStore(
- prefs::mojom::PreferencesManagerPtr prefs_manager_ptr)
+ prefs::mojom::PreferencesFactoryPtr pref_factory_ptr)
: prefs_binding_(this),
- prefs_manager_ptr_(std::move(prefs_manager_ptr)),
- initialized_(false) {}
+ pref_factory_ptr_(std::move(pref_factory_ptr)),
+ initialized_(false) {
+ pref_factory_ptr_->Create(prefs_binding_.CreateInterfacePtrAndBind(),
+ mojo::MakeRequest(&prefs_manager_ptr_));
+}
void PrefObserverStore::Subscribe(const std::set<std::string>& keys) {
- if (keys_.empty())
- prefs_manager_ptr_->AddObserver(prefs_binding_.CreateInterfacePtrAndBind());
keys_.insert(keys.begin(), keys.end());
std::vector<std::string> pref_array;

Powered by Google App Engine
This is Rietveld 408576698