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

Unified Diff: mojo/dart/embedder/builtin.dart

Issue 1640933003: Dart: Roll runtime forward (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 | « DEPS ('k') | mojo/dart/embedder/dart_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/embedder/builtin.dart
diff --git a/mojo/dart/embedder/builtin.dart b/mojo/dart/embedder/builtin.dart
index 7077039becefb341cb9fb9df811e0792f3eab193..1adbc610115832a1f6421cfd27b29d5859e6c646 100644
--- a/mojo/dart/embedder/builtin.dart
+++ b/mojo/dart/embedder/builtin.dart
@@ -27,9 +27,25 @@ Uri _uriBase() {
return _cachedUriBase;
}
+String _rawScript;
+Uri _scriptUri() {
+ if (_rawScript.startsWith('http:') ||
+ _rawScript.startsWith('https:') ||
+ _rawScript.startsWith('file:')) {
+ return Uri.parse(_rawScript);
+ } else {
+ return Uri.base.resolveUri(new Uri.file(_rawScript));
+ }
+}
+
_setupHooks() {
VMLibraryHooks.eventHandlerSendData = MojoHandleWatcher.timer;
VMLibraryHooks.timerMillisecondClock = MojoCoreNatives.timerMillisecondClock;
+
+ // TODO(zra): When the Dart issue here:
+ // https://github.com/dart-lang/sdk/issues/25603
+ // is resolved, there will be no need to eagerly compute the script URI.
+ VMLibraryHooks.platformScript = _scriptUri();
}
_getUriBaseClosure() => _uriBase;
@@ -39,4 +55,4 @@ _getPrintClosure() => _print;
// The root library (aka the script) is imported into this library. The
// embedder uses this to lookup the main entrypoint in the root library's
// namespace.
-Function _getMainClosure() => main;
+Function _getMainClosure() => main;
« no previous file with comments | « DEPS ('k') | mojo/dart/embedder/dart_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698