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.context.context; | 5 library analyzer.src.context.context; |
| 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/cancelable_future.dart'; | 10 import 'package:analyzer/src/cancelable_future.dart'; |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 672 return true; | 672 return true; |
| 673 } | 673 } |
| 674 return source.exists(); | 674 return source.exists(); |
| 675 } | 675 } |
| 676 | 676 |
| 677 @override | 677 @override |
| 678 CacheEntry getCacheEntry(AnalysisTarget target) { | 678 CacheEntry getCacheEntry(AnalysisTarget target) { |
| 679 CacheEntry entry = _cache.get(target); | 679 CacheEntry entry = _cache.get(target); |
| 680 if (entry == null) { | 680 if (entry == null) { |
| 681 entry = new CacheEntry(target); | 681 entry = new CacheEntry(target); |
| 682 if (target is Source) { | |
| 683 entry.modificationTime = getModificationStamp(target); | |
|
Brian Wilkerson
2015/05/22 18:58:52
Unless we explicitly want to not have a modificati
scheglov
2015/05/22 19:17:30
We use "modificationTime" only "_validateCacheCons
| |
| 684 } | |
| 682 _cache.put(entry); | 685 _cache.put(entry); |
| 683 } | 686 } |
| 684 return entry; | 687 return entry; |
| 685 } | 688 } |
| 686 | 689 |
| 687 @override | 690 @override |
| 688 CompilationUnitElement getCompilationUnitElement( | 691 CompilationUnitElement getCompilationUnitElement( |
| 689 Source unitSource, Source librarySource) { | 692 Source unitSource, Source librarySource) { |
| 690 AnalysisTarget target = new LibrarySpecificUnit(librarySource, unitSource); | 693 AnalysisTarget target = new LibrarySpecificUnit(librarySource, unitSource); |
| 691 return _cache.getValue(target, COMPILATION_UNIT_ELEMENT); | 694 return _cache.getValue(target, COMPILATION_UNIT_ELEMENT); |
| (...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1994 PendingFuture pendingFuture = | 1997 PendingFuture pendingFuture = |
| 1995 new PendingFuture<T>(_context, target, computeValue); | 1998 new PendingFuture<T>(_context, target, computeValue); |
| 1996 if (!pendingFuture.evaluate(entry)) { | 1999 if (!pendingFuture.evaluate(entry)) { |
| 1997 _context._pendingFutureTargets | 2000 _context._pendingFutureTargets |
| 1998 .putIfAbsent(target, () => <PendingFuture>[]) | 2001 .putIfAbsent(target, () => <PendingFuture>[]) |
| 1999 .add(pendingFuture); | 2002 .add(pendingFuture); |
| 2000 } | 2003 } |
| 2001 return pendingFuture.future; | 2004 return pendingFuture.future; |
| 2002 } | 2005 } |
| 2003 } | 2006 } |
| OLD | NEW |