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

Unified Diff: src/libplatform/tracing/trace-writer.cc

Issue 2232683002: [Tracing] Minor bugs fix. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove end Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/libplatform/tracing/trace-object.cc ('k') | test/cctest/libplatform/test-tracing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/libplatform/tracing/trace-object.cc ('k') | test/cctest/libplatform/test-tracing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698