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

Unified Diff: pkg/front_end/lib/src/incremental_kernel_generator_impl.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 | « pkg/front_end/lib/incremental_kernel_generator.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
diff --git a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
index 4221ba8f2f2b21bc71a14ec2b54bff25c22deb5d..50473ebc34fb0f6466988b3b2f0cc7c1c9c41bfe 100644
--- a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
+++ b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
@@ -57,12 +57,13 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
_options = options;
@override
- Future<DeltaProgram> computeDelta() async {
+ Future<DeltaProgram> computeDelta(
+ {Future<Null> watch(Uri uri, bool used)}) async {
var deltaLibraries = await _resolvedAstGenerator.computeDelta();
var kernelOptions = _convertOptions(_options);
var packages = null; // TODO(paulberry)
var kernels = <Uri, Program>{};
- deltaLibraries.newState.forEach((uri, resolvedLibrary) {
+ for (Uri uri in deltaLibraries.newState.keys) {
// The kernel generation code doesn't currently support building a kernel
// directly from resolved ASTs--it wants to query an analysis context. So
// we provide it with a proxy analysis context that feeds it the resolved
@@ -76,7 +77,11 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
new DartLoader(repository, kernelOptions, packages, context: context);
loader.loadLibrary(uri);
kernels[uri] = new Program(repository.libraries);
- });
+ // TODO(paulberry) rework watch invocation to eliminate race condition,
+ // include part source files, and prevent watch from being a bottleneck
+ if (watch != null) await watch(uri, true);
+ }
+ // TODO(paulberry) invoke watch with used=false for each unused source
return new DeltaProgram(kernels);
}
« no previous file with comments | « pkg/front_end/lib/incremental_kernel_generator.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698