| Index: components/data_reduction_proxy/core/browser/data_usage_store.cc
|
| diff --git a/components/data_reduction_proxy/core/browser/data_usage_store.cc b/components/data_reduction_proxy/core/browser/data_usage_store.cc
|
| index 98bcbbd0ed433bf750933983259f567349dc910b..fb89dd096a4fd02641f3af48d077004e888aecd8 100644
|
| --- a/components/data_reduction_proxy/core/browser/data_usage_store.cc
|
| +++ b/components/data_reduction_proxy/core/browser/data_usage_store.cc
|
| @@ -22,23 +22,23 @@
|
| #include "base/time/time.h"
|
| #include "components/data_reduction_proxy/proto/data_store.pb.h"
|
|
|
| +namespace data_reduction_proxy {
|
| +
|
| namespace {
|
| +
|
| const char kCurrentBucketIndexKey[] = "current_bucket_index";
|
| const char kBucketKeyPrefix[] = "data_usage_bucket:";
|
|
|
| const int kMinutesInHour = 60;
|
| const int kMinutesInDay = 24 * kMinutesInHour;
|
|
|
| -// Time interval for each DataUsageBucket.
|
| -const int kDataUsageBucketLengthInMinutes = 15;
|
| -static_assert(kDataUsageBucketLengthInMinutes > 0,
|
| +static_assert(data_reduction_proxy::kDataUsageBucketLengthInMinutes > 0,
|
| "Length of time should be positive");
|
| -static_assert(kMinutesInHour % kDataUsageBucketLengthInMinutes == 0,
|
| +static_assert(kMinutesInHour %
|
| + data_reduction_proxy::kDataUsageBucketLengthInMinutes ==
|
| + 0,
|
| "kDataUsageBucketLengthMins must be a factor of kMinsInHour");
|
|
|
| -// Number of days for which to maintain data usage history.
|
| -const int kDataUsageHistoryNumDays = 60;
|
| -
|
| // Total number of buckets persisted to DB.
|
| const int kNumDataUsageBuckets =
|
| kDataUsageHistoryNumDays * kMinutesInDay / kDataUsageBucketLengthInMinutes;
|
| @@ -65,8 +65,6 @@ base::Time BucketLowerBoundary(base::Time time) {
|
|
|
| } // namespace
|
|
|
| -namespace data_reduction_proxy {
|
| -
|
| DataUsageStore::DataUsageStore(DataStore* db)
|
| : db_(db), current_bucket_index_(-1) {
|
| sequence_checker_.DetachFromSequence();
|
|
|