| 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_input; | 5 library barback.phase_input; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'asset_forwarder.dart'; | 9 import 'asset_forwarder.dart'; |
| 10 import 'asset_node.dart'; | 10 import 'asset_node.dart'; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 StreamSubscription _inputSubscription; | 43 StreamSubscription _inputSubscription; |
| 44 | 44 |
| 45 /// The streams exposed by this input. | 45 /// The streams exposed by this input. |
| 46 final _streams = new NodeStreams(); | 46 final _streams = new NodeStreams(); |
| 47 Stream get onStatusChange => _streams.onStatusChange; | 47 Stream get onStatusChange => _streams.onStatusChange; |
| 48 Stream<AssetNode> get onAsset => _streams.onAsset; | 48 Stream<AssetNode> get onAsset => _streams.onAsset; |
| 49 Stream<LogEntry> get onLog => _streams.onLog; | 49 Stream<LogEntry> get onLog => _streams.onLog; |
| 50 | 50 |
| 51 /// How far along [this] is in processing its assets. | 51 /// How far along [this] is in processing its assets. |
| 52 NodeStatus get status { | 52 NodeStatus get status { |
| 53 var status = input.state.isDirty && !input.deferred ? | 53 var status = input.state.isDirty && !input.isLazy ? |
| 54 NodeStatus.MATERIALIZING : NodeStatus.IDLE; | 54 NodeStatus.MATERIALIZING : NodeStatus.IDLE; |
| 55 return status.dirtier(NodeStatus.dirtiest( | 55 return status.dirtier(NodeStatus.dirtiest( |
| 56 _transforms.map((transform) => transform.status))); | 56 _transforms.map((transform) => transform.status))); |
| 57 } | 57 } |
| 58 | 58 |
| 59 PhaseInput(this._phase, AssetNode input, this._location) | 59 PhaseInput(this._phase, AssetNode input, this._location) |
| 60 : _inputForwarder = new AssetForwarder(input) { | 60 : _inputForwarder = new AssetForwarder(input) { |
| 61 _inputSubscription = input.onStateChange.listen((state) { | 61 _inputSubscription = input.onStateChange.listen((state) { |
| 62 if (state.isRemoved) { | 62 if (state.isRemoved) { |
| 63 remove(); | 63 remove(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 /// Force all [LazyTransformer]s' transforms in this input to begin producing | 103 /// Force all [LazyTransformer]s' transforms in this input to begin producing |
| 104 /// concrete assets. | 104 /// concrete assets. |
| 105 void forceAllTransforms() { | 105 void forceAllTransforms() { |
| 106 for (var transform in _transforms) { | 106 for (var transform in _transforms) { |
| 107 transform.force(); | 107 transform.force(); |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 String toString() => "phase input in $_location for $input"; | 111 String toString() => "phase input in $_location for $input"; |
| 112 } | 112 } |
| OLD | NEW |