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

Unified Diff: third_party/WebKit/Source/platform/JSONValues.cpp

Issue 2017053003: Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 4 years, 7 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 | « third_party/WebKit/Source/platform/Decimal.cpp ('k') | third_party/WebKit/Source/platform/PODInterval.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/JSONValues.cpp
diff --git a/third_party/WebKit/Source/platform/JSONValues.cpp b/third_party/WebKit/Source/platform/JSONValues.cpp
index a92906491293aaeda7974fccaa845678f40a53dc..86f642cf6b77490ea7cd5a98e870cabbd5a0986d 100644
--- a/third_party/WebKit/Source/platform/JSONValues.cpp
+++ b/third_party/WebKit/Source/platform/JSONValues.cpp
@@ -45,13 +45,13 @@ const char* const falseString = "false";
inline bool escapeChar(UChar c, StringBuilder* dst)
{
switch (c) {
- case '\b': dst->appendLiteral("\\b"); break;
- case '\f': dst->appendLiteral("\\f"); break;
- case '\n': dst->appendLiteral("\\n"); break;
- case '\r': dst->appendLiteral("\\r"); break;
- case '\t': dst->appendLiteral("\\t"); break;
- case '\\': dst->appendLiteral("\\\\"); break;
- case '"': dst->appendLiteral("\\\""); break;
+ case '\b': dst->append("\\b"); break;
+ case '\f': dst->append("\\f"); break;
+ case '\n': dst->append("\\n"); break;
+ case '\r': dst->append("\\r"); break;
+ case '\t': dst->append("\\t"); break;
+ case '\\': dst->append("\\\\"); break;
+ case '"': dst->append("\\\""); break;
default:
return false;
}
@@ -61,7 +61,7 @@ inline bool escapeChar(UChar c, StringBuilder* dst)
void writeIndent(int depth, StringBuilder* output)
{
for (int i = 0; i < depth; ++i)
- output->appendLiteral(" ");
+ output->append(" ");
}
} // anonymous namespace
@@ -363,15 +363,15 @@ void JSONObject::writeJSON(StringBuilder* output) const
void JSONObject::prettyWriteJSONInternal(StringBuilder* output, int depth) const
{
- output->appendLiteral("{\n");
+ output->append("{\n");
for (size_t i = 0; i < m_order.size(); ++i) {
Dictionary::const_iterator it = m_data.find(m_order[i]);
ASSERT_WITH_SECURITY_IMPLICATION(it != m_data.end());
if (i)
- output->appendLiteral(",\n");
+ output->append(",\n");
writeIndent(depth + 1, output);
doubleQuoteStringForJSON(it->key, output);
- output->appendLiteral(": ");
+ output->append(": ");
it->value->prettyWriteJSONInternal(output, depth + 1);
}
output->append('\n');
« no previous file with comments | « third_party/WebKit/Source/platform/Decimal.cpp ('k') | third_party/WebKit/Source/platform/PODInterval.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698