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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 2068833002: Change Dart_DefaultCanonicalizeUrl to accept the library url string instead of a library, this is u… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address-code-review-comments Created 4 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/include/dart_api.h ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 1a0fab6568ba112cc25b82fecb27c5ede29ba18e..b9e9f554cd6c77f0784ed35103fa138a4c8e61b2 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -5171,24 +5171,23 @@ DART_EXPORT Dart_Handle Dart_SetLibraryTagHandler(
}
-DART_EXPORT Dart_Handle Dart_DefaultCanonicalizeUrl(Dart_Handle library,
+DART_EXPORT Dart_Handle Dart_DefaultCanonicalizeUrl(Dart_Handle base_url,
Dart_Handle url) {
API_TIMELINE_DURATION;
DARTSCOPE(Thread::Current());
CHECK_CALLBACK_STATE(T);
- const Library& lib = Api::UnwrapLibraryHandle(Z, library);
- if (lib.IsNull()) {
- RETURN_TYPE_ERROR(Z, library, Library);
+ const String& base_uri = Api::UnwrapStringHandle(Z, base_url);
+ if (base_uri.IsNull()) {
+ RETURN_TYPE_ERROR(Z, base_url, String);
}
const String& uri = Api::UnwrapStringHandle(Z, url);
if (uri.IsNull()) {
RETURN_TYPE_ERROR(Z, url, String);
}
- const String& lib_uri = String::Handle(Z, lib.url());
const char* resolved_uri;
- if (!ResolveUri(uri.ToCString(), lib_uri.ToCString(), &resolved_uri)) {
+ if (!ResolveUri(uri.ToCString(), base_uri.ToCString(), &resolved_uri)) {
return Api::NewError("%s: Unable to canonicalize uri '%s'.",
CURRENT_FUNC, uri.ToCString());
}
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698