OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_PREFS_TRACKED_PREF_HASH_STORE_H_ | 5 #ifndef COMPONENTS_PREFS_TRACKED_PREF_HASH_STORE_H_ |
6 #define COMPONENTS_PREFS_TRACKED_PREF_HASH_STORE_H_ | 6 #define COMPONENTS_PREFS_TRACKED_PREF_HASH_STORE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 class HashStoreContents; | 10 class HashStoreContents; |
11 class PrefHashStoreTransaction; | 11 class PrefHashStoreTransaction; |
12 | 12 |
13 namespace base { | |
14 class DictionaryValue; | |
15 class Value; | |
16 } // namespace base | |
17 | |
13 // Holds the configuration and implementation used to calculate and verify | 18 // Holds the configuration and implementation used to calculate and verify |
14 // preference MACs. | 19 // preference MACs. |
15 // TODO(gab): Rename this class as it is no longer a store. | 20 // TODO(gab): Rename this class as it is no longer a store. |
16 class PrefHashStore { | 21 class PrefHashStore { |
17 public: | 22 public: |
18 virtual ~PrefHashStore() {} | 23 virtual ~PrefHashStore() {} |
19 | 24 |
20 // Returns a PrefHashStoreTransaction which can be used to perform a series | 25 // Returns a PrefHashStoreTransaction which can be used to perform a series |
21 // of operations on the hash store. |storage| MAY be used as the backing store | 26 // of operations on the hash store. |storage| MAY be used as the backing store |
22 // depending on the implementation. Therefore the HashStoreContents used for | 27 // depending on the implementation. Therefore the HashStoreContents used for |
23 // related transactions should correspond to the same underlying data store. | 28 // related transactions should correspond to the same underlying data store. |
24 virtual std::unique_ptr<PrefHashStoreTransaction> BeginTransaction( | 29 virtual std::unique_ptr<PrefHashStoreTransaction> BeginTransaction( |
25 std::unique_ptr<HashStoreContents> storage) = 0; | 30 std::unique_ptr<HashStoreContents> storage) = 0; |
31 | |
32 virtual std::string ComputeMac(const std::string& path, | |
gab
2016/08/03 18:19:35
Document these new methods. Something like
// Com
proberge
2016/08/04 00:13:46
Done.
| |
33 const base::Value* new_value) = 0; | |
gab
2016/08/03 18:19:35
s/new_value/value/ (this API doesn't care that it'
proberge
2016/08/04 00:13:46
Done.
| |
34 | |
35 virtual std::unique_ptr<base::DictionaryValue> ComputeSplitMacs( | |
36 const std::string& path, | |
37 const base::DictionaryValue* split_values) = 0; | |
26 }; | 38 }; |
27 | 39 |
28 #endif // COMPONENTS_PREFS_TRACKED_PREF_HASH_STORE_H_ | 40 #endif // COMPONENTS_PREFS_TRACKED_PREF_HASH_STORE_H_ |
OLD | NEW |