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

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

Issue 9597015: Update Timer API to take the callback as the last parameter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « runtime/bin/chunked_stream.dart ('k') | runtime/bin/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) 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 = (String s) { 10 _file.onError = (String s) {
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 1014
1015 String get name() => _name; 1015 String get name() => _name;
1016 1016
1017 void set onError(void handler(String error)) { 1017 void set onError(void handler(String error)) {
1018 _onError = handler; 1018 _onError = handler;
1019 } 1019 }
1020 1020
1021 void set onNoPendingWrites(void handler()) { 1021 void set onNoPendingWrites(void handler()) {
1022 _onNoPendingWrites = handler; 1022 _onNoPendingWrites = handler;
1023 if (_pendingWrites == 0) { 1023 if (_pendingWrites == 0) {
1024 _noPendingWriteTimer = new Timer((t) { 1024 _noPendingWriteTimer = new Timer(0, (t) {
1025 if (_onNoPendingWrites != null) _onNoPendingWrites(); 1025 if (_onNoPendingWrites != null) _onNoPendingWrites();
1026 }, 0); 1026 });
1027 } 1027 }
1028 } 1028 }
1029 1029
1030 void _ensureFileService() { 1030 void _ensureFileService() {
1031 if (_fileService == null) { 1031 if (_fileService == null) {
1032 _fileService = _FileUtils.newServicePort(); 1032 _fileService = _FileUtils.newServicePort();
1033 } 1033 }
1034 } 1034 }
1035 1035
1036 void _writeEnqueued() { 1036 void _writeEnqueued() {
(...skipping 17 matching lines...) Expand all
1054 bool _asyncUsed; 1054 bool _asyncUsed;
1055 int _pendingWrites = 0; 1055 int _pendingWrites = 0;
1056 1056
1057 SendPort _fileService; 1057 SendPort _fileService;
1058 1058
1059 Timer _noPendingWriteTimer; 1059 Timer _noPendingWriteTimer;
1060 1060
1061 Function _onNoPendingWrites; 1061 Function _onNoPendingWrites;
1062 Function _onError; 1062 Function _onError;
1063 } 1063 }
OLDNEW
« no previous file with comments | « runtime/bin/chunked_stream.dart ('k') | runtime/bin/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698