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

Unified Diff: runtime/lib/lib_prefix.dart

Issue 1998963003: Rework standalone to use a synchronous loader that does not invoke Dart code (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 | « runtime/include/dart_api.h ('k') | runtime/lib/vmservice.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/lib_prefix.dart
diff --git a/runtime/lib/lib_prefix.dart b/runtime/lib/lib_prefix.dart
index 4f509da5bff4a23e95cbea1eed136bfcd5357576..9d5af287e9e25e79f56e8ca99c2cb7e8318687c3 100644
--- a/runtime/lib/lib_prefix.dart
+++ b/runtime/lib/lib_prefix.dart
@@ -46,19 +46,27 @@ class _LibraryPrefix {
// second element is the Completer for the load request.
var _outstandingLoadRequests = new List<List>();
-// Called from the VM when all outstanding load requests have
-// finished.
+// Called from the VM when an outstanding load request has finished.
_completeDeferredLoads() {
+ // Determine which outstanding load requests have completed and complete
+ // their completer (with an error or true). For outstanding load requests
+ // which have not completed, remember them for next time in
+ // stillOutstandingLoadRequests.
+ var stillOutstandingLoadRequests = new List<List>();
for (int i = 0; i < _outstandingLoadRequests.length; i++) {
var prefix = _outstandingLoadRequests[i][0];
- var completer = _outstandingLoadRequests[i][1];
- var error = prefix._loadError();
- if (error != null) {
- completer.completeError(error);
+ if (prefix._load()) {
+ var completer = _outstandingLoadRequests[i][1];
+ var error = prefix._loadError();
+ if (error != null) {
+ completer.completeError(error);
+ } else {
+ prefix._invalidateDependentCode();
+ completer.complete(true);
+ }
} else {
- prefix._invalidateDependentCode();
- completer.complete(true);
+ stillOutstandingLoadRequests.add(_outstandingLoadRequests[i]);
}
}
- _outstandingLoadRequests.clear();
+ _outstandingLoadRequests = stillOutstandingLoadRequests;
}
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/lib/vmservice.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698