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

Unified Diff: pkg/analyzer/lib/src/context/cache.dart

Issue 1129033003: When a target is removed, invalidate all dependent results. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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/context/context.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/cache.dart
diff --git a/pkg/analyzer/lib/src/context/cache.dart b/pkg/analyzer/lib/src/context/cache.dart
index be6bd3482c17edd210afcaebaddf01003140df2c..5a4ef821039309718ec4b25bbf6d8c305dc0c544 100644
--- a/pkg/analyzer/lib/src/context/cache.dart
+++ b/pkg/analyzer/lib/src/context/cache.dart
@@ -434,6 +434,16 @@ class CacheEntry {
}
/**
+ * Invalidates all the results of this entry, with propagation.
+ */
+ void _invalidateAll() {
+ List<ResultDescriptor> results = _resultMap.keys.toList();
+ for (ResultDescriptor result in results) {
+ _invalidate(result, true);
+ }
+ }
+
+ /**
* Set the [dependedOn] on which this result depends.
*/
void _setDependedOnResults(ResultData thisData, TargetedResult thisResult,
@@ -716,7 +726,10 @@ abstract class CachePartition {
for (CacheFlushManager flushManager in _flushManagerMap.values) {
flushManager.targetRemoved(target);
}
- _targetMap.remove(target);
+ CacheEntry entry = _targetMap.remove(target);
+ if (entry != null) {
+ entry._invalidateAll();
+ }
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/context/context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698