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

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

Issue 233193004: Fix File:openRead and file_input_stream_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « no previous file | tests/standalone/io/file_input_stream_test.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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 _closeFile(); 119 _closeFile();
120 _unsubscribed = true; 120 _unsubscribed = true;
121 } 121 }
122 }); 122 });
123 } 123 }
124 124
125 void _start() { 125 void _start() {
126 if (_position < 0) { 126 if (_position < 0) {
127 _controller.addError(new RangeError("Bad start position: $_position")); 127 _controller.addError(new RangeError("Bad start position: $_position"));
128 _controller.close(); 128 _controller.close();
129 _closeCompleter.complete();
129 return; 130 return;
130 } 131 }
131 132
132 void onReady(RandomAccessFile file) { 133 void onReady(RandomAccessFile file) {
133 _openedFile = file; 134 _openedFile = file;
134 _readInProgress = false; 135 _readInProgress = false;
135 _readBlock(); 136 _readBlock();
136 } 137 }
137 138
138 void onOpenFile(RandomAccessFile file) { 139 void onOpenFile(RandomAccessFile file) {
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 void _checkAvailable() { 922 void _checkAvailable() {
922 if (_asyncDispatched) { 923 if (_asyncDispatched) {
923 throw new FileSystemException("An async operation is currently pending", 924 throw new FileSystemException("An async operation is currently pending",
924 path); 925 path);
925 } 926 }
926 if (closed) { 927 if (closed) {
927 throw new FileSystemException("File closed", path); 928 throw new FileSystemException("File closed", path);
928 } 929 }
929 } 930 }
930 } 931 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/file_input_stream_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698