| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library barback.transform_node; | 5 library barback.transform_node; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'asset.dart'; | 9 import 'asset.dart'; |
| 10 import 'asset_id.dart'; | 10 import 'asset_id.dart'; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 controller.setDirty(); | 91 controller.setDirty(); |
| 92 } | 92 } |
| 93 _onDirtyController.add(null); | 93 _onDirtyController.add(null); |
| 94 } | 94 } |
| 95 | 95 |
| 96 /// Applies this transform. | 96 /// Applies this transform. |
| 97 /// | 97 /// |
| 98 /// Returns a set of asset nodes representing the outputs from this transform | 98 /// Returns a set of asset nodes representing the outputs from this transform |
| 99 /// that weren't emitted last time it was run. | 99 /// that weren't emitted last time it was run. |
| 100 Future<Set<AssetNode>> apply() { | 100 Future<Set<AssetNode>> apply() { |
| 101 assert(!_onDirtyController.isClosed); |
| 102 |
| 101 var newOutputs = new AssetSet(); | 103 var newOutputs = new AssetSet(); |
| 102 var transform = createTransform(this, newOutputs); | 104 var transform = createTransform(this, newOutputs); |
| 103 | 105 |
| 104 // Clear all the old input subscriptions. If an input is re-used, we'll | 106 // Clear all the old input subscriptions. If an input is re-used, we'll |
| 105 // re-subscribe. | 107 // re-subscribe. |
| 106 for (var subscription in _inputSubscriptions.values) { | 108 for (var subscription in _inputSubscriptions.values) { |
| 107 subscription.cancel(); | 109 subscription.cancel(); |
| 108 } | 110 } |
| 109 _inputSubscriptions.clear(); | 111 _inputSubscriptions.clear(); |
| 110 | 112 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } else { | 186 } else { |
| 185 var controller = new AssetNodeController.available(asset); | 187 var controller = new AssetNodeController.available(asset); |
| 186 _outputControllers[asset.id] = controller; | 188 _outputControllers[asset.id] = controller; |
| 187 brandNewOutputs.add(controller.node); | 189 brandNewOutputs.add(controller.node); |
| 188 } | 190 } |
| 189 } | 191 } |
| 190 | 192 |
| 191 return brandNewOutputs; | 193 return brandNewOutputs; |
| 192 } | 194 } |
| 193 } | 195 } |
| OLD | NEW |