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

Unified Diff: sdk/lib/io/link.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: Address comments Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/file_system_entity.dart ('k') | tests/standalone/io/file_read_special_device_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/link.dart
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart
index d36d7796424212cbd1d37deba4c28784eeeda3da..bfe0cdc96a17ba154224026bbfba418de8c3d0c0 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.dart
@@ -204,8 +204,17 @@ class _Link extends FileSystemEntity implements Link {
}
Future<String> target() {
- // TODO(whesse): Replace with asynchronous version.
- return new Future.sync(targetSync);
+ _ensureFileService();
+ List request = new List(2);
+ request[0] = _LINK_TARGET_REQUEST;
+ request[1] = path;
+ return _fileService.call(request).then((response) {
+ if (_isErrorResponse(response)) {
+ throw _exceptionFromResponse(response,
+ "Cannot get target of link '$path'");
+ }
+ return response;
+ });
}
String targetSync() {
« no previous file with comments | « sdk/lib/io/file_system_entity.dart ('k') | tests/standalone/io/file_read_special_device_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698