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

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

Issue 23171020: Enable cross-package transforms to see new transformers in other packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. 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/phase.dart ('k') | pkg/barback/test/package_graph/add_remove_transform_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/phase_output.dart
diff --git a/pkg/barback/lib/src/phase_output.dart b/pkg/barback/lib/src/phase_output.dart
index ae309d9820eba63990cd6e77601aabc457d5a267..8082e54ac546e81491886cc9841c932e9fcc4e24 100644
--- a/pkg/barback/lib/src/phase_output.dart
+++ b/pkg/barback/lib/src/phase_output.dart
@@ -28,7 +28,7 @@ class PhaseOutput {
/// The asset node for this output.
AssetNode get output => _outputController.node;
- final AssetNodeController _outputController;
+ AssetNodeController _outputController;
/// The assets for this output.
///
@@ -59,6 +59,18 @@ class PhaseOutput {
_watchAsset(node);
}
+ /// Removes all existing listeners on [output] without actually closing
+ /// [this].
+ ///
+ /// This marks [output] as removed, but immediately replaces it with a new
+ /// [AssetNode] in the same state as the old output. This is used when adding
+ /// a new [Phase] to cause consumers of the prior phase's outputs to be to
+ /// start consuming the new phase's outputs instead.
+ void removeListeners() {
+ _outputController.setRemoved();
+ _outputController = new AssetNodeController.from(_assets.first);
+ }
+
/// Watches [node] for state changes and adjusts [_assets] and [output]
/// appropriately when they occur.
void _watchAsset(AssetNode node) {
« no previous file with comments | « pkg/barback/lib/src/phase.dart ('k') | pkg/barback/test/package_graph/add_remove_transform_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698