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

Issue 8818009: Add chunked input stream (Closed)

Created:
9 years ago by Søren Gjesse
Modified:
9 years ago
Reviewers:
Mads Ager (google)
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add chunked input stream The chunked input stream can deliver data fron an input stream as fixed sized blocks of data. R=ager@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=2163

Patch Set 1 #

Patch Set 2 : Added ChunkedStreamTest.dart #

Total comments: 16

Patch Set 3 : Addressed review comments from ager@ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+429 lines, -5 lines) Patch
M runtime/bin/buffer_list.dart View 1 2 3 chunks +53 lines, -2 lines 0 comments Download
M runtime/bin/builtin_sources.gypi View 1 chunk +1 line, -0 lines 0 comments Download
A runtime/bin/chunked_stream.dart View 1 2 1 chunk +125 lines, -0 lines 0 comments Download
M runtime/bin/input_stream.dart View 1 2 1 chunk +51 lines, -0 lines 0 comments Download
A tests/standalone/src/ChunkedStreamTest.dart View 1 2 1 chunk +172 lines, -0 lines 0 comments Download
M tests/standalone/src/FileInputStreamTest.dart View 2 chunks +27 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Gjesse
9 years ago (2011-12-06 12:26:32 UTC) #1
Mads Ager (google)
lgtm http://codereview.chromium.org/8818009/diff/3001/runtime/bin/buffer_list.dart File runtime/bin/buffer_list.dart (right): http://codereview.chromium.org/8818009/diff/3001/runtime/bin/buffer_list.dart#newcode57 runtime/bin/buffer_list.dart:57: /* Do you want to use DartDoc style ...
9 years ago (2011-12-06 14:05:01 UTC) #2
Søren Gjesse
9 years ago (2011-12-07 07:58:29 UTC) #3
http://codereview.chromium.org/8818009/diff/3001/runtime/bin/buffer_list.dart
File runtime/bin/buffer_list.dart (right):

http://codereview.chromium.org/8818009/diff/3001/runtime/bin/buffer_list.dart...
runtime/bin/buffer_list.dart:57: /*
On 2011/12/06 14:05:02, Mads Ager wrote:
> Do you want to use DartDoc style here: '/**'?
> 
> Half of the methods here seem to have DartDoc style comments and the rest do
> not.

I am not realy sure. This is an internal class. Made them all DartDoc style for
now.

http://codereview.chromium.org/8818009/diff/3001/runtime/bin/chunked_stream.dart
File runtime/bin/chunked_stream.dart (right):

http://codereview.chromium.org/8818009/diff/3001/runtime/bin/chunked_stream.d...
runtime/bin/chunked_stream.dart:7: : _chunkSize = chunkSize, _bufferList = new 
_BufferList() {
On 2011/12/06 14:05:02, Mads Ager wrote:
> Remove one of the spaces after 'new'?

Done.

http://codereview.chromium.org/8818009/diff/3001/runtime/bin/chunked_stream.d...
runtime/bin/chunked_stream.dart:98: void issueCloseCallback(Timer timer) {
On 2011/12/06 14:05:02, Mads Ager wrote:
> We should remove the Timer argument from Timer callbacks. I don't see any use
> for it at all. We can do that in another change.

OK

http://codereview.chromium.org/8818009/diff/3001/runtime/bin/chunked_stream.d...
runtime/bin/chunked_stream.dart:112: // Schedule close callback if no more data
and input is closed..
On 2011/12/06 14:05:02, Mads Ager wrote:
> Remove extra period.

Done.

http://codereview.chromium.org/8818009/diff/3001/runtime/bin/input_stream.dart
File runtime/bin/input_stream.dart (right):

http://codereview.chromium.org/8818009/diff/3001/runtime/bin/input_stream.dar...
runtime/bin/input_stream.dart:120: * Decodes a binary input stream into
characters using the specified
On 2011/12/06 14:05:02, Mads Ager wrote:
> This looks like a copied comment. ;-)

Done.

http://codereview.chromium.org/8818009/diff/3001/tests/standalone/src/Chunked...
File tests/standalone/src/ChunkedStreamTest.dart (right):

http://codereview.chromium.org/8818009/diff/3001/tests/standalone/src/Chunked...
tests/standalone/src/ChunkedStreamTest.dart:91: var _16k = 1024 * 16;
On 2011/12/06 14:05:02, Mads Ager wrote:
> Is the underscore needed here?

Yes, a variable cannot start with a digit.

http://codereview.chromium.org/8818009/diff/3001/tests/standalone/src/Chunked...
tests/standalone/src/ChunkedStreamTest.dart:115: chunk = stream.read();
On 2011/12/06 14:05:02, Mads Ager wrote:
> Maybe add comments here static how many bytes are expected to be in the stream
> at each point? Here it is 7.

Done.

http://codereview.chromium.org/8818009/diff/3001/tests/standalone/src/Chunked...
tests/standalone/src/ChunkedStreamTest.dart:156: 
On 2011/12/06 14:05:02, Mads Ager wrote:
> It would be nice to also have a test that changes the chunkSize in the
> dataHandler. Potentially just an extra stage above.

Good point. Done.

Powered by Google App Engine
This is Rietveld 408576698