| 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/dart/element/element.dart' | 10 import 'package:analyzer/src/dart/element/element.dart' |
| (...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 */ | 1086 */ |
| 1087 KEEP_CONTINUE, | 1087 KEEP_CONTINUE, |
| 1088 | 1088 |
| 1089 /** | 1089 /** |
| 1090 * Keep this result and stop visiting results that depend on this one. | 1090 * Keep this result and stop visiting results that depend on this one. |
| 1091 */ | 1091 */ |
| 1092 STOP | 1092 STOP |
| 1093 } | 1093 } |
| 1094 | 1094 |
| 1095 /** | 1095 /** |
| 1096 * [InvalidatedResult] describes an invalidated result. | |
| 1097 */ | |
| 1098 class InvalidatedResult { | |
| 1099 /** | |
| 1100 * The target in which the result was invalidated. | |
| 1101 */ | |
| 1102 final CacheEntry entry; | |
| 1103 | |
| 1104 /** | |
| 1105 * The descriptor of the result which was invalidated. | |
| 1106 */ | |
| 1107 final ResultDescriptor descriptor; | |
| 1108 | |
| 1109 /** | |
| 1110 * The value of the result which was invalidated. | |
| 1111 */ | |
| 1112 final Object value; | |
| 1113 | |
| 1114 InvalidatedResult(this.entry, this.descriptor, this.value); | |
| 1115 | |
| 1116 @override | |
| 1117 String toString() => '$descriptor of ${entry.target}'; | |
| 1118 } | |
| 1119 | |
| 1120 /** | |
| 1121 * A Stream-like interface, which broadcasts events synchronously. | 1096 * A Stream-like interface, which broadcasts events synchronously. |
| 1122 * If a second event is fired while delivering a first event, then the second | 1097 * If a second event is fired while delivering a first event, then the second |
| 1123 * event will be delivered first, and then delivering of the first will be | 1098 * event will be delivered first, and then delivering of the first will be |
| 1124 * continued. | 1099 * continued. |
| 1125 */ | 1100 */ |
| 1126 class ReentrantSynchronousStream<T> { | 1101 class ReentrantSynchronousStream<T> { |
| 1127 final List<Function> listeners = <Function>[]; | 1102 final List<Function> listeners = <Function>[]; |
| 1128 | 1103 |
| 1129 /** | 1104 /** |
| 1130 * Send the given [event] to the stream. | 1105 * Send the given [event] to the stream. |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1268 void resultAccessed(TargetedResult result) {} | 1243 void resultAccessed(TargetedResult result) {} |
| 1269 | 1244 |
| 1270 @override | 1245 @override |
| 1271 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { | 1246 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { |
| 1272 return TargetedResult.EMPTY_LIST; | 1247 return TargetedResult.EMPTY_LIST; |
| 1273 } | 1248 } |
| 1274 | 1249 |
| 1275 @override | 1250 @override |
| 1276 void targetRemoved(AnalysisTarget target) {} | 1251 void targetRemoved(AnalysisTarget target) {} |
| 1277 } | 1252 } |
| OLD | NEW |