Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: pkg/analyzer/lib/src/task/driver.dart

Issue 1806563003: AnalysisDriver.createWorkOrderForResult() should check AnalysisContext.aboutToComputeResult() first. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/driver_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 */ 158 */
159 WorkOrder createWorkOrderForResult( 159 WorkOrder createWorkOrderForResult(
160 AnalysisTarget target, ResultDescriptor result) { 160 AnalysisTarget target, ResultDescriptor result) {
161 CacheEntry entry = context.getCacheEntry(target); 161 CacheEntry entry = context.getCacheEntry(target);
162 CacheState state = entry.getState(result); 162 CacheState state = entry.getState(result);
163 if (state == CacheState.VALID || 163 if (state == CacheState.VALID ||
164 state == CacheState.ERROR || 164 state == CacheState.ERROR ||
165 state == CacheState.IN_PROCESS) { 165 state == CacheState.IN_PROCESS) {
166 return null; 166 return null;
167 } 167 }
168 if (context.aboutToComputeResult(entry, result)) {
169 return null;
170 }
168 TaskDescriptor taskDescriptor = taskManager.findTask(target, result); 171 TaskDescriptor taskDescriptor = taskManager.findTask(target, result);
169 if (taskDescriptor == null) { 172 if (taskDescriptor == null) {
170 return null; 173 return null;
171 } 174 }
172 try { 175 try {
173 WorkItem workItem = 176 WorkItem workItem =
174 new WorkItem(context, target, taskDescriptor, result, 0, null); 177 new WorkItem(context, target, taskDescriptor, result, 0, null);
175 return new WorkOrder(taskManager, workItem); 178 return new WorkOrder(taskManager, workItem);
176 } catch (exception, stackTrace) { 179 } catch (exception, stackTrace) {
177 throw new AnalysisException( 180 throw new AnalysisException(
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 final TaskManager taskManager; 860 final TaskManager taskManager;
858 861
859 _WorkOrderDependencyWalker(this.taskManager, WorkItem startingNode) 862 _WorkOrderDependencyWalker(this.taskManager, WorkItem startingNode)
860 : super(startingNode); 863 : super(startingNode);
861 864
862 @override 865 @override
863 WorkItem getNextInput(WorkItem node, List<WorkItem> skipInputs) { 866 WorkItem getNextInput(WorkItem node, List<WorkItem> skipInputs) {
864 return node.gatherInputs(taskManager, skipInputs); 867 return node.gatherInputs(taskManager, skipInputs);
865 } 868 }
866 } 869 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/driver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698