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

Side by Side Diff: pkg/analyzer/lib/src/context/cache.dart

Issue 2289283003: An AnalysisTarget is a priority one if its Source is in prioritySources. (Closed)
Patch Set: Created 4 years, 3 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/context/cache_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.context.cache; 5 library analyzer.src.context.cache;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/file_system/file_system.dart'; 10 import 'package:analyzer/file_system/file_system.dart';
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 } 1222 }
1223 CacheFlushManager manager = _flushManagerMap[policy]; 1223 CacheFlushManager manager = _flushManagerMap[policy];
1224 if (manager == null) { 1224 if (manager == null) {
1225 manager = new CacheFlushManager(policy, _isPriorityAnalysisTarget); 1225 manager = new CacheFlushManager(policy, _isPriorityAnalysisTarget);
1226 _flushManagerMap[policy] = manager; 1226 _flushManagerMap[policy] = manager;
1227 } 1227 }
1228 return manager; 1228 return manager;
1229 } 1229 }
1230 1230
1231 bool _isPriorityAnalysisTarget(AnalysisTarget target) { 1231 bool _isPriorityAnalysisTarget(AnalysisTarget target) {
1232 return context.priorityTargets.contains(target); 1232 Source source = target.source;
1233 return source != null && context.prioritySources.contains(source);
1233 } 1234 }
1234 1235
1235 /** 1236 /**
1236 * If the given [target] is a [Source], remove it from the list of [sources]. 1237 * If the given [target] is a [Source], remove it from the list of [sources].
1237 */ 1238 */
1238 void _removeIfSource(AnalysisTarget target) { 1239 void _removeIfSource(AnalysisTarget target) {
1239 if (target is Source) { 1240 if (target is Source) {
1240 sources.remove(target); 1241 sources.remove(target);
1241 String path = target.fullName; 1242 String path = target.fullName;
1242 List<Source> pathSources = pathToSource[path]; 1243 List<Source> pathSources = pathToSource[path];
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 void resultAccessed(TargetedResult result) {} 1527 void resultAccessed(TargetedResult result) {}
1527 1528
1528 @override 1529 @override
1529 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { 1530 List<TargetedResult> resultStored(TargetedResult newResult, newValue) {
1530 return TargetedResult.EMPTY_LIST; 1531 return TargetedResult.EMPTY_LIST;
1531 } 1532 }
1532 1533
1533 @override 1534 @override
1534 void targetRemoved(AnalysisTarget target) {} 1535 void targetRemoved(AnalysisTarget target) {}
1535 } 1536 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/cache_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698