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

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

Issue 18650004: Make Assets know their ID. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add AssetSet and revise. Created 7 years, 6 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/asset_graph.dart
diff --git a/pkg/barback/lib/src/asset_graph.dart b/pkg/barback/lib/src/asset_graph.dart
index 5d77a5c8bc7944b24da693713285736f9c0454ad..125df9557e6a3f346fe6b2d5147eaad59addbabd 100644
--- a/pkg/barback/lib/src/asset_graph.dart
+++ b/pkg/barback/lib/src/asset_graph.dart
@@ -10,6 +10,7 @@ import 'dart:collection';
import 'asset.dart';
import 'asset_id.dart';
import 'asset_provider.dart';
+import 'asset_set.dart';
import 'errors.dart';
import 'change_batch.dart';
import 'phase.dart';
@@ -190,12 +191,12 @@ class AssetGraph {
var changes = _sourceChanges;
_sourceChanges = null;
- var updated = new Map<AssetId, Asset>();
+ var updated = new AssetSet();
var futures = [];
for (var id in changes.updated) {
// TODO(rnystrom): Catch all errors from provider and route to results.
futures.add(_provider.getAsset(id).then((asset) {
- updated[id] = asset;
+ updated.add(asset);
}).catchError((error) {
if (error is AssetNotFoundException) {
// Handle missing asset errors like regular missing assets.

Powered by Google App Engine
This is Rietveld 408576698