| Index: runtime/vm/json_stream.cc
|
| diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc
|
| index 2ed62efd8c1caf16ed1ab3bfaa4e79f129dc22e6..e1cf409b64961394802fc5e9f24cab7b12c9d8c5 100644
|
| --- a/runtime/vm/json_stream.cc
|
| +++ b/runtime/vm/json_stream.cc
|
| @@ -357,9 +357,9 @@ void JSONStream::PrintValue(Isolate* isolate, bool ref) {
|
| }
|
|
|
|
|
| -void JSONStream::PrintServiceId(const char* name, const Object& o) {
|
| +void JSONStream::PrintServiceId(const Object& o) {
|
| ASSERT(id_zone_ != NULL);
|
| - PrintProperty(name, id_zone_->GetServiceId(o));
|
| + PrintProperty("id", id_zone_->GetServiceId(o));
|
| }
|
|
|
|
|
| @@ -558,6 +558,27 @@ JSONObject::JSONObject(const JSONArray* arr) : stream_(arr->stream_) {
|
| }
|
|
|
|
|
| +void JSONObject::AddFixedServiceId(const char* format, ...) const {
|
| + // Mark that this id is fixed.
|
| + AddProperty("fixedId", true);
|
| + // Add the id property.
|
| + stream_->PrintPropertyName("id");
|
| + va_list args;
|
| + va_start(args, format);
|
| + intptr_t len = OS::VSNPrint(NULL, 0, format, args);
|
| + va_end(args);
|
| + char* p = reinterpret_cast<char*>(malloc(len+1));
|
| + va_start(args, format);
|
| + intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
|
| + va_end(args);
|
| + ASSERT(len == len2);
|
| + stream_->buffer_.AddChar('"');
|
| + stream_->AddEscapedUTF8String(p);
|
| + stream_->buffer_.AddChar('"');
|
| + free(p);
|
| +}
|
| +
|
| +
|
| void JSONObject::AddPropertyF(const char* name,
|
| const char* format, ...) const {
|
| stream_->PrintPropertyName(name);
|
|
|