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

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

Issue 196273003: Move isPrimary computation from PhaseInput into TransformNode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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_forwarder.dart » ('j') | pkg/barback/lib/src/phase_forwarder.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/phase.dart
diff --git a/pkg/barback/lib/src/phase.dart b/pkg/barback/lib/src/phase.dart
index 7f33ef4298b46d2586c1b112f75248e170d3306f..2872b1c846a0d84116f236db19c089b2229198b1 100644
--- a/pkg/barback/lib/src/phase.dart
+++ b/pkg/barback/lib/src/phase.dart
@@ -173,14 +173,18 @@ class Phase {
node.force();
- // Each group is one channel along which an asset may be forwarded. Then
- // there's one additional channel for the non-grouped transformers.
- var forwarder = new PhaseForwarder(_groups.length + 1);
+ // Each group is one channel along which an asset may be forwarded, as is
+ // each transformer.
+ var forwarder = new PhaseForwarder(node,
+ _groups.length + _transformers.length);
_forwarders[node.id] = forwarder;
forwarder.onAsset.listen(_handleOutputWithoutForwarder);
+ if (forwarder.output != null) {
+ _handleOutputWithoutForwarder(forwarder.output);
+ }
_inputOrigins.add(node.origin);
- var input = new PhaseInput(this, node, _transformers, "$_location.$_index");
+ var input = new PhaseInput(this, node, "$_location.$_index");
_inputs[node.id] = input;
input.input.whenRemoved(() {
_inputOrigins.remove(node.origin);
@@ -194,6 +198,8 @@ class Phase {
if (!isDirty) _onDoneController.add(null);
});
+ input.updateTransformers(_transformers);
+
for (var group in _groups.values) {
group.addInput(node);
}
@@ -245,7 +251,9 @@ class Phase {
// if it becomes available. If it's removed before becoming available,
// try again, since it could be generated again.
output.force();
- return output.whenAvailable((_) => output).catchError((error) {
+ return output.whenAvailable((_) {
+ return output;
+ }).catchError((error) {
if (error is! AssetNotFoundException) throw error;
return getOutput(id);
});
@@ -293,7 +301,7 @@ class Phase {
}
for (var forwarder in _forwarders.values) {
- forwarder.numChannels = _groups.length + 1;
+ forwarder.numChannels = _groups.length + _transformers.length;
}
}
« no previous file with comments | « no previous file | pkg/barback/lib/src/phase_forwarder.dart » ('j') | pkg/barback/lib/src/phase_forwarder.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698