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

Issue 8953030: Add input streams based on supplying data from lists (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 input streams based on supplying data from lists Two new streams are added ListInputStream and DynamicListInputStream. ListInputStream takes all the data in the stream in the constructor whereas DynamicListInputStream can get data added dynamically using the write method and have end of stream indicated using the method markEndOfStream. In a separate change I expect to have the current FileInputStream be based on the _BaseDataInputStream as it currently used the same logic with the sync file API. R=ager@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=2621

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+295 lines, -91 lines) Patch
M runtime/bin/builtin_sources.gypi View 1 chunk +1 line, -0 lines 0 comments Download
A runtime/bin/list_input_stream.dart View 1 chunk +62 lines, -0 lines 2 comments Download
M runtime/bin/stream_util.dart View 1 chunk +91 lines, -0 lines 6 comments Download
M tests/standalone/src/ChunkedStreamTest.dart View 5 chunks +7 lines, -44 lines 0 comments Download
A tests/standalone/src/ListInputStreamTest.dart View 1 chunk +127 lines, -0 lines 0 comments Download
M tests/standalone/src/StringStreamTest.dart View 9 chunks +7 lines, -47 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Gjesse
9 years ago (2011-12-19 14:21:56 UTC) #1
Mads Ager (google)
LGTM http://codereview.chromium.org/8953030/diff/1/runtime/bin/list_input_stream.dart File runtime/bin/list_input_stream.dart (right): http://codereview.chromium.org/8953030/diff/1/runtime/bin/list_input_stream.dart#newcode6 runtime/bin/list_input_stream.dart:6: ListInputStream(List<int> buffer) this._buffer and remove the assignment line? ...
9 years ago (2011-12-19 15:04:18 UTC) #2
Søren Gjesse
9 years ago (2011-12-20 09:45:14 UTC) #3
http://codereview.chromium.org/8953030/diff/1/runtime/bin/list_input_stream.dart
File runtime/bin/list_input_stream.dart (right):

http://codereview.chromium.org/8953030/diff/1/runtime/bin/list_input_stream.d...
runtime/bin/list_input_stream.dart:6: ListInputStream(List<int> buffer)
On 2011/12/19 15:04:18, Mads Ager wrote:
> this._buffer and remove the assignment line?
> 
> Maybe this will even fit on the line?
> 
> ListInputStream(List<int> this._buffer) : _streamMarkedClosed = true;

Why am I forgetting out good stuff? Changed to 

ListInputStream(List<int> this._buffer) {
  _streamMarkedClosed = true;
}

as _streamMarkedClosed is a field on a super class which cannot be initialized
in the initializer list.

http://codereview.chromium.org/8953030/diff/1/runtime/bin/stream_util.dart
File runtime/bin/stream_util.dart (right):

http://codereview.chromium.org/8953030/diff/1/runtime/bin/stream_util.dart#ne...
runtime/bin/stream_util.dart:53: // TODO(sgjesse): Find a better way of
scheduling callbacks from
On 2011/12/19 15:04:18, Mads Ager wrote:
> This comment used to be about the Timer with a 0ms argument. Maybe just remove
> the TODO?

Done.

http://codereview.chromium.org/8953030/diff/1/runtime/bin/stream_util.dart#ne...
runtime/bin/stream_util.dart:83: // Stream is marked closed available is now all
remaining data.
On 2011/12/19 15:04:18, Mads Ager wrote:
> Comment not completely understood. I think you should have a period after
closed
> and then explain the point about 'available' with more words. :)

Done.

http://codereview.chromium.org/8953030/diff/1/runtime/bin/stream_util.dart#ne...
runtime/bin/stream_util.dart:86: // The close callback has now been called and
stream is fully closed.
On 2011/12/19 15:04:18, Mads Ager wrote:
> and stream -> and the stream

Done.

Powered by Google App Engine
This is Rietveld 408576698