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

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: Addressed review comments. 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
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/isolate_patch.dart ('k') | tests/isolate/package_config_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/isolate/isolate.dart
diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart
index 8d284d23a10df287f882ab56add2f70ab35b862c..a0bfa6737fad0b1acc3946dd4e069e4bfa381719 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.
+ */
+ external static Future<Uri> get packageRoot;
+
+ /**
+ * Returns the package root of the current isolate, if any.
+ *
+ * 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.
+ */
+ 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: URIs are
+ * returned unmodified.
+ */
+ external static Future<Uri> resolvePackageUri(Uri packageUri);
+
+ /**
* Creates and spawns an isolate that shares the same code as the current
* isolate.
*
@@ -222,6 +250,14 @@ class Isolate {
* resolved against this location, as by
* `packageRoot.resolve("foo/bar.dart")`.
*
+ * If the [packageConfig] parameter is provided, then it is used to find the
+ * location of a package resolution configuration file for the spawned
+ * isolate.
+ *
kevmoo 2016/01/13 02:21:19 Need notes on the behavior if both `packageRoot` a
+ * If the [automaticPackageResolution] parameter is provided, then the
kevmoo 2016/01/13 02:21:19 provided => `true`.
+ * location of the package sources in the spawned isolate is automatically
+ * determined.
kevmoo 2016/01/13 02:21:19 determined how? How does this relate to packageRo
+ *
* The [environment] is a mapping from strings to strings which the
* spawned isolate uses when looking up [String.fromEnvironment] values.
* The system may add its own entries to environment as well.
@@ -244,7 +280,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.
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/isolate_patch.dart ('k') | tests/isolate/package_config_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698