Remove vmservice_patch.dart.

The code in the patch is now inlined into the vmservice library.
This is being done because, the vmservice related libraries are
now compiled directly from source instead of from the "patched_sdk".
So, what is being compiled now does not have the vmservice_patch
applied. By removing the patch, we are removing the need to
artificially patch the vmservice library and making the
vmservice_io.dill complete.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2946773002 .
This commit is contained in:
Siva Chandra 2017-06-20 12:24:11 -07:00
parent d514347a44
commit b9bf4fcc48
5 changed files with 30 additions and 62 deletions

View file

@ -1,48 +0,0 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// 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() {
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;
}
}
List _decodeAssets(Uint8List data) native "VMService_DecodeAssets";
@patch
bool sendIsolateServiceMessage(SendPort sp, List m)
native "VMService_SendIsolateServiceMessage";
@patch
void sendRootServiceMessage(List m) native "VMService_SendRootServiceMessage";
@patch
void sendObjectRootServiceMessage(List m)
native "VMService_SendObjectRootServiceMessage";
@patch
void _onStart() native "VMService_OnStart";
@patch
void _onExit() native "VMService_OnExit";
@patch
void onServerAddressChange(String address)
native "VMService_OnServerAddressChange";
@patch
bool _vmListenStream(String streamId) native "VMService_ListenStream";
@patch
void _vmCancelStream(String streamId) native "VMService_CancelStream";
@patch
Uint8List _requestAssets() native "VMService_RequestAssets";
@patch
void _spawnUriNotify(obj, String token) native "VMService_spawnUriNotify";

View file

@ -6,8 +6,6 @@
{
'sources': [
'vmservice_patch.dart',
# The above file needs to be first as it imports required libraries.
'vmservice.cc',
],
}

View file

@ -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) {

View file

@ -188,6 +188,10 @@ class Message {
}
}
external bool sendIsolateServiceMessage(SendPort sp, List m);
external void sendRootServiceMessage(List m);
external void sendObjectRootServiceMessage(List m);
bool sendIsolateServiceMessage(SendPort sp, List m)
native "VMService_SendIsolateServiceMessage";
void sendRootServiceMessage(List m) native "VMService_SendRootServiceMessage";
void sendObjectRootServiceMessage(List m)
native "VMService_SendObjectRootServiceMessage";

View file

@ -480,22 +480,23 @@ void _registerIsolate(int port_id, SendPort sp, String name) {
}
/// Notify the VM that the service is running.
external void _onStart();
void _onStart() native "VMService_OnStart";
/// Notify the VM that the service is no longer running.
external void _onExit();
void _onExit() native "VMService_OnExit";
/// Notify the VM that the server's address has changed.
external void onServerAddressChange(String address);
void onServerAddressChange(String address)
native "VMService_OnServerAddressChange";
/// Subscribe to a service stream.
external bool _vmListenStream(String streamId);
bool _vmListenStream(String streamId) native "VMService_ListenStream";
/// Cancel a subscription to a service stream.
external void _vmCancelStream(String streamId);
void _vmCancelStream(String streamId) native "VMService_CancelStream";
/// Get the bytes to the tar archive.
external Uint8List _requestAssets();
Uint8List _requestAssets() native "VMService_RequestAssets";
/// Notify the vm service that an isolate has been spawned via rpc.
external void _spawnUriNotify(obj, String token);
void _spawnUriNotify(obj, String token) native "VMService_spawnUriNotify";