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

Unified Diff: third_party/WebKit/public/web/WebPageSerializer.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 | « third_party/WebKit/Source/web/tests/PageSerializerTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/web/WebPageSerializer.h
diff --git a/third_party/WebKit/public/web/WebPageSerializer.h b/third_party/WebKit/public/web/WebPageSerializer.h
index 7a59b6a82effd69af7bdc65276308c23c32360ba..44d5f94fb12b387a63a990f8500f02f9b824083c 100644
--- a/third_party/WebKit/public/web/WebPageSerializer.h
+++ b/third_party/WebKit/public/web/WebPageSerializer.h
@@ -63,21 +63,29 @@ public:
BLINK_EXPORT static WebData generateMHTMLHeader(
const WebString& boundary, WebLocalFrame*);
- // Generates and returns MHTML parts for the given frame and all the
+ // Delegate for controling the behavior of generateMHTMLParts method.
+ class MHTMLPartsGenerationDelegate {
+ public:
+ // Tells whether to skip serialization of a subresource with a given URI.
+ // Used to deduplicate resources across multiple frames.
+ virtual bool shouldSkipResource(const WebURL&) = 0;
+
+ // Returns a Content-ID to be used for the given frame.
+ // See rfc2557 - section 8.3 - "Use of the Content-ID header and CID URLs".
+ // Format note - the returned string should be of the form "<foo@bar.com>"
+ // (i.e. the strings should include the angle brackets).
+ virtual WebString getContentID(const WebFrame&) = 0;
+ };
+
+ // Generates and returns MHTML parts for the given frame and the
// savable resources underneath.
//
// Same |boundary| needs to used for all generateMHTMLHeader and
// generateMHTMLParts and generateMHTMLFooter calls that belong to the same
// MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
- //
- // |frameToContentID| is used for 1) emitting cid: scheme uri links for
- // subframes and 2) emitting MIME Content-ID headers.
- // See rfc2557 - section 8.3 - "Use of the Content-ID header and CID URLs".
- // Format note - |frameToContentID| should contain strings of the form
- // "<foo@bar.com>" (i.e. the strings should include the angle brackets).
BLINK_EXPORT static WebData generateMHTMLParts(
const WebString& boundary, WebLocalFrame*, bool useBinaryEncoding,
- const WebVector<std::pair<WebFrame*, WebString>>& frameToContentID);
+ MHTMLPartsGenerationDelegate*);
// Generates and returns an MHTML footer.
//
@@ -92,7 +100,7 @@ public:
// This function will serialize the specified frame to HTML data.
// We have a data buffer to temporary saving generated html data. We will
- // sequentially call WebPageSeriazlierClient once the data buffer is full.
+ // sequentially call WebPageSerializerClient once the data buffer is full.
//
// Return false means if no data has been serialized (i.e. because
// the target frame didn't have a valid url).
« no previous file with comments | « third_party/WebKit/Source/web/tests/PageSerializerTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698