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

Side by Side Diff: components/user_prefs/tracked/hash_store_contents.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_USER_PREFS_TRACKED_HASH_STORE_CONTENTS_H_ 5 #ifndef COMPONENTS_USER_PREFS_TRACKED_HASH_STORE_CONTENTS_H_
6 #define COMPONENTS_USER_PREFS_TRACKED_HASH_STORE_CONTENTS_H_ 6 #define COMPONENTS_USER_PREFS_TRACKED_HASH_STORE_CONTENTS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 11
12 namespace base { 12 namespace base {
13 class DictionaryValue; 13 class DictionaryValue;
14 class Value; 14 class Value;
15 } // namespace base 15 } // namespace base
16 16
17 enum class HashStoreContentsType : int32_t {
gab 2016/08/08 04:37:45 Can get rid of this now?
proberge 2016/08/31 17:30:16 Done.
18 DICTIONARY_HASH_STORE_CONTENTS = 1,
19 REGISTRY_HASH_STORE_CONTENTS = 2
20 };
21
17 // Provides access to the contents of a preference hash store. The store 22 // Provides access to the contents of a preference hash store. The store
18 // contains the following data: 23 // contains the following data:
19 // Contents: a client-defined dictionary that should map preference names to 24 // Contents: a client-defined dictionary that should map preference names to
20 // MACs. 25 // MACs.
21 // Version: a client-defined version number for the format of Contents. 26 // Version: a client-defined version number for the format of Contents.
22 // Super MAC: a MAC that authenticates the entirety of Contents. 27 // Super MAC: a MAC that authenticates the entirety of Contents.
23 class HashStoreContents { 28 class HashStoreContents {
24 public: 29 public:
25 virtual ~HashStoreContents() {} 30 virtual ~HashStoreContents() {}
26 31
32 // Helper function to make a clone of this object.
33 // NOTE: this is intended to be used as a lightweight alternative to making
34 // this class RefCountedThreadSafe. Do not make copies of this object unless
35 // you can't avoid it.
gab 2016/08/08 04:37:45 In order to make this API cleaner, I'd like us to
proberge 2016/08/31 17:30:16 Done.
36 virtual std::unique_ptr<HashStoreContents> MakeCopy() const = 0;
37
38 // Returns the string to append to UMA histograms for this store type.
gab 2016/08/08 04:37:45 "Returns the suffix to be appended" (the fact tha
proberge 2016/08/31 17:30:16 Done.
39 // The returned value must either be an empty string or one of the values in
40 // histograms.xml's TrackedPreferencesExternalValidators.
41 virtual std::string GetUMASuffix() const = 0;
gab 2016/08/08 04:37:45 Return a base::StringPiece instead of an std::stri
proberge 2016/08/31 17:30:16 Done.
42
27 // Discards all data related to this hash store. 43 // Discards all data related to this hash store.
28 virtual void Reset() = 0; 44 virtual void Reset() = 0;
29 45
30 // Outputs the MAC validating the preference at path. Returns true if a MAC 46 // Outputs the MAC validating the preference at path. Returns true if a MAC
31 // was successfully read and false otherwise. 47 // was successfully read and false otherwise.
32 virtual bool GetMac(const std::string& path, std::string* out_value) = 0; 48 virtual bool GetMac(const std::string& path, std::string* out_value) = 0;
33 49
34 // Outputs the MACS validating the split preference at path. Returns true if 50 // Outputs the MACS validating the split preference at path. Returns true if
35 // MACS were successfully read and false otherwise. 51 // MACS were successfully read and false otherwise.
36 virtual bool GetSplitMacs(const std::string& path, 52 virtual bool GetSplitMacs(const std::string& path,
(...skipping 28 matching lines...) Expand all
65 // Retrieves the super MAC value previously stored by SetSuperMac. May be 81 // Retrieves the super MAC value previously stored by SetSuperMac. May be
66 // empty if no super MAC has been stored or if this store does not support 82 // empty if no super MAC has been stored or if this store does not support
67 // super MACs. 83 // super MACs.
68 virtual std::string GetSuperMac() const = 0; 84 virtual std::string GetSuperMac() const = 0;
69 85
70 // Stores a super MAC value for this hash store. 86 // Stores a super MAC value for this hash store.
71 virtual void SetSuperMac(const std::string& super_mac) = 0; 87 virtual void SetSuperMac(const std::string& super_mac) = 0;
72 }; 88 };
73 89
74 #endif // COMPONENTS_USER_PREFS_TRACKED_HASH_STORE_CONTENTS_H_ 90 #endif // COMPONENTS_USER_PREFS_TRACKED_HASH_STORE_CONTENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698