Chromium Code Reviews| Index: base/trace_event/trace_event_impl.cc |
| diff --git a/base/trace_event/trace_event_impl.cc b/base/trace_event/trace_event_impl.cc |
| index 4ab0d358f9d202dd31ba6418b098da6751348e05..3ed0f7dedb60e574587bd8768431775779626cb0 100644 |
| --- a/base/trace_event/trace_event_impl.cc |
| +++ b/base/trace_event/trace_event_impl.cc |
| @@ -293,10 +293,12 @@ void TraceEvent::AppendAsJSON( |
| // Category group checked at category creation time. |
| DCHECK(!strchr(name_, '"')); |
| StringAppendF(out, "{\"pid\":%i,\"tid\":%i,\"ts\":%" PRId64 |
| - "," |
| - "\"ph\":\"%c\",\"cat\":\"%s\",\"name\":\"%s\",\"args\":", |
| - process_id, thread_id, time_int64, phase_, category_group_name, |
| - name_); |
| + ",\"ph\":\"%c\",\"cat\":", |
| + process_id, thread_id, time_int64, phase_); |
| + EscapeJSONString(category_group_name, true, out); |
|
Primiano Tucci (use gerrit)
2016/04/07 13:30:08
In which case does a category name contain quotes?
Mario Pistrich
2016/04/07 13:50:58
Yeah, I've added it just to be sure - should I rem
Primiano Tucci (use gerrit)
2016/04/07 16:17:56
I am pretty sure that if somebody adds quotes to t
Mario Pistrich
2016/04/07 18:59:52
Okay, sounds reasonable, I removed escaping the tr
|
| + *out += ",\"name\":"; |
| + EscapeJSONString(name_, true, out); |
| + *out += ",\"args\":"; |
| // Output argument names and values, stop at first NULL argument name. |
| // TODO(oysteine): The dual predicates here is a bit ugly; if the filtering |