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

Side by Side Diff: pkg/analyzer/lib/src/context/cache.dart

Issue 1420613003: Keep cache entries for explicitly added sources. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/cache_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.context.cache; 5 library analyzer.src.context.cache;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/src/generated/engine.dart' 10 import 'package:analyzer/src/generated/engine.dart'
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 // Stop depending on other results. 558 // Stop depending on other results.
559 TargetedResult thisResult = new TargetedResult(target, descriptor); 559 TargetedResult thisResult = new TargetedResult(target, descriptor);
560 for (TargetedResult dependedOnResult in thisData.dependedOnResults) { 560 for (TargetedResult dependedOnResult in thisData.dependedOnResults) {
561 ResultData data = _partition._getDataFor(dependedOnResult); 561 ResultData data = _partition._getDataFor(dependedOnResult);
562 if (data != null && deltaResult != DeltaResult.KEEP_CONTINUE) { 562 if (data != null && deltaResult != DeltaResult.KEEP_CONTINUE) {
563 data.dependentResults.remove(thisResult); 563 data.dependentResults.remove(thisResult);
564 } 564 }
565 } 565 }
566 // Invalidate results that depend on this result. 566 // Invalidate results that depend on this result.
567 _invalidateDependentResults(id, thisData, delta, level + 1); 567 _invalidateDependentResults(id, thisData, delta, level + 1);
568 // If empty, remove the entry altogether. 568 // If empty and not explicitly added, remove the entry altogether.
569 if (_resultMap.isEmpty) { 569 if (_resultMap.isEmpty && !explicitlyAdded) {
570 _partition._targetMap.remove(target); 570 _partition._targetMap.remove(target);
571 _partition._removeIfSource(target); 571 _partition._removeIfSource(target);
572 } 572 }
573 // Notify controller. 573 // Notify controller.
574 _partition.onResultInvalidated 574 _partition.onResultInvalidated
575 .add(new InvalidatedResult(this, descriptor, thisData.value)); 575 .add(new InvalidatedResult(this, descriptor, thisData.value));
576 } 576 }
577 577
578 /** 578 /**
579 * Invalidates all the results of this entry, with propagation. 579 * Invalidates all the results of this entry, with propagation.
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 void resultAccessed(TargetedResult result) {} 1226 void resultAccessed(TargetedResult result) {}
1227 1227
1228 @override 1228 @override
1229 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { 1229 List<TargetedResult> resultStored(TargetedResult newResult, newValue) {
1230 return TargetedResult.EMPTY_LIST; 1230 return TargetedResult.EMPTY_LIST;
1231 } 1231 }
1232 1232
1233 @override 1233 @override
1234 void targetRemoved(AnalysisTarget target) {} 1234 void targetRemoved(AnalysisTarget target) {}
1235 } 1235 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/cache_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698