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

Unified Diff: pkg/barback/lib/src/asset_cascade.dart

Issue 21446002: Add events in barback to bubble up the dirty bit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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/barback/lib/src/phase.dart » ('j') | pkg/barback/lib/src/phase.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/asset_cascade.dart
diff --git a/pkg/barback/lib/src/asset_cascade.dart b/pkg/barback/lib/src/asset_cascade.dart
index 40a615cbd462356708b37dee8ba4f4e35500dac6..7818f7037f0fffa1302f03845c7145d1977b9079 100644
--- a/pkg/barback/lib/src/asset_cascade.dart
+++ b/pkg/barback/lib/src/asset_cascade.dart
@@ -103,6 +103,10 @@ class AssetCascade {
for (var transformers in phases.reversed) {
nextPhase = new Phase(this, _phases.length, transformers.toList(),
nextPhase);
+ nextPhase.onDirty.listen((_) {
+ _newChanges = true;
+ _waitForProcess();
+ });
_phases.insert(0, nextPhase);
}
}
@@ -165,8 +169,6 @@ class AssetCascade {
/// given source is already known, it is considered modified and all
/// transforms that use it will be re-applied.
void updateSources(Iterable<AssetId> sources) {
- _newChanges = true;
-
for (var id in sources) {
var controller = _sourceControllerMap[id];
if (controller != null) {
@@ -193,14 +195,10 @@ class AssetCascade {
_sourceControllerMap.remove(id).setRemoved();
});
}
-
- _waitForProcess();
}
/// Removes [removed] from the graph's known set of source assets.
void removeSources(Iterable<AssetId> removed) {
- _newChanges = true;
-
removed.forEach((id) {
// If the source was being loaded, cancel that load.
if (_loadingSources.containsKey(id)) _loadingSources.remove(id).cancel();
@@ -209,8 +207,6 @@ class AssetCascade {
// Don't choke if an id is double-removed for some reason.
if (controller != null) controller.setRemoved();
});
-
- _waitForProcess();
}
void reportError(error) {
« no previous file with comments | « no previous file | pkg/barback/lib/src/phase.dart » ('j') | pkg/barback/lib/src/phase.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698