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

Side by Side Diff: pkg/barback/lib/src/asset_cascade.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/barback/lib/src/phase.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library barback.asset_cascade; 5 library barback.asset_cascade;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'asset.dart'; 10 import 'asset.dart';
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 for (var i = 0; i < transformers.length; i++) { 180 for (var i = 0; i < transformers.length; i++) {
181 if (_phases.length > i) { 181 if (_phases.length > i) {
182 _phases[i].updateTransformers(transformers[i]); 182 _phases[i].updateTransformers(transformers[i]);
183 continue; 183 continue;
184 } 184 }
185 185
186 _addPhase(_phases.last.addPhase(transformers[i])); 186 _addPhase(_phases.last.addPhase(transformers[i]));
187 } 187 }
188 188
189 if (transformers.length < _phases.length) { 189 if (transformers.length == 0) {
190 for (var i = transformers.length; i < _phases.length; i++) { 190 _phases.last.updateTransformers([]);
191 // TODO(nweiz): actually remove phases rather than emptying them of 191 } else if (transformers.length < _phases.length) {
192 // transformers. 192 _phases[transformers.length - 1].removeFollowing();
193 _phases[i].updateTransformers([]); 193 _phases.removeRange(transformers.length, _phases.length);
194 }
195 } 194 }
196 } 195 }
197 196
198 void reportError(BarbackException error) { 197 void reportError(BarbackException error) {
199 _accumulatedErrors.add(error); 198 _accumulatedErrors.add(error);
200 _errorsController.add(error); 199 _errorsController.add(error);
201 } 200 }
202 201
203 /// Add [phase] to the end of [_phases] and watch its [onDirty] stream. 202 /// Add [phase] to the end of [_phases] and watch its [onDirty] stream.
204 void _addPhase(Phase phase) { 203 void _addPhase(Phase phase) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 259
261 // Otherwise, everything is done. 260 // Otherwise, everything is done.
262 return; 261 return;
263 } 262 }
264 263
265 // Process that phase and then loop onto the next. 264 // Process that phase and then loop onto the next.
266 return future.then((_) => _process()); 265 return future.then((_) => _process());
267 }); 266 });
268 } 267 }
269 } 268 }
OLDNEW
« no previous file with comments | « no previous file | pkg/barback/lib/src/phase.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698