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

Unified Diff: sdk/lib/vmservice/asset.dart

Issue 2946773002: Remove vmservice_patch.dart. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « runtime/lib/vmservice_sources.gypi ('k') | sdk/lib/vmservice/message.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « runtime/lib/vmservice_sources.gypi ('k') | sdk/lib/vmservice/message.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698