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

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

Issue 2151373002: Share LibrarySpecificUnits when possible (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Clean-up Created 4 years, 5 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.html_work_manager; 5 library analyzer.src.task.html_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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 * contexts. 53 * contexts.
54 */ 54 */
55 CachePartition get privateAnalysisCachePartition => 55 CachePartition get privateAnalysisCachePartition =>
56 context.privateAnalysisCachePartition; 56 context.privateAnalysisCachePartition;
57 57
58 /** 58 /**
59 * Specifies that the client want the given [result] of the given [target] 59 * Specifies that the client want the given [result] of the given [target]
60 * to be computed with priority. 60 * to be computed with priority.
61 */ 61 */
62 void addPriorityResult(AnalysisTarget target, ResultDescriptor result) { 62 void addPriorityResult(AnalysisTarget target, ResultDescriptor result) {
63 priorityResultQueue.add(new TargetedResult(target, result)); 63 priorityResultQueue
64 .add(new TargetedResult(context.canonicalizeTarget(target), result));
64 } 65 }
65 66
66 @override 67 @override
67 void applyChange(List<Source> addedSources, List<Source> changedSources, 68 void applyChange(List<Source> addedSources, List<Source> changedSources,
68 List<Source> removedSources) { 69 List<Source> removedSources) {
69 addedSources = addedSources.where(_isHtmlSource).toList(); 70 addedSources = addedSources.where(_isHtmlSource).toList();
70 changedSources = changedSources.where(_isHtmlSource).toList(); 71 changedSources = changedSources.where(_isHtmlSource).toList();
71 removedSources = removedSources.where(_isHtmlSource).toList(); 72 removedSources = removedSources.where(_isHtmlSource).toList();
72 // source queue 73 // source queue
73 sourceQueue.addAll(addedSources); 74 sourceQueue.addAll(addedSources);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 return state != CacheState.VALID && state != CacheState.ERROR; 244 return state != CacheState.VALID && state != CacheState.ERROR;
244 } 245 }
245 246
246 /** 247 /**
247 * Return `true` if the given target is an HTML source. 248 * Return `true` if the given target is an HTML source.
248 */ 249 */
249 static bool _isHtmlSource(AnalysisTarget target) { 250 static bool _isHtmlSource(AnalysisTarget target) {
250 return target is Source && AnalysisEngine.isHtmlFileName(target.fullName); 251 return target is Source && AnalysisEngine.isHtmlFileName(target.fullName);
251 } 252 }
252 } 253 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/driver.dart ('k') | pkg/analyzer/lib/src/task/options_work_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698