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

Unified Diff: runtime/lib/vmservice_patch.dart

Issue 1474603003: Move tar archive parsing to C++ (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove <string> and <vector> Created 5 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 side-by-side diff with in-line comments
Download patch
Index: runtime/lib/vmservice_patch.dart
diff --git a/runtime/lib/vmservice_patch.dart b/runtime/lib/vmservice_patch.dart
index a88500448a8ad54b61751477568d6f1638a6b78e..394201360c44f288bf6162e0000b4f14fb998291 100644
--- a/runtime/lib/vmservice_patch.dart
+++ b/runtime/lib/vmservice_patch.dart
@@ -2,6 +2,25 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+patch class Asset {
+ /// Call to request assets from the embedder.
+ /* patch */ static HashMap<String, Asset> request() {
Ivan Posva 2015/11/25 17:09:04 Does this need to be a public addition to the Asse
zra 2015/11/25 19:06:16 This is patching over a public call implemented in
+ HashMap<String, Asset> assets = new HashMap<String, Asset>();
+ Uint8List tarBytes = _requestAssets();
+ if (tarBytes == null) {
+ return assets;
+ }
+ List assetList = _decodeAssets(tarBytes);
+ for (int i = 0; i < assetList.length; i++) {
+ var a = new Asset(assetList[i][0], assetList[i][1]);
Ivan Posva 2015/11/25 17:09:04 If you have even entries for the names and odd ent
zra 2015/11/25 19:06:16 Done.
+ assets[a.name] = a;
+ }
+ return assets;
+ }
+}
+
+List _decodeAssets(Uint8List data) native "VMService_DecodeAssets";
+
patch bool sendIsolateServiceMessage(SendPort sp, List m)
native "VMService_SendIsolateServiceMessage";
patch void sendRootServiceMessage(List m)
@@ -10,4 +29,4 @@ patch void _onStart() native "VMService_OnStart";
patch void _onExit() native "VMService_OnExit";
patch bool _vmListenStream(String streamId) native "VMService_ListenStream";
patch void _vmCancelStream(String streamId) native "VMService_CancelStream";
-patch Uint8List _requestAssets() native "VMService_RequestAssets";
+patch Uint8List _requestAssets() native "VMService_RequestAssets";

Powered by Google App Engine
This is Rietveld 408576698