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

Unified Diff: third_party/WebKit/Source/web/WebPageSerializer.cpp

Issue 1371323003: Escape "--" in the page URL at page serialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-09-30T19:11:33 Follow review comments Created 5 years, 3 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/web/WebPageSerializer.cpp
diff --git a/third_party/WebKit/Source/web/WebPageSerializer.cpp b/third_party/WebKit/Source/web/WebPageSerializer.cpp
index f995480ece363c17138ac2bdc721d8d478d8cdb0..d8df88675cf68a7b848513ef8c420c09c9756300 100644
--- a/third_party/WebKit/Source/web/WebPageSerializer.cpp
+++ b/third_party/WebKit/Source/web/WebPageSerializer.cpp
@@ -267,19 +267,23 @@ bool WebPageSerializer::retrieveAllResources(WebView* view,
WebString WebPageSerializer::generateMetaCharsetDeclaration(const WebString& charset)
{
+ // TODO(yosin) We should call |PageSerializer::metaCharsetDeclarationOf()|.
String charsetString = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" + static_cast<const String&>(charset) + "\">";
return charsetString;
}
WebString WebPageSerializer::generateMarkOfTheWebDeclaration(const WebURL& url)
{
- return String::format("\n<!-- saved from url=(%04d)%s -->\n",
- static_cast<int>(url.spec().length()),
- url.spec().data());
+ StringBuilder builder;
+ builder.append("\n<!-- ");
+ builder.append(PageSerializer::markOfTheWebDeclaration(url));
+ builder.append(" -->\n");
+ return builder.toString();
}
WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTarget)
{
+ // TODO(yosin) We should call |PageSerializer::baseTagDeclarationOf()|.
if (baseTarget.isEmpty())
return String("<base href=\".\">");
String baseString = "<base href=\".\" target=\"" + static_cast<const String&>(baseTarget) + "\">";
« no previous file with comments | « third_party/WebKit/Source/core/page/PageSerializer.cpp ('k') | third_party/WebKit/Source/web/tests/PageSerializerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698