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

Unified Diff: runtime/bin/loader.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/bin/dartutils.cc ('k') | runtime/include/dart_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/loader.cc
diff --git a/runtime/bin/loader.cc b/runtime/bin/loader.cc
index a391b707e4abf65f1955b2b790b53b5b913dbf82..4b887ad2c785258894d464d464024f257b175d69 100644
--- a/runtime/bin/loader.cc
+++ b/runtime/bin/loader.cc
@@ -362,7 +362,11 @@ Dart_Handle Loader::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)) {
+ return library_url;
+ }
+ return Dart_DefaultCanonicalizeUrl(library_url, url);
}
const char* url_string = NULL;
Dart_Handle result = Dart_StringToCString(url, &url_string);
@@ -374,6 +378,9 @@ Dart_Handle Loader::LibraryTagHandler(Dart_LibraryTag tag,
if (tag != Dart_kScriptTag) {
// Grab the library's url.
Dart_Handle library_url = Dart_LibraryUrl(library);
+ if (Dart_IsError(library_url)) {
+ return library_url;
+ }
const char* library_url_string = NULL;
result = Dart_StringToCString(library_url, &library_url_string);
if (Dart_IsError(result)) {
@@ -399,6 +406,9 @@ Dart_Handle Loader::LibraryTagHandler(Dart_LibraryTag tag,
url_string);
}
Dart_Handle library_url = Dart_LibraryUrl(library);
+ if (Dart_IsError(library_url)) {
+ return library_url;
+ }
Dart_Handle library_file_path = DartUtils::LibraryFilePath(library_url);
const char* lib_path_str = NULL;
Dart_StringToCString(library_file_path, &lib_path_str);
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | runtime/include/dart_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698