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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/lib/async_patch.dart

Issue 11784018: Skeleton API for lazy library loading. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Dummy implementations and tests of basic API, but not functionality Created 7 years, 10 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: dart/sdk/lib/_internal/compiler/implementation/lib/async_patch.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/lib/async_patch.dart b/dart/sdk/lib/_internal/compiler/implementation/lib/async_patch.dart
index 0e0a70d2e4620d53530b8b8eb24c3f0b2809d2d2..64c828963ccac5d3fba22b5aff259489f2a34a43 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/lib/async_patch.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/lib/async_patch.dart
@@ -38,3 +38,15 @@ patch class Timer {
return new TimerImpl.repeating(milliseconds, callback);
}
}
+
+final Set<String> _loadedLibraries = new Set<String>();
+
+patch class DeferredLibrary {
+ patch Future<bool> load() {
+ // TODO(ahe): Implement this.
+ Future future =
+ new Future<bool>.immediate(!_loadedLibraries.contains(libraryName));
+ _loadedLibraries.add(libraryName);
+ return future;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698