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

Unified Diff: sdk/lib/isolate/isolate.dart

Issue 1553233002: Add package config support to dart:isolate (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: resolvePackageUri for dart2js Created 4 years, 11 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
Index: sdk/lib/isolate/isolate.dart
diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart
index 8d284d23a10df287f882ab56add2f70ab35b862c..fe3dc52d9f59ed50332b8b9cadf44cd70a6b7a19 100644
--- a/sdk/lib/isolate/isolate.dart
+++ b/sdk/lib/isolate/isolate.dart
@@ -127,6 +127,34 @@ class Isolate {
external static Isolate get current;
/**
+ * Returns the package root of the current isolate, if any.
+ *
+ * If the isolate is using a [packageConfig] or the isolate has not been
+ * setup for package resolution, this getter returns `null`, otherwise it
+ * returns the package root - a directory that package URIs are resolved
+ * against.
+ */
rmacnak 2016/01/13 01:39:00 Note how this value can differ from Platform.packa
+ external static Future<Uri> get packageRoot;
+
+ /**
+ * Returns the package root of the current isolate, if any.
rmacnak 2016/01/13 01:39:00 package root => location of the package config
+ *
+ * If the isolate is using a [packageRoot] or the isolate has not been
+ * setup for package resolution, this getter returns `null`, otherwise it
+ * returns the package config URI.
+ */
rmacnak 2016/01/13 01:39:00 Note how this value can differ from Platform.packa
+ external static Future<Uri> get packageConfig;
+
+ /**
+ * Maps a package: URI to a non-package Uri.
+ *
+ * If there is no valid mapping from the package: URI in the current
+ * isolate, then this call returns `null`. Non-package: URI are
rmacnak 2016/01/13 01:39:00 Non-package: URIs
Ivan Posva 2016/01/13 02:13:15 Done.
+ * returned unmodified.
+ */
+ external static Future<Uri> resolvePackageUri(Uri packageUri);
+
+ /**
* Creates and spawns an isolate that shares the same code as the current
* isolate.
*
@@ -244,7 +272,9 @@ class Isolate {
bool errorsAreFatal,
bool checked,
Map<String, String> environment,
- Uri packageRoot});
+ Uri packageRoot,
+ Uri packageConfig,
+ bool automaticPackageResolution: false});
/**
* Requests the isolate to pause.

Powered by Google App Engine
This is Rietveld 408576698