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

Unified Diff: runtime/vm/json_stream.h

Issue 1132323002: Add Service ID zones to service protocol (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 | « runtime/vm/isolate.cc ('k') | runtime/vm/json_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/json_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698