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

Unified Diff: runtime/bin/platform_patch.dart

Issue 2988613002: Compute the script Uri lazily (Closed)
Patch Set: Created 3 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 | « pkg/dev_compiler/tool/input_sdk/patch/io_patch.dart ('k') | runtime/lib/internal_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform_patch.dart
diff --git a/runtime/bin/platform_patch.dart b/runtime/bin/platform_patch.dart
index f8d117e74e22ac329ab570f87224ab50b6ecdaf9..a634357534ff2359d3de6afd5a58832221374fc0 100644
--- a/runtime/bin/platform_patch.dart
+++ b/runtime/bin/platform_patch.dart
@@ -32,18 +32,22 @@ class _Platform {
@patch
static String _packageConfig() => VMLibraryHooks.packageConfigString;
+ @patch
+ static Uri _script() => VMLibraryHooks.platformScript;
+
// This script singleton is written to by the embedder if applicable.
static void set _nativeScript(String path) {
zra 2017/07/24 15:32:48 In the standalone VM, this setter is called from t
- if (path.startsWith('http:') ||
- path.startsWith('https:') ||
- path.startsWith('package:') ||
- path.startsWith('dart:') ||
- path.startsWith('data:') ||
- path.startsWith('file:')) {
- script = Uri.parse(path);
- } else {
- script = Uri.base.resolveUri(new Uri.file(path));
- }
- VMLibraryHooks.platformScript = script;
+ VMLibraryHooks.platformScript = (() {
+ if (path.startsWith('http:') ||
+ path.startsWith('https:') ||
+ path.startsWith('package:') ||
+ path.startsWith('dart:') ||
+ path.startsWith('data:') ||
+ path.startsWith('file:')) {
+ return Uri.parse(path);
+ } else {
+ return Uri.base.resolveUri(new Uri.file(path));
+ }
+ });
}
}
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/patch/io_patch.dart ('k') | runtime/lib/internal_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698