Bug 801780 - Part 1: Escape quotes in memory reporter paths when dumping to JSON. r=njn

This commit is contained in:
Justin Lebar 2012-10-17 10:44:31 -04:00
Родитель b905e6a742
Коммит f09d24441f
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -399,7 +399,8 @@ DumpReport(nsIGZFileWriter *aWriter, bool aIsFirst,
DUMP(aWriter, "\", \"path\": \""); DUMP(aWriter, "\", \"path\": \"");
nsCString path(aPath); nsCString path(aPath);
path.ReplaceSubstring("\\", "\\\\"); // escape backslashes for JSON path.ReplaceSubstring("\\", "\\\\"); /* <backslash> --> \\ */
path.ReplaceSubstring("\"", "\\\""); // " --> \"
DUMP(aWriter, path); DUMP(aWriter, path);
DUMP(aWriter, "\", \"kind\": "); DUMP(aWriter, "\", \"kind\": ");