Index: runtime/bin/vmservice/server.dart |
diff --git a/runtime/bin/vmservice/server.dart b/runtime/bin/vmservice/server.dart |
index a847828b84a6af53388420013ceac87ce1a47ad0..2530f3740f9c15ff89530751b86e3b9dbf85d65e 100644 |
--- a/runtime/bin/vmservice/server.dart |
+++ b/runtime/bin/vmservice/server.dart |
@@ -10,11 +10,9 @@ class WebSocketClient extends Client { |
static const int NOT_MAP_ERROR_CODE = 4002; |
final WebSocket socket; |
- WebSocketClient(this.socket, service) : super(service) { |
+ WebSocketClient(this.socket, VMService service) : super(service) { |
socket.listen((message) => onWebSocketMessage(message)); |
socket.done.then((_) => close()); |
- service.subscribe('debug', this); |
- service.subscribe('gc', this); |
} |
void onWebSocketMessage(message) { |
@@ -37,15 +35,15 @@ class WebSocketClient extends Client { |
} |
} |
- void post(var serial, dynamic response) { |
+ void post(var serial, dynamic result) { |
try { |
- Map map = { |
- 'id': serial, |
- 'response': response |
- }; |
- if (serial == null && response is! String) { |
- socket.add(response); |
+ if (serial == null && result is! String) { |
+ socket.add(result); |
} else { |
+ Map map = { |
+ 'id': serial, |
+ 'result': result |
+ }; |
socket.add(JSON.encode(map)); |
} |
} catch (_) { |
@@ -67,11 +65,12 @@ class HttpRequestClient extends Client { |
new ContentType("application", "json", charset: "utf-8"); |
final HttpRequest request; |
- HttpRequestClient(this.request, service) : super(service); |
+ HttpRequestClient(this.request, VMService service) |
+ : super(service, sendEvents:false); |
- void post(var serial, String response) { |
+ void post(var serial, String result) { |
request.response..headers.contentType = jsonContentType |
- ..write(response) |
+ ..write(result) |
..close(); |
close(); |
} |