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

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 968533003: Discard previous overlay content on _sourceChanged() notification. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 82376bbd65fb35421f37d2b5afd739d37cb0d3ca..74d4e3b516daef8b445840ccd75e03d008eca627 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -15,7 +15,6 @@ import 'package:analyzer/src/cancelable_future.dart';
import 'package:analyzer/src/generated/incremental_resolution_validator.dart';
import 'package:analyzer/src/services/lint.dart';
import 'package:analyzer/src/task/task_dart.dart';
-import 'package:analyzer/src/util/lru_map.dart';
import '../../instrumentation/instrumentation.dart';
import 'ast.dart';
@@ -971,12 +970,6 @@ class AnalysisContextImpl implements InternalAnalysisContext {
ContentCache _contentCache = new ContentCache();
/**
- * A cache of content used to override the default content of a source
- * before the corresponding override was removed from [_contentCache].
- */
- LRUMap<Source, String> _prevOverlayCache = new LRUMap<Source, String>(5);
-
- /**
* The source factory used to create the sources that can be analyzed in this context.
*/
SourceFactory _sourceFactory;
@@ -2246,7 +2239,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
TimestampedData<String> fileContents = getContents(source);
String fileContentsData = fileContents.data;
if (fileContentsData == originalContents) {
- _prevOverlayCache.put(source, fileContentsData);
+ sourceEntry.setValue(SourceEntry.CONTENT, fileContentsData);
sourceEntry.modificationTime = fileContents.modificationTime;
changed = false;
}
@@ -5019,8 +5012,9 @@ class AnalysisContextImpl implements InternalAnalysisContext {
return;
}
// Check if the content of the source is the same as it was the last time.
- String sourceContent = _prevOverlayCache.get(source);
+ String sourceContent = sourceEntry.getValue(SourceEntry.CONTENT);
if (sourceContent != null) {
+ sourceEntry.setState(SourceEntry.CONTENT, CacheState.FLUSHED);
try {
TimestampedData<String> fileContents = getContents(source);
if (fileContents.data == sourceContent) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698