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

Side by Side Diff: pkg/analyzer/lib/src/dart/analysis/file_tracker.dart

Issue 2829253002: Add support for external summaries bundle in AnalysisDriver. (Closed)
Patch Set: Fixes for review comments. Created 3 years, 8 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'dart:collection'; 5 import 'dart:collection';
6 import 'dart:typed_data'; 6 import 'dart:typed_data';
7 7
8 import 'package:analyzer/file_system/file_system.dart'; 8 import 'package:analyzer/file_system/file_system.dart';
9 import 'package:analyzer/src/dart/analysis/byte_store.dart'; 9 import 'package:analyzer/src/dart/analysis/byte_store.dart';
10 import 'package:analyzer/src/dart/analysis/driver.dart'; 10 import 'package:analyzer/src/dart/analysis/driver.dart';
11 import 'package:analyzer/src/dart/analysis/file_state.dart'; 11 import 'package:analyzer/src/dart/analysis/file_state.dart';
12 import 'package:analyzer/src/generated/engine.dart'; 12 import 'package:analyzer/src/generated/engine.dart';
13 import 'package:analyzer/src/generated/source.dart'; 13 import 'package:analyzer/src/generated/source.dart';
14 import 'package:analyzer/src/summary/package_bundle_reader.dart';
14 15
15 /** 16 /**
16 * Callback used by [FileTracker] to report to its client that files have been 17 * Callback used by [FileTracker] to report to its client that files have been
17 * added, changed, or removed, and therefore more analysis may be necessary. 18 * added, changed, or removed, and therefore more analysis may be necessary.
18 */ 19 */
19 typedef void FileTrackerChangeHook(); 20 typedef void FileTrackerChangeHook();
20 21
21 /** 22 /**
22 * Maintains the file system state needed by the analysis driver, as well as 23 * Maintains the file system state needed by the analysis driver, as well as
23 * information about files that have changed and the impact of those changes. 24 * information about files that have changed and the impact of those changes.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 var _pendingFiles = new LinkedHashSet<String>(); 84 var _pendingFiles = new LinkedHashSet<String>();
84 85
85 FileTracker( 86 FileTracker(
86 this.logger, 87 this.logger,
87 ByteStore byteStore, 88 ByteStore byteStore,
88 FileContentOverlay contentOverlay, 89 FileContentOverlay contentOverlay,
89 ResourceProvider resourceProvider, 90 ResourceProvider resourceProvider,
90 SourceFactory sourceFactory, 91 SourceFactory sourceFactory,
91 AnalysisOptions analysisOptions, 92 AnalysisOptions analysisOptions,
92 Uint32List salt, 93 Uint32List salt,
94 SummaryDataStore externalSummaries,
93 this._changeHook) 95 this._changeHook)
94 : fsState = new FileSystemState(logger, byteStore, contentOverlay, 96 : fsState = new FileSystemState(logger, byteStore, contentOverlay,
95 resourceProvider, sourceFactory, analysisOptions, salt); 97 resourceProvider, sourceFactory, analysisOptions, salt,
98 externalSummaries: externalSummaries);
96 99
97 /** 100 /**
98 * Returns the path to exactly one that needs analysis. Throws a [StateError] 101 * Returns the path to exactly one that needs analysis. Throws a [StateError]
99 * if no files need analysis. 102 * if no files need analysis.
100 */ 103 */
101 String get anyPendingFile { 104 String get anyPendingFile {
102 if (_pendingChangedFiles.isNotEmpty) { 105 if (_pendingChangedFiles.isNotEmpty) {
103 return _pendingChangedFiles.first; 106 return _pendingChangedFiles.first;
104 } 107 }
105 if (_pendingImportFiles.isNotEmpty) { 108 if (_pendingImportFiles.isNotEmpty) {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 // If the file has not been accessed yet, we either will eventually read 304 // If the file has not been accessed yet, we either will eventually read
302 // it later while analyzing one of the added files, or don't need it. 305 // it later while analyzing one of the added files, or don't need it.
303 if (fsState.knownFilePaths.contains(path)) { 306 if (fsState.knownFilePaths.contains(path)) {
304 verifyApiSignature(path); 307 verifyApiSignature(path);
305 } 308 }
306 return true; 309 return true;
307 } 310 }
308 return false; 311 return false;
309 } 312 }
310 } 313 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/file_state.dart ('k') | pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698