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

Side by Side Diff: third_party/WebKit/Source/core/xml/XSLTProcessor.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, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of the XSL implementation. 2 * This file is part of the XSL implementation.
3 * 3 *
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved.
5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org> 5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org>
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 22 matching lines...) Expand all
33 #include "core/loader/FrameLoaderClient.h" 33 #include "core/loader/FrameLoaderClient.h"
34 #include "core/xml/DocumentXSLT.h" 34 #include "core/xml/DocumentXSLT.h"
35 #include "platform/weborigin/SecurityOrigin.h" 35 #include "platform/weborigin/SecurityOrigin.h"
36 #include "wtf/Assertions.h" 36 #include "wtf/Assertions.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 static inline void transformTextStringToXHTMLDocumentString(String& text) 40 static inline void transformTextStringToXHTMLDocumentString(String& text)
41 { 41 {
42 // Modify the output so that it is a well-formed XHTML document with a <pre> tag enclosing the text. 42 // Modify the output so that it is a well-formed XHTML document with a <pre> tag enclosing the text.
43 text.replaceWithLiteral('&', "&amp;"); 43 text.replace('&', "&amp;");
44 text.replaceWithLiteral('<', "&lt;"); 44 text.replace('<', "&lt;");
45 text = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" 45 text = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
46 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www .w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n" 46 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www .w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
47 "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" 47 "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
48 "<head><title/></head>\n" 48 "<head><title/></head>\n"
49 "<body>\n" 49 "<body>\n"
50 "<pre>" + text + "</pre>\n" 50 "<pre>" + text + "</pre>\n"
51 "</body>\n" 51 "</body>\n"
52 "</html>\n"; 52 "</html>\n";
53 } 53 }
54 54
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 161
162 DEFINE_TRACE(XSLTProcessor) 162 DEFINE_TRACE(XSLTProcessor)
163 { 163 {
164 visitor->trace(m_stylesheet); 164 visitor->trace(m_stylesheet);
165 visitor->trace(m_stylesheetRootNode); 165 visitor->trace(m_stylesheetRootNode);
166 visitor->trace(m_document); 166 visitor->trace(m_document);
167 } 167 }
168 168
169 } // namespace blink 169 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FormSubmission.cpp ('k') | third_party/WebKit/Source/platform/text/LocaleWinTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698