| 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;
|
| - }
|
| -}
|
|
|