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

Side by Side Diff: sdk/lib/io/file_impl.dart

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/data_transformer.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.io; 5 part of dart.io;
6 6
7 // Read the file in blocks of size 64k. 7 // Read the file in blocks of size 64k.
8 const int _BLOCK_SIZE = 64 * 1024; 8 const int _BLOCK_SIZE = 64 * 1024;
9 9
10 10
(...skipping 18 matching lines...) Expand all
29 29
30 _FileStream(String this._path) : _position = 0 { 30 _FileStream(String this._path) : _position = 0 {
31 _setupController(); 31 _setupController();
32 } 32 }
33 33
34 _FileStream.forStdin() : _position = 0 { 34 _FileStream.forStdin() : _position = 0 {
35 _setupController(); 35 _setupController();
36 } 36 }
37 37
38 StreamSubscription<List<int>> listen(void onData(List<int> event), 38 StreamSubscription<List<int>> listen(void onData(List<int> event),
39 {void onError(AsyncError error), 39 {void onError(error),
40 void onDone(), 40 void onDone(),
41 bool cancelOnError}) { 41 bool cancelOnError}) {
42 return _controller.stream.listen(onData, 42 return _controller.stream.listen(onData,
43 onError: onError, 43 onError: onError,
44 onDone: onDone, 44 onDone: onDone,
45 cancelOnError: cancelOnError); 45 cancelOnError: cancelOnError);
46 } 46 }
47 47
48 void _setupController() { 48 void _setupController() {
49 _controller = new StreamController<List<int>>( 49 _controller = new StreamController<List<int>>(
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 new FileIOException("File closed '$_path'")); 1038 new FileIOException("File closed '$_path'"));
1039 }); 1039 });
1040 return completer.future; 1040 return completer.future;
1041 } 1041 }
1042 1042
1043 final String _path; 1043 final String _path;
1044 int _id; 1044 int _id;
1045 1045
1046 SendPort _fileService; 1046 SendPort _fileService;
1047 } 1047 }
OLDNEW
« no previous file with comments | « sdk/lib/io/data_transformer.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698