| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |