OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 @patch | 5 @patch class Asset { |
6 class Asset { | |
7 /// Call to request assets from the embedder. | 6 /// Call to request assets from the embedder. |
8 @patch | 7 @patch static HashMap<String, Asset> request() { |
9 static HashMap<String, Asset> request() { | |
10 HashMap<String, Asset> assets = new HashMap<String, Asset>(); | 8 HashMap<String, Asset> assets = new HashMap<String, Asset>(); |
11 Uint8List tarBytes = _requestAssets(); | 9 Uint8List tarBytes = _requestAssets(); |
12 if (tarBytes == null) { | 10 if (tarBytes == null) { |
13 return assets; | 11 return assets; |
14 } | 12 } |
15 List assetList = _decodeAssets(tarBytes); | 13 List assetList = _decodeAssets(tarBytes); |
16 for (int i = 0; i < assetList.length; i += 2) { | 14 for (int i = 0; i < assetList.length; i += 2) { |
17 var a = new Asset(assetList[i], assetList[i + 1]); | 15 var a = new Asset(assetList[i], assetList[i + 1]); |
18 assets[a.name] = a; | 16 assets[a.name] = a; |
19 } | 17 } |
20 return assets; | 18 return assets; |
21 } | 19 } |
22 } | 20 } |
23 | 21 |
24 List _decodeAssets(Uint8List data) native "VMService_DecodeAssets"; | 22 List _decodeAssets(Uint8List data) native "VMService_DecodeAssets"; |
25 | 23 |
26 @patch | 24 @patch bool sendIsolateServiceMessage(SendPort sp, List m) |
27 bool sendIsolateServiceMessage(SendPort sp, List m) | |
28 native "VMService_SendIsolateServiceMessage"; | 25 native "VMService_SendIsolateServiceMessage"; |
29 @patch | 26 @patch void sendRootServiceMessage(List m) |
30 void sendRootServiceMessage(List m) native "VMService_SendRootServiceMessage"; | 27 native "VMService_SendRootServiceMessage"; |
31 @patch | 28 @patch void sendObjectRootServiceMessage(List m) |
32 void sendObjectRootServiceMessage(List m) | |
33 native "VMService_SendObjectRootServiceMessage"; | 29 native "VMService_SendObjectRootServiceMessage"; |
34 @patch | 30 @patch void _onStart() native "VMService_OnStart"; |
35 void _onStart() native "VMService_OnStart"; | 31 @patch void _onExit() native "VMService_OnExit"; |
36 @patch | 32 @patch void onServerAddressChange(String address) |
37 void _onExit() native "VMService_OnExit"; | |
38 @patch | |
39 void onServerAddressChange(String address) | |
40 native "VMService_OnServerAddressChange"; | 33 native "VMService_OnServerAddressChange"; |
41 @patch | 34 @patch bool _vmListenStream(String streamId) native "VMService_ListenStream"; |
42 bool _vmListenStream(String streamId) native "VMService_ListenStream"; | 35 @patch void _vmCancelStream(String streamId) native "VMService_CancelStream"; |
43 @patch | 36 @patch Uint8List _requestAssets() native "VMService_RequestAssets"; |
44 void _vmCancelStream(String streamId) native "VMService_CancelStream"; | 37 @patch void _spawnUriNotify(obj, String token) |
45 @patch | 38 native "VMService_spawnUriNotify"; |
46 Uint8List _requestAssets() native "VMService_RequestAssets"; | |
47 @patch | |
48 void _spawnUriNotify(obj, String token) native "VMService_spawnUriNotify"; | |
OLD | NEW |