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

Unified Diff: pkg/barback/lib/src/transform.dart

Issue 178223024: Refactor the Transform classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
Index: pkg/barback/lib/src/transform.dart
diff --git a/pkg/barback/lib/src/transform.dart b/pkg/barback/lib/src/transform.dart
index 26b718d0f47d68a032c19eb351c59ff123400e96..1695388d3d98839fa09a2f0bc534f68a707c2a29 100644
--- a/pkg/barback/lib/src/transform.dart
+++ b/pkg/barback/lib/src/transform.dart
@@ -7,7 +7,6 @@ library barback.transform;
import 'asset.dart';
import 'asset_set.dart';
import 'base_transform.dart';
-import 'transform_logger.dart';
import 'transform_node.dart';
/// While a [Transformer] represents a *kind* of transformation, this defines
@@ -18,10 +17,10 @@ import 'transform_node.dart';
/// the transformation. It lets the [Transformer] access inputs and generate
/// outputs.
class Transform extends BaseTransform {
- final AssetSet _outputs;
+ final _outputs = new AssetSet();
- Transform(TransformNode node, this._outputs, LogFunction logFunction)
- : super(node, logFunction);
+ Transform._(TransformNode node)
+ : super(node);
/// Stores [output] as the output created by this transformation.
///
@@ -32,3 +31,14 @@ class Transform extends BaseTransform {
_outputs.add(output);
}
}
+
+/// The controller for [Transform].
+class TransformController extends BaseTransformController {
+ Transform get transform => super.transform;
+
+ /// The set of assets that the transformer has emitted.
+ AssetSet get outputs => transform._outputs;
+
+ TransformController(TransformNode node)
+ : super(new Transform._(node));
+}

Powered by Google App Engine
This is Rietveld 408576698