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

Unified Diff: third_party/WebKit/Source/core/frame/FrameSerializer.cpp

Issue 2017303002: Revert of Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: third_party/WebKit/Source/core/frame/FrameSerializer.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameSerializer.cpp b/third_party/WebKit/Source/core/frame/FrameSerializer.cpp
index c733c41dbab5ca6e6ddf689f8b241d17fcac2b23..a49c4505834089fff944f7009500f9d8e3ba5d48 100644
--- a/third_party/WebKit/Source/core/frame/FrameSerializer.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameSerializer.cpp
@@ -146,14 +146,14 @@
// TODO(tiger): Refactor MarkupAccumulator so it is easier to append an element like this, without special cases for XHTML
if (isHTMLHeadElement(element)) {
- result.append("<meta http-equiv=\"Content-Type\" content=\"");
+ result.appendLiteral("<meta http-equiv=\"Content-Type\" content=\"");
appendAttributeValue(result, m_document->suggestedMIMEType());
- result.append("; charset=");
+ result.appendLiteral("; charset=");
appendAttributeValue(result, m_document->characterSet());
if (m_document->isXHTMLDocument())
- result.append("\" />");
+ result.appendLiteral("\" />");
else
- result.append("\">");
+ result.appendLiteral("\">");
}
// FIXME: For object (plugins) tags and video tag we could replace them by an image of their current contents.
@@ -227,9 +227,9 @@
// TODO(tiger): Refactor MarkupAccumulator so it is easier to append an attribute like this.
out.append(' ');
out.append(attributeName);
- out.append("=\"");
+ out.appendLiteral("=\"");
appendAttributeValue(out, attributeValue);
- out.append("\"");
+ out.appendLiteral("\"");
}
// TODO(tiger): Right now there is no support for rewriting URLs inside CSS
@@ -308,9 +308,9 @@
void FrameSerializer::serializeCSSStyleSheet(CSSStyleSheet& styleSheet, const KURL& url)
{
StringBuilder cssText;
- cssText.append("@charset \"");
+ cssText.appendLiteral("@charset \"");
cssText.append(styleSheet.contents()->charset().lower());
- cssText.append("\";\n\n");
+ cssText.appendLiteral("\";\n\n");
for (unsigned i = 0; i < styleSheet.length(); ++i) {
CSSRule* rule = styleSheet.item(i);
@@ -318,7 +318,7 @@
if (!itemText.isEmpty()) {
cssText.append(itemText);
if (i < styleSheet.length() - 1)
- cssText.append("\n\n");
+ cssText.appendLiteral("\n\n");
}
// Some rules have resources associated with them that we need to retrieve.
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameConsole.cpp ('k') | third_party/WebKit/Source/core/html/ImageDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698