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

Unified Diff: runtime/bin/loader.cc

Issue 2837873005: Fix some assertion failures on Fuchsia (Closed)
Patch Set: . Created 3 years, 8 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/loader.h ('k') | runtime/bin/main.cc » ('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 de82be482639d729dd82c52a08cf82a723711f37..102fa47fec8e4b37d3b67f113fd17011837ee801 100644
--- a/runtime/bin/loader.cc
+++ b/runtime/bin/loader.cc
@@ -290,19 +290,37 @@ void Loader::AddDependencyLocked(Loader* loader, const char* resolved_uri) {
if (dependencies == NULL) {
return;
}
- uint8_t* scoped_file_path = NULL;
- intptr_t scoped_file_path_length = -1;
- Dart_Handle uri = Dart_NewStringFromCString(resolved_uri);
- ASSERT(!Dart_IsError(uri));
- Dart_Handle result = Loader::ResolveAsFilePath(uri, &scoped_file_path,
- &scoped_file_path_length);
- if (Dart_IsError(result)) {
- Log::Print("Error resolving dependency: %s\n", Dart_GetError(result));
+ dependencies->Add(strdup(resolved_uri));
+}
+
zra 2017/04/26 20:25:01 two newlines between functions.
rmacnak 2017/04/26 20:34:06 Done.
+void Loader::ResolveDependenciesAsFilePaths() {
+ IsolateData* isolate_data =
+ reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData());
+ ASSERT(isolate_data != NULL);
+ MallocGrowableArray<char*>* dependencies = isolate_data->dependencies();
+ if (dependencies == NULL) {
return;
}
- dependencies->Add(StringUtils::StrNDup(
- reinterpret_cast<const char*>(scoped_file_path),
- scoped_file_path_length));
+
+ for (intptr_t i = 0; i < dependencies->length(); i++) {
+ char* resolved_uri = (*dependencies)[i];
+
+ uint8_t* scoped_file_path = NULL;
+ intptr_t scoped_file_path_length = -1;
+ Dart_Handle uri = Dart_NewStringFromCString(resolved_uri);
+ ASSERT(!Dart_IsError(uri));
+ Dart_Handle result = Loader::ResolveAsFilePath(uri, &scoped_file_path,
+ &scoped_file_path_length);
+ if (Dart_IsError(result)) {
+ Log::Print("Error resolving dependency: %s\n", Dart_GetError(result));
+ return;
+ }
+
+ (*dependencies)[i] =
+ StringUtils::StrNDup(reinterpret_cast<const char*>(scoped_file_path),
+ scoped_file_path_length);
+ free(resolved_uri);
+ }
}
« no previous file with comments | « runtime/bin/loader.h ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698