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

Issue 8885032: Improve the event handling for string input stream (Closed)

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

Description

Improve the event handling for string input stream 1. The string input stream now calls the data or line handler if there is still data available after returning from the data or line handler. These callbacks are scheduled on the event loop. 2. The reading of data is now throtteld so that calls to read or readLine will not eagerly try to read from the wrapped input stream. After each call to read the data handler is installed if no more buffered data is available. Also when the data handler is called the data handler on the wrapped input stream is un-installed if no more data is required for the current data or line handler. One side effect of this change is that just reading from an input stream obtained from a file is no longer possible. One will have to set up a data handler callback of some kind before any calls to read will return data. We can of cause change this to allow synchronous usage of an input stream obtained from a file (maybe with an optional argument to openInputStream). Fixed a related throtteling issue with the chunked input stream. R=ager@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=2310

Patch Set 1 #

Total comments: 2

Patch Set 2 : Updated the Dart test runner to work with the file input stream changes #

Total comments: 4

Patch Set 3 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+287 lines, -176 lines) Patch
M runtime/bin/chunked_stream.dart View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/string_stream.dart View 1 4 chunks +99 lines, -49 lines 0 comments Download
M tests/standalone/src/FileInputStreamTest.dart View 3 chunks +22 lines, -28 lines 0 comments Download
M tests/standalone/src/StatusFileParserTest.dart View 1 1 chunk +3 lines, -2 lines 0 comments Download
M tests/standalone/src/StringStreamTest.dart View 2 chunks +2 lines, -4 lines 0 comments Download
A tests/standalone/src/readline_test1.dat View 1 chunk +10 lines, -0 lines 0 comments Download
A tests/standalone/src/readline_test2.dat View 1 chunk +10 lines, -0 lines 0 comments Download
M tests/stub-generator/test_config.dart View 1 2 1 chunk +49 lines, -26 lines 0 comments Download
M tools/testing/dart/status_file_parser.dart View 1 2 2 chunks +52 lines, -42 lines 0 comments Download
M tools/testing/dart/test_suite.dart View 1 2 2 chunks +39 lines, -25 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Søren Gjesse
9 years ago (2011-12-09 08:33:22 UTC) #1
Mads Ager (google)
LGTM However, we should grep through the source base to find uses of this that ...
9 years ago (2011-12-09 08:47:04 UTC) #2
Søren Gjesse
Updated the Dart test runner - PTAL http://codereview.chromium.org/8885032/diff/1/runtime/bin/string_stream.dart File runtime/bin/string_stream.dart (right): http://codereview.chromium.org/8885032/diff/1/runtime/bin/string_stream.dart#newcode246 runtime/bin/string_stream.dart:246: if (decodedLine ...
9 years ago (2011-12-09 11:44:32 UTC) #3
Mads Ager (google)
lgtm http://codereview.chromium.org/8885032/diff/3001/tools/testing/dart/status_file_parser.dart File tools/testing/dart/status_file_parser.dart (right): http://codereview.chromium.org/8885032/diff/3001/tools/testing/dart/status_file_parser.dart#newcode77 tools/testing/dart/status_file_parser.dart:77: String line; Indent line 77 to 113. http://codereview.chromium.org/8885032/diff/3001/tools/testing/dart/test_suite.dart ...
9 years ago (2011-12-09 13:09:33 UTC) #4
Søren Gjesse
9 years ago (2011-12-09 13:36:43 UTC) #5
http://codereview.chromium.org/8885032/diff/3001/tools/testing/dart/status_fi...
File tools/testing/dart/status_file_parser.dart (right):

http://codereview.chromium.org/8885032/diff/3001/tools/testing/dart/status_fi...
tools/testing/dart/status_file_parser.dart:77: String line;
On 2011/12/09 13:09:33, Mads Ager wrote:
> Indent line 77 to 113.

Done.

http://codereview.chromium.org/8885032/diff/3001/tools/testing/dart/test_suit...
File tools/testing/dart/test_suite.dart (right):

http://codereview.chromium.org/8885032/diff/3001/tools/testing/dart/test_suit...
tools/testing/dart/test_suite.dart:174: List<Future> fut = new List();
On 2011/12/09 13:09:33, Mads Ager wrote:
> fut fut, delete?

Done.

Powered by Google App Engine
This is Rietveld 408576698