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

Unified Diff: Source/web/WebPageSerializerImpl.cpp

Issue 482753002: Use StringBuilder::appendLiteral() / StringBuilder::append(char) when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | « Source/platform/weborigin/SchemeRegistry.cpp ('k') | Source/web/tests/LocaleICUTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebPageSerializerImpl.cpp
diff --git a/Source/web/WebPageSerializerImpl.cpp b/Source/web/WebPageSerializerImpl.cpp
index 1a37bb1c278cb0edbccbc71e1f36f61e7992db5d..77d076c50ba9270dd7b0109b34650b3e01da62b6 100644
--- a/Source/web/WebPageSerializerImpl.cpp
+++ b/Source/web/WebPageSerializerImpl.cpp
@@ -156,7 +156,7 @@ String WebPageSerializerImpl::preActionBeforeSerializeOpenTag(
result.append(WebPageSerializer::generateMarkOfTheWebDeclaration(param->url));
} else if (isHTMLBaseElement(*element)) {
// Comment the BASE tag when serializing dom.
- result.append("<!--");
+ result.appendLiteral("<!--");
}
} else {
// Write XML declaration.
@@ -168,13 +168,13 @@ String WebPageSerializerImpl::preActionBeforeSerializeOpenTag(
xmlEncoding = param->document->encodingName();
if (xmlEncoding.isEmpty())
xmlEncoding = UTF8Encoding().name();
- result.append("<?xml version=\"");
+ result.appendLiteral("<?xml version=\"");
result.append(param->document->xmlVersion());
- result.append("\" encoding=\"");
+ result.appendLiteral("\" encoding=\"");
result.append(xmlEncoding);
if (param->document->xmlStandalone())
- result.append("\" standalone=\"yes");
- result.append("\"?>\n");
+ result.appendLiteral("\" standalone=\"yes");
+ result.appendLiteral("\"?>\n");
}
// Add doc type declaration if original document has it.
if (!param->haveSeenDocType) {
@@ -249,7 +249,7 @@ String WebPageSerializerImpl::postActionAfterSerializeEndTag(
return result.toString();
// Comment the BASE tag when serializing DOM.
if (isHTMLBaseElement(*element)) {
- result.append("-->");
+ result.appendLiteral("-->");
// Append a new base tag declaration.
result.append(WebPageSerializer::generateBaseTagDeclaration(
param->document->baseTarget()));
« no previous file with comments | « Source/platform/weborigin/SchemeRegistry.cpp ('k') | Source/web/tests/LocaleICUTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698