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

Unified Diff: tools/gn/trace.cc

Issue 100823007: Stop doing unnecessary UTF-8 to UTF-16 conversions in JSONWriter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ChromeOS page encodings Created 7 years 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 | « sync/syncable/entry.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/trace.cc
diff --git a/tools/gn/trace.cc b/tools/gn/trace.cc
index aa73eba93b526fa74e0eabbd8c90e1b15c44cb96..18082c4776b4913d43bec830f2018690296313a4 100644
--- a/tools/gn/trace.cc
+++ b/tools/gn/trace.cc
@@ -241,7 +241,7 @@ void SaveTraces(const base::FilePath& file_name) {
out << ",\"dur\":" << item.delta().InMicroseconds();
quote_buffer.resize(0);
- base::JsonDoubleQuote(item.name(), true, &quote_buffer);
+ base::EscapeJSONString(item.name(), true, &quote_buffer);
out << ",\"name\":" << quote_buffer;
out << ",\"cat\":";
@@ -270,13 +270,13 @@ void SaveTraces(const base::FilePath& file_name) {
bool needs_comma = false;
if (!item.toolchain().empty()) {
quote_buffer.resize(0);
- base::JsonDoubleQuote(item.toolchain(), true, &quote_buffer);
+ base::EscapeJSONString(item.toolchain(), true, &quote_buffer);
out << "\"toolchain\":" << quote_buffer;
needs_comma = true;
}
if (!item.cmdline().empty()) {
quote_buffer.resize(0);
- base::JsonDoubleQuote(item.cmdline(), true, &quote_buffer);
+ base::EscapeJSONString(item.cmdline(), true, &quote_buffer);
if (needs_comma)
out << ",";
out << "\"cmdline\":" << quote_buffer;
« no previous file with comments | « sync/syncable/entry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698