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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1502563004: Save-Page-As-Complete-Html: Each frame links to a distinct local file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-url-deduping-for-frame-and-adding-save-item-id
Patch Set: Rebasing... Created 5 years 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: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 9e01406593394ecf970e84632b087772fde715ad..bb9929d1abfdb1ff32032c1c9a7bd8b2e7fe6754 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4761,7 +4761,8 @@ void RenderFrameImpl::OnGetSavableResourceLinks() {
}
void RenderFrameImpl::OnGetSerializedHtmlWithLocalLinks(
- const std::map<GURL, base::FilePath>& url_to_local_path) {
+ const std::map<GURL, base::FilePath>& url_to_local_path,
+ const std::map<int, base::FilePath>& frame_routing_id_to_local_path) {
// Convert input to the canonical way of passing a map into a Blink API.
std::vector<std::pair<WebURL, WebString>> weburl_to_local_path;
for (const auto& it : url_to_local_path) {
@@ -4770,11 +4771,22 @@ void RenderFrameImpl::OnGetSerializedHtmlWithLocalLinks(
weburl_to_local_path.push_back(std::make_pair(
WebURL(url), ConvertRelativePathToHtmlAttribute(local_path)));
}
+ std::vector<std::pair<WebFrame*, WebString>> webframe_to_local_path;
+ for (const auto& it : frame_routing_id_to_local_path) {
+ int routing_id = it.first;
+ const base::FilePath& local_path = it.second;
+
+ WebFrame* web_frame = GetWebFrameFromRoutingIdForFrameOrProxy(routing_id);
+ if (web_frame) {
+ webframe_to_local_path.push_back(std::make_pair(
+ web_frame, ConvertRelativePathToHtmlAttribute(local_path)));
+ }
+ }
// Serialize the frame (without recursing into subframes).
WebPageSerializer::serialize(GetWebFrame(),
this, // WebPageSerializerClient.
- weburl_to_local_path);
+ weburl_to_local_path, webframe_to_local_path);
}
void RenderFrameImpl::OnSerializeAsMHTML(

Powered by Google App Engine
This is Rietveld 408576698