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

Unified Diff: services/preferences/tracked/segregated_pref_store.h

Issue 2745563005: Pref service: add support for tracked prefs. (Closed)
Patch Set: deflake tests Created 3 years, 8 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/tracked/segregated_pref_store.h
diff --git a/services/preferences/tracked/segregated_pref_store.h b/services/preferences/tracked/segregated_pref_store.h
index 8118dd5fc1aec28715a0b507515a6dc14d270ab4..3621e49aa079cb09c49549eeac5de8b9688f3867 100644
--- a/services/preferences/tracked/segregated_pref_store.h
+++ b/services/preferences/tracked/segregated_pref_store.h
@@ -16,6 +16,7 @@
#include "base/memory/ref_counted.h"
#include "base/observer_list.h"
#include "components/prefs/persistent_pref_store.h"
+#include "services/preferences/public/interfaces/tracked_preference_validation_delegate.mojom.h"
// Provides a unified PersistentPrefStore implementation that splits its storage
// and retrieval between two underlying PersistentPrefStore instances: a set of
@@ -43,7 +44,8 @@ class SegregatedPrefStore : public PersistentPrefStore {
SegregatedPrefStore(
const scoped_refptr<PersistentPrefStore>& default_pref_store,
const scoped_refptr<PersistentPrefStore>& selected_pref_store,
- const std::set<std::string>& selected_pref_names);
+ const std::set<std::string>& selected_pref_names,
+ prefs::mojom::TrackedPreferenceValidationDelegatePtr validation_delegate);
// PrefStore implementation
void AddObserver(Observer* observer) override;
@@ -101,6 +103,11 @@ class SegregatedPrefStore : public PersistentPrefStore {
PersistentPrefStore* StoreForKey(const std::string& key);
const PersistentPrefStore* StoreForKey(const std::string& key) const;
+ // |validation_delegate_| is used by |default_pref_store_| and
+ // |selected_pref_store_| PrefHashFilters. Its lifetime is managed here since
+ // a single owner is required.
+ prefs::mojom::TrackedPreferenceValidationDelegatePtr validation_delegate_;
+
scoped_refptr<PersistentPrefStore> default_pref_store_;
scoped_refptr<PersistentPrefStore> selected_pref_store_;
std::set<std::string> selected_preference_names_;

Powered by Google App Engine
This is Rietveld 408576698