| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_store_impl.h
|
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_store_impl.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_store_impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7bf9e8c8370eeb6080cecd1a47ac87097046aa61
|
| --- /dev/null
|
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_store_impl.h
|
| @@ -0,0 +1,53 @@
|
| +// Copyright 2015 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 COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_STORE_IMPL_H_
|
| +#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_STORE_IMPL_H_
|
| +
|
| +#include "base/macros.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "base/threading/thread_checker.h"
|
| +#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_store.h"
|
| +
|
| +namespace leveldb {
|
| +class DB;
|
| +class Iterator;
|
| +class Slice;
|
| +class Status;
|
| +class WriteBatch;
|
| +}
|
| +
|
| +namespace data_reduction_proxy {
|
| +class DataUsageBucket;
|
| +
|
| +// Implementation of DataReductionProxyStore using LevelDB.
|
| +class DataReductionProxyStoreImpl : public DataReductionProxyStore {
|
| + public:
|
| + DataReductionProxyStoreImpl(const std::string& profile_path);
|
| +
|
| + void InitializeOnDBThread() override;
|
| +
|
| + DataReductionProxyStore::Status Get(const std::string& key,
|
| + std::string& value) override;
|
| +
|
| + DataReductionProxyStore::Status Put(
|
| + const std::map<std::string, std::string>* map) override;
|
| +
|
| + private:
|
| + // Ref counted classes have private destructors to prevent accidental deletion
|
| + // of the object when there are still references to it.
|
| + friend class base::RefCountedThreadSafe<DataReductionProxyStore>;
|
| + ~DataReductionProxyStoreImpl() override;
|
| +
|
| + scoped_ptr<leveldb::DB> db_;
|
| + base::ThreadChecker thread_checker_;
|
| + const std::string profile_path_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(DataReductionProxyStoreImpl);
|
| +};
|
| +
|
| +} // namespace data_reduction_proxy
|
| +
|
| +#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_STORE_IMPL_H_
|
|
|