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

Unified Diff: pkg/analyzer/lib/src/dart/analysis/driver.dart

Issue 2829253002: Add support for external summaries bundle in AnalysisDriver. (Closed)
Patch Set: Fixes for review comments. Created 3 years, 8 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/analyzer/lib/src/dart/analysis/file_state.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/analysis/driver.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index 4a9c6f524775360fc16e733917caeb7c5f78bd90..ad38bcae6cdeb84f3d7d15e71e162f6d2f2d1097 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -30,6 +30,7 @@ import 'package:analyzer/src/lint/registry.dart' as linter;
import 'package:analyzer/src/summary/api_signature.dart';
import 'package:analyzer/src/summary/format.dart';
import 'package:analyzer/src/summary/idl.dart';
+import 'package:analyzer/src/summary/package_bundle_reader.dart';
import 'package:meta/meta.dart';
/**
@@ -105,6 +106,13 @@ class AnalysisDriver implements AnalysisDriverGeneric {
final ByteStore _byteStore;
/**
+ * The optional store with externally provided unlinked and corresponding
+ * linked summaries. These summaries are always added to the store for any
+ * file analysis.
+ */
+ final SummaryDataStore _externalSummaries;
+
+ /**
* This [ContentCache] is consulted for a file content before reading
* the content from the file.
*/
@@ -276,10 +284,12 @@ class AnalysisDriver implements AnalysisDriverGeneric {
SourceFactory sourceFactory,
this._analysisOptions,
{PackageBundle sdkBundle,
- this.disableChangesAndCacheAllResults: false})
+ this.disableChangesAndCacheAllResults: false,
+ SummaryDataStore externalSummaries})
: _logger = logger,
_sourceFactory = sourceFactory.clone(),
- _sdkBundle = sdkBundle {
+ _sdkBundle = sdkBundle,
+ _externalSummaries = externalSummaries {
_onResults = _resultController.stream.asBroadcastStream();
_testView = new AnalysisDriverTestView(this);
_createFileTracker(logger);
@@ -1075,8 +1085,16 @@ class AnalysisDriver implements AnalysisDriverGeneric {
*/
void _createFileTracker(PerformanceLog logger) {
_fillSalt();
- _fileTracker = new FileTracker(logger, _byteStore, _contentOverlay,
- _resourceProvider, sourceFactory, _analysisOptions, _salt, _changeHook);
+ _fileTracker = new FileTracker(
+ logger,
+ _byteStore,
+ _contentOverlay,
+ _resourceProvider,
+ sourceFactory,
+ _analysisOptions,
+ _salt,
+ _externalSummaries,
+ _changeHook);
}
/**
@@ -1091,7 +1109,8 @@ class AnalysisDriver implements AnalysisDriverGeneric {
_analysisOptions,
declaredVariables,
_sourceFactory,
- _fileTracker);
+ _externalSummaries,
+ fsState);
/**
* Fill [_salt] with data.
@@ -1530,6 +1549,16 @@ class AnalysisDriverTestView {
FileTracker get fileTracker => driver._fileTracker;
Map<String, AnalysisResult> get priorityResults => driver._priorityResults;
+
+ SummaryDataStore getSummaryStore(String libraryPath) {
+ FileState library = driver.fsState.getFileForPath(libraryPath);
+ LibraryContext libraryContext = driver._createLibraryContext(library);
+ try {
+ return libraryContext.store;
+ } finally {
+ libraryContext.dispose();
+ }
+ }
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/analysis/file_state.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698