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.task.model; | 5 library analyzer.task.model; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:developer'; | 8 import 'dart:developer'; |
9 | 9 |
10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
328 } | 328 } |
329 internalPerform(); | 329 internalPerform(); |
330 } finally { | 330 } finally { |
331 stopwatch.stop(); | 331 stopwatch.stop(); |
332 } | 332 } |
333 // } finally { | 333 // } finally { |
334 // previousTag.makeCurrent(); | 334 // previousTag.makeCurrent(); |
335 // } | 335 // } |
336 } on AnalysisException { | 336 } on AnalysisException { |
337 rethrow; | 337 rethrow; |
338 } on ModificationTimeMismatchError { | |
339 rethrow; | |
338 } catch (exception, stackTrace) { | 340 } catch (exception, stackTrace) { |
339 throw new AnalysisException( | 341 throw new AnalysisException( |
340 'Unexpected exception while performing $description', | 342 'Unexpected exception while performing $description', |
341 new CaughtException(exception, stackTrace)); | 343 new CaughtException(exception, stackTrace)); |
342 } | 344 } |
343 } | 345 } |
344 } | 346 } |
345 | 347 |
346 /** | 348 /** |
347 * A description of a [List]-based analysis result that can be computed by an | 349 * A description of a [List]-based analysis result that can be computed by an |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
416 * [V] must be a [List]. | 418 * [V] must be a [List]. |
417 * Return a task input that can be used to compute a list whose elements are | 419 * Return a task input that can be used to compute a list whose elements are |
418 * the result of passing keys [K] and the corresponding elements of [V] to | 420 * the result of passing keys [K] and the corresponding elements of [V] to |
419 * the [mapper] function. | 421 * the [mapper] function. |
420 */ | 422 */ |
421 TaskInput<List/*<E>*/ > toFlattenList/*<E>*/( | 423 TaskInput<List/*<E>*/ > toFlattenList/*<E>*/( |
422 BinaryFunction<K, dynamic /*element of V*/, dynamic/*=E*/ > mapper); | 424 BinaryFunction<K, dynamic /*element of V*/, dynamic/*=E*/ > mapper); |
423 } | 425 } |
424 | 426 |
425 /** | 427 /** |
428 * Instances of this class are thrown when a task detects that the modification | |
429 * time of a cache entry is not the same as the actual modification time. This | |
430 * means that any analysis results based on the content of the target cannot be | |
431 * used anymore and must be invalidated. | |
432 */ | |
433 class ModificationTimeMismatchError { | |
434 final AnalysisTarget target; | |
Brian Wilkerson
2016/06/08 22:21:55
I suspect this will always be a Source, but the ex
| |
435 | |
436 ModificationTimeMismatchError(this.target); | |
437 } | |
438 | |
439 /** | |
426 * A policy object that can compute sizes of results and provide the maximum | 440 * A policy object that can compute sizes of results and provide the maximum |
427 * active and idle sizes that can be kept in the cache. | 441 * active and idle sizes that can be kept in the cache. |
428 * | 442 * |
429 * All the [ResultDescriptor]s with the same [ResultCachingPolicy] instance | 443 * All the [ResultDescriptor]s with the same [ResultCachingPolicy] instance |
430 * share the same total size in a cache. | 444 * share the same total size in a cache. |
431 * | 445 * |
432 * Clients may implement this class when implementing plugins. | 446 * Clients may implement this class when implementing plugins. |
433 */ | 447 */ |
434 abstract class ResultCachingPolicy<T> { | 448 abstract class ResultCachingPolicy<T> { |
435 /** | 449 /** |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
771 /** | 785 /** |
772 * A work should be done, but without any special urgency. | 786 * A work should be done, but without any special urgency. |
773 */ | 787 */ |
774 NORMAL, | 788 NORMAL, |
775 | 789 |
776 /** | 790 /** |
777 * Nothing to do. | 791 * Nothing to do. |
778 */ | 792 */ |
779 NONE | 793 NONE |
780 } | 794 } |
OLD | NEW |