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

Unified Diff: third_party/WebKit/Source/core/page/PageSerializer.h

Issue 1417323006: OOPIFs: Deduplicating MHTML parts across frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mhtml-serialization-per-frame
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
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | third_party/WebKit/Source/core/page/PageSerializer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/PageSerializer.h
diff --git a/third_party/WebKit/Source/core/page/PageSerializer.h b/third_party/WebKit/Source/core/page/PageSerializer.h
index bd99edeec83660d23270ec72ad7af4e15a4e9fbf..0de4675913c9d022dc5082674a279c3aaad55aa6 100644
--- a/third_party/WebKit/Source/core/page/PageSerializer.h
+++ b/third_party/WebKit/Source/core/page/PageSerializer.h
@@ -68,7 +68,11 @@ class CORE_EXPORT PageSerializer final {
public:
class Delegate {
public:
- virtual bool shouldIgnoreAttribute(const Attribute&) = 0;
+ // Controls whether HTML serialization should skip the given attribute.
+ virtual bool shouldIgnoreAttribute(const Attribute&)
+ {
+ return false;
+ }
// Method allowing the Delegate control which URLs are written into the
// generated html document.
@@ -79,14 +83,24 @@ public:
// (i.e. in place of img.src or iframe.src or object.data).
//
// If no link rewriting is desired, this method should return false.
- virtual bool rewriteLink(const Element&, String& rewrittenLink) = 0;
+ virtual bool rewriteLink(const Element&, String& rewrittenLink)
+ {
+ return false;
+ }
+
+ // Tells whether to skip serialization of a subresource with a given URI.
+ // Used to deduplicate resources across multiple frames.
+ virtual bool shouldSkipResource(const KURL&)
+ {
+ return false;
+ }
};
// Constructs a serializer that will write output to the given vector of
- // SerializedResources and use the optional Delegate for controlling some
- // serialization aspects. Callers need to ensure that the Delegate stays
+ // SerializedResources and uses the Delegate for controlling some
+ // serialization aspects. Callers need to ensure that both arguments stay
// alive until the PageSerializer gets destroyed.
- PageSerializer(Vector<SerializedResource>&, Delegate*);
+ PageSerializer(Vector<SerializedResource>&, Delegate&);
// Initiates the serialization of the frame. All serialized content and
// retrieved resources are added to the Vector passed to the constructor.
@@ -94,8 +108,6 @@ public:
// Subsequent resources are images, css, etc.
void serializeFrame(const LocalFrame&);
- Delegate* delegate();
-
static String markOfTheWebDeclaration(const KURL&);
private:
@@ -118,7 +130,7 @@ private:
Vector<SerializedResource>* m_resources;
ListHashSet<KURL> m_resourceURLs;
- Delegate* m_delegate;
+ Delegate& m_delegate;
};
} // namespace blink
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | third_party/WebKit/Source/core/page/PageSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698