Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Issue 1173343009: LevelDB storage for data reduction proxy to store data usage stats. (Closed)

Created:
5 years, 6 months ago by Not at Google. Contact bengr
Modified:
5 years, 5 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

LevelDB storage for data reduction proxy to store data usage stats. * DataStore is an interface for a key-value store, with DataStoreImpl providing a LevelDB based implementation. * Data usage for an interval of time is stored in DataUsageBucket. * DataUsageStore uses DataStore to store data usage in a circular array. Array is stored in key-value store by converting array indexes to a unique key. * Ownership: DBDataOwner owns all objects that live on the DB sequenced task runner. DBDataOwner is created on UI task runner, but thereafter used and destroyed on DB task runner. DBDataOwner is owned by DataReductionProxyService which lives on UI task runner. * Threading: All DB operations occur on DB task runner. DataReductionProxyService will posts tasks to DBDataOwner on the DB task runner. BUG=482442 Committed: https://crrev.com/9a02cfe87e75d1c4996b87fb3ec9d4e1fc9b8d6b Cr-Commit-Position: refs/heads/master@{#337968}

Patch Set 1 #

Patch Set 2 : Readd DEPS to fix history #

Patch Set 3 : Comments #

Total comments: 1

Patch Set 4 : Fix tests #

Total comments: 54

Patch Set 5 : Made code more robust against LevelDB failures. #

Patch Set 6 : Minor formatting #

Patch Set 7 : Use ref counting for DataUsageStorageHelper. #

Patch Set 8 : Remove unused weak factory #

Patch Set 9 : Misc changes #

Patch Set 10 : Change ERROR to MISC_ERROR to fix compile. #

Patch Set 11 : Remove DCHECKs. #

Total comments: 40

Patch Set 12 : Addressed cmumford's comments. #

Patch Set 13 : Minor formatting #

Patch Set 14 : Fix DataUsageBucketWrapper ref counting #

Patch Set 15 : Use FILE_PATH_LITERAL #

Patch Set 16 : Add level DB dep to BUILD.gn #

Patch Set 17 : Add leveldb dep to correct BUILD.gn #

Patch Set 18 : Use raw pointers for arguments instead of ref counting #

Total comments: 74

Patch Set 19 : Use scoped ptr for data usage store. #

Patch Set 20 : Remove friend from impl #

Total comments: 30

Patch Set 21 : Temp patch before splitting into multiple cls. #

Patch Set 22 : Smaller subset of original cl. #

Patch Set 23 : Add missing include #

Total comments: 16

Patch Set 24 : Use SequenceChecker. Drop content/public/ dependency. #

Total comments: 16

Patch Set 25 : Remove unused includes #

Patch Set 26 : Rename classes to remove DataReductionProxy prefix. #

Total comments: 18

Patch Set 27 : Fix Build.gn #

Patch Set 28 : Rename DBDataStore to DataStore #

Patch Set 29 : Minor formatting #

Patch Set 30 : Minor format #

Patch Set 31 : db_data_store.proto -> data_store.proto #

Patch Set 32 : Make data_usage_store_ private in unittest #

Patch Set 33 : Fix unittests #

Total comments: 32

Patch Set 34 : Addressed comments #

Patch Set 35 : Remove wrong const #

Unified diffs Side-by-side diffs Delta from patch set Stats (+829 lines, -0 lines) Patch
M components/components_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +1 line, -0 lines 0 comments Download
M components/data_reduction_proxy.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 3 chunks +11 lines, -1 line 0 comments Download
M components/data_reduction_proxy/core/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 3 chunks +10 lines, -0 lines 0 comments Download
A + components/data_reduction_proxy/core/browser/DEPS View 1 2 3 4 5 6 21 22 23 0 chunks +-1 lines, --1 lines 0 comments Download
A components/data_reduction_proxy/core/browser/data_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +42 lines, -0 lines 0 comments Download
A components/data_reduction_proxy/core/browser/data_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +27 lines, -0 lines 0 comments Download
A components/data_reduction_proxy/core/browser/data_store_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +57 lines, -0 lines 0 comments Download
A components/data_reduction_proxy/core/browser/data_store_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +132 lines, -0 lines 0 comments Download
A components/data_reduction_proxy/core/browser/data_usage_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +70 lines, -0 lines 0 comments Download
A components/data_reduction_proxy/core/browser/data_usage_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +178 lines, -0 lines 0 comments Download
A components/data_reduction_proxy/core/browser/data_usage_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +161 lines, -0 lines 0 comments Download
A components/data_reduction_proxy/core/browser/db_data_owner.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +53 lines, -0 lines 0 comments Download
A components/data_reduction_proxy/core/browser/db_data_owner.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +49 lines, -0 lines 0 comments Download
M components/data_reduction_proxy/proto/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 chunk +1 line, -0 lines 0 comments Download
A components/data_reduction_proxy/proto/data_store.proto View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +24 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 2 chunks +14 lines, -0 lines 0 comments Download

Messages

Total messages: 41 (6 generated)
Not at Google. Contact bengr
thestig: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h chrome/browser/profiles/profile_impl_io_data.cc bengr,jeremyim: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h components/data_reduction_proxy.gypi components/data_reduction_proxy/core/browser/BUILD.gn components/data_reduction_proxy/core/browser/DEPS components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.h components/data_reduction_proxy/core/browser/data_reduction_proxy_service.cc components/data_reduction_proxy/core/browser/data_reduction_proxy_service.h components/data_reduction_proxy/core/browser/data_reduction_proxy_store.cc ...
5 years, 6 months ago (2015-06-18 23:52:37 UTC) #3
Lei Zhang
chrome/ lgtm since it's just passing a bit more info down.
5 years, 6 months ago (2015-06-18 23:57:54 UTC) #4
cmumford
A bunch of comments, but a few memory bugs, so marking as not lgtm. Also, ...
5 years, 6 months ago (2015-06-19 20:17:21 UTC) #5
Not at Google. Contact bengr
Thanks for the detailed review cmumford@. Made the code more robust against errors from level ...
5 years, 6 months ago (2015-06-23 21:25:52 UTC) #6
cmumford
Run "git cl lint" too. It will catch a few other minor issues in this ...
5 years, 6 months ago (2015-06-24 18:49:00 UTC) #7
Not at Google. Contact bengr
https://codereview.chromium.org/1173343009/diff/200001/components/data_reduction_proxy/core/browser/data_reduction_proxy_store.cc File components/data_reduction_proxy/core/browser/data_reduction_proxy_store.cc (right): https://codereview.chromium.org/1173343009/diff/200001/components/data_reduction_proxy/core/browser/data_reduction_proxy_store.cc#newcode18 components/data_reduction_proxy/core/browser/data_reduction_proxy_store.cc:18: bool DummyDataReductionProxyStore::IsValid() { On 2015/06/24 18:48:59, cmumford wrote: > ...
5 years, 6 months ago (2015-06-24 23:54:43 UTC) #8
cmumford
lgtm FYI: you're still missing owners on: android_webview/browser/aw_browser_context.cc tools/metrics/histograms/histograms.xml
5 years, 5 months ago (2015-06-25 16:25:07 UTC) #9
Not at Google. Contact bengr
Thanks cmumford@! Adding sgurun@ and isherman@ for new dependencies. sgurun: android_webview/browser/aw_browser_context.cc isherman: tools/metrics/histograms/histograms.xml
5 years, 5 months ago (2015-06-25 18:16:40 UTC) #11
michaeln
https://codereview.chromium.org/1173343009/diff/200001/components/data_reduction_proxy/core/browser/data_usage_storage_helper.h File components/data_reduction_proxy/core/browser/data_usage_storage_helper.h (right): https://codereview.chromium.org/1173343009/diff/200001/components/data_reduction_proxy/core/browser/data_usage_storage_helper.h#newcode21 components/data_reduction_proxy/core/browser/data_usage_storage_helper.h:21: class DataUsageBucketWrapper On 2015/06/24 23:54:42, kundaji wrote: > On ...
5 years, 5 months ago (2015-06-25 19:56:26 UTC) #13
sgurun-gerrit only
On 2015/06/25 19:56:26, michaeln wrote: > https://codereview.chromium.org/1173343009/diff/200001/components/data_reduction_proxy/core/browser/data_usage_storage_helper.h > File components/data_reduction_proxy/core/browser/data_usage_storage_helper.h > (right): > > https://codereview.chromium.org/1173343009/diff/200001/components/data_reduction_proxy/core/browser/data_usage_storage_helper.h#newcode21 ...
5 years, 5 months ago (2015-06-25 20:02:31 UTC) #14
Ilya Sherman
histograms lgtm
5 years, 5 months ago (2015-06-25 21:30:23 UTC) #15
Not at Google. Contact bengr
https://codereview.chromium.org/1173343009/diff/200001/components/data_reduction_proxy/core/browser/data_usage_storage_helper.h File components/data_reduction_proxy/core/browser/data_usage_storage_helper.h (right): https://codereview.chromium.org/1173343009/diff/200001/components/data_reduction_proxy/core/browser/data_usage_storage_helper.h#newcode21 components/data_reduction_proxy/core/browser/data_usage_storage_helper.h:21: class DataUsageBucketWrapper On 2015/06/25 19:56:26, michaeln wrote: > On ...
5 years, 5 months ago (2015-06-25 22:08:01 UTC) #16
bengr
https://codereview.chromium.org/1173343009/diff/340001/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc File chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc (right): https://codereview.chromium.org/1173343009/diff/340001/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc#newcode194 chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc:194: scoped_refptr<data_reduction_proxy::DataReductionProxyStoreImpl> store( So the store is created on UI ...
5 years, 5 months ago (2015-06-25 23:22:56 UTC) #17
bengr
5 years, 5 months ago (2015-06-25 23:23:01 UTC) #18
michaeln
Drive by comments, cmumford asked me to look at one thing, but then i looked ...
5 years, 5 months ago (2015-06-26 20:15:01 UTC) #19
michaeln
This patch is kind of large, it may be helpful to break it down into ...
5 years, 5 months ago (2015-06-26 20:38:16 UTC) #20
Not at Google. Contact bengr
Thanks for the reviews! @michaeln: DataReductionProxyStore is a common store for the component. Will eventually ...
5 years, 5 months ago (2015-06-29 20:53:28 UTC) #21
Not at Google. Contact bengr
https://codereview.chromium.org/1173343009/diff/340001/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc File components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc (right): https://codereview.chromium.org/1173343009/diff/340001/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc#newcode316 components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc:316: data_usage_store_(new DataUsageStorageHelper(store)), On 2015/06/29 20:53:26, kundaji wrote: > On ...
5 years, 5 months ago (2015-06-29 21:17:46 UTC) #22
Not at Google. Contact bengr
michaeln@: I am changing this cl to get rid of ref counting. Instead DataReductionProxyService will ...
5 years, 5 months ago (2015-06-29 22:17:59 UTC) #23
michaeln
> I am changing this cl to get rid of ref counting. sgtm! https://codereview.chromium.org/1173343009/diff/340001/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.h File ...
5 years, 5 months ago (2015-06-29 23:19:30 UTC) #24
jeremyim
https://codereview.chromium.org/1173343009/diff/380001/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h File chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h (right): https://codereview.chromium.org/1173343009/diff/380001/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h#newcode8 chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h:8: #include "base/files/file_path.h" remove include, forward declare base::FilePath https://codereview.chromium.org/1173343009/diff/380001/chrome/browser/profiles/profile_impl_io_data.cc File ...
5 years, 5 months ago (2015-06-30 01:59:19 UTC) #25
jeremyim
Also, +1 on splitting this CL into 2 parts. =)
5 years, 5 months ago (2015-06-30 02:00:07 UTC) #26
Not at Google. Contact bengr
Thanks for the reviews! I changed this cl to get rid of ref counting for ...
5 years, 5 months ago (2015-07-01 17:13:49 UTC) #27
jeremyim
https://codereview.chromium.org/1173343009/diff/380001/components/data_reduction_proxy/proto/store.proto File components/data_reduction_proxy/proto/store.proto (right): https://codereview.chromium.org/1173343009/diff/380001/components/data_reduction_proxy/proto/store.proto#newcode13 components/data_reduction_proxy/proto/store.proto:13: // Contains data usage for an interval of time. ...
5 years, 5 months ago (2015-07-01 21:31:02 UTC) #28
Not at Google. Contact bengr
https://codereview.chromium.org/1173343009/diff/380001/components/data_reduction_proxy/proto/store.proto File components/data_reduction_proxy/proto/store.proto (right): https://codereview.chromium.org/1173343009/diff/380001/components/data_reduction_proxy/proto/store.proto#newcode13 components/data_reduction_proxy/proto/store.proto:13: // Contains data usage for an interval of time. ...
5 years, 5 months ago (2015-07-01 23:17:38 UTC) #29
jeremyim
https://codereview.chromium.org/1173343009/diff/440001/components/data_reduction_proxy/core/browser/db_service.h File components/data_reduction_proxy/core/browser/db_service.h (right): https://codereview.chromium.org/1173343009/diff/440001/components/data_reduction_proxy/core/browser/db_service.h#newcode26 components/data_reduction_proxy/core/browser/db_service.h:26: class DBService { On 2015/07/01 23:17:38, kundaji wrote: > ...
5 years, 5 months ago (2015-07-06 20:08:43 UTC) #30
Not at Google. Contact bengr
Thanks for the review! https://codereview.chromium.org/1173343009/diff/440001/components/data_reduction_proxy/core/browser/db_service.h File components/data_reduction_proxy/core/browser/db_service.h (right): https://codereview.chromium.org/1173343009/diff/440001/components/data_reduction_proxy/core/browser/db_service.h#newcode26 components/data_reduction_proxy/core/browser/db_service.h:26: class DBService { On 2015/07/06 ...
5 years, 5 months ago (2015-07-06 21:02:24 UTC) #31
Not at Google. Contact bengr
Ping. Can you please take a look?
5 years, 5 months ago (2015-07-07 22:38:24 UTC) #32
jeremyim
Some minor comments about renaming/sorting of forward declarations. https://codereview.chromium.org/1173343009/diff/460001/components/data_reduction_proxy/core/browser/data_usage_store_unittest.cc File components/data_reduction_proxy/core/browser/data_usage_store_unittest.cc (right): https://codereview.chromium.org/1173343009/diff/460001/components/data_reduction_proxy/core/browser/data_usage_store_unittest.cc#newcode58 components/data_reduction_proxy/core/browser/data_usage_store_unittest.cc:58: scoped_ptr<DataUsageStore> ...
5 years, 5 months ago (2015-07-08 18:21:46 UTC) #33
Not at Google. Contact bengr
https://codereview.chromium.org/1173343009/diff/460001/components/data_reduction_proxy/core/browser/data_usage_store_unittest.cc File components/data_reduction_proxy/core/browser/data_usage_store_unittest.cc (right): https://codereview.chromium.org/1173343009/diff/460001/components/data_reduction_proxy/core/browser/data_usage_store_unittest.cc#newcode58 components/data_reduction_proxy/core/browser/data_usage_store_unittest.cc:58: scoped_ptr<DataUsageStore> data_usage_store_; On 2015/07/08 18:21:45, jeremyim wrote: > On ...
5 years, 5 months ago (2015-07-08 19:07:21 UTC) #34
jeremyim
lgtm % comment nits https://codereview.chromium.org/1173343009/diff/630001/components/data_reduction_proxy/core/browser/data_store.h File components/data_reduction_proxy/core/browser/data_store.h (right): https://codereview.chromium.org/1173343009/diff/630001/components/data_reduction_proxy/core/browser/data_store.h#newcode18 components/data_reduction_proxy/core/browser/data_store.h:18: // implementation. nit: Don't think ...
5 years, 5 months ago (2015-07-08 22:17:57 UTC) #35
Not at Google. Contact bengr
https://codereview.chromium.org/1173343009/diff/630001/components/data_reduction_proxy/core/browser/data_store.h File components/data_reduction_proxy/core/browser/data_store.h (right): https://codereview.chromium.org/1173343009/diff/630001/components/data_reduction_proxy/core/browser/data_store.h#newcode18 components/data_reduction_proxy/core/browser/data_store.h:18: // implementation. On 2015/07/08 22:17:56, jeremyim wrote: > nit: ...
5 years, 5 months ago (2015-07-09 00:11:44 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1173343009/670001
5 years, 5 months ago (2015-07-09 00:22:02 UTC) #39
commit-bot: I haz the power
Committed patchset #35 (id:670001)
5 years, 5 months ago (2015-07-09 02:16:29 UTC) #40
commit-bot: I haz the power
5 years, 5 months ago (2015-07-09 02:17:28 UTC) #41
Message was sent while issue was closed.
Patchset 35 (id:??) landed as
https://crrev.com/9a02cfe87e75d1c4996b87fb3ec9d4e1fc9b8d6b
Cr-Commit-Position: refs/heads/master@{#337968}

Powered by Google App Engine
This is Rietveld 408576698