Chromium Code Reviews| 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.task.driver; | 5 library analyzer.src.task.driver; |
| 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/context/cache.dart'; | 10 import 'package:analyzer/src/context/cache.dart'; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 highestPriority = priority; | 119 highestPriority = priority; |
| 120 highestManager = manager; | 120 highestManager = manager; |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 // Nothing to do. | 123 // Nothing to do. |
| 124 if (highestPriority == WorkOrderPriority.NONE) { | 124 if (highestPriority == WorkOrderPriority.NONE) { |
| 125 return null; | 125 return null; |
| 126 } | 126 } |
| 127 // Create a new WorkOrder. | 127 // Create a new WorkOrder. |
| 128 TargetedResult request = highestManager.getNextResult(); | 128 TargetedResult request = highestManager.getNextResult(); |
| 129 // print('request: $request'); | |
| 129 if (request != null) { | 130 if (request != null) { |
| 130 WorkOrder workOrder = | 131 WorkOrder workOrder = |
| 131 createWorkOrderForResult(request.target, request.result); | 132 createWorkOrderForResult(request.target, request.result); |
| 132 if (workOrder != null) { | 133 if (workOrder != null) { |
| 133 return workOrder; | 134 return workOrder; |
| 134 } | 135 } |
| 135 } | 136 } |
| 136 } | 137 } |
| 137 } | 138 } |
| 138 | 139 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 isTaskRunning = false; | 226 isTaskRunning = false; |
| 226 } | 227 } |
| 227 } | 228 } |
| 228 | 229 |
| 229 /** | 230 /** |
| 230 * Perform the given work item. | 231 * Perform the given work item. |
| 231 * Return the performed [AnalysisTask]. | 232 * Return the performed [AnalysisTask]. |
| 232 */ | 233 */ |
| 233 AnalysisTask performWorkItem(WorkItem item) { | 234 AnalysisTask performWorkItem(WorkItem item) { |
| 234 if (item.exception != null) { | 235 if (item.exception != null) { |
| 236 print(item.exception); | |
|
Brian Wilkerson
2015/06/05 18:24:48
Ditto, noting that this code isn't commented out.
scheglov
2015/06/05 18:28:24
Thank you.
Removed.
| |
| 235 // Mark all of the results that the task would have computed as being in | 237 // Mark all of the results that the task would have computed as being in |
| 236 // ERROR with the exception recorded on the work item. | 238 // ERROR with the exception recorded on the work item. |
| 237 CacheEntry targetEntry = context.getCacheEntry(item.target); | 239 CacheEntry targetEntry = context.getCacheEntry(item.target); |
| 238 targetEntry.setErrorState(item.exception, item.descriptor.results); | 240 targetEntry.setErrorState(item.exception, item.descriptor.results); |
| 239 return null; | 241 return null; |
| 240 } | 242 } |
| 241 // Otherwise, perform the task. | 243 // Otherwise, perform the task. |
| 242 AnalysisTask task = item.buildTask(); | 244 AnalysisTask task = item.buildTask(); |
| 243 _onTaskStartedController.add(task); | 245 _onTaskStartedController.add(task); |
| 244 task.perform(); | 246 task.perform(); |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 782 final TaskManager taskManager; | 784 final TaskManager taskManager; |
| 783 | 785 |
| 784 _WorkOrderDependencyWalker(this.taskManager, WorkItem startingNode) | 786 _WorkOrderDependencyWalker(this.taskManager, WorkItem startingNode) |
| 785 : super(startingNode); | 787 : super(startingNode); |
| 786 | 788 |
| 787 @override | 789 @override |
| 788 WorkItem getNextInput(WorkItem node, List<WorkItem> skipInputs) { | 790 WorkItem getNextInput(WorkItem node, List<WorkItem> skipInputs) { |
| 789 return node.gatherInputs(taskManager, skipInputs); | 791 return node.gatherInputs(taskManager, skipInputs); |
| 790 } | 792 } |
| 791 } | 793 } |
| OLD | NEW |