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

Side by Side Diff: runtime/bin/file_impl.dart

Issue 9703023: Fix some minor static type issues in dart:io implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove change to _File.openSync optional argument. Created 8 years, 9 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 | « no previous file | runtime/bin/process_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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class _FileInputStream extends _BaseDataInputStream implements InputStream { 5 class _FileInputStream extends _BaseDataInputStream implements InputStream {
6 _FileInputStream(String name) { 6 _FileInputStream(String name) {
7 _file = new File(name); 7 _file = new File(name);
8 _data = []; 8 _data = [];
9 _position = 0; 9 _position = 0;
10 _file.onError = (e) { 10 _file.onError = (e) {
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 "Mixed use of synchronous and asynchronous API"); 648 "Mixed use of synchronous and asynchronous API");
649 } 649 }
650 var decoder = _StringDecoders.decoder(encoding); 650 var decoder = _StringDecoders.decoder(encoding);
651 List<int> bytes = readAsBytesSync(); 651 List<int> bytes = readAsBytesSync();
652 decoder.write(bytes); 652 decoder.write(bytes);
653 return _getDecodedLines(decoder); 653 return _getDecodedLines(decoder);
654 } 654 }
655 655
656 String get name() => _name; 656 String get name() => _name;
657 657
658 void set onError(void handler(String error)) { 658 void set onError(void handler(Exception error)) {
659 _onError = handler; 659 _onError = handler;
660 } 660 }
661 661
662 void _ensureFileService() { 662 void _ensureFileService() {
663 if (_fileService == null) { 663 if (_fileService == null) {
664 _fileService = _FileUtils.newServicePort(); 664 _fileService = _FileUtils.newServicePort();
665 } 665 }
666 } 666 }
667 667
668 bool _isErrorResponse(response) { 668 bool _isErrorResponse(response) {
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 bool _asyncUsed; 1098 bool _asyncUsed;
1099 int _pendingWrites = 0; 1099 int _pendingWrites = 0;
1100 1100
1101 SendPort _fileService; 1101 SendPort _fileService;
1102 1102
1103 Timer _noPendingWriteTimer; 1103 Timer _noPendingWriteTimer;
1104 1104
1105 Function _onNoPendingWrites; 1105 Function _onNoPendingWrites;
1106 Function _onError; 1106 Function _onError;
1107 } 1107 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/process_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698