OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_PREFS_TRACKED_PREF_STORE_HASH_STORE_CONTENTS_H_ | |
6 #define CHROME_BROWSER_PREFS_TRACKED_PREF_STORE_HASH_STORE_CONTENTS_H_ | |
7 | |
8 #include <string> | |
9 #include "base/compiler_specific.h" | |
10 #include "base/macros.h" | |
11 #include "chrome/browser/prefs/tracked/hash_store_contents.h" | |
12 | |
13 class PersistentPrefStore; | |
14 class WriteablePrefStore; | |
15 | |
16 class PrefStoreHashStoreContents : public HashStoreContents { | |
gab
2014/06/06 21:54:59
To avoid a lot of new code (trying to keep things
erikwright (departed)
2014/06/10 20:27:48
I think the other methods like "Initialized", "Res
gab
2014/06/11 18:23:55
Okay, keeping them as two separate classes with sl
| |
17 public: | |
18 // Does increment the reference count on |pref_store|. Assumes that | |
19 // |pref_store| indirectly owns this delegate. | |
20 explicit PrefStoreHashStoreContents(PersistentPrefStore* pref_store); | |
21 | |
22 // Does increment the reference count on |pref_store|. Assumes that | |
23 // |pref_store| indirectly owns this delegate. Ignores calls to | |
24 // CommitPendingWrite() because this is not supported by WriteablePrefStore. | |
25 explicit PrefStoreHashStoreContents(WriteablePrefStore* pref_store); | |
26 | |
27 // A super MAC used to validate the hash store contents when determining | |
28 // whether | |
29 // an unknown value is to be trusted is stored as a string under | |
30 // |kSuperMacPref| | |
31 static const char kSuperMacPref[]; | |
32 | |
33 // HashStoreContents implementation | |
34 virtual std::string hash_store_id() const OVERRIDE; | |
35 virtual void Reset() OVERRIDE; | |
36 virtual bool IsInitialized() const OVERRIDE; | |
37 virtual const base::DictionaryValue* GetContents() const OVERRIDE; | |
38 virtual scoped_ptr<MutableDictionary> GetMutableContents() OVERRIDE; | |
39 virtual std::string GetSuperMac() const OVERRIDE; | |
40 virtual void SetSuperMac(const std::string& super_mac) OVERRIDE; | |
41 virtual void CommitPendingWrite() OVERRIDE; | |
42 | |
43 private: | |
44 WriteablePrefStore* const pref_store_; | |
45 PersistentPrefStore* const persistent_pref_store_; | |
46 | |
47 DISALLOW_COPY_AND_ASSIGN(PrefStoreHashStoreContents); | |
48 }; | |
49 | |
50 #endif // CHROME_BROWSER_PREFS_TRACKED_PREF_STORE_HASH_STORE_CONTENTS_H_ | |
OLD | NEW |