Index: pkg/compiler/lib/src/library_loader.dart |
diff --git a/pkg/compiler/lib/src/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart |
index efb4893b3940cce97d6f02680b52d4109b603609..9da31d6188cc9103c690665e835a67a71f0c22f1 100644 |
--- a/pkg/compiler/lib/src/library_loader.dart |
+++ b/pkg/compiler/lib/src/library_loader.dart |
@@ -131,7 +131,7 @@ typedef Future<Iterable<LibraryElement>> ReuseLibrariesFunction( |
* point to the 'packages' folder. |
* |
*/ |
-abstract class LibraryLoaderTask implements CompilerTask { |
+abstract class LibraryLoaderTask implements LibraryProvider, CompilerTask { |
factory LibraryLoaderTask( |
ResolvedUriTranslator uriTranslator, |
ScriptLoader scriptLoader, |
@@ -145,9 +145,6 @@ abstract class LibraryLoaderTask implements CompilerTask { |
/// Returns all libraries that have been loaded. |
Iterable<LibraryElement> get libraries; |
- /// Looks up the library with the [canonicalUri]. |
- LibraryElement lookupLibrary(Uri canonicalUri); |
- |
/// Loads the library specified by the [resolvedUri] and returns its |
/// [LibraryElement]. |
/// |
@@ -176,6 +173,14 @@ abstract class LibraryLoaderTask implements CompilerTask { |
Future<Null> resetLibraries(ReuseLibrariesFunction reuseLibraries); |
} |
+/// Interface for an entity that provide libraries. For instance from normal |
+/// library loading or from deserialization. |
+// TODO(johnniwinther): Use this to integrate deserialized libraries better. |
+abstract class LibraryProvider { |
+ /// Looks up the library with the [canonicalUri]. |
+ LibraryElement lookupLibrary(Uri canonicalUri); |
+} |
+ |
/// Handle for creating synthesized/patch libraries during library loading. |
abstract class LibraryLoader { |
/// This method must be called when a new synthesized/patch library has been |