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

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

Issue 16854005: First pass at build dependency graph for barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 6 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
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
new file mode 100644
index 0000000000000000000000000000000000000000..06b2952a90040cba2f058d2f208617019a1f01f9
--- /dev/null
+++ b/pkg/barback/lib/src/asset_node.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library barback.asset_node;
+
+import 'dart:async';
+
+import '../barback.dart';
+import 'asset_graph.dart';
+import 'phase.dart';
+import 'transform_node.dart';
+
+/// Describes an asset and its relationship to the build dependency graph.
+/// 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.
+/// on it.
+class AssetNode {
+ final AssetId id;
+ Asset asset;
+
+ /// 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.
+ final consumers = new Set<TransformNode>();
+
+ AssetNode(this.id);
+
+ /// Updates this node's generated asset value and marks all transforms that
+ /// use this as dirty.
+ void updateAsset(Asset asset) {
+ this.asset = asset;
+ consumers.forEach((consumer) => consumer.isDirty = true);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698