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

Side by Side Diff: runtime/vm/json_stream.cc

Issue 1765563002: Stream blocks of timeline events over the service protocol (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 queue->PrintJSON(this); 468 queue->PrintJSON(this);
469 } 469 }
470 470
471 471
472 void JSONStream::PrintValue(Isolate* isolate, bool ref) { 472 void JSONStream::PrintValue(Isolate* isolate, bool ref) {
473 PrintCommaIfNeeded(); 473 PrintCommaIfNeeded();
474 isolate->PrintJSON(this, ref); 474 isolate->PrintJSON(this, ref);
475 } 475 }
476 476
477 477
478 void JSONStream::PrintValue(TimelineEvent* timeline_event) { 478 void JSONStream::PrintValue(const TimelineEvent* timeline_event) {
479 PrintCommaIfNeeded(); 479 PrintCommaIfNeeded();
480 timeline_event->PrintJSON(this); 480 timeline_event->PrintJSON(this);
481 } 481 }
482 482
483 483
484 void JSONStream::PrintValue(const TimelineEventBlock* timeline_event_block) {
485 PrintCommaIfNeeded();
486 timeline_event_block->PrintJSON(this);
487 }
488
489
484 void JSONStream::PrintValueVM(bool ref) { 490 void JSONStream::PrintValueVM(bool ref) {
485 PrintCommaIfNeeded(); 491 PrintCommaIfNeeded();
486 Service::PrintJSONForVM(this, ref); 492 Service::PrintJSONForVM(this, ref);
487 } 493 }
488 494
489 495
490 void JSONStream::PrintServiceId(const Object& o) { 496 void JSONStream::PrintServiceId(const Object& o) {
491 ASSERT(id_zone_ != NULL); 497 ASSERT(id_zone_ != NULL);
492 PrintProperty("id", id_zone_->GetServiceId(o)); 498 PrintProperty("id", id_zone_->GetServiceId(o));
493 } 499 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 } 592 }
587 593
588 594
589 void JSONStream::PrintProperty(const char* name, Isolate* isolate) { 595 void JSONStream::PrintProperty(const char* name, Isolate* isolate) {
590 PrintPropertyName(name); 596 PrintPropertyName(name);
591 PrintValue(isolate); 597 PrintValue(isolate);
592 } 598 }
593 599
594 600
595 void JSONStream::PrintProperty(const char* name, 601 void JSONStream::PrintProperty(const char* name,
596 TimelineEvent* timeline_event) { 602 const TimelineEvent* timeline_event) {
597 PrintPropertyName(name); 603 PrintPropertyName(name);
598 PrintValue(timeline_event); 604 PrintValue(timeline_event);
599 } 605 }
600 606
601 607
608 void JSONStream::PrintProperty(const char* name,
609 const TimelineEventBlock* timeline_event_block) {
610 PrintPropertyName(name);
611 PrintValue(timeline_event_block);
612 }
613
614
602 void JSONStream::PrintfProperty(const char* name, const char* format, ...) { 615 void JSONStream::PrintfProperty(const char* name, const char* format, ...) {
603 PrintPropertyName(name); 616 PrintPropertyName(name);
604 va_list args; 617 va_list args;
605 va_start(args, format); 618 va_start(args, format);
606 intptr_t len = OS::VSNPrint(NULL, 0, format, args); 619 intptr_t len = OS::VSNPrint(NULL, 0, format, args);
607 va_end(args); 620 va_end(args);
608 char* p = reinterpret_cast<char*>(malloc(len+1)); 621 char* p = reinterpret_cast<char*>(malloc(len+1));
609 va_start(args, format); 622 va_start(args, format);
610 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); 623 intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
611 va_end(args); 624 va_end(args);
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 ASSERT(len == len2); 867 ASSERT(len == len2);
855 stream_->buffer_.AddChar('"'); 868 stream_->buffer_.AddChar('"');
856 stream_->AddEscapedUTF8String(p); 869 stream_->AddEscapedUTF8String(p);
857 stream_->buffer_.AddChar('"'); 870 stream_->buffer_.AddChar('"');
858 free(p); 871 free(p);
859 } 872 }
860 873
861 #endif // !PRODUCT 874 #endif // !PRODUCT
862 875
863 } // namespace dart 876 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698