| OLD | NEW |
| 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 | 5 |
| 6 // Used for holding error code and error message for failed OS system calls. | 6 // Used for holding error code and error message for failed OS system calls. |
| 7 class _OSStatus { | 7 class _OSStatus { |
| 8 int _errorCode; | 8 int _errorCode; |
| 9 String _errorMessage; | 9 String _errorMessage; |
| 10 } | 10 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 schedule(replyTo); | 137 schedule(replyTo); |
| 138 }; | 138 }; |
| 139 } | 139 } |
| 140 | 140 |
| 141 void enqueue(_DirectoryOperation operation, void callback(result, ignored)) { | 141 void enqueue(_DirectoryOperation operation, void callback(result, ignored)) { |
| 142 ReceivePort replyPort = new ReceivePort.singleShot(); | 142 ReceivePort replyPort = new ReceivePort.singleShot(); |
| 143 replyPort.receive(scheduleWrap(callback)); | 143 replyPort.receive(scheduleWrap(callback)); |
| 144 operation.replyPort = replyPort.toSendPort(); | 144 operation.replyPort = replyPort.toSendPort(); |
| 145 _queue.addLast(operation); | 145 _queue.addLast(operation); |
| 146 if (_isolate == null) { | 146 if (_isolate == null) { |
| 147 _isolate = new _FileOperationIsolate(); | 147 _isolate = new _DirectoryOperationIsolate(); |
| 148 _isolate.spawn().then((port) { | 148 _isolate.spawn().then((port) { |
| 149 schedule(port); | 149 schedule(port); |
| 150 }); | 150 }); |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 Queue<_DirectoryOperation> _queue; | 154 Queue<_DirectoryOperation> _queue; |
| 155 _DirectoryOperationIsolate _isolate; | 155 _DirectoryOperationIsolate _isolate; |
| 156 } | 156 } |
| 157 | 157 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 var _doneHandler; | 362 var _doneHandler; |
| 363 var _existsHandler; | 363 var _existsHandler; |
| 364 var _createHandler; | 364 var _createHandler; |
| 365 var _createTempHandler; | 365 var _createTempHandler; |
| 366 var _deleteHandler; | 366 var _deleteHandler; |
| 367 var _errorHandler; | 367 var _errorHandler; |
| 368 | 368 |
| 369 String _path; | 369 String _path; |
| 370 _DirectoryOperationScheduler _scheduler; | 370 _DirectoryOperationScheduler _scheduler; |
| 371 } | 371 } |
| OLD | NEW |