All but a few of these comments will be addressed when internal change
37570979
lands. Please review my responses for those which are not addressed.
Thanks for the review!
On 2012/10/31 22:37:37, jar wrote:
> nit: NO_COPY_AND_ASSIGN macro.
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> nit: I think even here in test land, members should be private, and we
should
> use accessors.
> You can use protected in test fixtures, but I don't think this
qualifies.
Fixed upstream.
https://codereview.chromium.org/11300020/diff/5001/net/quic/quic_crypto_stream_test.cc#newcode40
net/quic/quic_crypto_stream_test.cc:40: };
On 2012/10/31 22:37:37, jar wrote:
> nit: DISALLOW_COPY_AND_ASSIGN
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> These should probably be protected:
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> nit: typo? "...we strictly in-order creation"
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> nit: with return on line 182, else and curlies are not needed.
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> I don't think there are every any entries in
implicitly_created_streams_ that
> are larger than the largest_peer_created_stream_id.
> Why are we checking in line 187?
We need IsClosed() to return true *only* when a stream has been closed.
So if IsClosed() is called with a stream id *larger* than the largest
peer created stream id, we need IsClosed() to return false.
The check on 186 will cause us to return false if the stream id is
larger than the largest peer created stream id.
The check on 187 will cause us to return false if the stream id has been
implicitly created.
Only if it has actually been closed, will these two checks allows us to
return true. (FWIW, there is some pretty rigorous testing (I hope :>)
in quic_session_test)
Added a more explicit comment in the .h file. (upstream)
On 2012/10/31 22:37:37, jar wrote:
> nit: declare/init as close to first use as possible.
I assume you're referring to byte_offset, not data_len?
On 2012/10/31 22:37:37, jar wrote:
> nit: typo? "...can't pass it up the stream might..."
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> nit: define/init as close to first use as possible.
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> Shouldn't this be a DCHECK(), even if we do put this defensive code
here?
Could be a DCHECK, but that complicates unit tests. Leaving as is, as
per our offline discussion.
On 2012/10/31 22:37:37, jar wrote:
> nit: idx --> index
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> Should this be second.data()? I think the other call may instigate an
> allocation and strcpy just to make room for the null.
> The other uses of c_str() in this file might also need to be changed.
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> nit: putting this after line 161 will mean that you don't have to
reset it in
> line 171 (and make the loop clearer that it is always pointing to
frames.begin()
> ).
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> Shouldn't you first test for frames_.end()?
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> nit: iov_index? (I found other folks using the "iov" abbreviation,
and figure
> maybe it is common in such code... but the idx might as well be
spelled out per
> style guide).
Fixed upstream.
On 2012/11/01 17:43:47, alyssar wrote:
> I think there's some confusion about the memory model, which we should
clarify
> in comments in the .h file.
> In Readv we're memcpy-ing into caller supplied buffers.
> In GetReadableRegions we're providing access into the sequencer's
'buffers'
Changed to use data().
On 2012/10/31 22:37:37, jar wrote:
> nit: indent
Fixed upstream.
On 2012/11/01 17:43:47, alyssar wrote:
> I believe the header should be updated. This is supposed to be
similar to the
> system call:
> man readv -> "on success, the readv() function returns the number of
bytes
> read;"
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> I was curious why you used a slightly different pattern here, than you
did with
> seemingly similar code on line 216-218.
> I don't know that either is better, so I was curious (and I had to
reach each
> pattern carefully to make sense of it).
Do you think something should be changed here? Can you be explicit?
On 2012/10/31 22:37:37, jar wrote:
> Reading the code, it appears to return the number of bytes
transferred, rather
> than the number of iovs used.
Fixed upstream.
On 2012/10/31 22:37:37, jar wrote:
> nit: methods after typedefs etc.
Fixed upstream.
On 2012/11/01 22:21:10, jar wrote:
> nit: indent
Fixed upstream.
On 2012/11/01 22:21:10, jar wrote:
> nit: most of these should be const methods. line 52 might need a const
return
> type.
Fixed upstream.
On 2012/11/01 22:21:10, jar wrote:
> nit: indent
Fixed upstream.
On 2012/11/01 22:21:10, jar wrote:
> nit: indent (happens several more times).
Fixed upstream.
On 2012/11/01 22:21:10, jar wrote:
> nit: move closer to first use.
Fixed upstream.
On 2012/11/01 22:21:10, jar wrote:
> nit: move closer to first use. (next test as well)
Fixed upstream.
On 2012/11/01 22:21:10, jar wrote:
> nit: (assuming you went with the longer spelling in source code)
idx-->index
> (throughout this file)
Fixed upstream.
On 2012/11/01 22:21:10, jar wrote:
> nit: probably avoid c_str() (in favor of data()) unless really needed,
to avoid
> accidental mutation of string buffer.
Fixed upstream.
On 2012/11/01 22:21:10, jar wrote:
> nit: period at end
Fixed upstream.
On 2012/11/01 22:21:10, jar wrote:
> nit: both above are probably const methods.
Fixed upstream.
On 2012/11/01 22:21:10, jar wrote:
> nit: const method
It's gauche to return mutable pointers to members in a const method.
IIRC, there was a recent thread about this on chromium-dev.
https://codereview.chromium.org/11300020/