Index: content/common/frame_messages.h |
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h |
index f4fc8b5b1e3bbe4eca185a760961e2e0d1bd0e88..298dd754f8ddaa2d18e072c2bc86795fc30e01ee 100644 |
--- a/content/common/frame_messages.h |
+++ b/content/common/frame_messages.h |
@@ -29,6 +29,7 @@ |
#include "content/public/common/three_d_api_types.h" |
#include "content/public/common/transition_element.h" |
#include "ipc/ipc_message_macros.h" |
+#include "ipc/ipc_platform_file.h" |
#include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" |
#include "third_party/WebKit/public/web/WebTreeScopeType.h" |
#include "ui/gfx/ipc/gfx_param_traits.h" |
@@ -717,6 +718,31 @@ IPC_MESSAGE_ROUTED3(FrameMsg_GetSerializedHtmlWithLocalLinks, |
std::vector<base::FilePath> /* paths of local copy */, |
base::FilePath /* local directory path */) |
+// Serialize target frame and its resources into MHTML and write it into the |
+// provided destination file handle. |
+// |
+// When starting generation of a new MHTML document, one needs to start by |
+// sending FrameMsg_SerializeAsMHTML for the *main* frame (main frame needs to |
+// be the first part in the MHTML document + main frame will trigger generation |
+// of the MHTML header). |
+// |
+// The same |mhtml_boundary_marker| should be used for serialization of each |
+// frame (this string will be used as a mime multipart boundary within the mhtml |
+// document). |
+// |
+// For more details about frame to content id map please see |
+// WebPageSerializer::generateMHTMLParts method. |
+// |
+// |is_last_frame| controls whether the serializer in the renderer will |
+// emit the MHTML footer. |
+using FrameRoutingIdToContentIdMap = std::map<int, std::string>; |
+IPC_MESSAGE_ROUTED5(FrameMsg_SerializeAsMHTML, |
+ int /* job_id (used to match responses to requests) */, |
+ IPC::PlatformFileForTransit /* destination file handle */, |
+ std::string /* mhtml boundary marker */, |
+ FrameRoutingIdToContentIdMap, |
+ bool /* is last frame */) |
+ |
IPC_MESSAGE_ROUTED1(FrameMsg_SetFrameOwnerProperties, |
blink::WebFrameOwnerProperties /* frame_owner_properties */) |
@@ -1246,6 +1272,11 @@ IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializedHtmlWithLocalLinksResponse, |
std::string /* data buffer */, |
bool /* end of data? */) |
+// Response to FrameMsg_SerializeAsMHTML. |
+IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializeAsMHTMLResponse, |
+ int /* job_id (used to match responses to requests) */, |
+ bool /* true if success, false if error */) |
+ |
// Sent when the renderer updates hint for importance of a tab. |
IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdatePageImportanceSignals, |
content::PageImportanceSignals) |