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

Unified Diff: runtime/bin/vmservice/loader.dart

Issue 2715463003: Add option to gen_snapshot for creating a Makefile describing a snapshot's dependencies. (Closed)
Patch Set: . Created 3 years, 10 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 | « runtime/bin/loader.cc ('k') | runtime/platform/allocation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/loader.dart
diff --git a/runtime/bin/vmservice/loader.dart b/runtime/bin/vmservice/loader.dart
index a72e735df2cbe3f27bba5d090a49fad0c0dc42db..7710fe008ac0cca3f17472a5b5475d5f0015d30a 100644
--- a/runtime/bin/vmservice/loader.dart
+++ b/runtime/bin/vmservice/loader.dart
@@ -953,7 +953,10 @@ const _Dart_kResourceLoad = 5; // Resource class support.
const _Dart_kGetPackageRootUri = 6; // Uri of the packages/ directory.
const _Dart_kGetPackageConfigUri = 7; // Uri of the .packages file.
const _Dart_kResolvePackageUri = 8; // Resolve a package: uri.
+
+// Extra requests. Keep these in sync between loader.dart and loader.cc.
const _Dart_kImportExtension = 9; // Import a dart-ext: file.
+const _Dart_kResolveAsFilePath = 10; // Resolve uri to file path.
// External entry point for loader requests.
_processLoadRequest(request) {
@@ -1115,6 +1118,36 @@ _processLoadRequest(request) {
break;
}
break;
+ case _Dart_kResolveAsFilePath:
+ String uri = request[4];
+ Uri resolvedUri = Uri.parse(uri);
+ try {
+ if (resolvedUri.scheme == 'package') {
+ resolvedUri = loaderState._resolvePackageUri(resolvedUri);
+ }
+ if (resolvedUri.scheme == '' || resolvedUri.scheme == 'file') {
+ resolvedUri = loaderState._workingDirectory.resolveUri(resolvedUri);
+ var msg = new List(5);
+ msg[0] = tag;
+ msg[1] = uri;
+ msg[2] = resolvedUri.toString();
+ msg[3] = null;
+ msg[4] = resolvedUri.toFilePath();
+ sp.send(msg);
+ } else {
+ throw "Cannot resolve scheme (${resolvedUri.scheme}) to file path"
+ " for $resolvedUri";
+ }
+ } catch (e) {
+ var msg = new List(5);
+ msg[0] = -tag;
+ msg[1] = uri;
+ msg[2] = resolvedUri.toString();
+ msg[3] = null;
+ msg[4] = e.toString();
+ sp.send(msg);
+ }
+ break;
default:
_log('Unknown loader request tag=$tag from $isolateId');
}
« no previous file with comments | « runtime/bin/loader.cc ('k') | runtime/platform/allocation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698