Chromium Code Reviews| Index: components/data_reduction_proxy/core/browser/db_service.h |
| diff --git a/components/data_reduction_proxy/core/browser/db_service.h b/components/data_reduction_proxy/core/browser/db_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..80816f2afb58c79dad05d50269cfdeda18d9f2b2 |
| --- /dev/null |
| +++ b/components/data_reduction_proxy/core/browser/db_service.h |
| @@ -0,0 +1,48 @@ |
| +// 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_DB_SERVICE_H_ |
| +#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DB_SERVICE_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "base/threading/thread_checker.h" |
|
jeremyim
2015/07/01 21:31:01
Unused.
Not at Google. Contact bengr
2015/07/01 23:17:38
Done.
|
| + |
| +namespace base { |
| +class FilePath; |
| +} // namespace base |
| + |
| +namespace data_reduction_proxy { |
| +class DataReductionProxyStore; |
| +class DataUsageStore; |
| +class DataUsageBucket; |
| + |
| +typedef base::Callback<void(scoped_ptr<DataUsageBucket>)> |
| + OnLoadDataUsageBucketCallback; |
| + |
| +// Contains and initializes all Data Reduction Proxy objects that have a |
| +// lifetime based on the DB thread. |
| +class DBService { |
|
jeremyim
2015/07/01 21:31:02
DataReductionProxyDBData?
Not at Google. Contact bengr
2015/07/01 23:17:38
Personally prefer just DBData without the prefix.
jeremyim
2015/07/06 20:08:42
For better our worse, we prefix our filenames + cl
Not at Google. Contact bengr
2015/07/06 21:02:23
sleevi@ had brought our naming convention up in a
|
| + public: |
| + explicit DBService(scoped_ptr<DataReductionProxyStore> store); |
| + virtual ~DBService(); |
| + |
| + void InitializeOnDBThread(); |
| + |
| + void LoadCurrentDataUsageBucket(DataUsageBucket* bucket); |
| + |
| + void StoreCurrentDataUsageBucket(scoped_ptr<DataUsageBucket> current); |
| + |
| + base::WeakPtr<DBService> GetWeakPtr(); |
| + |
| + private: |
| + scoped_ptr<DataReductionProxyStore> store_; |
| + scoped_ptr<DataUsageStore> data_usage_; |
| + base::WeakPtrFactory<DBService> weak_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DBService); |
| +}; |
| + |
| +} // namespace data_reduction_proxy |
| +#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DB_SERVICE_H_ |