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

Unified Diff: sdk/lib/mirrors/mirrors.dart

Issue 1095903002: Deal with deferred loading in the VM mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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/vm/dart_api_impl.cc ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/mirrors/mirrors.dart
diff --git a/sdk/lib/mirrors/mirrors.dart b/sdk/lib/mirrors/mirrors.dart
index db7594d829ae1db9b396c5802470c22edd369251..715342430186bd2824323216a6f574a61de82c7f 100644
--- a/sdk/lib/mirrors/mirrors.dart
+++ b/sdk/lib/mirrors/mirrors.dart
@@ -55,6 +55,8 @@
*/
library dart.mirrors;
+import 'dart:async' show Future;
+
/**
* A [MirrorSystem] is the main interface used to reflect on a set of
* associated libraries.
@@ -69,8 +71,10 @@ library dart.mirrors;
*/
abstract class MirrorSystem {
/**
- * Returns an immutable map from URIs to mirrors for all
- * libraries known to this mirror system.
+ * Returns an immutable map from URIs to mirrors for all libraries known
+ * to this mirror system. For a runtime mirror system, only libraries which
+ * are currently loaded are included, and repeated calls of this method may
+ * return different maps as libraries are loaded.
*/
Map<Uri, LibraryMirror> get libraries;
@@ -612,7 +616,8 @@ abstract class LibraryDependencyMirror implements Mirror {
/// [targetLibrary].
LibraryMirror get sourceLibrary;
- /// Returns the library mirror of the library that is imported or exported.
+ /// Returns the library mirror of the library that is imported or exported,
+ /// or null if the library is not loaded.
LibraryMirror get targetLibrary;
/// Returns the prefix if this is a prefixed import and `null` otherwise.
@@ -626,6 +631,11 @@ abstract class LibraryDependencyMirror implements Mirror {
SourceLocation get location;
List<InstanceMirror> get metadata;
+
+ /// Returns a future that completes with a library mirror on the library being
+ /// imported or exported when it is loaded, and initiates a load of that
+ /// library if it is not loaded.
+ Future<LibraryMirror> loadLibrary();
}
/// A mirror on a show/hide combinator declared on a library dependency.
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698