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

Side by Side 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: Handle unprovided sources and errors a bit better. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/barback/lib/src/asset_id.dart ('k') | pkg/barback/lib/src/asset_provider.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 'asset.dart';
10 import 'asset_graph.dart';
11 import 'asset_id.dart';
12 import 'phase.dart';
13 import 'transform_node.dart';
14
15 /// Describes an asset and its relationship to the build dependency graph.
16 ///
17 /// Keeps a cache of the last asset that was built for this node (i.e. for this
18 /// node's ID and phase) and tracks which transforms depend on it.
19 class AssetNode {
20 final AssetId id;
21 Asset asset;
22
23 /// The [TransformNode]s that consume this node's asset as an input.
24 final consumers = new Set<TransformNode>();
25
26 AssetNode(this.id);
27
28 /// Updates this node's generated asset value and marks all transforms that
29 /// use this as dirty.
30 void updateAsset(Asset asset) {
31 this.asset = asset;
32 consumers.forEach((consumer) => consumer.dirty());
33 }
34 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/asset_id.dart ('k') | pkg/barback/lib/src/asset_provider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698