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

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

Issue 2529393002: Make core libraries use generic method syntax. (Closed)
Patch Set: Update status files. Created 3 years, 11 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
« no previous file with comments | « sdk/lib/internal/sort.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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 completer.complete(_file); 206 completer.complete(_file);
207 }, 207 },
208 onError: error, 208 onError: error,
209 cancelOnError: true); 209 cancelOnError: true);
210 }) 210 })
211 .catchError(completer.completeError); 211 .catchError(completer.completeError);
212 return completer.future; 212 return completer.future;
213 } 213 }
214 214
215 Future<File> close() => 215 Future<File> close() =>
216 _openFuture.then/*<File>*/((openedFile) => openedFile.close()); 216 _openFuture.then<File>((openedFile) => openedFile.close());
217 } 217 }
218 218
219 219
220 // Class for encapsulating the native implementation of files. 220 // Class for encapsulating the native implementation of files.
221 class _File extends FileSystemEntity implements File { 221 class _File extends FileSystemEntity implements File {
222 final String path; 222 final String path;
223 223
224 // Constructor for file. 224 // Constructor for file.
225 _File(this.path) { 225 _File(this.path) {
226 if (path is! String) { 226 if (path is! String) {
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 void _checkAvailable() { 1028 void _checkAvailable() {
1029 if (_asyncDispatched) { 1029 if (_asyncDispatched) {
1030 throw new FileSystemException("An async operation is currently pending", 1030 throw new FileSystemException("An async operation is currently pending",
1031 path); 1031 path);
1032 } 1032 }
1033 if (closed) { 1033 if (closed) {
1034 throw new FileSystemException("File closed", path); 1034 throw new FileSystemException("File closed", path);
1035 } 1035 }
1036 } 1036 }
1037 } 1037 }
OLDNEW
« no previous file with comments | « sdk/lib/internal/sort.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698