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

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

Issue 48483002: Remove deprecated parts of dart:async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address Bob's comment. Created 7 years, 1 month 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.asset_cascade; 5 library barback.asset_cascade;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'asset.dart'; 10 import 'asset.dart';
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 /// 116 ///
117 /// It loads source assets within [package] using [provider]. 117 /// It loads source assets within [package] using [provider].
118 AssetCascade(this.graph, this.package) { 118 AssetCascade(this.graph, this.package) {
119 _onDirtyPool.add(_onDirtyController.stream); 119 _onDirtyPool.add(_onDirtyController.stream);
120 _addPhase(new Phase(this, [])); 120 _addPhase(new Phase(this, []));
121 121
122 // Keep track of logged errors so we can know that the build failed. 122 // Keep track of logged errors so we can know that the build failed.
123 onLog.listen((entry) { 123 onLog.listen((entry) {
124 if (entry.level == LogLevel.ERROR) { 124 if (entry.level == LogLevel.ERROR) {
125 _accumulatedErrors.add( 125 _accumulatedErrors.add(
126 new TransformerException(entry.transform, entry.message)); 126 new TransformerException(entry.transform, entry.message, null));
nweiz 2013/10/30 22:48:18 Can you add a TODO to track the stack trace of err
floitsch 2013/10/31 00:38:14 Done.
127 } 127 }
128 }); 128 });
129 } 129 }
130 130
131 /// Gets the asset identified by [id]. 131 /// Gets the asset identified by [id].
132 /// 132 ///
133 /// If [id] is for a generated or transformed asset, this will wait until it 133 /// If [id] is for a generated or transformed asset, this will wait until it
134 /// has been created and return it. This means that the returned asset will 134 /// has been created and return it. This means that the returned asset will
135 /// always be [AssetState.AVAILABLE]. 135 /// always be [AssetState.AVAILABLE].
136 /// 136 ///
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // If this source was already loading, cancel the old load, since it may 180 // If this source was already loading, cancel the old load, since it may
181 // return out-of-date contents for the asset. 181 // return out-of-date contents for the asset.
182 if (_loadingSources.containsKey(id)) _loadingSources[id].cancel(); 182 if (_loadingSources.containsKey(id)) _loadingSources[id].cancel();
183 183
184 _loadingSources[id] = 184 _loadingSources[id] =
185 new CancelableFuture<Asset>(graph.provider.getAsset(id)); 185 new CancelableFuture<Asset>(graph.provider.getAsset(id));
186 _loadingSources[id].whenComplete(() { 186 _loadingSources[id].whenComplete(() {
187 _loadingSources.remove(id); 187 _loadingSources.remove(id);
188 }).then((asset) { 188 }).then((asset) {
189 var controller = _sourceControllerMap[id].setAvailable(asset); 189 var controller = _sourceControllerMap[id].setAvailable(asset);
190 }).catchError((error) { 190 }).catchError((error, stack) {
191 reportError(new AssetLoadException(id, error)); 191 reportError(new AssetLoadException(id, error, stack));
192 192
193 // TODO(nweiz): propagate error information through asset nodes. 193 // TODO(nweiz): propagate error information through asset nodes.
194 _sourceControllerMap.remove(id).setRemoved(); 194 _sourceControllerMap.remove(id).setRemoved();
195 }); 195 });
196 } 196 }
197 } 197 }
198 198
199 /// Removes [removed] from the graph's known set of source assets. 199 /// Removes [removed] from the graph's known set of source assets.
200 void removeSources(Iterable<AssetId> removed) { 200 void removeSources(Iterable<AssetId> removed) {
201 removed.forEach((id) { 201 removed.forEach((id) {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 301
302 // Otherwise, everything is done. 302 // Otherwise, everything is done.
303 return; 303 return;
304 } 304 }
305 305
306 // Process that phase and then loop onto the next. 306 // Process that phase and then loop onto the next.
307 return future.then((_) => _process()); 307 return future.then((_) => _process());
308 }); 308 });
309 } 309 }
310 } 310 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698