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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 @patch 5 @patch
6 class _Platform { 6 class _Platform {
7 @patch 7 @patch
8 static int _numberOfProcessors() native "Platform_NumberOfProcessors"; 8 static int _numberOfProcessors() native "Platform_NumberOfProcessors";
9 @patch 9 @patch
10 static String _pathSeparator() native "Platform_PathSeparator"; 10 static String _pathSeparator() native "Platform_PathSeparator";
(...skipping 14 matching lines...) Expand all
25 static String _version() native "Platform_GetVersion"; 25 static String _version() native "Platform_GetVersion";
26 26
27 @patch 27 @patch
28 static String _localeName() native "Platform_LocaleName"; 28 static String _localeName() native "Platform_LocaleName";
29 29
30 @patch 30 @patch
31 static String _packageRoot() => VMLibraryHooks.packageRootString; 31 static String _packageRoot() => VMLibraryHooks.packageRootString;
32 @patch 32 @patch
33 static String _packageConfig() => VMLibraryHooks.packageConfigString; 33 static String _packageConfig() => VMLibraryHooks.packageConfigString;
34 34
35 @patch
36 static Uri _script() => VMLibraryHooks.platformScript;
37
35 // This script singleton is written to by the embedder if applicable. 38 // This script singleton is written to by the embedder if applicable.
36 static void set _nativeScript(String path) { 39 static void set _nativeScript(String path) {
zra 2017/07/24 15:32:48 In the standalone VM, this setter is called from t
37 if (path.startsWith('http:') || 40 VMLibraryHooks.platformScript = (() {
38 path.startsWith('https:') || 41 if (path.startsWith('http:') ||
39 path.startsWith('package:') || 42 path.startsWith('https:') ||
40 path.startsWith('dart:') || 43 path.startsWith('package:') ||
41 path.startsWith('data:') || 44 path.startsWith('dart:') ||
42 path.startsWith('file:')) { 45 path.startsWith('data:') ||
43 script = Uri.parse(path); 46 path.startsWith('file:')) {
44 } else { 47 return Uri.parse(path);
45 script = Uri.base.resolveUri(new Uri.file(path)); 48 } else {
46 } 49 return Uri.base.resolveUri(new Uri.file(path));
47 VMLibraryHooks.platformScript = script; 50 }
51 });
48 } 52 }
49 } 53 }
OLDNEW
« 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