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

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

Issue 2304573002: Add ComputeMac and ComputeSplitMacs methods to pref_hash_store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase-update'd Created 4 years, 3 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 2024a7d9ce79da0046a03efe515e9a0711979d87..3e5cc262ae719bf00d5ca3a33f8e5fb91f8bae8f 100644
--- a/components/user_prefs/tracked/pref_hash_store.h
+++ b/components/user_prefs/tracked/pref_hash_store.h
@@ -6,9 +6,12 @@
#define COMPONENTS_PREFS_TRACKED_PREF_HASH_STORE_H_
#include <memory>
+#include <string>
+
+#include "base/values.h"
+#include "components/user_prefs/tracked/pref_hash_store_transaction.h"
class HashStoreContents;
-class PrefHashStoreTransaction;
// Holds the configuration and implementation used to calculate and verify
// preference MACs.
@@ -24,6 +27,21 @@ class PrefHashStore {
// |storage| must outlive the returned transaction.
virtual std::unique_ptr<PrefHashStoreTransaction> BeginTransaction(
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(
+ const std::string& path,
+ const base::DictionaryValue* split_values) = 0;
};
#endif // COMPONENTS_PREFS_TRACKED_PREF_HASH_STORE_H_
« no previous file with comments | « components/user_prefs/tracked/pref_hash_filter_unittest.cc ('k') | components/user_prefs/tracked/pref_hash_store_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698