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

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

Issue 19841002: Remove calls to [new Future] work around issue 11911. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change. Created 7 years, 5 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/transform.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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // Process that phase and then loop onto the next. 216 // Process that phase and then loop onto the next.
217 return future.then((_) => _process()); 217 return future.then((_) => _process());
218 }); 218 });
219 } 219 }
220 220
221 /// Processes the current batch of changes to source assets. 221 /// Processes the current batch of changes to source assets.
222 Future _processSourceChanges() { 222 Future _processSourceChanges() {
223 // Always pump the event loop. This ensures a bunch of synchronous source 223 // Always pump the event loop. This ensures a bunch of synchronous source
224 // changes are processed in a single batch even when the first one starts 224 // changes are processed in a single batch even when the first one starts
225 // the build process. 225 // the build process.
226 return new Future(() { 226 return newFuture(() {
227 if (_sourceChanges == null) return null; 227 if (_sourceChanges == null) return null;
228 228
229 // Take the current batch to ensure it doesn't get added to while we're 229 // Take the current batch to ensure it doesn't get added to while we're
230 // processing it. 230 // processing it.
231 var changes = _sourceChanges; 231 var changes = _sourceChanges;
232 _sourceChanges = null; 232 _sourceChanges = null;
233 233
234 var updated = new AssetSet(); 234 var updated = new AssetSet();
235 var futures = []; 235 var futures = [];
236 for (var id in changes.updated) { 236 for (var id in changes.updated) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 msg.write(prefixLines(error.toString())); 287 msg.write(prefixLines(error.toString()));
288 if (stackTrace != null) { 288 if (stackTrace != null) {
289 msg.write("\n\n"); 289 msg.write("\n\n");
290 msg.write("Stack trace:\n"); 290 msg.write("Stack trace:\n");
291 msg.write(prefixLines(stackTrace.toString())); 291 msg.write(prefixLines(stackTrace.toString()));
292 } 292 }
293 return msg.toString(); 293 return msg.toString();
294 }).join("\n\n"); 294 }).join("\n\n");
295 } 295 }
296 } 296 }
OLDNEW
« no previous file with comments | « no previous file | pkg/barback/lib/src/transform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698