| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 /** | 5 /** |
| 6 * A function used to determine whether results should be collected for the | 6 * A function used to determine whether results should be collected for the |
| 7 * file with the given [path]. | 7 * file with the given [path]. |
| 8 */ | 8 */ |
| 9 typedef bool ShouldCollectPredicate(String path); | 9 typedef bool ShouldCollectPredicate(String path); |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 /** | 21 /** |
| 22 * A function used to determine whether results should be collected for the | 22 * A function used to determine whether results should be collected for the |
| 23 * file whose path is passed in as an argument. | 23 * file whose path is passed in as an argument. |
| 24 */ | 24 */ |
| 25 final ShouldCollectPredicate _shouldCollect; | 25 final ShouldCollectPredicate _shouldCollect; |
| 26 | 26 |
| 27 /** | 27 /** |
| 28 * A multi-keyed map, where the first key is the (normalized and absolute) | 28 * A multi-keyed map, where the first key is the (normalized and absolute) |
| 29 * path to the file associated with the results, and the second is the id of | 29 * path to the file associated with the results, and the second is the id of |
| 30 * the plugin that provided the partial results. The value is the partial | 30 * the plugin that provided the partial results. The value is the partial |
| 31 * results contrinuted by the plugin for the file. | 31 * results contributed by the plugin for the file. |
| 32 */ | 32 */ |
| 33 Map<String, Map<String, E>> resultMap = <String, Map<String, E>>{}; | 33 Map<String, Map<String, E>> resultMap = <String, Map<String, E>>{}; |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * Initialize a newly created result manager. | 36 * Initialize a newly created result manager. |
| 37 */ | 37 */ |
| 38 ResultCollector(this.serverId, {ShouldCollectPredicate predicate}) | 38 ResultCollector(this.serverId, {ShouldCollectPredicate predicate}) |
| 39 : _shouldCollect = predicate; | 39 : _shouldCollect = predicate; |
| 40 | 40 |
| 41 /** | 41 /** |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 /** | 116 /** |
| 117 * Stop collecting results contributed for the file with the given [filePath]. | 117 * Stop collecting results contributed for the file with the given [filePath]. |
| 118 * Until the collector is told to start collecting results for the file, any | 118 * Until the collector is told to start collecting results for the file, any |
| 119 * results that are contributed for the file are discarded. | 119 * results that are contributed for the file are discarded. |
| 120 */ | 120 */ |
| 121 void stopCollectingFor(String filePath) { | 121 void stopCollectingFor(String filePath) { |
| 122 resultMap.remove(filePath); | 122 resultMap.remove(filePath); |
| 123 } | 123 } |
| 124 } | 124 } |
| OLD | NEW |