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

Issue 6965015: net: add CRL filter infrastructure. (Closed)

Created:
9 years, 6 months ago by agl
Modified:
9 years, 6 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

net: add CRL filter infrastructure. This doesn't plumb anything in yet, it just runs unittests. BUG=none TEST=net_unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=87676

Patch Set 1 #

Total comments: 53

Patch Set 2 : ... #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1179 lines, -0 lines) Patch
A net/base/crl_filter.h View 1 chunk +110 lines, -0 lines 0 comments Download
A net/base/crl_filter.cc View 1 1 chunk +854 lines, -0 lines 0 comments Download
A net/base/crl_filter_unittest.cc View 1 1 chunk +212 lines, -0 lines 2 comments Download
M net/net.gyp View 1 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
agl
9 years, 6 months ago (2011-05-31 15:24:44 UTC) #1
Mike Belshe
lgtm Just a few nits. http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc File net/base/crl_filter.cc (right): http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode295 net/base/crl_filter.cc:295: uint8 r = kDeBruijnLookup[((w&-w) ...
9 years, 6 months ago (2011-06-02 18:11:25 UTC) #2
agl
http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc File net/base/crl_filter.cc (right): http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode295 net/base/crl_filter.cc:295: uint8 r = kDeBruijnLookup[((w&-w) * kDeBruijn) >> 27]; On ...
9 years, 6 months ago (2011-06-02 21:04:39 UTC) #3
Mike Belshe
On 2011/06/02 21:04:39, agl wrote: > http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc > File net/base/crl_filter.cc (right): > > http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode295 > ...
9 years, 6 months ago (2011-06-02 21:17:12 UTC) #4
Ryan Sleevi
agl: two LEAKs and a BUG below, along with a host of nits that , ...
9 years, 6 months ago (2011-06-02 22:01:54 UTC) #5
agl
9 years, 6 months ago (2011-06-02 22:57:17 UTC) #6
Thanks! I was already working on the memory leaks because of the valgrind
builder. I also switched to returning scoped_refptrs rather than raw pointers to
make sure that there's no confusion about the ownership.

I'm afraid that I've been writing too much Go and the compiler can only tell me
when I've missed semicolons!

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc
File net/base/crl_filter.cc (right):

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode47
net/base/crl_filter.cc:47: return true;
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> LEAK: inflateEnd() is never called, particularly along the early termination
> cases. 

Opps, thanks!

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode110
net/base/crl_filter.cc:110: RangeDecoder(base::StringPiece in, const
std::vector<uint32> spans)
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> nit: const std::vector<uint32> -> const std::vector<uint32>& 

Done.

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode123
net/base/crl_filter.cc:123: while (high_ >> 24 == low_ >> 24) {
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> nit: I think parenthesis for the sub-statements here and on lines 146 and 161
> would help readability, even though operator precedence doesn't require them.
> Not required by the style guide though. 

Done.

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode139
net/base/crl_filter.cc:139: for (unsigned i = 0; i < spans_.size(); i++) {
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> nit: unsigned -> size_t (or std::vector<uint32>::size_type for the extremely
> pedantic) 

Done.

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode178
net/base/crl_filter.cc:178: const std::vector<uint32> spans_;
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> nit?: const std::vector<uint32>& , to further avoid any copies

I'd rather reduce the surprise than save copying 12 bytes. Stashing a pointer
which was a const reference is a bit of a sharp edge.

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode324
net/base/crl_filter.cc:324: uint32 w;
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> nit?: Move down two lines, between line 326 and 327 

Done.

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode356
net/base/crl_filter.cc:356: 
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> nit: Delete this blank line 

Done.

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode402
net/base/crl_filter.cc:402: if (num_bits_ > 0) {
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> nit: Inconsistent bracing with rest of the file's one-line statements (eg: see
> lines 378/379 or 382/383) 

Done.

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode430
net/base/crl_filter.cc:430: uint8* buf_;
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> LEAK: buf_ is leaked (allocated on lines 410 || 413) 

Thanks!

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode432
net/base/crl_filter.cc:432: unsigned buf_used_;
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> nit: size_t for bytes in memory,
> http://www.chromium.org/developers/coding-style#TOC-Types 

Done.

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode434
net/base/crl_filter.cc:434: unsigned num_bits_;
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> 
> DISALLOW_COPY_AND_ASSIGN(BitWriter)

Done.

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode590
net/base/crl_filter.cc:590: url,
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> nit: 2 spaces -> 4 spaces 

Done.

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode714
net/base/crl_filter.cc:714: static const unsigned num_span_values = 3;
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> nit: constant name
> 
> http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Constant_Names 

Done.

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode715
net/base/crl_filter.cc:715: if (data.size() < num_span_values * sizeof(uint32))
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> nit: Use a variable for num_span_values * sizeof(uint32), since you compute it
> here and again on lines 719/720
> 
> Given that num_span_values is itself a constant, you could make this a
constant
> as well for readability. 

Done.

http://codereview.chromium.org/6965015/diff/1/net/base/crl_filter.cc#newcode769
net/base/crl_filter.cc:769: if (crls_included_.count(std::make_pair<std::string,
std::string>(
On 2011/06/02 22:01:54, Ryan Sleevi wrote:
> nit: base/stl_util-inl.h has ContainsKey, which is the more prevalent pattern
> within the net/ code 

Done.

Powered by Google App Engine
This is Rietveld 408576698