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

Unified Diff: runtime/bin/dartutils.cc

Issue 16092007: HTTP loading tests and package root support (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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/builtin.dart ('k') | tests/standalone/http_launch_data/http_isolate_main.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index b55ae0b6fb3f75af889202e55d49ebebf16dbee2..fc9046942654246cd33e0bd4816867ac5d229c4c 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -563,14 +563,18 @@ Dart_Handle DartUtils::LoadScriptHttp(Dart_Handle uri,
Dart_Handle DartUtils::LoadScript(const char* script_uri,
Dart_Handle builtin_lib) {
- if (DartUtils::IsHttpSchemeURL(script_uri)) {
- return LoadScriptHttp(NewString(script_uri), builtin_lib);
- }
- Dart_Handle resolved_script_uri;
- resolved_script_uri = ResolveScriptUri(NewString(script_uri), builtin_lib);
+ // Always call ResolveScriptUri because as a side effect it sets
+ // the script entry path which is used when automatically resolving
+ // package root.
+ Dart_Handle resolved_script_uri =
+ ResolveScriptUri(NewString(script_uri), builtin_lib);
if (Dart_IsError(resolved_script_uri)) {
return resolved_script_uri;
}
+ // Handle http: requests separately.
+ if (DartUtils::IsHttpSchemeURL(script_uri)) {
+ return LoadScriptHttp(resolved_script_uri, builtin_lib);
+ }
Dart_Handle script_path = DartUtils::FilePathFromUri(resolved_script_uri,
builtin_lib);
if (Dart_IsError(script_path)) {
« no previous file with comments | « runtime/bin/builtin.dart ('k') | tests/standalone/http_launch_data/http_isolate_main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698