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

Unified Diff: third_party/WebKit/Source/web/WebPageSerializerImpl.h

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: third_party/WebKit/Source/web/WebPageSerializerImpl.h
diff --git a/third_party/WebKit/Source/web/WebPageSerializerImpl.h b/third_party/WebKit/Source/web/WebPageSerializerImpl.h
index 212135c164db21dcc3941ee77a3cf331348911a8..65d164c2ec29d4214829abe2ed6f31213229b8e7 100644
--- a/third_party/WebKit/Source/web/WebPageSerializerImpl.h
+++ b/third_party/WebKit/Source/web/WebPageSerializerImpl.h
@@ -44,6 +44,8 @@
#include "public/web/WebPageSerializerClient.h"
#include "web/WebEntities.h"
+#include <utility>
Łukasz Anforowicz 2015/12/16 21:39:02 I think I should have added this include earlier -
+
namespace WTF {
class TextEncoding;
}
@@ -52,7 +54,9 @@ namespace blink {
class Document;
class Element;
+class Frame;
class Node;
+class WebFrame;
class WebLocalFrame;
class WebLocalFrameImpl;
@@ -80,19 +84,20 @@ public:
WebPageSerializerImpl(
WebLocalFrame*,
WebPageSerializerClient*,
- const WebVector<std::pair<WebURL, WebString>>& urlsToLocalPaths);
+ const WebVector<std::pair<WebURL, WebString>>& urlsToLocalPaths,
+ const WebVector<std::pair<WebFrame*, WebString>>& framesToLocalPaths);
private:
// Specified frame which need to be serialized;
RawPtrWillBeMember<WebLocalFrameImpl> m_specifiedWebLocalFrameImpl;
// Pointer of WebPageSerializerClient
WebPageSerializerClient* m_client;
- // This hash map is used to map resource URL of original link to its local
- // file path.
- typedef HashMap<WTF::String, WTF::String> LinkLocalPathMap;
- // local_links_ include all pair of local resource path and corresponding
- // original link.
- LinkLocalPathMap m_localLinks;
+ // Map from URL of a savable resource (i.e. URL of an image) to a local path
+ // that the link should be replaced with.
+ HashMap<WTF::String, WTF::String> m_urlToLocalPath;
+ // Map from frame to a local path that the frame's src attribute should be
+ // replaced with.
+ HashMap<Frame*, WTF::String> m_frameToLocalPath;
// Data buffer for saving result of serialized DOM data.
StringBuilder m_dataBuffer;
@@ -166,6 +171,13 @@ private:
// Build content for a specified node
void buildContentForNode(Node*,
SerializeDomParam* param);
+
+ // Appends attrName="escapedAttrValue" to result.
+ void appendAttribute(
+ StringBuilder& result,
+ bool isHTMLDocument,
+ const String& attrName,
+ const String& attrValue);
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698