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

Issue 9432023: Add both sync and async methods for getting streams for a File (Closed)

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

Description

Add both sync and async methods for getting streams for a File The File class used to have two synchronous methods openInputStream and openOutputStream for getting streams for a file. These have now been changed to work asynchronously by the associated callback inputStreamHandler or outputStreamHandler when the stream is opened and available. To support the synchronous API two new methods openInputStreamSync and openOutputStreamSync which returns the stream directly as before have been added. The actual implemnetation of the file streams still uses the synchronous file API internally. However this change adds "simulated" handling of noPendingWriteHandler and closeHandler for file output stream. R=ager@google.com BUG=dart:1784 TEST= Committed: https://code.google.com/p/dart/source/detail?r=4452

Patch Set 1 #

Total comments: 12

Patch Set 2 : Addressed review comments from ager@ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+364 lines, -75 lines) Patch
M runtime/bin/file.dart View 1 4 chunks +40 lines, -15 lines 0 comments Download
M runtime/bin/file_impl.dart View 8 chunks +144 lines, -30 lines 0 comments Download
M samples/actors/samples/sssp/sssp-util.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/src/FileInputStreamTest.dart View 1 7 chunks +33 lines, -5 lines 0 comments Download
A tests/standalone/src/FileOutputStreamTest.dart View 1 1 chunk +115 lines, -0 lines 0 comments Download
M tests/standalone/src/FileTest.dart View 9 chunks +11 lines, -11 lines 0 comments Download
M tests/standalone/src/ReadIntoConstList.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M tests/standalone/src/StreamPipeTest.dart View 6 chunks +10 lines, -10 lines 0 comments Download
M tools/testing/dart/status_file_parser.dart View 1 1 chunk +8 lines, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
Søren Gjesse
8 years, 10 months ago (2012-02-22 12:54:19 UTC) #1
Mads Ager (google)
LGTM with a couple of comments. https://chromiumcodereview.appspot.com/9432023/diff/1/runtime/bin/file.dart File runtime/bin/file.dart (right): https://chromiumcodereview.appspot.com/9432023/diff/1/runtime/bin/file.dart#newcode129 runtime/bin/file.dart:129: * then the ...
8 years, 10 months ago (2012-02-22 13:20:20 UTC) #2
Søren Gjesse
https://chromiumcodereview.appspot.com/9432023/diff/1/runtime/bin/file.dart File runtime/bin/file.dart (right): https://chromiumcodereview.appspot.com/9432023/diff/1/runtime/bin/file.dart#newcode129 runtime/bin/file.dart:129: * then the input stream itself will be asynchronous ...
8 years, 10 months ago (2012-02-22 14:03:18 UTC) #3
Søren Gjesse
8 years, 10 months ago (2012-02-22 14:09:11 UTC) #4

          

Powered by Google App Engine
This is Rietveld 408576698