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 "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
9 #include "vm/debugger.h" | 9 #include "vm/debugger.h" |
10 #include "vm/json_stream.h" | 10 #include "vm/json_stream.h" |
11 #include "vm/message.h" | 11 #include "vm/message.h" |
12 #include "vm/metrics.h" | 12 #include "vm/metrics.h" |
13 #include "vm/object.h" | 13 #include "vm/object.h" |
14 #include "vm/safepoint.h" | 14 #include "vm/safepoint.h" |
15 #include "vm/service.h" | 15 #include "vm/service.h" |
16 #include "vm/service_event.h" | 16 #include "vm/service_event.h" |
17 #include "vm/thread_registry.h" | |
17 #include "vm/timeline.h" | 18 #include "vm/timeline.h" |
18 #include "vm/unicode.h" | 19 #include "vm/unicode.h" |
19 | 20 |
20 | 21 |
21 namespace dart { | 22 namespace dart { |
22 | 23 |
23 #ifndef PRODUCT | 24 #ifndef PRODUCT |
24 | 25 |
25 void AppendJSONStreamConsumer(Dart_StreamConsumer_State state, | 26 void AppendJSONStreamConsumer(Dart_StreamConsumer_State state, |
26 const char* stream_name, | 27 const char* stream_name, |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
533 queue->PrintJSON(this); | 534 queue->PrintJSON(this); |
534 } | 535 } |
535 | 536 |
536 | 537 |
537 void JSONStream::PrintValue(Isolate* isolate, bool ref) { | 538 void JSONStream::PrintValue(Isolate* isolate, bool ref) { |
538 PrintCommaIfNeeded(); | 539 PrintCommaIfNeeded(); |
539 isolate->PrintJSON(this, ref); | 540 isolate->PrintJSON(this, ref); |
540 } | 541 } |
541 | 542 |
542 | 543 |
544 void JSONStream::PrintValue(ThreadRegistry* reg) { | |
545 PrintCommaIfNeeded(); | |
546 reg->PrintJSON(this); | |
547 } | |
548 | |
549 | |
550 void JSONStream::PrintValue(Thread* thread) { | |
551 PrintCommaIfNeeded(); | |
552 thread->PrintJSON(this); | |
553 } | |
554 | |
zra
2016/12/08 18:54:13
Please keep two newlines between functions in sour
bkonyi
2016/12/08 20:58:32
Done.
| |
555 void JSONStream::PrintValue(Zone* zone) { | |
556 PrintCommaIfNeeded(); | |
557 zone->PrintJSON(this); | |
558 } | |
559 | |
zra
2016/12/08 18:54:13
ditto
bkonyi
2016/12/08 20:58:32
Done.
| |
543 void JSONStream::PrintValue(const TimelineEvent* timeline_event) { | 560 void JSONStream::PrintValue(const TimelineEvent* timeline_event) { |
544 PrintCommaIfNeeded(); | 561 PrintCommaIfNeeded(); |
545 timeline_event->PrintJSON(this); | 562 timeline_event->PrintJSON(this); |
546 } | 563 } |
547 | 564 |
548 | 565 |
549 void JSONStream::PrintValue(const TimelineEventBlock* timeline_event_block) { | 566 void JSONStream::PrintValue(const TimelineEventBlock* timeline_event_block) { |
550 PrintCommaIfNeeded(); | 567 PrintCommaIfNeeded(); |
551 timeline_event_block->PrintJSON(this); | 568 timeline_event_block->PrintJSON(this); |
552 } | 569 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
656 PrintValue(queue); | 673 PrintValue(queue); |
657 } | 674 } |
658 | 675 |
659 | 676 |
660 void JSONStream::PrintProperty(const char* name, Isolate* isolate) { | 677 void JSONStream::PrintProperty(const char* name, Isolate* isolate) { |
661 PrintPropertyName(name); | 678 PrintPropertyName(name); |
662 PrintValue(isolate); | 679 PrintValue(isolate); |
663 } | 680 } |
664 | 681 |
665 | 682 |
683 void JSONStream::PrintProperty(const char* name, ThreadRegistry* reg) { | |
684 PrintPropertyName(name); | |
685 PrintValue(reg); | |
686 } | |
687 | |
688 | |
689 void JSONStream::PrintProperty(const char* name, Thread* thread) { | |
690 PrintPropertyName(name); | |
691 PrintValue(thread); | |
692 } | |
693 | |
694 | |
695 void JSONStream::PrintProperty(const char* name, Zone* zone) { | |
696 PrintPropertyName(name); | |
697 PrintValue(zone); | |
698 } | |
699 | |
700 | |
666 void JSONStream::PrintProperty(const char* name, | 701 void JSONStream::PrintProperty(const char* name, |
667 const TimelineEvent* timeline_event) { | 702 const TimelineEvent* timeline_event) { |
668 PrintPropertyName(name); | 703 PrintPropertyName(name); |
669 PrintValue(timeline_event); | 704 PrintValue(timeline_event); |
670 } | 705 } |
671 | 706 |
672 | 707 |
673 void JSONStream::PrintProperty(const char* name, | 708 void JSONStream::PrintProperty(const char* name, |
674 const TimelineEventBlock* timeline_event_block) { | 709 const TimelineEventBlock* timeline_event_block) { |
675 PrintPropertyName(name); | 710 PrintPropertyName(name); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
985 ASSERT(len == len2); | 1020 ASSERT(len == len2); |
986 stream_->buffer_.AddChar('"'); | 1021 stream_->buffer_.AddChar('"'); |
987 stream_->AddEscapedUTF8String(p); | 1022 stream_->AddEscapedUTF8String(p); |
988 stream_->buffer_.AddChar('"'); | 1023 stream_->buffer_.AddChar('"'); |
989 free(p); | 1024 free(p); |
990 } | 1025 } |
991 | 1026 |
992 #endif // !PRODUCT | 1027 #endif // !PRODUCT |
993 | 1028 |
994 } // namespace dart | 1029 } // namespace dart |
OLD | NEW |