#ifndef CHROME_BROWSER_PREFS_PREF_HASH_STORE_IMPL_H_
#define CHROME_BROWSER_PREFS_PREF_HASH_STORE_IMPL_H_
#include <string>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/prefs/pref_hash_calculator.h"
#include "chrome/browser/prefs/pref_hash_store.h"
class HashStoreContents;
class PrefHashStoreTransaction;
namespace base {
class DictionaryValue;
class Value;
}
class PrefHashStoreImpl : public PrefHashStore {
public:
enum StoreVersion {
VERSION_UNINITIALIZED = 0,
VERSION_PRE_MIGRATION = 1,
VERSION_LATEST = 2,
};
PrefHashStoreImpl(const std::string& seed,
const std::string& device_id,
scoped_ptr<HashStoreContents> contents);
virtual ~PrefHashStoreImpl();
void Reset();
virtual scoped_ptr<PrefHashStoreTransaction> BeginTransaction() OVERRIDE;
virtual void CommitPendingWrite() OVERRIDE;
StoreVersion GetCurrentVersion() const;
private:
class PrefHashStoreTransactionImpl;
const PrefHashCalculator pref_hash_calculator_;
scoped_ptr<HashStoreContents> contents_;
const bool initial_hashes_dictionary_trusted_;
bool has_pending_write_;
DISALLOW_COPY_AND_ASSIGN(PrefHashStoreImpl);
};
#endif