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

Unified Diff: runtime/bin/main.cc

Issue 10103031: Refactor URI processing of native extensions directive #import("dart-ext:foo"). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 8 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/extensions_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index e0bee3ad42379b58dc3fe2279b1c2f3c84ecf6b0..f6613c31f98fe75c7e941cfc7ae0a02c1d9deaa5 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -263,13 +263,8 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
Dart_Handle dart_args[2];
dart_args[0] = library_url;
dart_args[1] = url;
- if (is_dart_extension_url) {
- return Dart_Invoke(
- builtin_lib, Dart_NewString("_resolveExtensionUri"), 2, dart_args);
- } else {
- return Dart_Invoke(
- builtin_lib, Dart_NewString("_resolveUri"), 2, dart_args);
- }
+ return Dart_Invoke(
+ builtin_lib, Dart_NewString("_resolveUri"), 2, dart_args);
}
if (is_dart_scheme_url) {
ASSERT(tag == kImportTag);
@@ -285,11 +280,6 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
} else {
return Dart_Error("Do not know how to load '%s'", url_string);
}
- } else if (is_dart_extension_url) {
- if (tag != kImportTag) {
- return Dart_Error("Dart extensions must use import: '%s'", url_string);
- }
- return Extensions::LoadExtension(url_string, library);
} else {
// Get the file path out of the url.
Dart_Handle builtin_lib = Builtin::LoadLibrary(Builtin::kBuiltinLibrary);
@@ -302,6 +292,12 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
}
Dart_StringToCString(file_path, &url_string);
}
+ if (is_dart_extension_url) {
+ if (tag != kImportTag) {
+ return Dart_Error("Dart extensions must use import: '%s'", url_string);
+ }
+ return Extensions::LoadExtension(url_string, library);
+ }
result = DartUtils::LoadSource(NULL,
library,
url,
« no previous file with comments | « runtime/bin/extensions_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698