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 CHROME_BROWSER_PREFS_PREF_HASH_STORE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PREF_HASH_STORE_IMPL_H_ |
6 #define CHROME_BROWSER_PREFS_PREF_HASH_STORE_IMPL_H_ | 6 #define CHROME_BROWSER_PREFS_PREF_HASH_STORE_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 VERSION_LATEST = 2, | 35 VERSION_LATEST = 2, |
36 }; | 36 }; |
37 | 37 |
38 // Constructs a PrefHashStoreImpl that calculates hashes using | 38 // Constructs a PrefHashStoreImpl that calculates hashes using |
39 // |seed| and |device_id| and stores them in |contents|. | 39 // |seed| and |device_id| and stores them in |contents|. |
40 // | 40 // |
41 // The same |seed| and |device_id| must be used to load and validate | 41 // The same |seed| and |device_id| must be used to load and validate |
42 // previously stored hashes in |contents|. | 42 // previously stored hashes in |contents|. |
43 PrefHashStoreImpl(const std::string& seed, | 43 PrefHashStoreImpl(const std::string& seed, |
44 const std::string& device_id, | 44 const std::string& device_id, |
45 scoped_ptr<HashStoreContents> contents); | 45 scoped_ptr<HashStoreContents> contents, |
| 46 bool use_super_mac); |
46 | 47 |
47 virtual ~PrefHashStoreImpl(); | 48 virtual ~PrefHashStoreImpl(); |
48 | 49 |
49 // Clears the contents of this PrefHashStore. |IsInitialized()| will return | 50 // Clears the contents of this PrefHashStore. |IsInitialized()| will return |
50 // false after this call. | 51 // false after this call. |
51 void Reset(); | 52 void Reset(); |
52 | 53 |
53 // PrefHashStore implementation. | 54 // PrefHashStore implementation. |
54 virtual scoped_ptr<PrefHashStoreTransaction> BeginTransaction() OVERRIDE; | 55 virtual scoped_ptr<PrefHashStoreTransaction> BeginTransaction() OVERRIDE; |
55 virtual void CommitPendingWrite() OVERRIDE; | 56 virtual void CommitPendingWrite() OVERRIDE; |
56 | 57 |
57 // Returns the current version of this hash store. | |
58 StoreVersion GetCurrentVersion() const; | |
59 | |
60 private: | 58 private: |
61 class PrefHashStoreTransactionImpl; | 59 class PrefHashStoreTransactionImpl; |
62 | 60 |
63 const PrefHashCalculator pref_hash_calculator_; | 61 const PrefHashCalculator pref_hash_calculator_; |
64 scoped_ptr<HashStoreContents> contents_; | 62 scoped_ptr<HashStoreContents> contents_; |
65 const bool initial_hashes_dictionary_trusted_; | 63 const bool initial_hashes_dictionary_trusted_; |
| 64 bool use_super_mac_; |
66 | 65 |
67 // True if hashes have been modified since the last call to | 66 // True if hashes have been modified since the last call to |
68 // CommitPendingWriteIfRequired(). | 67 // CommitPendingWriteIfRequired(). |
69 bool has_pending_write_; | 68 bool has_pending_write_; |
70 | 69 |
71 DISALLOW_COPY_AND_ASSIGN(PrefHashStoreImpl); | 70 DISALLOW_COPY_AND_ASSIGN(PrefHashStoreImpl); |
72 }; | 71 }; |
73 | 72 |
74 #endif // CHROME_BROWSER_PREFS_PREF_HASH_STORE_IMPL_H_ | 73 #endif // CHROME_BROWSER_PREFS_PREF_HASH_STORE_IMPL_H_ |
OLD | NEW |