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

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

Issue 22961002: Add more metadata to non-programmatic barback exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Small fix 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 | « pkg/barback/lib/src/asset_cascade.dart ('k') | pkg/barback/lib/src/build_result.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/asset_node.dart
diff --git a/pkg/barback/lib/src/asset_node.dart b/pkg/barback/lib/src/asset_node.dart
index 6e7789a91fb766b5596573fbac3c41738c21f0aa..587f2bdb4f1610700e2b483d51d0bee41dfd49d2 100644
--- a/pkg/barback/lib/src/asset_node.dart
+++ b/pkg/barback/lib/src/asset_node.dart
@@ -22,6 +22,11 @@ class AssetNode {
/// The id of the asset that this node represents.
final AssetId id;
+ /// The transform that created this asset node.
+ ///
+ /// This is `null` for source assets.
+ final TransformNode transform;
+
/// The current state of the asset node.
AssetState get state => _state;
AssetState _state;
@@ -106,10 +111,10 @@ class AssetNode {
return onStateChange.firstWhere(test);
}
- AssetNode._(this.id)
+ AssetNode._(this.id, this.transform)
: _state = AssetState.DIRTY;
- AssetNode._available(Asset asset)
+ AssetNode._available(Asset asset, this.transform)
: id = asset.id,
_asset = asset,
_state = AssetState.AVAILABLE;
@@ -122,13 +127,13 @@ class AssetNodeController {
final AssetNode node;
/// Creates a controller for a dirty node.
- AssetNodeController(AssetId id)
- : node = new AssetNode._(id);
+ AssetNodeController(AssetId id, [TransformNode transform])
+ : node = new AssetNode._(id, transform);
/// Creates a controller for an available node with the given concrete
/// [asset].
- AssetNodeController.available(Asset asset)
- : node = new AssetNode._available(asset);
+ AssetNodeController.available(Asset asset, [TransformNode transform])
+ : node = new AssetNode._available(asset, transform);
/// Marks the node as [AssetState.DIRTY].
void setDirty() {
« no previous file with comments | « pkg/barback/lib/src/asset_cascade.dart ('k') | pkg/barback/lib/src/build_result.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698