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

Side by Side Diff: pkg/barback/test/transformer/mock.dart

Issue 243793005: Don't require Transformer methods to return Futures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
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.test.transformer.mock; 5 library barback.test.transformer.mock;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:barback/barback.dart'; 9 import 'package:barback/barback.dart';
10 import 'package:barback/src/utils.dart'; 10 import 'package:barback/src/utils.dart';
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 if (consumePrimary) transform.consumePrimary(); 183 if (consumePrimary) transform.consumePrimary();
184 return newFuture(() => doApply(transform)).then((_) { 184 return newFuture(() => doApply(transform)).then((_) {
185 if (_apply != null) return _apply.future; 185 if (_apply != null) return _apply.future;
186 }).whenComplete(() { 186 }).whenComplete(() {
187 _runningTransforms--; 187 _runningTransforms--;
188 if (_runningTransforms == 0) _started = new Completer(); 188 if (_runningTransforms == 0) _started = new Completer();
189 }); 189 });
190 } 190 }
191 191
192 /// The wrapped version of [isPrimary] for subclasses to override. 192 /// The wrapped version of [isPrimary] for subclasses to override.
193 Future<bool> doIsPrimary(AssetId id); 193 ///
194 /// This can return a `bool` or a `Future<bool>`.
195 doIsPrimary(AssetId id);
194 196
195 /// The wrapped version of [doApply] for subclasses to override. 197 /// The wrapped version of [doApply] for subclasses to override.
196 Future doApply(Transform transform); 198 ///
199 /// This may return a [Future]. If it does, it won't be considered finished
200 /// until that [Future] completes.
201 doApply(Transform transform);
197 } 202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698