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

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

Issue 14642012: dart:io | Add asynchronous versions of the methods of FileSystemEntity and Link. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add new async test file. Created 7 years, 7 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
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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 const int _LENGTH_FROM_PATH_REQUEST = 11; 198 const int _LENGTH_FROM_PATH_REQUEST = 11;
199 const int _LAST_MODIFIED_REQUEST = 12; 199 const int _LAST_MODIFIED_REQUEST = 12;
200 const int _FLUSH_REQUEST = 13; 200 const int _FLUSH_REQUEST = 13;
201 const int _READ_BYTE_REQUEST = 14; 201 const int _READ_BYTE_REQUEST = 14;
202 const int _WRITE_BYTE_REQUEST = 15; 202 const int _WRITE_BYTE_REQUEST = 15;
203 const int _READ_REQUEST = 16; 203 const int _READ_REQUEST = 16;
204 const int _READ_LIST_REQUEST = 17; 204 const int _READ_LIST_REQUEST = 17;
205 const int _WRITE_LIST_REQUEST = 18; 205 const int _WRITE_LIST_REQUEST = 18;
206 const int _CREATE_LINK_REQUEST = 19; 206 const int _CREATE_LINK_REQUEST = 19;
207 const int _DELETE_LINK_REQUEST = 20; 207 const int _DELETE_LINK_REQUEST = 20;
208 const int _LINK_TARGET_REQUEST = 21;
208 209
209 // Base class for _File and _RandomAccessFile with shared functions. 210 // Base class for _File and _RandomAccessFile with shared functions.
210 class _FileBase { 211 class _FileBase {
211 bool _isErrorResponse(response) { 212 bool _isErrorResponse(response) {
212 return response is List && response[0] != _SUCCESS_RESPONSE; 213 return response is List && response[0] != _SUCCESS_RESPONSE;
213 } 214 }
214 215
215 _exceptionFromResponse(response, String message) { 216 _exceptionFromResponse(response, String message) {
216 assert(_isErrorResponse(response)); 217 assert(_isErrorResponse(response));
217 switch (response[_ERROR_RESPONSE_ERROR_TYPE]) { 218 switch (response[_ERROR_RESPONSE_ERROR_TYPE]) {
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 new FileIOException("File closed '$_path'")); 1038 new FileIOException("File closed '$_path'"));
1038 }); 1039 });
1039 return completer.future; 1040 return completer.future;
1040 } 1041 }
1041 1042
1042 final String _path; 1043 final String _path;
1043 int _id; 1044 int _id;
1044 1045
1045 SendPort _fileService; 1046 SendPort _fileService;
1046 } 1047 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698