| 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.phase_output; | 5 library barback.phase_output; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'asset_forwarder.dart'; | 10 import 'asset_forwarder.dart'; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 /// A string describing the location of [this] in the transformer graph. | 29 /// A string describing the location of [this] in the transformer graph. |
| 30 final String _location; | 30 final String _location; |
| 31 | 31 |
| 32 /// The asset node for this output. | 32 /// The asset node for this output. |
| 33 AssetNode get output => _outputForwarder.node; | 33 AssetNode get output => _outputForwarder.node; |
| 34 AssetForwarder _outputForwarder; | 34 AssetForwarder _outputForwarder; |
| 35 | 35 |
| 36 /// A stream that emits an [AssetNode] each time this output starts forwarding | 36 /// A stream that emits an [AssetNode] each time this output starts forwarding |
| 37 /// a new asset. | 37 /// a new asset. |
| 38 Stream<AssetNode> get onAsset => _onAssetController.stream; | 38 Stream<AssetNode> get onAsset => _onAssetController.stream; |
| 39 final _onAssetController = new StreamController<AssetNode>(sync: true); | 39 final _onAssetController = |
| 40 new StreamController<AssetNode>.broadcast(sync: true); |
| 40 | 41 |
| 41 /// The assets for this output. | 42 /// The assets for this output. |
| 42 /// | 43 /// |
| 43 /// If there's no collision, this will only have one element. Otherwise, it | 44 /// If there's no collision, this will only have one element. Otherwise, it |
| 44 /// will be ordered by which asset was added first. | 45 /// will be ordered by which asset was added first. |
| 45 final _assets = new Queue<AssetNode>(); | 46 final _assets = new Queue<AssetNode>(); |
| 46 | 47 |
| 47 /// The [AssetCollisionException] for this output, or null if there is no | 48 /// The [AssetCollisionException] for this output, or null if there is no |
| 48 /// collision currently. | 49 /// collision currently. |
| 49 AssetCollisionException get collisionException { | 50 AssetCollisionException get collisionException { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // they've successfully resolved the collision or not. | 105 // they've successfully resolved the collision or not. |
| 105 if (_assets.length > 1) { | 106 if (_assets.length > 1) { |
| 106 // TODO(nweiz): report this through the output asset. | 107 // TODO(nweiz): report this through the output asset. |
| 107 _phase.cascade.reportError(collisionException); | 108 _phase.cascade.reportError(collisionException); |
| 108 } | 109 } |
| 109 }); | 110 }); |
| 110 } | 111 } |
| 111 | 112 |
| 112 String toString() => "phase output in $_location for $output"; | 113 String toString() => "phase output in $_location for $output"; |
| 113 } | 114 } |
| OLD | NEW |