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

Unified Diff: pkg/analyzer/lib/src/summary/summarize_elements.dart

Issue 1725913002: Add file hashes to SdkBundle; rename to PackageBundle. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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: pkg/analyzer/lib/src/summary/summarize_elements.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_elements.dart b/pkg/analyzer/lib/src/summary/summarize_elements.dart
index 50f6f7ca75af5e8d8b4aae031449e671c1b5beca..afd3ab1e00ce94fcb6de287ef7ab6353139c0641 100644
--- a/pkg/analyzer/lib/src/summary/summarize_elements.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart
@@ -26,8 +26,8 @@ LibrarySerializationResult serializeLibrary(
LibraryElement lib, TypeProvider typeProvider, bool strongMode) {
var serializer = new _LibrarySerializer(lib, typeProvider, strongMode);
LinkedLibraryBuilder linked = serializer.serializeLibrary();
- return new LibrarySerializationResult(
- linked, serializer.unlinkedUnits, serializer.unitUris);
+ return new LibrarySerializationResult(linked, serializer.unlinkedUnits,
+ serializer.unitUris, serializer.unitSources);
}
ReferenceKind _getReferenceKind(Element element) {
@@ -95,7 +95,14 @@ class LibrarySerializationResult {
*/
final List<String> unitUris;
- LibrarySerializationResult(this.linked, this.unlinkedUnits, this.unitUris);
+ /**
+ * Source object corresponding to each compilation unit appearing in the
+ * library.
+ */
+ final List<Source> unitSources;
+
+ LibrarySerializationResult(
+ this.linked, this.unlinkedUnits, this.unitUris, this.unitSources);
}
/**
@@ -130,9 +137,9 @@ class _CompilationUnitSerializer {
*/
final UnlinkedUnitBuilder unlinkedUnit = new UnlinkedUnitBuilder();
-/**
- * Absolute URI of the compilation unit.
- */
+ /**
+ * Absolute URI of the compilation unit.
+ */
String unitUri;
/**
@@ -182,6 +189,11 @@ class _CompilationUnitSerializer {
this.librarySerializer, this.compilationUnit, this.unitNum);
/**
+ * Source object for the compilation unit.
+ */
+ Source get unitSource => compilationUnit.source;
+
+ /**
* Add all classes, enums, typedefs, executables, and top level variables
* from the given compilation unit [element] to the compilation unit summary.
* [unitNum] indicates the ordinal position of this compilation unit in the
@@ -1317,6 +1329,13 @@ class _LibrarySerializer {
}
/**
+ * Retrieve a list of the Sources for the compilation units in the library.
+ */
+ List<String> get unitSources => compilationUnitSerializers
+ .map((_CompilationUnitSerializer s) => s.unitSource)
+ .toList();
+
+ /**
* Retrieve a list of the URIs for the compilation units in the library.
*/
List<String> get unitUris => compilationUnitSerializers

Powered by Google App Engine
This is Rietveld 408576698