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

Unified Diff: content/common/frame_messages.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: 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: content/common/frame_messages.h
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h
index f4fc8b5b1e3bbe4eca185a760961e2e0d1bd0e88..b70017e2e1e381f3084c4533394d31fa61beb3f5 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 (when handling the
+// main frame, the renderer generates MHTML header + mhtml boundary marker).
+//
+// When serializing the first, main frame of an MHTML document,
+// |mhtml_boundary_marker| should be an empty string. Otherwise it needs to be
+// the marker generated and reported back by the previous
+// FrameHostMsg_SerializeAsMHTMLResponse.
ncarter (slow) 2015/12/04 22:54:47 It seems like the back-and-forth for boundary-mark
Łukasz Anforowicz 2015/12/05 00:18:39 Thanks for bringing that up. I am not quite happy
ncarter (slow) 2015/12/07 18:39:57 Yeah, my instinct is also to apply the "if it ain'
+//
+// 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,12 @@ IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializedHtmlWithLocalLinksResponse,
std::string /* data buffer */,
bool /* end of data? */)
+// Response to FrameMsg_SerializeAsMHTML.
+IPC_MESSAGE_ROUTED3(FrameHostMsg_SerializeAsMHTMLResponse,
+ int /* job_id (used to match responses to requests) */,
+ bool /* true if success, false if error */,
+ std::string /* mhtml boundary marker that was used */)
+
// Sent when the renderer updates hint for importance of a tab.
IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdatePageImportanceSignals,
content::PageImportanceSignals)

Powered by Google App Engine
This is Rietveld 408576698