Index: sdk/lib/vmservice/asset.dart |
diff --git a/sdk/lib/vmservice/asset.dart b/sdk/lib/vmservice/asset.dart |
index 708c169849842aaa0cd711d4190f59c188150bd9..32c8ec2f987da7383e1155dca0327dfb8a7e69bd 100644 |
--- a/sdk/lib/vmservice/asset.dart |
+++ b/sdk/lib/vmservice/asset.dart |
@@ -37,12 +37,25 @@ class Asset { |
} |
} |
- /// Call to request assets from the embedder. |
- external static HashMap<String, Asset> request(); |
+ static HashMap<String, Asset> request() { |
+ Uint8List tarBytes = _requestAssets(); |
+ if (tarBytes == null) { |
+ return null; |
+ } |
+ List assetList = _decodeAssets(tarBytes); |
+ HashMap<String, Asset> assets = new HashMap<String, Asset>(); |
+ for (int i = 0; i < assetList.length; i += 2) { |
+ var a = new Asset(assetList[i], assetList[i + 1]); |
+ assets[a.name] = a; |
+ } |
+ return assets; |
+ } |
String toString() => '$name ($mimeType)'; |
} |
+List _decodeAssets(Uint8List data) native "VMService_DecodeAssets"; |
+ |
HashMap<String, Asset> _assets; |
HashMap<String, Asset> get assets { |
if (_assets == null) { |