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

Side by Side Diff: pkg/barback/lib/src/group_runner.dart

Issue 36463002: Fix a synchrony bug in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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
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.group_runner; 5 library barback.group_runner;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'asset_cascade.dart'; 9 import 'asset_cascade.dart';
10 import 'asset_node.dart'; 10 import 'asset_node.dart';
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // Process the first phase that needs to do work. 78 // Process the first phase that needs to do work.
79 for (var phase in _phases) { 79 for (var phase in _phases) {
80 var future = phase.process(); 80 var future = phase.process();
81 if (future != null) return future.then((_) => process()); 81 if (future != null) return future.then((_) => process());
82 } 82 }
83 83
84 // If we get here, all phases are done processing. 84 // If we get here, all phases are done processing.
85 var newOutputs = _phases.last.availableOutputs 85 var newOutputs = _phases.last.availableOutputs
86 .difference(_alreadyEmittedOutputs); 86 .difference(_alreadyEmittedOutputs);
87 for (var output in newOutputs) { 87 for (var output in newOutputs) {
88 output.whenRemoved.then((_) => _alreadyEmittedOutputs.remove(output)); 88 output.whenRemoved(() => _alreadyEmittedOutputs.remove(output));
89 } 89 }
90 _alreadyEmittedOutputs.addAll(newOutputs); 90 _alreadyEmittedOutputs.addAll(newOutputs);
91 91
92 return new Future.value(newOutputs); 92 return new Future.value(newOutputs);
93 } 93 }
94 } 94 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698