Chromium Code Reviews| Index: runtime/vm/json_stream.h |
| diff --git a/runtime/vm/json_stream.h b/runtime/vm/json_stream.h |
| index 12bd79873538217b4bd99974912d12f632c5ed6f..af901aae01c1948da20c9a8cd8e811e607b63cc8 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 { |
| @@ -20,7 +21,9 @@ class JSONObject; |
| class MessageQueue; |
| class Metric; |
| class Object; |
| +class RingIdZone; |
|
turnidge
2015/05/12 20:08:01
Is this forward declaration right? I see "RingSer
Cutch
2015/05/12 23:32:58
Done.
|
| class ServiceEvent; |
| +class ServiceIdZone; |
| class SourceBreakpoint; |
| class String; |
| class Zone; |
| @@ -40,6 +43,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 +106,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 +135,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 +165,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); |
| } |