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

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

Issue 1124113004: Get AnalysisCache from InternalAnalysisContext. (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 cb756991194215bc10717cb9ee8e30c78a25f67c..6b970fa438090a3954d7d21aafbf5917a8ca9136 100644
--- a/pkg/analyzer/lib/src/context/cache.dart
+++ b/pkg/analyzer/lib/src/context/cache.dart
@@ -40,11 +40,7 @@ class AnalysisCache {
* so the most specific partition (usually an [SdkCachePartition]) should be
* first and the most general (usually a [UniversalCachePartition]) last.
*/
- AnalysisCache(this._partitions) {
- for (CachePartition partition in _partitions) {
- partition._cache = this;
- }
- }
+ AnalysisCache(this._partitions);
// TODO(brianwilkerson) Implement or delete this.
// /**
@@ -605,15 +601,6 @@ class CacheFlushManager<T> {
*/
abstract class CachePartition {
/**
- * The [AnalysisCache] that owns this partition.
- *
- * TODO(scheglov) It seems wrong. Partitions may be shared between caches.
- * But we need a way to go from every "enclosing" partition into "enclosed"
- * ones.
- */
- AnalysisCache _cache;
-
- /**
* The context that owns this partition. Multiple contexts can reference a
* partition, but only one context can own it.
*/
@@ -720,7 +707,7 @@ abstract class CachePartition {
int size() => _targetMap.length;
ResultData _getDataFor(TargetedResult result) {
- return _cache._getDataFor(result);
+ return context.analysisCache._getDataFor(result);
}
/**
@@ -860,6 +847,9 @@ class SdkCachePartition extends CachePartition {
@override
bool contains(AnalysisTarget target) {
+ if (target is AnalysisContextTarget) {
+ return true;
+ }
Source source = target.source;
return source != null && source.isInSystemLibrary;
}
« 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