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

Unified Diff: runtime/bin/dartutils.cc

Issue 2011543002: Canonicalize uris in C++ instead of Dart for the standalone embedder. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fixz release build Created 4 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
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/gen_snapshot.cc » ('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 b7f418b7a7cab7c68bbed5b6373039ae6fb55c26..8be3b29a3ce8bfea25422945f16c5ff7c86f0542 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -367,18 +367,6 @@ Dart_Handle DartUtils::LibraryFilePath(Dart_Handle library_uri) {
}
-Dart_Handle DartUtils::ResolveUri(Dart_Handle library_url, Dart_Handle url) {
- const int kNumArgs = 2;
- Dart_Handle dart_args[kNumArgs];
- dart_args[0] = library_url;
- dart_args[1] = url;
- return Dart_Invoke(DartUtils::BuiltinLib(),
- NewString("_resolveUri"),
- kNumArgs,
- dart_args);
-}
-
-
static Dart_Handle LoadDataAsync_Invoke(Dart_Handle tag,
Dart_Handle url,
Dart_Handle library_url) {
@@ -397,6 +385,9 @@ static Dart_Handle LoadDataAsync_Invoke(Dart_Handle tag,
Dart_Handle DartUtils::LibraryTagHandler(Dart_LibraryTag tag,
Dart_Handle library,
Dart_Handle url) {
+ if (tag == Dart_kCanonicalizeUrl) {
+ return Dart_DefaultCanonicalizeUrl(library, url);
+ }
if (!Dart_IsLibrary(library)) {
return Dart_NewApiError("not a library");
}
@@ -420,10 +411,7 @@ Dart_Handle DartUtils::LibraryTagHandler(Dart_LibraryTag tag,
// Handle canonicalization, 'import' and 'part' of 'dart:' libraries.
if (is_dart_scheme_url || is_dart_library) {
- if (tag == Dart_kCanonicalizeUrl) {
- // These will be handled internally.
- return url;
- } else if (tag == Dart_kImportTag) {
+ if (tag == Dart_kImportTag) {
Builtin::BuiltinLibraryId id = Builtin::FindId(url_string);
if (id == Builtin::kInvalidLibrary) {
return NewError("The built-in library '%s' is not available"
@@ -452,11 +440,6 @@ Dart_Handle DartUtils::LibraryTagHandler(Dart_LibraryTag tag,
UNREACHABLE();
}
- if (tag == Dart_kCanonicalizeUrl) {
- // Resolve the url within the context of the library's URL.
- return ResolveUri(library_url, url);
- }
-
if (DartUtils::IsDartExtensionSchemeURL(url_string)) {
// Load a native code shared library to use in a native extension
if (tag != Dart_kImportTag) {
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/gen_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698