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

Unified Diff: runtime/bin/dartutils.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: 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 | « no previous file | runtime/bin/loader.cc » ('j') | runtime/include/dart_api.h » ('J')
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 c0d607271f91657fe5cebc283e7facb461a8710e..a57ef87bf2657c5ef7b1a47b0f52ac2337b0ad1b 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -408,11 +408,12 @@ 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);
+ Dart_Handle library_url = Dart_LibraryUrl(library);
+ if (Dart_IsError(library_url)) {
Cutch 2016/06/14 21:38:31 Should this only happen if library_url is needed?
siva 2016/06/14 22:23:29 If you see further down in the else branch it does
+ return library_url;
}
- if (!Dart_IsLibrary(library)) {
- return Dart_NewApiError("not a library");
+ if (tag == Dart_kCanonicalizeUrl) {
+ return Dart_DefaultCanonicalizeUrl(library_url, url);
}
if (!Dart_IsString(url)) {
return Dart_NewApiError("url is not a string");
@@ -422,7 +423,6 @@ Dart_Handle DartUtils::LibraryTagHandler(Dart_LibraryTag tag,
if (Dart_IsError(result)) {
return result;
}
- Dart_Handle library_url = Dart_LibraryUrl(library);
const char* library_url_string = NULL;
result = Dart_StringToCString(library_url, &library_url_string);
if (Dart_IsError(result)) {
« no previous file with comments | « no previous file | runtime/bin/loader.cc » ('j') | runtime/include/dart_api.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698