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

Issue 10392023: Change dart:io to use Future for one-shot operations. (Closed)

Created:
8 years, 7 months ago by Mads Ager (google)
Modified:
8 years, 7 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Change dart:io to use Future for one-shot operations. This appears to be what a lot of our users are doing and it is the style used in our other libraries. Noteworthy changes: - File and Directory objects are now immutable. - Directory.list returns an active lister object. - Write operations on files return futures and the onNoPendingWrites handler is gone. The same functionality is there by using 'then' on the future returned from the last write operation. - Process starting is now done with static methods: -- Process.start yields an InteractiveProcess. -- Process.run yields a Future<ProcessResult> BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=7529

Patch Set 1 #

Patch Set 2 : Minor cleanup #

Total comments: 16

Patch Set 3 : Use defaults in more of File again. #

Total comments: 16

Patch Set 4 : Address review comments. #

Patch Set 5 : Fixed a couple of uses in samples. #

Total comments: 2

Patch Set 6 : Get rid of InteractiveProcess. #

Patch Set 7 : Adding stable test binaries #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1166 lines, -1205 lines) Patch
M lib/compiler/implementation/lib/io.dart View 1 2 3 4 5 1 chunk +11 lines, -9 lines 0 comments Download
M lib/dartdoc/dartdoc.dart View 3 chunks +15 lines, -10 lines 0 comments Download
M runtime/bin/directory.dart View 1 2 5 chunks +52 lines, -51 lines 0 comments Download
M runtime/bin/directory_impl.dart View 1 2 3 8 chunks +70 lines, -54 lines 0 comments Download
M runtime/bin/file.dart View 1 2 23 chunks +83 lines, -106 lines 0 comments Download
M runtime/bin/file_impl.dart View 1 2 3 32 chunks +244 lines, -180 lines 0 comments Download
M runtime/bin/process.dart View 1 2 3 4 5 7 chunks +58 lines, -35 lines 0 comments Download
M runtime/bin/process_impl.dart View 1 2 3 4 5 7 chunks +62 lines, -95 lines 0 comments Download
M samples/leap/leap_server.dart View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M samples/total/server/TotalRunner.dart View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M tests/standalone/io/dart_std_io_pipe_test.dart View 1 2 3 4 5 2 chunks +2 lines, -3 lines 0 comments Download
M tests/standalone/io/directory_error_test.dart View 7 chunks +16 lines, -19 lines 0 comments Download
M tests/standalone/io/directory_invalid_arguments_test.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M tests/standalone/io/directory_test.dart View 1 2 3 12 chunks +119 lines, -164 lines 0 comments Download
M tests/standalone/io/file_error_test.dart View 14 chunks +112 lines, -69 lines 0 comments Download
M tests/standalone/io/file_invalid_arguments_test.dart View 1 2 3 7 chunks +45 lines, -41 lines 0 comments Download
M tests/standalone/io/file_output_stream_test.dart View 3 chunks +6 lines, -8 lines 0 comments Download
M tests/standalone/io/file_system_links_test.dart View 7 chunks +14 lines, -22 lines 0 comments Download
M tests/standalone/io/file_test.dart View 1 2 3 4 5 6 23 chunks +132 lines, -154 lines 0 comments Download
M tests/standalone/io/many_directory_operations_test.dart View 1 chunk +1 line, -2 lines 0 comments Download
M tests/standalone/io/many_file_operations_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/process_broken_pipe_test.dart View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/process_check_arguments_test.dart View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/process_environment_test.dart View 1 chunk +3 lines, -7 lines 0 comments Download
M tests/standalone/io/process_exit_negative_test.dart View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M tests/standalone/io/process_exit_test.dart View 1 2 3 4 5 2 chunks +7 lines, -9 lines 0 comments Download
M tests/standalone/io/process_invalid_arguments_test.dart View 1 chunk +10 lines, -16 lines 0 comments Download
M tests/standalone/io/process_run_output_test.dart View 1 chunk +12 lines, -10 lines 0 comments Download
M tests/standalone/io/process_segfault_test.dart View 1 2 3 4 5 2 chunks +7 lines, -9 lines 0 comments Download
M tests/standalone/io/process_start_exception_test.dart View 1 2 3 4 5 2 chunks +11 lines, -12 lines 0 comments Download
M tests/standalone/io/process_stderr_test.dart View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M tests/standalone/io/process_stdout_test.dart View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M tests/standalone/io/process_working_directory_test.dart View 1 2 3 4 5 2 chunks +8 lines, -10 lines 0 comments Download
M tests/standalone/io/stream_pipe_test.dart View 4 chunks +4 lines, -8 lines 0 comments Download
M tools/testing/bin/linux/dart View 0 chunks +-1 lines, --1 lines 0 comments Download
M tools/testing/bin/macos/dart View 0 chunks +-1 lines, --1 lines 0 comments Download
M tools/testing/bin/windows/dart.exe View 0 chunks +-1 lines, --1 lines 0 comments Download
M tools/testing/dart/drt_updater.dart View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M tools/testing/dart/test_runner.dart View 1 2 3 4 5 6 chunks +7 lines, -9 lines 0 comments Download
M tools/testing/dart/test_suite.dart View 4 chunks +11 lines, -14 lines 0 comments Download
M utils/compiler/build_helper.dart View 1 chunk +6 lines, -6 lines 0 comments Download
M utils/pub/io.dart View 12 chunks +21 lines, -56 lines 0 comments Download
M utils/tests/pub/pub_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/tests/pub/test_pub.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
Mads Ager (google)
Søren and Rico, could you guys perform the review of the actual dart:io changes? Bob, ...
8 years, 7 months ago (2012-05-10 10:23:05 UTC) #1
Søren Gjesse
LGTM! - with a few comments. I like this change after all. The API looks ...
8 years, 7 months ago (2012-05-10 11:24:45 UTC) #2
ricow1
LGTM https://chromiumcodereview.appspot.com/10392023/diff/4001/runtime/bin/process_impl.dart File runtime/bin/process_impl.dart (right): https://chromiumcodereview.appspot.com/10392023/diff/4001/runtime/bin/process_impl.dart#newcode160 runtime/bin/process_impl.dart:160: _reportError(new ProcessException(status._errorMessage, status._errorCode)); Long line https://chromiumcodereview.appspot.com/10392023/diff/4001/tests/standalone/io/directory_test.dart File tests/standalone/io/directory_test.dart ...
8 years, 7 months ago (2012-05-10 11:48:01 UTC) #3
Mads Ager (google)
Thanks for the comments! https://chromiumcodereview.appspot.com/10392023/diff/2001/runtime/bin/directory.dart File runtime/bin/directory.dart (right): https://chromiumcodereview.appspot.com/10392023/diff/2001/runtime/bin/directory.dart#newcode24 runtime/bin/directory.dart:24: * a [:Future<bool>:] the completes ...
8 years, 7 months ago (2012-05-10 12:42:37 UTC) #4
Bob Nystrom
Pub stuff LGTM. Nathan and I will likely get rid of much of that over ...
8 years, 7 months ago (2012-05-10 17:14:21 UTC) #5
Mads Ager (google)
https://chromiumcodereview.appspot.com/10392023/diff/2003/runtime/bin/process.dart File runtime/bin/process.dart (right): https://chromiumcodereview.appspot.com/10392023/diff/2003/runtime/bin/process.dart#newcode51 runtime/bin/process.dart:51: interface InteractiveProcess { On 2012/05/10 17:14:21, Bob Nystrom wrote: ...
8 years, 7 months ago (2012-05-10 17:33:18 UTC) #6
Mads Ager (google)
On 2012/05/10 17:33:18, Mads Ager wrote: > https://chromiumcodereview.appspot.com/10392023/diff/2003/runtime/bin/process.dart > File runtime/bin/process.dart (right): > > https://chromiumcodereview.appspot.com/10392023/diff/2003/runtime/bin/process.dart#newcode51 ...
8 years, 7 months ago (2012-05-10 19:04:04 UTC) #7
Siggi Cherem (dart-lang)
8 years, 7 months ago (2012-05-12 00:49:41 UTC) #8
lgtm! very very cool!

Powered by Google App Engine
This is Rietveld 408576698