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

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

Issue 223553008: Only pass an AssetId to isPrimary and declareOutputs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix script_compactor 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
« no previous file with comments | « pkg/barback/lib/src/transform.dart ('k') | pkg/barback/lib/src/transformer.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.transform_node; 5 library barback.transform_node;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'asset.dart'; 9 import 'asset.dart';
10 import 'asset_id.dart'; 10 import 'asset_id.dart';
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 /// Determines whether [primary] is primary for [transformer], and if so runs 185 /// Determines whether [primary] is primary for [transformer], and if so runs
186 /// [transformer.apply]. 186 /// [transformer.apply].
187 void _process() { 187 void _process() {
188 // Clear all the old input subscriptions. If an input is re-used, we'll 188 // Clear all the old input subscriptions. If an input is re-used, we'll
189 // re-subscribe. 189 // re-subscribe.
190 _clearInputSubscriptions(); 190 _clearInputSubscriptions();
191 _state = _TransformNodeState.PROCESSING; 191 _state = _TransformNodeState.PROCESSING;
192 primary.whenAvailable((_) { 192 primary.whenAvailable((_) {
193 _state = _TransformNodeState.PROCESSING; 193 _state = _TransformNodeState.PROCESSING;
194 return transformer.isPrimary(primary.asset); 194 return transformer.isPrimary(primary.asset.id);
195 }).catchError((error, stackTrace) { 195 }).catchError((error, stackTrace) {
196 // If the transform became dirty while processing, ignore any errors from 196 // If the transform became dirty while processing, ignore any errors from
197 // it. 197 // it.
198 if (_state.needsIsPrimary || _isRemoved) return false; 198 if (_state.needsIsPrimary || _isRemoved) return false;
199 199
200 // Catch all transformer errors and pipe them to the results stream. This 200 // Catch all transformer errors and pipe them to the results stream. This
201 // is so a broken transformer doesn't take down the whole graph. 201 // is so a broken transformer doesn't take down the whole graph.
202 phase.cascade.reportError(_wrapException(error, stackTrace)); 202 phase.cascade.reportError(_wrapException(error, stackTrace));
203 203
204 return false; 204 return false;
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 /// 506 ///
507 /// Specifically, whether [this] is [APPLIED] or [NOT_PRIMARY]. 507 /// Specifically, whether [this] is [APPLIED] or [NOT_PRIMARY].
508 bool get isDone => isApplied || isNotPrimary; 508 bool get isDone => isApplied || isNotPrimary;
509 509
510 final String name; 510 final String name;
511 511
512 const _TransformNodeState._(this.name); 512 const _TransformNodeState._(this.name);
513 513
514 String toString() => name; 514 String toString() => name;
515 } 515 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/transform.dart ('k') | pkg/barback/lib/src/transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698