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

Unified Diff: pkg/front_end/lib/incremental_kernel_generator.dart

Issue 2653143003: IncrementalKernalGenerator watch source callback (Closed)
Patch Set: merge Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/incremental_kernel_generator_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/incremental_kernel_generator.dart
diff --git a/pkg/front_end/lib/incremental_kernel_generator.dart b/pkg/front_end/lib/incremental_kernel_generator.dart
index 5e809607c8db5e569a55410b395b439764042aca..3b3b429df842a2a89499bb1239af76aa1dd8f69b 100644
--- a/pkg/front_end/lib/incremental_kernel_generator.dart
+++ b/pkg/front_end/lib/incremental_kernel_generator.dart
@@ -66,6 +66,16 @@ abstract class IncrementalKernelGenerator {
/// from disk; they are assumed to be unchanged regardless of the state of the
/// filesystem.
///
+ /// If [watch] is not `null`, then when a source file is first used
+ /// by [computeDelta], [watch] is called with the Uri of that source
+ /// file and `used` == `true` indicating that the source file is being
+ /// used when compiling the program. The content of the file is not read
+ /// until the Future returned by [watch] completes. If during a subsequent
+ /// call to [computeDelta], a source file that was being used is no longer
+ /// used, then [watch] is called with the Uri of that source file and
+ /// `used` == `false` indicating that the source file is no longer needed.
+ /// Multiple invocations of [watch] may be running concurrently.
+ ///
/// If the future completes successfully, the previous file state is updated
/// and the set of valid sources is set to the set of all sources in the
/// program.
@@ -74,7 +84,7 @@ abstract class IncrementalKernelGenerator {
/// source code), the caller may consider the previous file state and the set
/// of valid sources to be unchanged; this means that once the user fixes the
/// errors, it is safe to call [computeDelta] again.
- Future<DeltaProgram> computeDelta();
+ Future<DeltaProgram> computeDelta({Future<Null> watch(Uri uri, bool used)});
/// Remove any source file(s) associated with the given file path from the set
/// of valid sources. This guarantees that those files will be re-read on the
« no previous file with comments | « no previous file | pkg/front_end/lib/src/incremental_kernel_generator_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698