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

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

Issue 1276903004: Add timeline stream control and trace retrieval to the dart embedder api. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); 527 intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
528 va_end(args); 528 va_end(args);
529 ASSERT(len == len2); 529 ASSERT(len == len2);
530 buffer_.AddChar('"'); 530 buffer_.AddChar('"');
531 AddEscapedUTF8String(p); 531 AddEscapedUTF8String(p);
532 buffer_.AddChar('"'); 532 buffer_.AddChar('"');
533 free(p); 533 free(p);
534 } 534 }
535 535
536 536
537 void JSONStream::Steal(const char** buffer, intptr_t* buffer_length) {
538 ASSERT(buffer != NULL);
539 ASSERT(buffer_length != NULL);
540 *buffer_length = buffer_.length();
541 *buffer = buffer_.Steal();
542 }
543
544
537 void JSONStream::set_reply_port(Dart_Port port) { 545 void JSONStream::set_reply_port(Dart_Port port) {
538 reply_port_ = port; 546 reply_port_ = port;
539 } 547 }
540 548
541 549
542 void JSONStream::SetParams(const char** param_keys, 550 void JSONStream::SetParams(const char** param_keys,
543 const char** param_values, 551 const char** param_values,
544 intptr_t num_params) { 552 intptr_t num_params) {
545 param_keys_ = param_keys; 553 param_keys_ = param_keys;
546 param_values_ = param_values; 554 param_values_ = param_values;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); 708 intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
701 va_end(args); 709 va_end(args);
702 ASSERT(len == len2); 710 ASSERT(len == len2);
703 stream_->buffer_.AddChar('"'); 711 stream_->buffer_.AddChar('"');
704 stream_->AddEscapedUTF8String(p); 712 stream_->AddEscapedUTF8String(p);
705 stream_->buffer_.AddChar('"'); 713 stream_->buffer_.AddChar('"');
706 free(p); 714 free(p);
707 } 715 }
708 716
709 } // namespace dart 717 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698