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

Unified Diff: services/preferences/public/cpp/pref_store_impl.h

Issue 2778643002: Pref service: Filter updates from read-only pref stores. (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 side-by-side diff with in-line comments
Download patch
Index: services/preferences/public/cpp/pref_store_impl.h
diff --git a/services/preferences/public/cpp/pref_store_impl.h b/services/preferences/public/cpp/pref_store_impl.h
index ce8b68897db5eb06b8cb3a5a45b3e3ea5fd54e38..62146a648c7b75060307bfb4a8b2749023426cb7 100644
--- a/services/preferences/public/cpp/pref_store_impl.h
+++ b/services/preferences/public/cpp/pref_store_impl.h
@@ -27,23 +27,26 @@ class PrefStoreImpl : public ::PrefStore::Observer, public mojom::PrefStore {
// The created instance is registered in and owned by the
// |mojom::PrefStoreRegistry|.
static std::unique_ptr<PrefStoreImpl> Create(
- mojom::PrefStoreRegistryPtr registry_ptr,
+ mojom::PrefStoreRegistry* registry_ptr,
scoped_refptr<::PrefStore> pref_store,
PrefValueStore::PrefStoreType type);
private:
+ class Observer;
+
// PrefStore::Observer:
void OnPrefValueChanged(const std::string& key) override;
void OnInitializationCompleted(bool succeeded) override;
// prefs::mojom::PrefStore:
- void AddObserver(const AddObserverCallback& callback) override;
+ void AddObserver(const std::vector<std::string>& prefs_to_observe,
+ const AddObserverCallback& callback) override;
// The backing store we observer for changes.
scoped_refptr<::PrefStore> backing_pref_store_;
// Observers we notify when |backing_pref_store_| changes.
- std::vector<mojom::PrefStoreObserverPtr> observers_;
+ std::vector<std::unique_ptr<Observer>> observers_;
// True when the |backing_pref_store_| is initialized, either because it was
// passed already initialized in the constructor or after
« no previous file with comments | « services/preferences/public/cpp/pref_store_client_mixin.cc ('k') | services/preferences/public/cpp/pref_store_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698