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

Unified Diff: runtime/bin/vmservice/server.dart

Issue 1093043004: Do not JSON encode the 'result' of a service rpc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 5 years, 8 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 | « no previous file | runtime/observatory/lib/service.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/server.dart
diff --git a/runtime/bin/vmservice/server.dart b/runtime/bin/vmservice/server.dart
index 2530f3740f9c15ff89530751b86e3b9dbf85d65e..9818e588693fa789446c07ab0f7ccec9779bcfa9 100644
--- a/runtime/bin/vmservice/server.dart
+++ b/runtime/bin/vmservice/server.dart
@@ -35,17 +35,9 @@ class WebSocketClient extends Client {
}
}
- void post(var serial, dynamic result) {
+ void post(dynamic result) {
try {
- if (serial == null && result is! String) {
- socket.add(result);
- } else {
- Map map = {
- 'id': serial,
- 'result': result
- };
- socket.add(JSON.encode(map));
- }
+ socket.add(result);
} catch (_) {
print("Ignoring error posting over WebSocket.");
}
@@ -68,7 +60,7 @@ class HttpRequestClient extends Client {
HttpRequestClient(this.request, VMService service)
: super(service, sendEvents:false);
- void post(var serial, String result) {
+ void post(String result) {
request.response..headers.contentType = jsonContentType
..write(result)
..close();
« no previous file with comments | « no previous file | runtime/observatory/lib/service.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698