Index: runtime/vm/json_stream.h |
diff --git a/runtime/vm/json_stream.h b/runtime/vm/json_stream.h |
index 12bd79873538217b4bd99974912d12f632c5ed6f..8784b3979c95f262213203d270dc930e4f3c2744 100644 |
--- a/runtime/vm/json_stream.h |
+++ b/runtime/vm/json_stream.h |
@@ -8,6 +8,7 @@ |
#include "include/dart_api.h" // for Dart_Port |
#include "platform/json.h" |
#include "vm/allocation.h" |
+#include "vm/service.h" |
namespace dart { |
@@ -40,6 +41,13 @@ class JSONStream : ValueObject { |
void PostReply(); |
+ void set_id_zone(ServiceIdZone* id_zone) { |
+ id_zone_ = id_zone; |
+ } |
+ ServiceIdZone* id_zone() { |
+ return id_zone_; |
+ } |
+ |
TextBuffer* buffer() { return &buffer_; } |
const char* ToCString() { return buffer_.buf(); } |
@@ -96,6 +104,7 @@ class JSONStream : ValueObject { |
void PrintValue(Isolate* isolate, bool ref = true); |
bool PrintValueStr(const String& s, intptr_t limit); |
+ void PrintServiceId(const char* name, const Object& o); |
void PrintPropertyBool(const char* name, bool b); |
void PrintProperty(const char* name, intptr_t i); |
void PrintProperty64(const char* name, int64_t i); |
@@ -124,6 +133,9 @@ class JSONStream : ValueObject { |
intptr_t open_objects_; |
TextBuffer buffer_; |
+ // Default service id zone. |
+ RingServiceIdZone default_id_zone_; |
+ ServiceIdZone* id_zone_; |
Dart_Port reply_port_; |
const char* seq_; |
const char* method_; |
@@ -151,6 +163,10 @@ class JSONObject : public ValueObject { |
stream_->CloseObject(); |
} |
+ void AddServiceId(const char* name, const Object& o) const { |
+ stream_->PrintServiceId(name, o); |
+ } |
+ |
void AddProperty(const char* name, bool b) const { |
stream_->PrintPropertyBool(name, b); |
} |