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

Unified Diff: runtime/bin/builtin.dart

Issue 15966002: Add support for loading scripts from http (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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
Index: runtime/bin/builtin.dart
diff --git a/runtime/bin/builtin.dart b/runtime/bin/builtin.dart
index 5eb32ad712903d537a899c97b6294879e40e18ba..5d0cda91051a2a4d0f0229555ddea17447f82fd8 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -108,6 +108,9 @@ String _filePathFromUri(String userUri, bool isWindows) {
case 'package':
path = _filePathFromPackageUri(uri);
break;
+ case 'http':
+ path = _filePathFromHttpUri(uri);
+ break;
default:
// Only handling file and package URIs in standalone binary.
_logResolution("# Unknown scheme (${uri.scheme}) in $uri.");
@@ -164,3 +167,23 @@ String _filePathFromPackageUri(Uri uri) {
_logResolution("# Package: $path");
return path;
}
+
+String _filePathFromHttpUri(Uri uri) {
+ _logResolution('# Path: $uri');
+ return uri.toString();
+}
+
+String _pathFromHttpUri(String userUri) {
+ var uri = Uri.parse(userUri);
+ return uri.path;
+}
+
+String _domainFromHttpUri(String userUri) {
+ var uri = Uri.parse(userUri);
+ return uri.domain;
+}
+
+int _portFromHttpUri(String userUri) {
+ var uri = Uri.parse(userUri);
+ return uri.port == 0 ? 80 : uri.port;
+}

Powered by Google App Engine
This is Rietveld 408576698