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

Unified Diff: components/user_prefs/tracked/pref_hash_store.h

Issue 2204943002: Integrate registry_hash_store_contents with the rest of tracked prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove a lost include statement Created 4 years, 4 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
Index: components/user_prefs/tracked/pref_hash_store.h
diff --git a/components/user_prefs/tracked/pref_hash_store.h b/components/user_prefs/tracked/pref_hash_store.h
index 2fdc617301ae1fea64526ae16fe5d6621c272406..096895268ef51796773c8b959cedb4dc1ac96fa8 100644
--- a/components/user_prefs/tracked/pref_hash_store.h
+++ b/components/user_prefs/tracked/pref_hash_store.h
@@ -10,6 +10,11 @@
class HashStoreContents;
class PrefHashStoreTransaction;
+namespace base {
+class DictionaryValue;
+class Value;
+} // namespace base
+
// Holds the configuration and implementation used to calculate and verify
// preference MACs.
// TODO(gab): Rename this class as it is no longer a store.
@@ -21,8 +26,25 @@ class PrefHashStore {
// of operations on the hash store. |storage| MAY be used as the backing store
// depending on the implementation. Therefore the HashStoreContents used for
// related transactions should correspond to the same underlying data store.
+ // Does not own the HashStoreContents; callers must ensure transaction must
+ // not outlive |storage|.
virtual std::unique_ptr<PrefHashStoreTransaction> BeginTransaction(
- std::unique_ptr<HashStoreContents> storage) = 0;
+ HashStoreContents* storage) = 0;
+
+ // Computes the MAC to be associated with |path| and |value| in this store.
+ // PrefHashStoreTransaction typically uses this internally but it's also
+ // exposed for users that want to compute MACs ahead of time for asynchronous
+ // operations.
+ virtual std::string ComputeMac(const std::string& path,
+ const base::Value* value) = 0;
+
+ // Computes the MAC to be associated with |path| and |split_values| in this
+ // store. PrefHashStoreTransaction typically uses this internally but it's
+ // also exposed for users that want to compute MACs ahead of time for
+ // asynchronous operations.
+ virtual std::unique_ptr<base::DictionaryValue> ComputeSplitMacs(
gab 2016/08/08 04:37:46 ComputeMac/ComputeSplitMacs is another good candid
proberge 2016/08/31 17:30:17 Acknowledged.
+ const std::string& path,
+ const base::DictionaryValue* split_values) = 0;
};
#endif // COMPONENTS_PREFS_TRACKED_PREF_HASH_STORE_H_

Powered by Google App Engine
This is Rietveld 408576698