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

Unified Diff: sdk/lib/_internal/compiler/js_lib/js_helper.dart

Issue 837903002: Fix deferred loading with multiple apps on same page. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressing comments Created 5 years, 11 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
Index: sdk/lib/_internal/compiler/js_lib/js_helper.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/js_helper.dart b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
index d2f38367b381e9d4d357e4e6a715f45953074e96..63a13931be7ac3c18a13c27912d7cba89619d9e0 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
@@ -15,6 +15,7 @@ import 'dart:_js_embedded_names' show
DEFERRED_LIBRARY_HASHES,
INITIALIZE_LOADED_HUNK,
IS_HUNK_LOADED,
+ IS_HUNK_INITIALIZED,
NATIVE_SUPERCLASS_TAG_NAME;
import 'dart:collection';
@@ -3313,15 +3314,18 @@ Future<Null> loadDeferredLibrary(String loadId) {
// The indices into `uris` and `hashes` that we want to load.
List<int> indices = new List.generate(uris.length, (i) => i);
var isHunkLoaded = JS_EMBEDDED_GLOBAL('', IS_HUNK_LOADED);
+ var isHunkInitialized = JS_EMBEDDED_GLOBAL('', IS_HUNK_INITIALIZED);
// Filter away indices for hunks that have already been loaded.
List<int> indicesToLoad = indices
.where((int i) => !JS('bool','#(#)', isHunkLoaded, hashes[i]))
.toList();
- // Load the needed hunks.
+ List<int> indicesToInitialize = indices
+ .where((int i) => !JS('bool','#(#)', isHunkInitialized, hashes[i]))
+ .toList(); // Load the needed hunks.
return Future.wait(indicesToLoad
.map((int i) => _loadHunk(uris[i]))).then((_) {
// Now all hunks have been loaded, we run the needed initializers.
- for (int i in indicesToLoad) {
+ for (int i in indicesToInitialize) {
var initializer = JS_EMBEDDED_GLOBAL('', INITIALIZE_LOADED_HUNK);
JS('void', '#(#)', initializer, hashes[i]);
}
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart ('k') | sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698