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

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

Issue 8992007: Make the repeating argument to timers optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 9 years 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 | « runtime/bin/chunked_stream.dart ('k') | runtime/bin/string_stream.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 implements FileInputStream { 5 class _FileInputStream implements FileInputStream {
6 _FileInputStream(File file) { 6 _FileInputStream(File file) {
7 _file = file.openSync(); 7 _file = file.openSync();
8 _length = _file.lengthSync(); 8 _length = _file.lengthSync();
9 _checkScheduleCallbacks(); 9 _checkScheduleCallbacks();
10 } 10 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 _closed = true; 90 _closed = true;
91 } 91 }
92 } 92 }
93 93
94 // Schedule data callback if there is more data to read. Schedule 94 // Schedule data callback if there is more data to read. Schedule
95 // close callback once when all data has been read. Only schedule 95 // close callback once when all data has been read. Only schedule
96 // a new callback if the previous one has actually been called. 96 // a new callback if the previous one has actually been called.
97 if (!_closed) { 97 if (!_closed) {
98 if (available() > 0) { 98 if (available() > 0) {
99 if (_scheduledDataCallback == null) { 99 if (_scheduledDataCallback == null) {
100 _scheduledDataCallback = new Timer(issueDataCallback, 0, false); 100 _scheduledDataCallback = new Timer(issueDataCallback, 0);
101 } 101 }
102 } else if (!_eof) { 102 } else if (!_eof) {
103 if (_scheduledCloseCallback == null) { 103 if (_scheduledCloseCallback == null) {
104 _scheduledCloseCallback = new Timer(issueCloseCallback, 0, false); 104 _scheduledCloseCallback = new Timer(issueCloseCallback, 0);
105 _eof = true; 105 _eof = true;
106 } 106 }
107 } 107 }
108 } 108 }
109 } 109 }
110 110
111 RandomAccessFile _file; 111 RandomAccessFile _file;
112 int _length; 112 int _length;
113 bool _eof = false; 113 bool _eof = false;
114 bool _closed = false; 114 bool _closed = false;
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 var _readByteHandler; 1123 var _readByteHandler;
1124 var _readListHandler; 1124 var _readListHandler;
1125 var _noPendingWriteHandler; 1125 var _noPendingWriteHandler;
1126 var _positionHandler; 1126 var _positionHandler;
1127 var _setPositionHandler; 1127 var _setPositionHandler;
1128 var _truncateHandler; 1128 var _truncateHandler;
1129 var _lengthHandler; 1129 var _lengthHandler;
1130 var _flushHandler; 1130 var _flushHandler;
1131 var _errorHandler; 1131 var _errorHandler;
1132 } 1132 }
OLDNEW
« no previous file with comments | « runtime/bin/chunked_stream.dart ('k') | runtime/bin/string_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698