| OLD | NEW |
| 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 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 class _Directory implements Directory { | 7 class _Directory implements Directory { |
| 8 static const CREATE_REQUEST = 0; | 8 static const CREATE_REQUEST = 0; |
| 9 static const DELETE_REQUEST = 1; | 9 static const DELETE_REQUEST = 1; |
| 10 static const EXISTS_REQUEST = 2; | 10 static const EXISTS_REQUEST = 2; |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 int id; | 320 int id; |
| 321 bool canceled = false; | 321 bool canceled = false; |
| 322 bool nextRunning = false; | 322 bool nextRunning = false; |
| 323 bool closed = false; | 323 bool closed = false; |
| 324 | 324 |
| 325 _AsyncDirectoryLister(String this.path, | 325 _AsyncDirectoryLister(String this.path, |
| 326 bool this.recursive, | 326 bool this.recursive, |
| 327 bool this.followLinks) { | 327 bool this.followLinks) { |
| 328 controller = new StreamController(onListen: onListen, | 328 controller = new StreamController(onListen: onListen, |
| 329 onResume: onResume, | 329 onResume: onResume, |
| 330 onCancel: onCancel); | 330 onCancel: onCancel, |
| 331 sync: true); |
| 331 } | 332 } |
| 332 | 333 |
| 333 Stream get stream => controller.stream; | 334 Stream get stream => controller.stream; |
| 334 | 335 |
| 335 void onListen() { | 336 void onListen() { |
| 336 var request = [_Directory.LIST_START_REQUEST, path, recursive, followLinks]; | 337 var request = [_Directory.LIST_START_REQUEST, path, recursive, followLinks]; |
| 337 _Directory._newServicePort().call(request) | 338 _Directory._newServicePort().call(request) |
| 338 .then((response) { | 339 .then((response) { |
| 339 if (response is int) { | 340 if (response is int) { |
| 340 id = response; | 341 id = response; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 controller.addError( | 425 controller.addError( |
| 425 new DirectoryException("Directory listing failed", | 426 new DirectoryException("Directory listing failed", |
| 426 errorPath, | 427 errorPath, |
| 427 err)); | 428 err)); |
| 428 } else { | 429 } else { |
| 429 controller.addError( | 430 controller.addError( |
| 430 new DirectoryException("Internal error")); | 431 new DirectoryException("Internal error")); |
| 431 } | 432 } |
| 432 } | 433 } |
| 433 } | 434 } |
| OLD | NEW |