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/exception/exception.dart'; | 10 import 'package:analyzer/exception/exception.dart'; |
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 } | 1222 } |
1223 } | 1223 } |
1224 } | 1224 } |
1225 } | 1225 } |
1226 | 1226 |
1227 /** | 1227 /** |
1228 * Return the [CacheFlushManager] for the given [descriptor], not `null`. | 1228 * Return the [CacheFlushManager] for the given [descriptor], not `null`. |
1229 */ | 1229 */ |
1230 CacheFlushManager _getFlushManager(ResultDescriptor descriptor) { | 1230 CacheFlushManager _getFlushManager(ResultDescriptor descriptor) { |
1231 ResultCachingPolicy policy = descriptor.cachingPolicy; | 1231 ResultCachingPolicy policy = descriptor.cachingPolicy; |
1232 if (identical(policy, DEFAULT_CACHING_POLICY)) { | 1232 if (identical(policy, DEFAULT_CACHING_POLICY) || |
| 1233 context.analysisOptions.disableCacheFlushing) { |
1233 return UnlimitedCacheFlushManager.INSTANCE; | 1234 return UnlimitedCacheFlushManager.INSTANCE; |
1234 } | 1235 } |
1235 CacheFlushManager manager = _flushManagerMap[policy]; | 1236 CacheFlushManager manager = _flushManagerMap[policy]; |
1236 if (manager == null) { | 1237 if (manager == null) { |
1237 manager = new CacheFlushManager(policy, _isPriorityAnalysisTarget); | 1238 manager = new CacheFlushManager(policy, _isPriorityAnalysisTarget); |
1238 _flushManagerMap[policy] = manager; | 1239 _flushManagerMap[policy] = manager; |
1239 } | 1240 } |
1240 return manager; | 1241 return manager; |
1241 } | 1242 } |
1242 | 1243 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1539 void resultAccessed(TargetedResult result) {} | 1540 void resultAccessed(TargetedResult result) {} |
1540 | 1541 |
1541 @override | 1542 @override |
1542 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { | 1543 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { |
1543 return TargetedResult.EMPTY_LIST; | 1544 return TargetedResult.EMPTY_LIST; |
1544 } | 1545 } |
1545 | 1546 |
1546 @override | 1547 @override |
1547 void targetRemoved(AnalysisTarget target) {} | 1548 void targetRemoved(AnalysisTarget target) {} |
1548 } | 1549 } |
OLD | NEW |