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

Unified Diff: chrome/browser/prefs/pref_hash_store_impl.h

Issue 114223002: Multi-strategy based tracking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge up to r248367 Created 6 years, 11 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 | « chrome/browser/prefs/pref_hash_store.h ('k') | chrome/browser/prefs/pref_hash_store_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f70188d1417a9ed6d2c021f5c2736734bba1f3b6..78eb9c39eccd258fb1cd80bd2450c3d2647a9544 100644
--- a/chrome/browser/prefs/pref_hash_store_impl.h
+++ b/chrome/browser/prefs/pref_hash_store_impl.h
@@ -9,7 +9,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/prefs/scoped_user_pref_update.h"
#include "chrome/browser/prefs/pref_hash_calculator.h"
#include "chrome/browser/prefs/pref_hash_store.h"
@@ -17,8 +17,9 @@ class PrefRegistrySimple;
class PrefService;
namespace base {
+class DictionaryValue;
class Value;
-} // namespace base
+}
// Implements PrefHashStoreImpl by storing preference hashes in a PrefService.
class PrefHashStoreImpl : public PrefHashStore {
@@ -49,8 +50,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).
« no previous file with comments | « chrome/browser/prefs/pref_hash_store.h ('k') | chrome/browser/prefs/pref_hash_store_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698