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

Unified Diff: runtime/vm/unit_test.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/vm/isolate_reload_test.cc ('k') | runtime/vm/uri.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/unit_test.cc
diff --git a/runtime/vm/unit_test.cc b/runtime/vm/unit_test.cc
index f950c988c88f9758f347183f8f7deab6d66f4d52..903d79de48ebaa3c62525ddfeee0d19f7b5a81ae 100644
--- a/runtime/vm/unit_test.cc
+++ b/runtime/vm/unit_test.cc
@@ -75,7 +75,7 @@ static bool IsPackageSchemeURL(const char* url_name) {
static bool IsImportableTestLib(const char* url_name) {
- const char* kImportTestLibUri = "importable_test_lib";
+ const char* kImportTestLibUri = "test:importable_lib";
static const intptr_t kImportTestLibUriLen = strlen(kImportTestLibUri);
return (strncmp(url_name, kImportTestLibUri, kImportTestLibUriLen) == 0);
}
@@ -93,7 +93,7 @@ static Dart_Handle ImportableTestLibSource() {
static bool IsIsolateReloadTestLib(const char* url_name) {
- const char* kIsolateReloadTestLibUri = "isolate_reload_test_helper";
+ const char* kIsolateReloadTestLibUri = "test:isolate_reload_helper";
static const intptr_t kIsolateReloadTestLibUriLen =
strlen(kIsolateReloadTestLibUri);
return (strncmp(url_name,
@@ -139,6 +139,9 @@ static ThreadLocalKey script_reload_key = kUnsetThreadLocalKey;
static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
Dart_Handle library,
Dart_Handle url) {
+ if (tag == Dart_kCanonicalizeUrl) {
+ return Dart_DefaultCanonicalizeUrl(library, url);
+ }
if (tag == Dart_kScriptTag) {
// Reload request.
ASSERT(script_reload_key != kUnsetThreadLocalKey);
@@ -172,23 +175,6 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
bool is_dart_scheme_url = DartUtils::IsDartSchemeURL(url_chars);
bool is_io_library = DartUtils::IsDartIOLibURL(library_url_string);
- if (tag == Dart_kCanonicalizeUrl) {
- // Already canonicalized.
- if (IsImportableTestLib(url_chars) || IsIsolateReloadTestLib(url_chars)) {
- return url;
- }
- // If this is a Dart Scheme URL then it is not modified as it will be
- // handled by the VM internally.
- if (is_dart_scheme_url || is_io_library) {
- return url;
- }
-
- Dart_Handle library_url = Dart_LibraryUrl(library);
- if (Dart_IsError(library_url)) {
- return library_url;
- }
- return DartUtils::ResolveUri(library_url, url);
- }
if (is_dart_scheme_url) {
ASSERT(tag == Dart_kImportTag);
// Handle imports of other built-in libraries present in the SDK.
« no previous file with comments | « runtime/vm/isolate_reload_test.cc ('k') | runtime/vm/uri.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698