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

Issue 2066083002: SafeBrowising: Read and write V4Store from/to disk (Closed)

Created:
4 years, 6 months ago by vakh (use Gerrit instead)
Modified:
4 years, 5 months ago
CC:
chromium-reviews, asvitkine+watch_chromium.org, noé, woz
Base URL:
https://chromium.googlesource.com/chromium/src.git@01_UpdateDbAndStores
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Read and write V4Store from/to disk. Stores the updates as a V4StoreFileFormat proto with the following fields: 1. Magic number (integer) 2. Version (integer) 3. Hash prefix information (ListUpdateResponse proto). Overall design document: https://goto.google.com/design-doc-v4store Only FULL_UPDATEs are written to disk. Includes tests to read from and write to the disk. BUG=543161 Committed: https://crrev.com/2d092db5bb51f021d7213076ad3b33590be6efc4 Cr-Commit-Position: refs/heads/master@{#402621}

Patch Set 1 #

Patch Set 2 : Nit: Add some comments to the v4_store.proto file. #

Patch Set 3 : Nit: better test names. Tests for WriteToDisk #

Total comments: 33

Patch Set 4 : git pull #

Patch Set 5 : base::CreateAndOpenTemporaryFile doesn't work reliably on win_chromium_*rel_ng so using another mec… #

Patch Set 6 : Incorporate some CR feedback. +Lint #

Patch Set 7 : git pull from base branch: http://crrev.com/2062013002 #

Patch Set 8 : git pull #

Patch Set 9 : Track writes to store via UMA. Create a temp file for writing. Remove some DVLOGs. #

Total comments: 77

Patch Set 10 : git fetch && git pull && gclient sync #

Patch Set 11 : CR feedback: shess@ (except tests) #

Patch Set 12 : CR feedback: shess@ unittests #

Patch Set 13 : Add a test for showing the importance of having magic number #

Patch Set 14 : Update histograms.xml following the change in enum values in v4_store.h #

Patch Set 15 : Nit: Remove an unused V4StoreFileFormat file_format; #

Total comments: 3

Patch Set 16 : CR feedback: shess@ latest comments #

Total comments: 5

Patch Set 17 : Minor: CR feedback from rkaplow@ #

Patch Set 18 : git pull #

Total comments: 1

Patch Set 19 : Minor: Add units to histograms.xml #

Patch Set 20 : Fix leak, use smart pointers #

Patch Set 21 : Nit: Make store creation and use more consistent. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+465 lines, -13 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 1 chunk +1 line, -0 lines 0 comments Download
M components/safe_browsing_db.gypi View 3 chunks +15 lines, -2 lines 1 comment Download
M components/safe_browsing_db/BUILD.gn View 1 2 3 4 5 6 10 chunks +21 lines, -9 lines 0 comments Download
M components/safe_browsing_db/v4_database.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +5 lines, -0 lines 0 comments Download
M components/safe_browsing_db/v4_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +85 lines, -1 line 0 comments Download
M components/safe_browsing_db/v4_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +123 lines, -1 line 0 comments Download
A components/safe_browsing_db/v4_store.proto View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +27 lines, -0 lines 0 comments Download
A components/safe_browsing_db/v4_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +143 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 2 chunks +45 lines, -0 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 54 (9 generated)
vakh (use Gerrit instead)
Nit: Add some comments to the v4_store.proto file.
4 years, 6 months ago (2016-06-14 22:22:03 UTC) #1
vakh (use Gerrit instead)
nparker@, shess@: Please review the changes in * I'll update the CL description to be ...
4 years, 6 months ago (2016-06-14 22:23:01 UTC) #3
vakh (use Gerrit instead)
Nit: better test names. Tests for WriteToDisk
4 years, 6 months ago (2016-06-15 00:38:14 UTC) #4
Nathan Parker
https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc#newcode39 components/safe_browsing_db/v4_store.cc:39: // If a state already exists, don't re-initilize. Would ...
4 years, 6 months ago (2016-06-16 00:07:51 UTC) #5
vakh (use Gerrit instead)
git pull
4 years, 6 months ago (2016-06-16 06:06:06 UTC) #6
vakh (use Gerrit instead)
base::CreateAndOpenTemporaryFile doesn't work reliably on win_chromium_*rel_ng so using another mechanism to create temp store files
4 years, 6 months ago (2016-06-16 07:41:46 UTC) #7
vakh (use Gerrit instead)
Incorporate some CR feedback. +Lint
4 years, 6 months ago (2016-06-16 08:22:03 UTC) #8
vakh (use Gerrit instead)
Some feedback incorporated, some left for later today. https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc#newcode39 components/safe_browsing_db/v4_store.cc:39: // ...
4 years, 6 months ago (2016-06-16 08:25:19 UTC) #9
vakh (use Gerrit instead)
git pull from base branch: http://crrev.com/2062013002
4 years, 6 months ago (2016-06-16 22:36:02 UTC) #10
vakh (use Gerrit instead)
git pull
4 years, 6 months ago (2016-06-21 00:54:56 UTC) #11
vakh (use Gerrit instead)
Track writes to store via UMA. Create a temp file for writing. Remove some DVLOGs.
4 years, 6 months ago (2016-06-22 03:09:33 UTC) #12
vakh (use Gerrit instead)
https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc#newcode164 components/safe_browsing_db/v4_store.cc:164: size_t written = base::WriteFile(store_path_, file_format_string.c_str(), On 2016/06/16 00:07:50, Nathan ...
4 years, 6 months ago (2016-06-22 07:26:06 UTC) #13
vakh (use Gerrit instead)
https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_store.cc#newcode55 components/safe_browsing_db/v4_store.cc:55: // If a state already exists, don't re-initilize. Nit: ...
4 years, 6 months ago (2016-06-22 07:28:04 UTC) #14
Scott Hess - ex-Googler
https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_database.cc#newcode58 components/safe_browsing_db/v4_database.cc:58: DCHECK(base::CreateDirectory(base_path)); I don't think DCHECK and side effects mix ...
4 years, 6 months ago (2016-06-22 22:58:40 UTC) #15
Nathan Parker
https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_store.proto File components/safe_browsing_db/v4_store.proto (right): https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_store.proto#newcode20 components/safe_browsing_db/v4_store.proto:20: // Version 9 with PVer4 is very different from ...
4 years, 6 months ago (2016-06-23 00:37:55 UTC) #16
vakh (use Gerrit instead)
git fetch && git pull && gclient sync
4 years, 6 months ago (2016-06-23 16:26:59 UTC) #17
vakh (use Gerrit instead)
CR feedback: shess@ (except tests)
4 years, 6 months ago (2016-06-23 23:08:59 UTC) #18
vakh (use Gerrit instead)
Addressed comments (except unittests file). PTAL. https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_database.cc#newcode58 components/safe_browsing_db/v4_database.cc:58: DCHECK(base::CreateDirectory(base_path)); On 2016/06/22 ...
4 years, 6 months ago (2016-06-23 23:09:32 UTC) #19
vakh (use Gerrit instead)
CR feedback: shess@ unittests
4 years, 6 months ago (2016-06-23 23:29:20 UTC) #20
vakh (use Gerrit instead)
Add a test for showing the importance of having magic number
4 years, 6 months ago (2016-06-23 23:35:21 UTC) #21
vakh (use Gerrit instead)
And now I've addressed the comments in the unit tests. https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_store_unittest.cc File components/safe_browsing_db/v4_store_unittest.cc (right): https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_store_unittest.cc#newcode34 ...
4 years, 6 months ago (2016-06-23 23:36:22 UTC) #22
vakh (use Gerrit instead)
Update histograms.xml following the change in enum values in v4_store.h
4 years, 6 months ago (2016-06-23 23:36:41 UTC) #23
vakh (use Gerrit instead)
Nit: Remove an unused V4StoreFileFormat file_format;
4 years, 6 months ago (2016-06-24 00:57:21 UTC) #24
vakh (use Gerrit instead)
https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc#newcode160 components/safe_browsing_db/v4_store.cc:160: *response_to_write = response; On 2016/06/16 00:07:50, Nathan Parker wrote: ...
4 years, 6 months ago (2016-06-24 01:04:50 UTC) #25
Scott Hess - ex-Googler
Comments on comments. Will follow with comments-on-code. https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_database.cc#newcode58 components/safe_browsing_db/v4_database.cc:58: DCHECK(base::CreateDirectory(base_path)); On ...
4 years, 6 months ago (2016-06-24 04:14:12 UTC) #26
Scott Hess - ex-Googler
Guess it was mostly comments on comments, then. https://codereview.chromium.org/2066083002/diff/270001/components/safe_browsing_db/v4_store_unittest.cc File components/safe_browsing_db/v4_store_unittest.cc (right): https://codereview.chromium.org/2066083002/diff/270001/components/safe_browsing_db/v4_store_unittest.cc#newcode36 components/safe_browsing_db/v4_store_unittest.cc:36: ListUpdateResponse* ...
4 years, 6 months ago (2016-06-24 04:20:33 UTC) #27
vakh (use Gerrit instead)
CR feedback: shess@ latest comments
4 years, 6 months ago (2016-06-24 18:01:11 UTC) #28
vakh (use Gerrit instead)
https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/2066083002/diff/160001/components/safe_browsing_db/v4_database.cc#newcode58 components/safe_browsing_db/v4_database.cc:58: DCHECK(base::CreateDirectory(base_path)); On 2016/06/24 04:14:11, Scott Hess wrote: > On ...
4 years, 6 months ago (2016-06-24 18:03:50 UTC) #29
vakh (use Gerrit instead)
I feel like we are close to done here for code changes so adding rkaplow@ ...
4 years, 6 months ago (2016-06-24 18:05:40 UTC) #31
Scott Hess - ex-Googler
lgtm, I think. AFAICT there's nothing outstanding. https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc#newcode160 components/safe_browsing_db/v4_store.cc:160: *response_to_write = ...
4 years, 6 months ago (2016-06-24 19:51:17 UTC) #33
rkaplow
https://codereview.chromium.org/2066083002/diff/290001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2066083002/diff/290001/components/safe_browsing_db/v4_store.cc#newcode8 components/safe_browsing_db/v4_store.cc:8: #include "base/metrics/histogram.h" histogram_macros.h https://codereview.chromium.org/2066083002/diff/290001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2066083002/diff/290001/tools/metrics/histograms/histograms.xml#newcode46488 tools/metrics/histograms/histograms.xml:46488: ...
4 years, 5 months ago (2016-06-27 17:48:51 UTC) #34
vakh (use Gerrit instead)
Minor: CR feedback from rkaplow@
4 years, 5 months ago (2016-06-27 19:51:12 UTC) #35
vakh (use Gerrit instead)
Thanks for the review, rkaplow@ -- PTAL. https://codereview.chromium.org/2066083002/diff/290001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2066083002/diff/290001/tools/metrics/histograms/histograms.xml#newcode46488 tools/metrics/histograms/histograms.xml:46488: +<histogram name="SafeBrowsing.V4StoreVersionRead"> ...
4 years, 5 months ago (2016-06-27 19:51:29 UTC) #36
vakh (use Gerrit instead)
https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc#newcode160 components/safe_browsing_db/v4_store.cc:160: *response_to_write = response; On 2016/06/24 19:51:17, Scott Hess wrote: ...
4 years, 5 months ago (2016-06-27 19:54:21 UTC) #37
vakh (use Gerrit instead)
https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2066083002/diff/40001/components/safe_browsing_db/v4_store.cc#newcode160 components/safe_browsing_db/v4_store.cc:160: *response_to_write = response; On 2016/06/27 19:54:21, vakh wrote: > ...
4 years, 5 months ago (2016-06-28 01:34:43 UTC) #38
vakh (use Gerrit instead)
git pull
4 years, 5 months ago (2016-06-28 07:11:43 UTC) #40
rkaplow
lgtm https://codereview.chromium.org/2066083002/diff/330001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2066083002/diff/330001/tools/metrics/histograms/histograms.xml#newcode46639 tools/metrics/histograms/histograms.xml:46639: +<histogram name="SafeBrowsing.V4StoreVersionRead"> we still always want either a ...
4 years, 5 months ago (2016-06-28 14:42:15 UTC) #41
vakh (use Gerrit instead)
Minor: Add units to histograms.xml
4 years, 5 months ago (2016-06-28 19:08:02 UTC) #42
vakh (use Gerrit instead)
On 2016/06/28 14:42:15, rkaplow wrote: > lgtm > > https://codereview.chromium.org/2066083002/diff/330001/tools/metrics/histograms/histograms.xml > File tools/metrics/histograms/histograms.xml (right): > ...
4 years, 5 months ago (2016-06-28 19:08:41 UTC) #43
vakh (use Gerrit instead)
Fix leak, use smart pointers
4 years, 5 months ago (2016-06-28 22:19:58 UTC) #44
vakh (use Gerrit instead)
Nit: Make store creation and use more consistent.
4 years, 5 months ago (2016-06-28 22:22:31 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2066083002/390001
4 years, 5 months ago (2016-06-28 22:25:40 UTC) #48
commit-bot: I haz the power
Committed patchset #21 (id:390001)
4 years, 5 months ago (2016-06-29 00:45:07 UTC) #50
commit-bot: I haz the power
Patchset 21 (id:??) landed as https://crrev.com/2d092db5bb51f021d7213076ad3b33590be6efc4 Cr-Commit-Position: refs/heads/master@{#402621}
4 years, 5 months ago (2016-06-29 00:47:06 UTC) #52
horo
4 years, 5 months ago (2016-06-30 04:48:38 UTC) #54
Message was sent while issue was closed.
https://codereview.chromium.org/2066083002/diff/390001/components/safe_browsi...
File components/safe_browsing_db.gypi (right):

https://codereview.chromium.org/2066083002/diff/390001/components/safe_browsi...
components/safe_browsing_db.gypi:114: 'target_name': 'v4_store_proto',
need dependencies to safebrowsing_proto 
https://codereview.chromium.org/2106323002/

Powered by Google App Engine
This is Rietveld 408576698