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

Unified Diff: pkg/compiler/lib/src/library_loader.dart

Issue 2024783003: Support references to unserialized libraries. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | pkg/compiler/lib/src/serialization/serialization.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/serialization/serialization.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698