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

Issue 6711021: Safe-browsing PrefixSet cleanups. (Closed)

Created:
9 years, 9 months ago by Scott Hess - ex-Googler
Modified:
9 years, 6 months ago
Reviewers:
lzheng1, lzheng
CC:
chromium-reviews, Paweł Hajdan Jr.
Visibility:
Public.

Description

Safe-browsing PrefixSet cleanups. Make sure SBPrefix is a fixed size. PrefixSet tests for single-element set, set with large deltas, and int32 space edge cases. PrefixSet::GetPrefixes() can be const. Consolidate the SafeBrowsingDatabase GetPrefixes() checking code. Check whether deltas fit by directly checking whether the delta fit. Add a histogram for checking if SBPrefix really was crazy. BUG=71832 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=78667

Patch Set 1 #

Patch Set 2 : Add logging for first-broken-detected, appease the git-cl gods. #

Total comments: 4

Patch Set 3 : log when size is broken #

Unified diffs Side-by-side diffs Delta from patch set Stats (+123 lines, -36 lines) Patch
M chrome/browser/safe_browsing/prefix_set.h View 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/safe_browsing/prefix_set.cc View 2 chunks +8 lines, -7 lines 0 comments Download
M chrome/browser/safe_browsing/prefix_set_unittest.cc View 1 chunk +69 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_database.cc View 1 2 5 chunks +43 lines, -23 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_util.h View 1 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Scott Hess - ex-Googler
I have an additional change which does more thorough checking of the data, with additional ...
9 years, 9 months ago (2011-03-17 22:58:36 UTC) #1
Scott Hess - ex-Googler
On 2011/03/17 22:58:36, shess wrote: > I have an additional change which does more thorough ...
9 years, 9 months ago (2011-03-17 23:15:36 UTC) #2
lzheng
LGTM. I can take another look if you agree we should a histograms to catch ...
9 years, 9 months ago (2011-03-18 00:37:34 UTC) #3
Scott Hess - ex-Googler
On 2011/03/18 00:37:34, lzheng wrote: > I can take another look if you agree we ...
9 years, 9 months ago (2011-03-18 02:04:59 UTC) #4
lzheng1
9 years, 9 months ago (2011-03-18 02:27:53 UTC) #5
LGTM

On Thu, Mar 17, 2011 at 7:04 PM, <shess@chromium.org> wrote:

> On 2011/03/18 00:37:34, lzheng wrote:
>
>> I can take another look if you agree we should
>> a histograms to catch if it is the size not
>> matching or the restored not equal to the original?
>>
>
> I added a new histogram for the size being different, and left the existing
> one
> stand for continuity with the previous code.
>
>
>
>
>
http://codereview.chromium.org/6711021/diff/1006/chrome/browser/safe_browsing...
> File chrome/browser/safe_browsing/prefix_set.cc (right):
>
>
>
http://codereview.chromium.org/6711021/diff/1006/chrome/browser/safe_browsing...
> chrome/browser/safe_browsing/prefix_set.cc:62: if (delta !=
> static_cast<unsigned>(delta16) || run_length >= kMaxRun) {
> On 2011/03/18 00:37:34, lzheng wrote:
>
>> I feel delta >= kMaxDelta is the same as delta !=
>> static_cast<unsigned>(delta16). Can you confirm?
>>
>
> Should be identical.  It was one of the notions that occurred to me
> while going over things looking for possible off-by-one and other edge
> cases.
>
> It also occurred to me that we never encode 0, so we could use that, but
> I decided that the gain was really minimal for the complexity (the
> "delta too large" case only fires a dozen times or so for the current
> safe-browsing list, so 65536 might never be encoded ever).
>
>
>
>
http://codereview.chromium.org/6711021/diff/1006/chrome/browser/safe_browsing...
> File chrome/browser/safe_browsing/safe_browsing_database.cc (right):
>
>
>
http://codereview.chromium.org/6711021/diff/1006/chrome/browser/safe_browsing...
> chrome/browser/safe_browsing/safe_browsing_database.cc:249:
> RecordPrefixSetInfo(PREFIX_SET_GETPREFIXES_BROKEN);
> On 2011/03/18 00:37:34, lzheng wrote:
>
>> When you get here, do you want to see if it is restored.size() !=
>>
> unique.size()
>
>> or std::equal(unique.begin(), unique.end(), restored.begin())?
>>
>
> Actually, I had another histogram for this, I can pull it over.
>
>
> http://codereview.chromium.org/6711021/
>

Powered by Google App Engine
This is Rietveld 408576698