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

Unified Diff: third_party/WebKit/public/web/WebPageSerializer.h

Issue 1386873003: OOPIFs: Transitioning MHTML generation from view-oriented to frame-oriented. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mhtml-generation-mgr-cleanup
Patch Set: Moving "using" declaration under a singly-included section of frame_messges.h 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/MHTMLTest.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 2ae2e258ea2cdb5bc445726ed7ed9f4d721cd7a4..7a59b6a82effd69af7bdc65276308c23c32360ba 100644
--- a/third_party/WebKit/public/web/WebPageSerializer.h
+++ b/third_party/WebKit/public/web/WebPageSerializer.h
@@ -33,26 +33,58 @@
#include "../platform/WebCString.h"
#include "../platform/WebCommon.h"
+#include "../platform/WebData.h"
+#include "../platform/WebString.h"
#include "../platform/WebURL.h"
-#include "WebFrame.h"
+#include "../platform/WebVector.h"
+
+#include <utility>
namespace blink {
class WebPageSerializerClient;
-class WebString;
-class WebView;
+class WebFrame;
+class WebLocalFrame;
template <typename T> class WebVector;
-// Get html data by serializing all frames of current page with lists
-// which contain all resource links that have local copy.
+// Serialization of frame contents into html or mhtml.
+// TODO(lukasza): Rename this class to WebFrameSerializer?
class WebPageSerializer {
public:
- // Serializes the WebView contents to a MHTML representation.
- BLINK_EXPORT static WebCString serializeToMHTML(WebView*);
+ // Generates and returns an MHTML header.
+ //
+ // Contents of the header (i.e. title and mime type) will be based
+ // on the frame passed as an argument (which typically should be
+ // the main, top-level frame).
+ //
+ // 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).
+ BLINK_EXPORT static WebData generateMHTMLHeader(
+ const WebString& boundary, WebLocalFrame*);
- // Similar to serializeToMHTML but uses binary encoding for the MHTML parts.
- // This results in a smaller MHTML file but it might not be supported by other browsers.
- BLINK_EXPORT static WebCString serializeToMHTMLUsingBinaryEncoding(WebView*);
+ // Generates and returns MHTML parts for the given frame and all 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);
+
+ // Generates and returns an MHTML footer.
+ //
+ // 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).
+ BLINK_EXPORT static WebData generateMHTMLFooter(const WebString& boundary);
// IMPORTANT:
// The API below is an older implementation of a pageserialization that
« no previous file with comments | « third_party/WebKit/Source/web/tests/MHTMLTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698