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

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

Issue 2681573002: Rename _FileBasedSummaryResynthesizer to StoreBasedSummaryResynthesizer. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/package_bundle_reader.dart
diff --git a/pkg/analyzer/lib/src/summary/package_bundle_reader.dart b/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
index cf8bfcd185723a72588d25782d7baaaae4865362..31c392b5c43c435ecb0d2fd5a6727ca5694bfe9e 100644
--- a/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
+++ b/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
@@ -119,7 +119,7 @@ abstract class ResynthesizerResultProvider extends ResultProvider {
final InternalAnalysisContext context;
final SummaryDataStore _dataStore;
- _FileBasedSummaryResynthesizer _resynthesizer;
+ StoreBasedSummaryResynthesizer _resynthesizer;
ResynthesizerResultProvider(this.context, this._dataStore);
@@ -266,7 +266,7 @@ abstract class ResynthesizerResultProvider extends ResultProvider {
* Subclasses must call this method in their constructors.
*/
void createResynthesizer() {
- _resynthesizer = new _FileBasedSummaryResynthesizer(context,
+ _resynthesizer = new StoreBasedSummaryResynthesizer(context,
context.sourceFactory, context.analysisOptions.strongMode, _dataStore);
}
@@ -279,6 +279,33 @@ abstract class ResynthesizerResultProvider extends ResultProvider {
}
/**
+ * A concrete resynthesizer that serves summaries from [SummaryDataStore].
+ */
+class StoreBasedSummaryResynthesizer extends SummaryResynthesizer {
+ final SummaryDataStore _dataStore;
+
+ StoreBasedSummaryResynthesizer(AnalysisContext context,
+ SourceFactory sourceFactory, bool strongMode, this._dataStore)
+ : super(context, sourceFactory, strongMode);
+
+ @override
+ LinkedLibrary getLinkedSummary(String uri) {
+ return _dataStore.linkedMap[uri];
+ }
+
+ @override
+ UnlinkedUnit getUnlinkedSummary(String uri) {
+ return _dataStore.unlinkedMap[uri];
+ }
+
+ @override
+ bool hasLibrarySummary(String uri) {
+ LinkedLibrary linkedLibrary = _dataStore.linkedMap[uri];
+ return linkedLibrary != null;
+ }
+}
+
+/**
* A [SummaryDataStore] is a container for the data extracted from a set of
* summary package bundles. It contains maps which can be used to find linked
* and unlinked summaries by URI.
@@ -412,30 +439,3 @@ class SummaryDataStore {
addBundle(path, bundle);
}
}
-
-/**
- * A concrete resynthesizer that serves summaries from given file paths.
- */
-class _FileBasedSummaryResynthesizer extends SummaryResynthesizer {
- final SummaryDataStore _dataStore;
-
- _FileBasedSummaryResynthesizer(AnalysisContext context,
- SourceFactory sourceFactory, bool strongMode, this._dataStore)
- : super(context, sourceFactory, strongMode);
-
- @override
- LinkedLibrary getLinkedSummary(String uri) {
- return _dataStore.linkedMap[uri];
- }
-
- @override
- UnlinkedUnit getUnlinkedSummary(String uri) {
- return _dataStore.unlinkedMap[uri];
- }
-
- @override
- bool hasLibrarySummary(String uri) {
- LinkedLibrary linkedLibrary = _dataStore.linkedMap[uri];
- return linkedLibrary != null;
- }
-}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698