| Index: pkg/analyzer/lib/src/generated/engine.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
|
| index 4ddc93d4989d2f9dc288e57c70f7d84af01b4c0f..9cd12c7c6c0c394ab7d0c5859ae79012e407636d 100644
|
| --- a/pkg/analyzer/lib/src/generated/engine.dart
|
| +++ b/pkg/analyzer/lib/src/generated/engine.dart
|
| @@ -629,14 +629,6 @@ abstract class AnalysisContext {
|
| * so that the default contents will be returned.
|
| */
|
| void setContents(Source source, String contents);
|
| -
|
| - /**
|
| - * Check the cache for any invalid entries (entries whose modification time
|
| - * does not match the modification time of the source associated with the
|
| - * entry). Invalid entries will be marked as invalid so that the source will
|
| - * be re-analyzed. Return `true` if at least one entry was invalid.
|
| - */
|
| - bool validateCacheConsistency();
|
| }
|
|
|
| /**
|
| @@ -1572,6 +1564,31 @@ class CacheConsistencyValidationStatistics {
|
| }
|
|
|
| /**
|
| + * Interface for cache consistency validation in an [InternalAnalysisContext].
|
| + */
|
| +abstract class CacheConsistencyValidator {
|
| + /**
|
| + * Return sources for which the contexts needs to know modification times.
|
| + */
|
| + List<Source> getSourcesToComputeModificationTimes();
|
| +
|
| + /**
|
| + * Notify the validator that modification [times] were computed for [sources].
|
| + * If a source does not exist, its modification time is `-1`.
|
| + *
|
| + * It's up to the validator and the context how to use this information,
|
| + * the list of sources the context has might have been changed since the
|
| + * previous invocation of [getSourcesToComputeModificationTimes].
|
| + *
|
| + * Check the cache for any invalid entries (entries whose modification time
|
| + * does not match the modification time of the source associated with the
|
| + * entry). Invalid entries will be marked as invalid so that the source will
|
| + * be re-analyzed. Return `true` if at least one entry was invalid.
|
| + */
|
| + bool sourceModificationTimesComputed(List<Source> sources, List<int> times);
|
| +}
|
| +
|
| +/**
|
| * The possible states of cached data.
|
| */
|
| class CacheState extends Enum<CacheState> {
|
| @@ -2056,6 +2073,11 @@ abstract class InternalAnalysisContext implements AnalysisContext {
|
| AnalysisCache get analysisCache;
|
|
|
| /**
|
| + * The cache consistency validator for this context.
|
| + */
|
| + CacheConsistencyValidator get cacheConsistencyValidator;
|
| +
|
| + /**
|
| * Allow the client to supply its own content cache. This will take the
|
| * place of the content cache created by default, allowing clients to share
|
| * the content cache between contexts.
|
|
|