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

Unified Diff: runtime/vm/service.cc

Issue 1258343004: Make binary events JSON-RPC 2.0 compliant as well. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index aa99ebbb838c3c3824f875e6cc692a4bac6f1179..daa27141c367bef7c8d1fabe2ca456f6cde3b416 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -930,16 +930,21 @@ void Service::SendEchoEvent(Isolate* isolate, const char* text) {
JSONStream js;
{
JSONObject jsobj(&js);
+ jsobj.AddProperty("jsonrpc", "2.0");
+ jsobj.AddProperty("method", "streamNotify");
{
- JSONObject event(&jsobj, "event");
- event.AddProperty("type", "Event");
- event.AddProperty("kind", "_Echo");
- event.AddProperty("isolate", isolate);
- if (text != NULL) {
- event.AddProperty("text", text);
+ JSONObject params(&jsobj, "params");
+ params.AddProperty("streamId", echo_stream.id());
+ {
+ JSONObject event(&params, "event");
+ event.AddProperty("type", "Event");
+ event.AddProperty("kind", "_Echo");
+ event.AddProperty("isolate", isolate);
+ if (text != NULL) {
+ event.AddProperty("text", text);
+ }
}
}
- jsobj.AddProperty("streamId", echo_stream.id());
}
const String& message = String::Handle(String::New(js.ToCString()));
uint8_t data[] = {0, 128, 255};
@@ -2473,17 +2478,22 @@ void Service::SendGraphEvent(Isolate* isolate) {
JSONStream js;
{
JSONObject jsobj(&js);
+ jsobj.AddProperty("jsonrpc", "2.0");
+ jsobj.AddProperty("method", "streamNotify");
{
- JSONObject event(&jsobj, "event");
- event.AddProperty("type", "Event");
- event.AddProperty("kind", "_Graph");
- event.AddProperty("isolate", isolate);
-
- event.AddProperty("chunkIndex", i);
- event.AddProperty("chunkCount", num_chunks);
- event.AddProperty("nodeCount", node_count);
+ JSONObject params(&jsobj, "params");
+ params.AddProperty("streamId", graph_stream.id());
+ {
+ JSONObject event(&params, "event");
+ event.AddProperty("type", "Event");
+ event.AddProperty("kind", "_Graph");
+ event.AddProperty("isolate", isolate);
+
+ event.AddProperty("chunkIndex", i);
+ event.AddProperty("chunkCount", num_chunks);
+ event.AddProperty("nodeCount", node_count);
+ }
}
- jsobj.AddProperty("streamId", graph_stream.id());
}
const String& message = String::Handle(String::New(js.ToCString()));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698