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 #ifndef VM_JSON_STREAM_H_ | 5 #ifndef VM_JSON_STREAM_H_ |
6 #define VM_JSON_STREAM_H_ | 6 #define VM_JSON_STREAM_H_ |
7 | 7 |
8 #include "include/dart_api.h" // for Dart_Port | 8 #include "include/dart_api.h" // for Dart_Port |
9 #include "platform/json.h" | 9 #include "platform/json.h" |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 void PrintValueNoEscape(const char* s); | 131 void PrintValueNoEscape(const char* s); |
132 void PrintfValue(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); | 132 void PrintfValue(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); |
133 void PrintValue(const Object& o, bool ref = true); | 133 void PrintValue(const Object& o, bool ref = true); |
134 void PrintValue(Breakpoint* bpt); | 134 void PrintValue(Breakpoint* bpt); |
135 void PrintValue(const ServiceEvent* event); | 135 void PrintValue(const ServiceEvent* event); |
136 void PrintValue(Metric* metric); | 136 void PrintValue(Metric* metric); |
137 void PrintValue(MessageQueue* queue); | 137 void PrintValue(MessageQueue* queue); |
138 void PrintValue(Isolate* isolate, bool ref = true); | 138 void PrintValue(Isolate* isolate, bool ref = true); |
139 bool PrintValueStr(const String& s, intptr_t limit); | 139 bool PrintValueStr(const String& s, intptr_t limit); |
140 void PrintValue(TimelineEvent* timeline_event); | 140 void PrintValue(TimelineEvent* timeline_event); |
| 141 void PrintValueVM(bool ref = true); |
141 | 142 |
142 void PrintServiceId(const Object& o); | 143 void PrintServiceId(const Object& o); |
143 void PrintPropertyBool(const char* name, bool b); | 144 void PrintPropertyBool(const char* name, bool b); |
144 void PrintProperty(const char* name, intptr_t i); | 145 void PrintProperty(const char* name, intptr_t i); |
145 void PrintProperty64(const char* name, int64_t i); | 146 void PrintProperty64(const char* name, int64_t i); |
146 void PrintPropertyTimeMillis(const char* name, int64_t millis); | 147 void PrintPropertyTimeMillis(const char* name, int64_t millis); |
147 void PrintPropertyTimeMicros(const char* name, int64_t micros); | 148 void PrintPropertyTimeMicros(const char* name, int64_t micros); |
148 void PrintProperty(const char* name, double d); | 149 void PrintProperty(const char* name, double d); |
149 void PrintPropertyBase64(const char* name, | 150 void PrintPropertyBase64(const char* name, |
150 const uint8_t* bytes, | 151 const uint8_t* bytes, |
151 intptr_t length); | 152 intptr_t length); |
152 void PrintProperty(const char* name, const char* s); | 153 void PrintProperty(const char* name, const char* s); |
153 bool PrintPropertyStr(const char* name, const String& s, intptr_t limit); | 154 bool PrintPropertyStr(const char* name, const String& s, intptr_t limit); |
154 void PrintPropertyNoEscape(const char* name, const char* s); | 155 void PrintPropertyNoEscape(const char* name, const char* s); |
155 void PrintfProperty(const char* name, const char* format, ...) | 156 void PrintfProperty(const char* name, const char* format, ...) |
156 PRINTF_ATTRIBUTE(3, 4); | 157 PRINTF_ATTRIBUTE(3, 4); |
157 void PrintProperty(const char* name, const Object& o, bool ref = true); | 158 void PrintProperty(const char* name, const Object& o, bool ref = true); |
158 | 159 |
159 void PrintProperty(const char* name, const ServiceEvent* event); | 160 void PrintProperty(const char* name, const ServiceEvent* event); |
160 void PrintProperty(const char* name, Breakpoint* bpt); | 161 void PrintProperty(const char* name, Breakpoint* bpt); |
161 void PrintProperty(const char* name, Metric* metric); | 162 void PrintProperty(const char* name, Metric* metric); |
162 void PrintProperty(const char* name, MessageQueue* queue); | 163 void PrintProperty(const char* name, MessageQueue* queue); |
163 void PrintProperty(const char* name, Isolate* isolate); | 164 void PrintProperty(const char* name, Isolate* isolate); |
164 void PrintProperty(const char* name, TimelineEvent* timeline_event); | 165 void PrintProperty(const char* name, TimelineEvent* timeline_event); |
| 166 void PrintPropertyVM(const char* name, bool ref = true); |
165 void PrintPropertyName(const char* name); | 167 void PrintPropertyName(const char* name); |
166 void PrintCommaIfNeeded(); | 168 void PrintCommaIfNeeded(); |
167 bool NeedComma(); | 169 bool NeedComma(); |
168 | 170 |
169 bool AddDartString(const String& s, intptr_t limit); | 171 bool AddDartString(const String& s, intptr_t limit); |
170 void AddEscapedUTF8String(const char* s); | 172 void AddEscapedUTF8String(const char* s); |
171 void AddEscapedUTF8String(const char* s, intptr_t len); | 173 void AddEscapedUTF8String(const char* s, intptr_t len); |
172 | 174 |
173 intptr_t nesting_level() const { return open_objects_; } | 175 intptr_t nesting_level() const { return open_objects_; } |
174 | 176 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 271 } |
270 void AddProperty(const char* name, MessageQueue* queue) const { | 272 void AddProperty(const char* name, MessageQueue* queue) const { |
271 stream_->PrintProperty(name, queue); | 273 stream_->PrintProperty(name, queue); |
272 } | 274 } |
273 void AddProperty(const char* name, Isolate* isolate) const { | 275 void AddProperty(const char* name, Isolate* isolate) const { |
274 stream_->PrintProperty(name, isolate); | 276 stream_->PrintProperty(name, isolate); |
275 } | 277 } |
276 void AddProperty(const char* name, TimelineEvent* timeline_event) const { | 278 void AddProperty(const char* name, TimelineEvent* timeline_event) const { |
277 stream_->PrintProperty(name, timeline_event); | 279 stream_->PrintProperty(name, timeline_event); |
278 } | 280 } |
| 281 void AddPropertyVM(const char* name, bool ref = true) const { |
| 282 stream_->PrintPropertyVM(name, ref); |
| 283 } |
279 void AddPropertyF(const char* name, const char* format, ...) const | 284 void AddPropertyF(const char* name, const char* format, ...) const |
280 PRINTF_ATTRIBUTE(3, 4); | 285 PRINTF_ATTRIBUTE(3, 4); |
281 | 286 |
282 private: | 287 private: |
283 JSONStream* stream_; | 288 JSONStream* stream_; |
284 | 289 |
285 friend class JSONArray; | 290 friend class JSONArray; |
286 | 291 |
287 DISALLOW_ALLOCATION(); | 292 DISALLOW_ALLOCATION(); |
288 DISALLOW_COPY_AND_ASSIGN(JSONObject); | 293 DISALLOW_COPY_AND_ASSIGN(JSONObject); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 } | 334 } |
330 void AddValue(Metric* metric) const { | 335 void AddValue(Metric* metric) const { |
331 stream_->PrintValue(metric); | 336 stream_->PrintValue(metric); |
332 } | 337 } |
333 void AddValue(MessageQueue* queue) const { | 338 void AddValue(MessageQueue* queue) const { |
334 stream_->PrintValue(queue); | 339 stream_->PrintValue(queue); |
335 } | 340 } |
336 void AddValue(TimelineEvent* timeline_event) const { | 341 void AddValue(TimelineEvent* timeline_event) const { |
337 stream_->PrintValue(timeline_event); | 342 stream_->PrintValue(timeline_event); |
338 } | 343 } |
| 344 void AddValueVM(bool ref = true) const { |
| 345 stream_->PrintValueVM(ref); |
| 346 } |
339 void AddValueF(const char* format, ...) const PRINTF_ATTRIBUTE(2, 3); | 347 void AddValueF(const char* format, ...) const PRINTF_ATTRIBUTE(2, 3); |
340 | 348 |
341 private: | 349 private: |
342 JSONStream* stream_; | 350 JSONStream* stream_; |
343 | 351 |
344 friend class JSONObject; | 352 friend class JSONObject; |
345 | 353 |
346 DISALLOW_ALLOCATION(); | 354 DISALLOW_ALLOCATION(); |
347 DISALLOW_COPY_AND_ASSIGN(JSONArray); | 355 DISALLOW_COPY_AND_ASSIGN(JSONArray); |
348 }; | 356 }; |
349 | 357 |
350 } // namespace dart | 358 } // namespace dart |
351 | 359 |
352 #endif // VM_JSON_STREAM_H_ | 360 #endif // VM_JSON_STREAM_H_ |
OLD | NEW |