Index: components/prefs/pref_service.h |
diff --git a/components/prefs/pref_service.h b/components/prefs/pref_service.h |
index e08e361c40b618da1637b995323745dfc1e0052f..7860f14c0841bdcaca9852017b0ee9ca470548de 100644 |
--- a/components/prefs/pref_service.h |
+++ b/components/prefs/pref_service.h |
@@ -250,23 +250,22 @@ class COMPONENTS_PREFS_EXPORT PrefService : public base::NonThreadSafe { |
// this checks if a value exists for the path. |
bool HasPrefPath(const std::string& path) const; |
- // Returns a dictionary with effective preference values. |
- std::unique_ptr<base::DictionaryValue> GetPreferenceValues() const; |
- |
- // Returns a dictionary with effective preference values, omitting prefs that |
- // are at their default values. |
- std::unique_ptr<base::DictionaryValue> GetPreferenceValuesOmitDefaults() |
- const; |
- |
- // Returns a dictionary with effective preference values. Contrary to |
- // GetPreferenceValues(), the paths of registered preferences are not split on |
- // '.' characters. If a registered preference stores a dictionary, however, |
- // the hierarchical structure inside the preference will be preserved. |
- // For example, if "foo.bar" is a registered preference, the result could look |
- // like this: |
- // {"foo.bar": {"a": {"b": true}}}. |
- std::unique_ptr<base::DictionaryValue> |
- GetPreferenceValuesWithoutPathExpansion() const; |
+ // Issues a callback for every preference value. The preferences must not be |
+ // mutated during iteration. |
+ void IteratePreferenceValues( |
+ base::RepeatingCallback<void(const std::string& key, |
+ const base::Value& value)> callback) const; |
+ |
+ // Returns a dictionary with effective preference values. This is an expensive |
+ // operation which does a deep copy. Use only if you really need the results |
+ // in a base::Value (for example, for JSON serialization). Otherwise use |
+ // IteratePreferenceValues above to avoid the copies. |
+ // |
+ // If include_defaults is set, preferences set to their default values will |
+ // be included. Otherwise, these will be omitted from the returned |
+ // dictionary. |
+ std::unique_ptr<base::DictionaryValue> GetPreferenceValues( |
+ bool include_defaults) const; |
Roger Tawa OOO till Jul 10th
2017/04/11 21:04:29
Would be better if this were an enum instead of a
brettw
2017/04/18 19:28:38
Done
|
bool ReadOnly() const; |