OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
6 | 6 |
7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
9 #include "vm/json_stream.h" | 9 #include "vm/json_stream.h" |
10 #include "vm/message.h" | 10 #include "vm/message.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } | 255 } |
256 } | 256 } |
257 | 257 |
258 | 258 |
259 void JSONStream::AppendSerializedObject(const char* serialized_object) { | 259 void JSONStream::AppendSerializedObject(const char* serialized_object) { |
260 PrintCommaIfNeeded(); | 260 PrintCommaIfNeeded(); |
261 buffer_.AddString(serialized_object); | 261 buffer_.AddString(serialized_object); |
262 } | 262 } |
263 | 263 |
264 | 264 |
| 265 void JSONStream::AppendSerializedObject(const char* property_name, |
| 266 const char* serialized_object) { |
| 267 PrintCommaIfNeeded(); |
| 268 PrintPropertyName(property_name); |
| 269 buffer_.AddString(serialized_object); |
| 270 } |
| 271 |
265 void JSONStream::Clear() { | 272 void JSONStream::Clear() { |
266 buffer_.Clear(); | 273 buffer_.Clear(); |
267 open_objects_ = 0; | 274 open_objects_ = 0; |
268 } | 275 } |
269 | 276 |
270 | 277 |
271 void JSONStream::OpenObject(const char* property_name) { | 278 void JSONStream::OpenObject(const char* property_name) { |
272 PrintCommaIfNeeded(); | 279 PrintCommaIfNeeded(); |
273 open_objects_++; | 280 open_objects_++; |
274 if (property_name != NULL) { | 281 if (property_name != NULL) { |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); | 835 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); |
829 va_end(args); | 836 va_end(args); |
830 ASSERT(len == len2); | 837 ASSERT(len == len2); |
831 stream_->buffer_.AddChar('"'); | 838 stream_->buffer_.AddChar('"'); |
832 stream_->AddEscapedUTF8String(p); | 839 stream_->AddEscapedUTF8String(p); |
833 stream_->buffer_.AddChar('"'); | 840 stream_->buffer_.AddChar('"'); |
834 free(p); | 841 free(p); |
835 } | 842 } |
836 | 843 |
837 } // namespace dart | 844 } // namespace dart |
OLD | NEW |