Chromium Code Reviews| Index: chrome/browser/prefs/tracked/pref_store_hash_store_contents.h |
| diff --git a/chrome/browser/prefs/tracked/pref_store_hash_store_contents.h b/chrome/browser/prefs/tracked/pref_store_hash_store_contents.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bedcc26a22d99ee877c86e0ffd37f9f5cabe0d91 |
| --- /dev/null |
| +++ b/chrome/browser/prefs/tracked/pref_store_hash_store_contents.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_PREFS_TRACKED_PREF_STORE_HASH_STORE_CONTENTS_H_ |
| +#define CHROME_BROWSER_PREFS_TRACKED_PREF_STORE_HASH_STORE_CONTENTS_H_ |
| + |
| +#include <string> |
| +#include "base/compiler_specific.h" |
| +#include "base/macros.h" |
| +#include "chrome/browser/prefs/tracked/hash_store_contents.h" |
| + |
| +class PersistentPrefStore; |
| +class WriteablePrefStore; |
| + |
| +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
|
| + public: |
| + // Does increment the reference count on |pref_store|. Assumes that |
| + // |pref_store| indirectly owns this delegate. |
| + explicit PrefStoreHashStoreContents(PersistentPrefStore* pref_store); |
| + |
| + // Does increment the reference count on |pref_store|. Assumes that |
| + // |pref_store| indirectly owns this delegate. Ignores calls to |
| + // CommitPendingWrite() because this is not supported by WriteablePrefStore. |
| + explicit PrefStoreHashStoreContents(WriteablePrefStore* pref_store); |
| + |
| + // A super MAC used to validate the hash store contents when determining |
| + // whether |
| + // an unknown value is to be trusted is stored as a string under |
| + // |kSuperMacPref| |
| + static const char kSuperMacPref[]; |
| + |
| + // HashStoreContents implementation |
| + virtual std::string hash_store_id() const OVERRIDE; |
| + virtual void Reset() OVERRIDE; |
| + virtual bool IsInitialized() const OVERRIDE; |
| + virtual const base::DictionaryValue* GetContents() const OVERRIDE; |
| + virtual scoped_ptr<MutableDictionary> GetMutableContents() OVERRIDE; |
| + virtual std::string GetSuperMac() const OVERRIDE; |
| + virtual void SetSuperMac(const std::string& super_mac) OVERRIDE; |
| + virtual void CommitPendingWrite() OVERRIDE; |
| + |
| + private: |
| + WriteablePrefStore* const pref_store_; |
| + PersistentPrefStore* const persistent_pref_store_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PrefStoreHashStoreContents); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_PREFS_TRACKED_PREF_STORE_HASH_STORE_CONTENTS_H_ |