Chromium Code Reviews| Index: chrome/browser/prefs/pref_hash_store_impl.h |
| diff --git a/chrome/browser/prefs/pref_hash_store_impl.h b/chrome/browser/prefs/pref_hash_store_impl.h |
| index 63ac7cd9d9089880f4adc0d7abb5a20816363f70..a577e0c09416d089c2571ebfccc701976fb7f170 100644 |
| --- a/chrome/browser/prefs/pref_hash_store_impl.h |
| +++ b/chrome/browser/prefs/pref_hash_store_impl.h |
| @@ -5,21 +5,15 @@ |
| #ifndef CHROME_BROWSER_PREFS_PREF_HASH_STORE_IMPL_H_ |
| #define CHROME_BROWSER_PREFS_PREF_HASH_STORE_IMPL_H_ |
| -#include <string> |
|
erikwright (departed)
2014/01/15 22:27:42
I tend to think that you should include or declare
gab
2014/01/16 01:28:02
Ok, makes sense, done.
|
| - |
| #include "base/basictypes.h" |
| #include "base/compiler_specific.h" |
| -#include "base/memory/scoped_ptr.h" |
| +#include "base/prefs/scoped_user_pref_update.h" |
|
erikwright (departed)
2014/01/15 22:27:42
forward decl?
gab
2014/01/16 01:28:02
It's a typedef so I can't :(, right?
|
| #include "chrome/browser/prefs/pref_hash_calculator.h" |
| #include "chrome/browser/prefs/pref_hash_store.h" |
| class PrefRegistrySimple; |
| class PrefService; |
| -namespace base { |
| -class Value; |
| -} // namespace base |
| - |
| // Implements PrefHashStoreImpl by storing preference hashes in a PrefService. |
| class PrefHashStoreImpl : public PrefHashStore { |
| public: |
| @@ -44,8 +38,35 @@ class PrefHashStoreImpl : public PrefHashStore { |
| const base::Value* value) const OVERRIDE; |
| virtual void StoreHash(const std::string& path, |
| const base::Value* value) OVERRIDE; |
| + virtual ValueState CheckSplitValue( |
| + const std::string& path, |
| + const base::DictionaryValue* initial_split_value, |
| + std::vector<std::string>* invalid_keys) const OVERRIDE; |
| + virtual void StoreSplitHash( |
| + const std::string& path, |
| + const base::DictionaryValue* split_value) OVERRIDE; |
| private: |
| + // Clears any hashes stored for |path| through |update|. |
| + void ClearPath(const std::string& path, |
| + DictionaryPrefUpdate* update); |
| + |
| + // Returns true if there are split hashes stored for |path|. |
| + bool HasSplitHashesAtPath(const std::string& path) const; |
| + |
| + // Used by StoreHash and StoreSplitHash to store the hash of |new_value| at |
| + // |path| under |update|. Allows multiple hashes to be stored under the same |
| + // |update|. |
| + void StoreHashInternal(const std::string& path, |
| + const base::Value* new_value, |
| + DictionaryPrefUpdate* update); |
| + |
| + // Updates kHashOfHashesPref to reflect the last changes to the |hashes_dict|. |
| + // Must be called after every change to the |hashes_dict|, within the scope of |
| + // |update|. |
| + void UpdateHashOfHashes(const base::DictionaryValue* hashes_dict, |
| + DictionaryPrefUpdate* update); |
| + |
| // Returns true if the dictionary of hashes stored for |hash_store_id_| is |
| // trusted (which implies unknown values can be trusted as newly tracked |
| // values). |