Index: src/libplatform/tracing/trace-writer.cc |
diff --git a/src/libplatform/tracing/trace-writer.cc b/src/libplatform/tracing/trace-writer.cc |
index c4a75d122fb2f0bf6afb753087259143f0d46b9a..6d94350cfd9d165a5c632cb8088a928a598afa96 100644 |
--- a/src/libplatform/tracing/trace-writer.cc |
+++ b/src/libplatform/tracing/trace-writer.cc |
@@ -15,11 +15,11 @@ namespace tracing { |
// Currently we do not support JSON-escaping strings in trace arguments. |
// Thus we perform an IsJSONString() check before writing any string argument. |
-// In particular, this means strings cannot have control characters or " or \. |
+// In particular, this means strings cannot have control characters or \. |
V8_INLINE static bool IsJSONString(const char* str) { |
size_t len = strlen(str); |
for (size_t i = 0; i < len; ++i) { |
- if (iscntrl(str[i]) || str[i] == '\"' || str[i] == '\\') { |
+ if (iscntrl(str[i]) || str[i] == '\\') { |
return false; |
} |
} |
@@ -74,8 +74,8 @@ void JSONTraceWriter::AppendArgValue(uint8_t type, |
case TRACE_VALUE_TYPE_COPY_STRING: |
// Strings are currently not JSON-escaped, so we need to perform a check |
// to see if they are valid JSON strings. |
- CHECK(value.as_string == nullptr || IsJSONString(value.as_string)); |
- stream_ << "\"" << (value.as_string ? value.as_string : "NULL") << "\""; |
+ CHECK(value.as_string != nullptr && IsJSONString(value.as_string)); |
+ stream_ << (value.as_string ? value.as_string : "NULL"); |
break; |
default: |
UNREACHABLE(); |