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

Side by Side Diff: chrome/browser/prefs/pref_hash_store_transaction.h

Issue 324493002: Move preference MACs to the protected preference stores. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self-review. Created 6 years, 6 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 | Annotate | Revision Log
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 CHROME_BROWSER_PREFS_PREF_HASH_STORE_TRANSACTION_H_ 5 #ifndef CHROME_BROWSER_PREFS_PREF_HASH_STORE_TRANSACTION_H_
6 #define CHROME_BROWSER_PREFS_PREF_HASH_STORE_TRANSACTION_H_ 6 #define CHROME_BROWSER_PREFS_PREF_HASH_STORE_TRANSACTION_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 virtual ValueState CheckSplitValue( 60 virtual ValueState CheckSplitValue(
61 const std::string& path, 61 const std::string& path,
62 const base::DictionaryValue* initial_split_value, 62 const base::DictionaryValue* initial_split_value,
63 std::vector<std::string>* invalid_keys) const = 0; 63 std::vector<std::string>* invalid_keys) const = 0;
64 64
65 // Stores hashes for the |value| of the split preference at |path|. 65 // Stores hashes for the |value| of the split preference at |path|.
66 // |split_value| being an empty dictionary or NULL is equivalent. 66 // |split_value| being an empty dictionary or NULL is equivalent.
67 virtual void StoreSplitHash( 67 virtual void StoreSplitHash(
68 const std::string& path, 68 const std::string& path,
69 const base::DictionaryValue* split_value) = 0; 69 const base::DictionaryValue* split_value) = 0;
70
71 // Indicates whether the store contains a hash for the preference at |path|.
72 virtual bool HasHash(const std::string& path) const = 0;
73
74 // Sets the hash for the preference at |path|. If |hash| is NULL any stored
75 // hash is cleared. Otherwise:
76 // * If |path| is a split preference |hash| should be a DictionaryValue whose
77 // keys are keys in the split preference and whose values are MACs of the
78 // corresponding values in the split preference.
79 // * If |path| is an atomic preference |hash| should be a StringValue
80 // containing a MAC of the preference value.
81 // |hash| should originate from a PrefHashStore sharing the same MAC
82 // parameters as this transaction's store.
83 // The (in)validity of the super MAC will be maintained by this call.
84 virtual void ImportHash(const std::string& path, const base::Value* hash) = 0;
85
86 // Removes the hash stored at |path|. The (in)validity of the super MAC will
87 // be maintained by this call.
88 virtual void ClearHash(const std::string& path) = 0;
89
90 // Indicates whether the super MAC was successfully verified at the beginning
91 // of this transaction.
92 virtual bool IsSuperMACValid() const = 0;
93
94 // Forces a valid super MAC to be stored when this transaction terminates.
95 // Returns true if this results in a change to the store contents.
96 virtual bool StampSuperMac() = 0;
70 }; 97 };
71 98
72 #endif // CHROME_BROWSER_PREFS_PREF_HASH_STORE_TRANSACTION_H_ 99 #endif // CHROME_BROWSER_PREFS_PREF_HASH_STORE_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698