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

Unified Diff: utils/pub/hosted_source.dart

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added co19 issue number. 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 | « utils/pub/git_source.dart ('k') | utils/pub/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/hosted_source.dart
diff --git a/utils/pub/hosted_source.dart b/utils/pub/hosted_source.dart
index 5f63ec3ea1b15d095a5050b782c3d441bfa2289f..5a4106e29cac657b57ea2dafe8abcf349f93223c 100644
--- a/utils/pub/hosted_source.dart
+++ b/utils/pub/hosted_source.dart
@@ -63,7 +63,7 @@ class HostedSource extends Source {
/// Downloads a package from the site and unpacks it.
Future<bool> install(PackageId id, String destPath) {
- return new Future.of(() {
+ return new Future.sync(() {
var url = _makeVersionUrl(id, (server, package, version) =>
"$server/packages/$package/versions/$version.tar.gz");
log.io("Install package from $url.");
@@ -98,7 +98,7 @@ class HostedSource extends Source {
return '%${match[0].codeUnitAt(0)}';
});
- return new Future.immediate(
+ return new Future.value(
path.join(systemCacheRoot, urlDir, "${parsed.first}-${id.version}"));
}
« no previous file with comments | « utils/pub/git_source.dart ('k') | utils/pub/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698