diff options
author | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-25 16:38:31 +0000 |
---|---|---|
committer | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-25 16:38:31 +0000 |
commit | 68bf41ae4642cc0b1ad6f9d5c4050acaf3d7d1d5 (patch) | |
tree | 42a4b753dd5db63399fc7a55f021c0bf6adfb1ba /chrome/common/persistent_pref_store.h | |
parent | e6eddfdb8f1a9688145e5efba334d484c738a1c6 (diff) | |
download | chromium_src-68bf41ae4642cc0b1ad6f9d5c4050acaf3d7d1d5.zip chromium_src-68bf41ae4642cc0b1ad6f9d5c4050acaf3d7d1d5.tar.gz chromium_src-68bf41ae4642cc0b1ad6f9d5c4050acaf3d7d1d5.tar.bz2 |
Let PrefStore::GetValue return a const Value* instead of Value* and add PersistentPrefStore::GetMutableValue
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6713099
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79413 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/persistent_pref_store.h')
-rw-r--r-- | chrome/common/persistent_pref_store.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome/common/persistent_pref_store.h b/chrome/common/persistent_pref_store.h index 300e649..8bd677a 100644 --- a/chrome/common/persistent_pref_store.h +++ b/chrome/common/persistent_pref_store.h @@ -34,6 +34,16 @@ class PersistentPrefStore : public PrefStore { PREF_READ_ERROR_FILE_NOT_SPECIFIED }; + // Equivalent to PrefStore::GetValue but returns a mutable value. + virtual ReadResult GetMutableValue(const std::string& key, + 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. + virtual void ReportValueChanged(const std::string& key) = 0; + // Sets a |value| for |key| in the store. Assumes ownership of |value|, which // must be non-NULL. virtual void SetValue(const std::string& key, Value* value) = 0; @@ -51,9 +61,6 @@ class PersistentPrefStore : public PrefStore { // Removes the value for |key|. virtual void RemoveValue(const std::string& key) = 0; - // TODO(battre) Remove this function. - virtual void ReportValueChanged(const std::string& key) = 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. |