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

Unified Diff: components/prefs/writeable_pref_store.h

Issue 2812863002: Pref service: Add a ScopedDictionaryPrefUpdate to track value changes. (Closed)
Patch Set: rebase 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
« no previous file with comments | « components/prefs/pref_service.cc ('k') | components/prefs/writeable_pref_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/prefs/writeable_pref_store.h
diff --git a/components/prefs/writeable_pref_store.h b/components/prefs/writeable_pref_store.h
index 6cfbcee32d80104b5a1235662a09ee29580b6783..9a69c7cbe47e3bc8aae9417039588b3e2b198171 100644
--- a/components/prefs/writeable_pref_store.h
+++ b/components/prefs/writeable_pref_store.h
@@ -8,7 +8,9 @@
#include <stdint.h>
#include <memory>
+#include <set>
#include <string>
+#include <vector>
#include "base/macros.h"
#include "components/prefs/pref_store.h"
@@ -46,13 +48,25 @@ class COMPONENTS_PREFS_EXPORT WriteablePrefStore : public PrefStore {
virtual bool GetMutableValue(const std::string& key,
base::Value** result) = 0;
- // Triggers a value changed notification. This function needs to be called
- // if one retrieves a list or dictionary with GetMutableValue and change its
- // value. SetValue takes care of notifications itself. Note that
- // ReportValueChanged will trigger notifications even if nothing has changed.
- // |flags| is a bitmask of PrefWriteFlags.
+ // Triggers a value changed notification. This function or
+ // ReportSubValuesChanged needs to be called if one retrieves a list or
+ // dictionary with GetMutableValue and change its value. SetValue takes care
+ // of notifications itself. Note that ReportValueChanged will trigger
+ // notifications even if nothing has changed. |flags| is a bitmask of
+ // PrefWriteFlags.
virtual void ReportValueChanged(const std::string& key, uint32_t flags) = 0;
+ // Triggers a value changed notification for |path_components| in the |key|
+ // pref. This function or ReportValueChanged needs to be called if one
+ // retrieves a list or dictionary with GetMutableValue and change its value.
+ // SetValue takes care of notifications itself. Note that
+ // ReportSubValuesChanged will trigger notifications even if nothing has
+ // changed. |flags| is a bitmask of PrefWriteFlags.
+ virtual void ReportSubValuesChanged(
+ const std::string& key,
+ std::set<std::vector<std::string>> path_components,
+ uint32_t flags);
+
// 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
« no previous file with comments | « components/prefs/pref_service.cc ('k') | components/prefs/writeable_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698