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

Unified Diff: lib/src/async_package_resolver.dart

Issue 2132443003: Add package implementation. (Closed) Base URL: git@github.com:dart-lang/package_resolver@master
Patch Set: Code review changes Created 4 years, 5 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 | « lib/package_resolver.dart ('k') | lib/src/current_isolate_resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/async_package_resolver.dart
diff --git a/lib/src/async_package_resolver.dart b/lib/src/async_package_resolver.dart
new file mode 100644
index 0000000000000000000000000000000000000000..06c61e7773d2974894e96efaf76db0d27b860387
--- /dev/null
+++ b/lib/src/async_package_resolver.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package_resolver.dart';
+import 'sync_package_resolver.dart';
+
+/// An implementation of [PackageResolver] that wraps a [SyncPackageResolver].
+class AsyncPackageResolver implements PackageResolver {
+ /// The wrapped [SyncPackageResolver].
+ final SyncPackageResolver _inner;
+
+ AsyncPackageResolver(this._inner);
+
+ Future<Map<String, Uri>> get packageConfigMap async =>
+ _inner.packageConfigMap;
+
+ Future<Uri> get packageConfigUri async => _inner.packageConfigUri;
+ Future<Uri> get packageRoot async => _inner.packageRoot;
+ Future<SyncPackageResolver> get asSync async => _inner;
+ Future<String> get processArgument async => _inner.processArgument;
+
+ Future<Uri> resolveUri(packageUri) async => _inner.resolveUri(packageUri);
+ Future<Uri> urlFor(String package, [String path]) async =>
+ _inner.urlFor(package, path);
+ Future<Uri> packageUriFor(url) async => _inner.packageUriFor(url);
+ Future<String> packagePath(String package) async =>
+ _inner.packagePath(package);
+}
« no previous file with comments | « lib/package_resolver.dart ('k') | lib/src/current_isolate_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698