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

Issue 2183433002: PVer4: RICE decode bytes to list of uint32 or 4-byte hash prefixes (Closed)

Created:
4 years, 5 months ago by vakh (use Gerrit instead)
Modified:
4 years, 4 months ago
Reviewers:
palmer, Peter Kasting, noé
CC:
chromium-reviews, woz, Nathan Parker, Scott Hess - ex-Googler, francois_mozilla.com
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

PVer4: Implements a RICE Decoder that converts a RICE encoded string, to a list of uint32_t values, or a sequence of 4-byte hash prefixes. For more details about RICE encoding, see: https://en.wikipedia.org/wiki/Golomb_coding BUG=543161, 624567 Committed: https://crrev.com/9e71d408737100714f022dffe20dfb346d395bf9 Cr-Commit-Position: refs/heads/master@{#408478}

Patch Set 1 #

Patch Set 2 : Add DecodeIntegers and DecodeBytes methods and add unit tests #

Patch Set 3 : Tiny: Fix deps #

Patch Set 4 : Add comments and add a few more tests #

Patch Set 5 : Tiny: Change the type of data_byte_index_ and current_word_bit_index_ to unsigned int #

Total comments: 30

Patch Set 6 : CR feedback from palmer@. Added condition+test for num_entries<0. Reserving space in output to ensu… #

Patch Set 7 : Use RepeatedField instead of std::vector #

Patch Set 8 : s/size_t/unsigned int: to fix some compile errors on Windows #

Total comments: 13

Patch Set 9 : palmer@ feedback. Use int32 instead of uint32_t/int since that's what the proto offers #

Patch Set 10 : Add release mode only tests for cases that hit NOTREACHED #

Total comments: 4

Patch Set 11 : s/RICE/Rice and use safe-math to check integer overflow #

Unified diffs Side-by-side diffs Delta from patch set Stats (+637 lines, -0 lines) Patch
M components/safe_browsing_db/BUILD.gn View 1 2 3 4 5 6 4 chunks +14 lines, -0 lines 0 comments Download
M components/safe_browsing_db/DEPS View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A components/safe_browsing_db/v4_rice.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +156 lines, -0 lines 0 comments Download
A components/safe_browsing_db/v4_rice.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +275 lines, -0 lines 0 comments Download
A components/safe_browsing_db/v4_rice_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +191 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 75 (48 generated)
vakh (use Gerrit instead)
Add DecodeIntegers and DecodeBytes methods and add unit tests
4 years, 5 months ago (2016-07-26 06:33:05 UTC) #2
vakh (use Gerrit instead)
This CL contains the code to decode the RICE hashes. I'll send a follow-up CL ...
4 years, 5 months ago (2016-07-26 06:35:16 UTC) #6
vakh (use Gerrit instead)
TODO (vakh): Add comments in the header file to describe each method better. I'll add ...
4 years, 5 months ago (2016-07-26 06:36:58 UTC) #9
vakh (use Gerrit instead)
Tiny: Fix deps
4 years, 4 months ago (2016-07-26 06:39:10 UTC) #10
vakh (use Gerrit instead)
Add comments and add a few more tests
4 years, 4 months ago (2016-07-26 22:37:25 UTC) #15
vakh (use Gerrit instead)
Tiny: Correct the format specifier
4 years, 4 months ago (2016-07-26 23:06:16 UTC) #20
vakh (use Gerrit instead)
Tiny: Change the type of data_byte_index_ and current_word_bit_index_ to unsigned int
4 years, 4 months ago (2016-07-26 23:34:30 UTC) #25
palmer
https://codereview.chromium.org/2183433002/diff/100001/components/safe_browsing_db/v4_rice.cc File components/safe_browsing_db/v4_rice.cc (right): https://codereview.chromium.org/2183433002/diff/100001/components/safe_browsing_db/v4_rice.cc#newcode32 components/safe_browsing_db/v4_rice.cc:32: return DECODE_OUTPUT_IS_NULL_FAILURE; Does it make sense to DCHECK here? ...
4 years, 4 months ago (2016-07-26 23:59:49 UTC) #29
palmer
Also, this CL needs a much more informative description.
4 years, 4 months ago (2016-07-27 00:02:05 UTC) #30
vakh (use Gerrit instead)
CR feedback from palmer@. Added condition+test for num_entries<0. Reserving space in output to ensure that ...
4 years, 4 months ago (2016-07-27 00:49:30 UTC) #33
vakh (use Gerrit instead)
Thanks for the review. PTAL. I'm also changing it slightly to use RepeatedPtr<int> instead of ...
4 years, 4 months ago (2016-07-27 00:54:34 UTC) #36
vakh (use Gerrit instead)
Use RepeatedField instead of std::vector
4 years, 4 months ago (2016-07-27 01:50:57 UTC) #38
vakh (use Gerrit instead)
On 2016/07/27 00:02:05, palmer wrote: > Also, this CL needs a much more informative description. ...
4 years, 4 months ago (2016-07-27 01:54:02 UTC) #41
vakh (use Gerrit instead)
s/size_t/unsigned int: to fix some compile errors on Windows
4 years, 4 months ago (2016-07-27 02:00:16 UTC) #42
palmer
https://codereview.chromium.org/2183433002/diff/160001/components/safe_browsing_db/v4_rice.cc File components/safe_browsing_db/v4_rice.cc (right): https://codereview.chromium.org/2183433002/diff/160001/components/safe_browsing_db/v4_rice.cc#newcode36 components/safe_browsing_db/v4_rice.cc:36: return NUM_ENTRIES_NEGATIVE_FAILURE; Could this be a DCHECK (in addition ...
4 years, 4 months ago (2016-07-27 23:39:40 UTC) #47
vakh (use Gerrit instead)
palmer@ feedback. Use int32 instead of uint32_t/int since that's what the proto offers
4 years, 4 months ago (2016-07-28 06:25:09 UTC) #48
vakh (use Gerrit instead)
https://codereview.chromium.org/2183433002/diff/160001/components/safe_browsing_db/v4_rice.cc File components/safe_browsing_db/v4_rice.cc (right): https://codereview.chromium.org/2183433002/diff/160001/components/safe_browsing_db/v4_rice.cc#newcode36 components/safe_browsing_db/v4_rice.cc:36: return NUM_ENTRIES_NEGATIVE_FAILURE; On 2016/07/27 23:39:40, palmer wrote: > Could ...
4 years, 4 months ago (2016-07-28 07:26:31 UTC) #51
vakh (use Gerrit instead)
Add release mode only tests for cases that hit NOTREACHED
4 years, 4 months ago (2016-07-28 16:18:54 UTC) #54
vakh (use Gerrit instead)
https://codereview.chromium.org/2183433002/diff/160001/components/safe_browsing_db/v4_rice_unittest.cc File components/safe_browsing_db/v4_rice_unittest.cc (right): https://codereview.chromium.org/2183433002/diff/160001/components/safe_browsing_db/v4_rice_unittest.cc#newcode131 components/safe_browsing_db/v4_rice_unittest.cc:131: On 2016/07/27 23:39:40, palmer wrote: > Does it make ...
4 years, 4 months ago (2016-07-28 16:20:20 UTC) #57
palmer
https://codereview.chromium.org/2183433002/diff/200001/components/safe_browsing_db/v4_rice.cc File components/safe_browsing_db/v4_rice.cc (right): https://codereview.chromium.org/2183433002/diff/200001/components/safe_browsing_db/v4_rice.cc#newcode121 components/safe_browsing_db/v4_rice.cc:121: DCHECK_LT(last_value, last_value + offset); We need to make this ...
4 years, 4 months ago (2016-07-28 19:26:47 UTC) #60
vakh (use Gerrit instead)
s/RICE/Rice and use safe-math to check integer overflow
4 years, 4 months ago (2016-07-28 19:56:27 UTC) #61
vakh (use Gerrit instead)
pkasting: Please approve the DEPS addition: '+third_party/protobuf/src/google', https://codereview.chromium.org/2183433002/diff/200001/components/safe_browsing_db/v4_rice.cc File components/safe_browsing_db/v4_rice.cc (right): https://codereview.chromium.org/2183433002/diff/200001/components/safe_browsing_db/v4_rice.cc#newcode121 components/safe_browsing_db/v4_rice.cc:121: DCHECK_LT(last_value, last_value ...
4 years, 4 months ago (2016-07-28 19:57:22 UTC) #65
Peter Kasting
LGTM for DEPS
4 years, 4 months ago (2016-07-28 19:58:51 UTC) #66
palmer
LGTM. Thanks!
4 years, 4 months ago (2016-07-28 20:50:12 UTC) #67
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/2183433002/220001
4 years, 4 months ago (2016-07-28 20:52:44 UTC) #71
commit-bot: I haz the power
Committed patchset #11 (id:220001)
4 years, 4 months ago (2016-07-28 21:24:33 UTC) #73
commit-bot: I haz the power
4 years, 4 months ago (2016-07-28 21:26:21 UTC) #75
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/9e71d408737100714f022dffe20dfb346d395bf9
Cr-Commit-Position: refs/heads/master@{#408478}

Powered by Google App Engine
This is Rietveld 408576698