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

Side by Side Diff: lib/src/graph/transformer_classifier.dart

Issue 1947773002: Fix all strong-mode warnings. (Closed) Base URL: git@github.com:dart-lang/barback@master
Patch Set: Code review changes Created 4 years, 7 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
« no previous file with comments | « lib/src/graph/transform_node.dart ('k') | lib/src/transformer/aggregate_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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.graph.transformer_classifier; 5 library barback.graph.transformer_classifier;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import '../asset/asset_forwarder.dart'; 9 import '../asset/asset_forwarder.dart';
10 import '../asset/asset_node.dart'; 10 import '../asset/asset_node.dart';
11 import '../errors.dart'; 11 import '../errors.dart';
12 import '../log.dart'; 12 import '../log.dart';
13 import '../transformer/aggregate_transformer.dart'; 13 import '../transformer/aggregate_transformer.dart';
14 import '../transformer/wrapping_aggregate_transformer.dart'; 14 import '../transformer/wrapping_aggregate_transformer.dart';
15 import '../utils.dart';
16 import 'node_status.dart'; 15 import 'node_status.dart';
17 import 'node_streams.dart'; 16 import 'node_streams.dart';
18 import 'phase.dart'; 17 import 'phase.dart';
19 import 'transform_node.dart'; 18 import 'transform_node.dart';
20 19
21 /// A class for classifying the primary inputs for a transformer according to 20 /// A class for classifying the primary inputs for a transformer according to
22 /// its [AggregateTransformer.classifyPrimary] method. 21 /// its [AggregateTransformer.classifyPrimary] method.
23 /// 22 ///
24 /// This is also used for non-aggregate transformers; they're modeled as 23 /// This is also used for non-aggregate transformers; they're modeled as
25 /// aggregate transformers that return the primary path if `isPrimary` is true 24 /// aggregate transformers that return the primary path if `isPrimary` is true
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 _transforms.values.map((transform) => transform.status)); 66 _transforms.values.map((transform) => transform.status));
68 } 67 }
69 68
70 TransformerClassifier(this.phase, transformer, this._location) 69 TransformerClassifier(this.phase, transformer, this._location)
71 : transformer = transformer is AggregateTransformer ? 70 : transformer = transformer is AggregateTransformer ?
72 transformer : new WrappingAggregateTransformer(transformer); 71 transformer : new WrappingAggregateTransformer(transformer);
73 72
74 /// Adds a new asset as an input for this transformer. 73 /// Adds a new asset as an input for this transformer.
75 void addInput(AssetNode input) { 74 void addInput(AssetNode input) {
76 _activeClassifications++; 75 _activeClassifications++;
77 syncFuture(() => transformer.classifyPrimary(input.id)).catchError( 76 new Future.sync(() => transformer.classifyPrimary(input.id))
78 (error, stackTrace) { 77 .catchError((error, stackTrace) {
79 if (input.state.isRemoved) return null; 78 if (input.state.isRemoved) return null;
80 79
81 // Catch all transformer errors and pipe them to the results stream. This 80 // Catch all transformer errors and pipe them to the results stream. This
82 // is so a broken transformer doesn't take down the whole graph. 81 // is so a broken transformer doesn't take down the whole graph.
83 var info = new TransformInfo(transformer, input.id); 82 var info = new TransformInfo(transformer, input.id);
84 if (error is! AssetNotFoundException) { 83 if (error is! AssetNotFoundException) {
85 error = new TransformerException(info, error, stackTrace); 84 error = new TransformerException(info, error, stackTrace);
86 } else { 85 } else {
87 error = new MissingInputException(info, error.id); 86 error = new MissingInputException(info, error.id);
88 } 87 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 137
139 /// Force all deferred transforms to begin producing concrete assets. 138 /// Force all deferred transforms to begin producing concrete assets.
140 void forceAllTransforms() { 139 void forceAllTransforms() {
141 for (var transform in _transforms.values) { 140 for (var transform in _transforms.values) {
142 transform.force(); 141 transform.force();
143 } 142 }
144 } 143 }
145 144
146 String toString() => "classifier in $_location for $transformer"; 145 String toString() => "classifier in $_location for $transformer";
147 } 146 }
OLDNEW
« no previous file with comments | « lib/src/graph/transform_node.dart ('k') | lib/src/transformer/aggregate_transform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698