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

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

Issue 22914031: Support actually removing phases in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/phase.dart
diff --git a/pkg/barback/lib/src/phase.dart b/pkg/barback/lib/src/phase.dart
index 78b9ebe87c6e77517b4db9f5ac958498ecaf6afd..a73ee00a6ee8ba744e603157a81c75a51593d768 100644
--- a/pkg/barback/lib/src/phase.dart
+++ b/pkg/barback/lib/src/phase.dart
@@ -153,6 +153,24 @@ class Phase {
return _next;
}
+ /// Mark this phase as removed.
+ ///
+ /// This will remove all the phase's outputs and all following phases.
+ void remove() {
+ removeFollowing();
+ for (var input in _inputs.values.toList()) {
+ input.remove();
+ }
+ _onDirtyPool.close();
+ }
+
+ /// Remove all phases after this one.
+ Phase removeFollowing() {
+ if (_next == null) return;
+ _next.remove();
+ _next = null;
+ }
+
/// Processes this phase.
///
/// Returns a future that completes when processing is done. If there is
« no previous file with comments | « pkg/barback/lib/src/asset_cascade.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698