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

Unified Diff: packages/barback/lib/src/asset/asset_node.dart

Issue 3015713002: Roll to pickup pool changes
Patch Set: Created 3 years, 3 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 | « packages/barback/lib/src/asset/asset_id.dart ('k') | packages/barback/lib/src/asset/asset_node_set.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/barback/lib/src/asset/asset_node.dart
diff --git a/packages/barback/lib/src/asset/asset_node.dart b/packages/barback/lib/src/asset/asset_node.dart
index a9e000092d74681e52840bee14660d01ff130ac7..629599c06ed7e6112f6aa52b4e8ee56fab10b5ce 100644
--- a/packages/barback/lib/src/asset/asset_node.dart
+++ b/packages/barback/lib/src/asset/asset_node.dart
@@ -59,8 +59,8 @@ class AssetNode {
/// Whether this node is lazy, meaning that [force] must be called to
/// guarantee that it will eventually become available.
- bool get isLazy => _lazyCallback != null ||
- (_origin != null && _origin.isLazy);
+ bool get isLazy =>
+ _lazyCallback != null || (_origin != null && _origin.isLazy);
/// A broadcast stream that emits an event whenever the node changes state.
///
@@ -83,7 +83,7 @@ class AssetNode {
/// The return value of [callback] is piped to the returned Future. If the
/// asset is removed before becoming available, the returned future will throw
/// an [AssetNotFoundException].
- Future/*<T>*/ whenAvailable/*<T>*/(/*=T*/ callback(Asset asset)) {
+ Future<T> whenAvailable<T>(T callback(Asset asset)) {
return _waitForState((state) => state.isAvailable || state.isRemoved,
(state) {
if (state.isRemoved) throw new AssetNotFoundException(id);
@@ -98,7 +98,7 @@ class AssetNode {
///
/// The return value of [callback] is piped to the returned Future.
Future whenRemoved(callback()) =>
- _waitForState((state) => state.isRemoved, (_) => callback());
+ _waitForState((state) => state.isRemoved, (_) => callback());
/// Returns a [Future] that completes when [state] changes from its current
/// value to any other value.
@@ -114,8 +114,8 @@ class AssetNode {
/// [callback] is called synchronously if this is already in such a state.
///
/// The return value of [callback] is piped to the returned Future.
- Future/*<T>*/ _waitForState/*<T>*/(bool test(AssetState state),
- /*=T*/ callback(AssetState state)) {
+ Future<T> _waitForState<T>(
+ bool test(AssetState state), T callback(AssetState state)) {
if (test(state)) return new Future.sync(() => callback(state));
return onStateChange.firstWhere(test).then((_) => callback(state));
}
@@ -172,7 +172,7 @@ class AssetNodeController {
///
/// [callback] is guaranteed to only fire once.
AssetNodeController.lazy(AssetId id, void callback(),
- [TransformNode transform])
+ [TransformNode transform])
: node = new AssetNode._lazy(id, transform, null, callback);
/// Creates a controller for a node whose initial state matches the current
« no previous file with comments | « packages/barback/lib/src/asset/asset_id.dart ('k') | packages/barback/lib/src/asset/asset_node_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698