Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 library barback.asset_node; | |
| 6 | |
| 7 import 'dart:async'; | |
| 8 | |
| 9 import '../barback.dart'; | |
| 10 import 'asset_graph.dart'; | |
| 11 import 'phase.dart'; | |
| 12 import 'transform_node.dart'; | |
| 13 | |
| 14 /// Describes an asset and its relationship to the build dependency graph. | |
| 15 /// Keeps a cache of the last built asset and tracks which transforms depend | |
|
nweiz
2013/06/18 23:14:46
I don't understand what "last built asset" means.
Bob Nystrom
2013/06/20 00:23:59
Clarified.
| |
| 16 /// on it. | |
| 17 class AssetNode { | |
| 18 final AssetId id; | |
| 19 Asset asset; | |
| 20 | |
| 21 /// The [_TransformNode]s that consume this node's asset as an input. | |
|
nweiz
2013/06/18 23:14:46
Remove "_"
Bob Nystrom
2013/06/20 00:23:59
Done.
| |
| 22 final consumers = new Set<TransformNode>(); | |
| 23 | |
| 24 AssetNode(this.id); | |
| 25 | |
| 26 /// Updates this node's generated asset value and marks all transforms that | |
| 27 /// use this as dirty. | |
| 28 void updateAsset(Asset asset) { | |
| 29 this.asset = asset; | |
| 30 consumers.forEach((consumer) => consumer.isDirty = true); | |
| 31 } | |
| 32 } | |
| OLD | NEW |