Chromium Code Reviews| Index: content/common/frame_messages.h |
| diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h |
| index 23d68cafff10c2802d5cbd4a5259477dd22ee667..10a0a5713e8e301152face1a73e748a006ab7c19 100644 |
| --- a/content/common/frame_messages.h |
| +++ b/content/common/frame_messages.h |
| @@ -5,6 +5,11 @@ |
| // IPC messages for interacting with frames. |
| // Multiply-included message file, hence no include guard. |
| +#include <map> |
| +#include <set> |
| +#include <string> |
| +#include <vector> |
| + |
| #include "cc/surfaces/surface_id.h" |
| #include "cc/surfaces/surface_sequence.h" |
| #include "content/common/content_export.h" |
| @@ -430,6 +435,39 @@ IPC_STRUCT_TRAITS_BEGIN(content::SavableSubframe) |
| IPC_STRUCT_TRAITS_MEMBER(routing_id) |
| IPC_STRUCT_TRAITS_END() |
| +using FrameRoutingIdToContentIdMap = std::map<int, std::string>; |
|
dcheng
2015/12/11 07:36:05
Do we still need to typedef this?
Łukasz Anforowicz
2015/12/14 19:39:02
1. We do need a typedef - otherwise preprocessor w
|
| +IPC_STRUCT_BEGIN(FrameMsg_SerializeAsMHTML_Params) |
| + // Job id - used to match responses to requests. |
| + IPC_STRUCT_MEMBER(int, job_id) |
| + |
| + // Destination file handle. |
| + IPC_STRUCT_MEMBER(IPC::PlatformFileForTransit, destination_file) |
| + |
| + // MHTML boundary marker / MIME multipart boundary maker. The same |
| + // |mhtml_boundary_marker| should be used for serialization of each frame. |
| + IPC_STRUCT_MEMBER(std::string, mhtml_boundary_marker) |
| + |
| + // Frame to content-id map. |
| + // Keys are routing ids of either RenderFrames or RenderFrameProxies. |
| + // Values are MHTML content-ids - see WebPageSerializer::generateMHTMLParts. |
| + IPC_STRUCT_MEMBER(FrameRoutingIdToContentIdMap, |
| + frame_routing_id_to_content_id) |
| + |
| + // |digests_of_uris_to_skip| contains digests of uris of MHTML parts that |
| + // should be skipped. This helps deduplicate mhtml parts across frames. |
| + // SECURITY NOTE: Sha256 digests (rather than uris) are used to prevent |
| + // disclosing uris to other renderer processes; the digests should be |
| + // generated using SHA256HashString function from crypto/sha2.h and hashing |
| + // |salt + url.spec()|. |
| + IPC_STRUCT_MEMBER(std::set<std::string>, digests_of_uris_to_skip) |
| + |
| + // Salt used for |digests_of_uris_to_skip|. |
| + IPC_STRUCT_MEMBER(std::string, salt) |
| + |
| + // If |is_last_frame| is true, then an MHTML footer will be generated. |
| + IPC_STRUCT_MEMBER(bool, is_last_frame) |
| +IPC_STRUCT_END() |
| + |
| #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| // This message is used for supporting popup menus on Mac OS X and Android using |
| // native controls. See the FrameHostMsg_ShowPopup message. |
| @@ -722,29 +760,11 @@ IPC_MESSAGE_ROUTED1(FrameMsg_GetSerializedHtmlWithLocalLinks, |
| FrameMsg_GetSerializedHtmlWithLocalLinks_Map); |
| // 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 */) |
| +// provided destination file handle. Note that when serializing multiple |
| +// frames, one needs to serialize the *main* frame first (the main frame |
| +// needs to go first according to RFC2557 + the main frame will trigger |
| +// generation of the MHTML header). |
| +IPC_MESSAGE_ROUTED1(FrameMsg_SerializeAsMHTML, FrameMsg_SerializeAsMHTML_Params) |
| IPC_MESSAGE_ROUTED1(FrameMsg_SetFrameOwnerProperties, |
| blink::WebFrameOwnerProperties /* frame_owner_properties */) |
| @@ -1271,9 +1291,10 @@ IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializedHtmlWithLocalLinksResponse, |
| bool /* end of data? */) |
| // Response to FrameMsg_SerializeAsMHTML. |
| -IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializeAsMHTMLResponse, |
| +IPC_MESSAGE_ROUTED3(FrameHostMsg_SerializeAsMHTMLResponse, |
| int /* job_id (used to match responses to requests) */, |
| - bool /* true if success, false if error */) |
| + bool /* true if success, false if error */, |
| + std::set<GURL> /* uris of generated mhtml parts */) |
| // Sent when the renderer updates hint for importance of a tab. |
| IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdatePageImportanceSignals, |