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

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

Issue 23038018: Factor a PhaseOutput class out of Phase. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change. Created 7 years, 4 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/asset_node.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/asset_forwarder.dart
diff --git a/pkg/barback/lib/src/asset_forwarder.dart b/pkg/barback/lib/src/asset_forwarder.dart
index 7dc74dc8c4f2dff43df98611d5dcead30d17ab7f..a2440e0114e6297e2c529f02357ccc9aa4655f6e 100644
--- a/pkg/barback/lib/src/asset_forwarder.dart
+++ b/pkg/barback/lib/src/asset_forwarder.dart
@@ -25,7 +25,9 @@ class AssetForwarder {
AssetNode get node => _controller.node;
AssetForwarder(AssetNode node)
- : _controller = new AssetNodeController(node.id, node.transform) {
+ : _controller = new AssetNodeController.from(node) {
+ if (node.state.isRemoved) return;
+
_subscription = node.onStateChange.listen((state) {
if (state.isAvailable) {
_controller.setAvailable(node.asset);
@@ -36,12 +38,6 @@ class AssetForwarder {
close();
}
});
-
- if (node.state.isAvailable) {
- _controller.setAvailable(node.asset);
- } else if (node.state.isRemoved) {
- close();
- }
}
/// Closes the forwarder and marks [node] as removed.
« no previous file with comments | « no previous file | pkg/barback/lib/src/asset_node.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698