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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 PrintCommaIfNeeded(); | 301 PrintCommaIfNeeded(); |
302 buffer_.Printf("%" Pd64 "", i); | 302 buffer_.Printf("%" Pd64 "", i); |
303 } | 303 } |
304 | 304 |
305 | 305 |
306 void JSONStream::PrintValueTimeMillis(int64_t millis) { | 306 void JSONStream::PrintValueTimeMillis(int64_t millis) { |
307 PrintValue(static_cast<double>(millis)); | 307 PrintValue(static_cast<double>(millis)); |
308 } | 308 } |
309 | 309 |
310 | 310 |
| 311 void JSONStream::PrintValueTimeMicros(int64_t micros) { |
| 312 PrintValue64(micros); |
| 313 } |
| 314 |
| 315 |
311 void JSONStream::PrintValue(double d) { | 316 void JSONStream::PrintValue(double d) { |
312 PrintCommaIfNeeded(); | 317 PrintCommaIfNeeded(); |
313 buffer_.Printf("%f", d); | 318 buffer_.Printf("%f", d); |
314 } | 319 } |
315 | 320 |
316 | 321 |
317 static const char base64_digits[65] = | 322 static const char base64_digits[65] = |
318 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | 323 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
319 static const char base64_pad = '='; | 324 static const char base64_pad = '='; |
320 | 325 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 PrintPropertyName(name); | 463 PrintPropertyName(name); |
459 PrintValue64(i); | 464 PrintValue64(i); |
460 } | 465 } |
461 | 466 |
462 | 467 |
463 void JSONStream::PrintPropertyTimeMillis(const char* name, int64_t millis) { | 468 void JSONStream::PrintPropertyTimeMillis(const char* name, int64_t millis) { |
464 PrintProperty(name, static_cast<double>(millis)); | 469 PrintProperty(name, static_cast<double>(millis)); |
465 } | 470 } |
466 | 471 |
467 | 472 |
| 473 void JSONStream::PrintPropertyTimeMicros(const char* name, int64_t micros) { |
| 474 PrintProperty64(name, micros); |
| 475 } |
| 476 |
| 477 |
468 void JSONStream::PrintProperty(const char* name, double d) { | 478 void JSONStream::PrintProperty(const char* name, double d) { |
469 PrintPropertyName(name); | 479 PrintPropertyName(name); |
470 PrintValue(d); | 480 PrintValue(d); |
471 } | 481 } |
472 | 482 |
473 | 483 |
474 void JSONStream::PrintProperty(const char* name, const char* s) { | 484 void JSONStream::PrintProperty(const char* name, const char* s) { |
475 PrintPropertyName(name); | 485 PrintPropertyName(name); |
476 PrintValue(s); | 486 PrintValue(s); |
477 } | 487 } |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); | 781 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); |
772 va_end(args); | 782 va_end(args); |
773 ASSERT(len == len2); | 783 ASSERT(len == len2); |
774 stream_->buffer_.AddChar('"'); | 784 stream_->buffer_.AddChar('"'); |
775 stream_->AddEscapedUTF8String(p); | 785 stream_->AddEscapedUTF8String(p); |
776 stream_->buffer_.AddChar('"'); | 786 stream_->buffer_.AddChar('"'); |
777 free(p); | 787 free(p); |
778 } | 788 } |
779 | 789 |
780 } // namespace dart | 790 } // namespace dart |
OLD | NEW |