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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp

Issue 1845363003: String replaceWithLiteral should just use strlen, also rename to replace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another NUL fix. Created 4 years, 9 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/layout/LayoutTreeAsText.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp b/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
index 985b2d01d415224838adc50e7414dd88282513a8..5995155088b78a5c986253bc3566ad9eedef991b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
@@ -420,9 +420,9 @@ static void writeInlineTextBox(TextStream& ts, const InlineTextBox& textBox, int
{
writeInlineBox(ts, textBox, indent);
String value = textBox.text();
- value.replaceWithLiteral('\\', "\\\\");
- value.replaceWithLiteral('\n', "\\n");
- value.replaceWithLiteral('"', "\\\"");
+ value.replace('\\', "\\\\");
+ value.replace('\n', "\\n");
+ value.replace('"', "\\\"");
ts << " range=(" << textBox.start() << "," << (textBox.start() + textBox.len()) << ")"
<< " \"" << value << "\"";
}

Powered by Google App Engine
This is Rietveld 408576698