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

Unified Diff: sdk/lib/io/link.dart

Issue 3001963002: [dart:io] Namespaces for file IO (Closed)
Patch Set: Fuchsia fix Created 3 years, 4 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/io_sources.gni ('k') | sdk/lib/io/namespace_impl.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 cc347800423b6011212a84ebdd328fecdd03bc46..31028186dd2da7bfbab56824df0aa045783bd233 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.dart
@@ -168,7 +168,7 @@ class _Link extends FileSystemEntity implements Link {
var result =
recursive ? parent.create(recursive: true) : new Future.value(null);
return result
- .then((_) => _IOService._dispatch(_FILE_CREATE_LINK, [path, target]))
+ .then((_) => _File._dispatchWithNamespace(_FILE_CREATE_LINK, [null, path, target]))
.then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
@@ -185,7 +185,7 @@ class _Link extends FileSystemEntity implements Link {
if (Platform.isWindows) {
target = _makeWindowsLinkTarget(target);
}
- var result = _File._createLink(path, target);
+ var result = _File._createLink(_Namespace._namespace, path, target);
throwIfError(result, "Cannot create link", path);
}
@@ -225,7 +225,8 @@ class _Link extends FileSystemEntity implements Link {
if (recursive) {
return new Directory(path).delete(recursive: true).then((_) => this);
}
- return _IOService._dispatch(_FILE_DELETE_LINK, [path]).then((response) {
+ return _File._dispatchWithNamespace(_FILE_DELETE_LINK, [null, path])
+ .then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "Cannot delete link", path);
}
@@ -237,13 +238,14 @@ class _Link extends FileSystemEntity implements Link {
if (recursive) {
return new Directory(path).deleteSync(recursive: true);
}
- var result = _File._deleteLinkNative(path);
+ var result = _File._deleteLinkNative(_Namespace._namespace, path);
throwIfError(result, "Cannot delete link", path);
}
Future<Link> rename(String newPath) {
- return _IOService
- ._dispatch(_FILE_RENAME_LINK, [path, newPath]).then((response) {
+ return _File
+ ._dispatchWithNamespace(_FILE_RENAME_LINK, [null, path, newPath])
+ .then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
response, "Cannot rename link to '$newPath'", path);
@@ -253,13 +255,14 @@ class _Link extends FileSystemEntity implements Link {
}
Link renameSync(String newPath) {
- var result = _File._renameLink(path, newPath);
+ var result = _File._renameLink(_Namespace._namespace, path, newPath);
throwIfError(result, "Cannot rename link '$path' to '$newPath'");
return new Link(newPath);
}
Future<String> target() {
- return _IOService._dispatch(_FILE_LINK_TARGET, [path]).then((response) {
+ return _File._dispatchWithNamespace(_FILE_LINK_TARGET, [null, path])
+ .then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
response, "Cannot get target of link", path);
@@ -269,7 +272,7 @@ class _Link extends FileSystemEntity implements Link {
}
String targetSync() {
- var result = _File._linkTarget(path);
+ var result = _File._linkTarget(_Namespace._namespace, path);
throwIfError(result, "Cannot read link", path);
return result;
}
« no previous file with comments | « sdk/lib/io/io_sources.gni ('k') | sdk/lib/io/namespace_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698