Index: runtime/vm/json_stream.cc |
diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc |
index d72ff5bd765090a135348fd253d7c6b2b676e414..762124d1c26f04caebca29650c765a6645192107 100644 |
--- a/runtime/vm/json_stream.cc |
+++ b/runtime/vm/json_stream.cc |
@@ -8,6 +8,7 @@ |
#include "vm/debugger.h" |
#include "vm/json_stream.h" |
#include "vm/message.h" |
+#include "vm/metrics.h" |
#include "vm/object.h" |
#include "vm/unicode.h" |
@@ -259,6 +260,12 @@ void JSONStream::PrintValue(const DebuggerEvent* event) { |
} |
+void JSONStream::PrintValue(Metric* metric) { |
+ PrintCommaIfNeeded(); |
+ metric->PrintJSON(this); |
+} |
+ |
+ |
void JSONStream::PrintValue(Isolate* isolate, bool ref) { |
PrintCommaIfNeeded(); |
isolate->PrintJSON(this, ref); |
@@ -313,6 +320,11 @@ void JSONStream::PrintProperty(const char* name, SourceBreakpoint* bpt) { |
} |
+void JSONStream::PrintProperty(const char* name, Metric* metric) { |
+ PrintPropertyName(name); |
+ PrintValue(metric); |
+} |
+ |
void JSONStream::PrintProperty(const char* name, Isolate* isolate) { |
PrintPropertyName(name); |
PrintValue(isolate); |
@@ -396,6 +408,9 @@ bool JSONStream::NeedComma() { |
void JSONStream::AddEscapedUTF8String(const char* s) { |
+ if (s == NULL) { |
+ return; |
+ } |
intptr_t len = strlen(s); |
const uint8_t* s8 = reinterpret_cast<const uint8_t*>(s); |
intptr_t i = 0; |