diff options
Diffstat (limited to 'base/prefs')
-rw-r--r-- | base/prefs/persistent_pref_store.h | 6 | ||||
-rw-r--r-- | base/prefs/value_map_pref_store.cc | 5 | ||||
-rw-r--r-- | base/prefs/value_map_pref_store.h | 2 | ||||
-rw-r--r-- | base/prefs/writeable_pref_store.h | 5 |
4 files changed, 12 insertions, 6 deletions
diff --git a/base/prefs/persistent_pref_store.h b/base/prefs/persistent_pref_store.h index fb9d6dc..093ea8d5 100644 --- a/base/prefs/persistent_pref_store.h +++ b/base/prefs/persistent_pref_store.h @@ -46,12 +46,6 @@ class BASE_PREFS_EXPORT PersistentPrefStore : public WriteablePrefStore { virtual void OnError(PrefReadError error) = 0; }; - // Same as SetValue, but doesn't generate notifications. This is used by - // PrefService::GetMutableUserPref() in order to put empty entries - // into the user pref store. Using SetValue is not an option since existing - // tests rely on the number of notifications generated. - virtual void SetValueSilently(const std::string& key, base::Value* value) = 0; - // Whether the store is in a pseudo-read-only mode where changes are not // actually persisted to disk. This happens in some cases when there are // read errors during startup. diff --git a/base/prefs/value_map_pref_store.cc b/base/prefs/value_map_pref_store.cc index 5e890e2..8af1282 100644 --- a/base/prefs/value_map_pref_store.cc +++ b/base/prefs/value_map_pref_store.cc @@ -47,6 +47,11 @@ void ValueMapPrefStore::ReportValueChanged(const std::string& key) { FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(key)); } +void ValueMapPrefStore::SetValueSilently(const std::string& key, + base::Value* value) { + prefs_.SetValue(key, value); +} + ValueMapPrefStore::~ValueMapPrefStore() {} void ValueMapPrefStore::NotifyInitializationCompleted() { diff --git a/base/prefs/value_map_pref_store.h b/base/prefs/value_map_pref_store.h index c202725..d4e41f45 100644 --- a/base/prefs/value_map_pref_store.h +++ b/base/prefs/value_map_pref_store.h @@ -33,6 +33,8 @@ class BASE_PREFS_EXPORT ValueMapPrefStore : public WriteablePrefStore { virtual bool GetMutableValue(const std::string& key, base::Value** value) OVERRIDE; virtual void ReportValueChanged(const std::string& key) OVERRIDE; + virtual void SetValueSilently(const std::string& key, + base::Value* value) OVERRIDE; protected: virtual ~ValueMapPrefStore(); diff --git a/base/prefs/writeable_pref_store.h b/base/prefs/writeable_pref_store.h index 908d867..d320dcf 100644 --- a/base/prefs/writeable_pref_store.h +++ b/base/prefs/writeable_pref_store.h @@ -36,6 +36,11 @@ class BASE_PREFS_EXPORT WriteablePrefStore : public PrefStore { // ReportValueChanged will trigger notifications even if nothing has changed. virtual void ReportValueChanged(const std::string& key) = 0; + // Same as SetValue, but doesn't generate notifications. This is used by + // PrefService::GetMutableUserPref() in order to put empty entries + // into the user pref store. Using SetValue is not an option since existing + // tests rely on the number of notifications generated. + virtual void SetValueSilently(const std::string& key, base::Value* value) = 0; protected: virtual ~WriteablePrefStore() {} |