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

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

Issue 1399873002: Issue 24538. Route SDK results into SDK context DartWorkManager. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
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.dart_work_manager; 5 library analyzer.src.task.dart_work_manager;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/src/context/cache.dart'; 9 import 'package:analyzer/src/context/cache.dart';
10 import 'package:analyzer/src/generated/engine.dart' 10 import 'package:analyzer/src/generated/engine.dart'
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 * Notifies the manager about [SourceFactory] changes. 258 * Notifies the manager about [SourceFactory] changes.
259 */ 259 */
260 void onSourceFactoryChanged() { 260 void onSourceFactoryChanged() {
261 _invalidateAllLocalResolutionInformation(true); 261 _invalidateAllLocalResolutionInformation(true);
262 } 262 }
263 263
264 @override 264 @override
265 void resultsComputed( 265 void resultsComputed(
266 AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs) { 266 AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs) {
267 bool isDartSource = _isDartSource(target); 267 bool isDartSource = _isDartSource(target);
268 // Route SDK outputs to the SDK WorkManager.
269 if (isDartSource && target.source.isInSystemLibrary) {
270 SourceFactory sourceFactory = context.sourceFactory;
271 InternalAnalysisContext sdkContext = sourceFactory.dartSdk.context;
272 if (sdkContext != context) {
273 for (WorkManager sdkWorkManager in sdkContext.workManagers) {
274 if (sdkWorkManager is DartWorkManager) {
275 sdkWorkManager.resultsComputed(target, outputs);
276 return;
277 }
278 }
279 }
280 }
268 // Organize sources. 281 // Organize sources.
269 bool isDartLibrarySource = false; 282 bool isDartLibrarySource = false;
270 if (isDartSource) { 283 if (isDartSource) {
271 Source source = target; 284 Source source = target;
272 SourceKind kind = outputs[SOURCE_KIND]; 285 SourceKind kind = outputs[SOURCE_KIND];
273 if (kind != null) { 286 if (kind != null) {
274 unknownSourceQueue.remove(source); 287 unknownSourceQueue.remove(source);
275 if (kind == SourceKind.LIBRARY) { 288 if (kind == SourceKind.LIBRARY) {
276 isDartLibrarySource = true; 289 isDartLibrarySource = true;
277 if (context.prioritySources.contains(source)) { 290 if (context.prioritySources.contains(source)) {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 449 }
437 } 450 }
438 451
439 bool _shouldErrorsBeComputed(Source source) => 452 bool _shouldErrorsBeComputed(Source source) =>
440 context.shouldErrorsBeAnalyzed(source, null); 453 context.shouldErrorsBeAnalyzed(source, null);
441 454
442 static bool _isDartSource(AnalysisTarget target) { 455 static bool _isDartSource(AnalysisTarget target) {
443 return target is Source && AnalysisEngine.isDartFileName(target.fullName); 456 return target is Source && AnalysisEngine.isDartFileName(target.fullName);
444 } 457 }
445 } 458 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/test/file_system/memory_file_system_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698