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

Side by Side Diff: content/common/frame_messages.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 4 years, 11 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // IPC messages for interacting with frames. 5 // IPC messages for interacting with frames.
6 // Multiply-included message file, hence no include guard. 6 // Multiply-included message file, hence no include guard.
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map>
12 #include <set>
13 #include <string>
14 #include <vector>
15
11 #include "build/build_config.h" 16 #include "build/build_config.h"
12 #include "cc/surfaces/surface_id.h" 17 #include "cc/surfaces/surface_id.h"
13 #include "cc/surfaces/surface_sequence.h" 18 #include "cc/surfaces/surface_sequence.h"
14 #include "content/common/content_export.h" 19 #include "content/common/content_export.h"
15 #include "content/common/content_param_traits.h" 20 #include "content/common/content_param_traits.h"
16 #include "content/common/frame_message_enums.h" 21 #include "content/common/frame_message_enums.h"
17 #include "content/common/frame_param.h" 22 #include "content/common/frame_param.h"
18 #include "content/common/frame_replication_state.h" 23 #include "content/common/frame_replication_state.h"
19 #include "content/common/navigation_gesture.h" 24 #include "content/common/navigation_gesture.h"
20 #include "content/common/navigation_params.h" 25 #include "content/common/navigation_params.h"
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 451
447 // Size of the text track text. 452 // Size of the text track text.
448 IPC_STRUCT_MEMBER(std::string, text_track_text_size) 453 IPC_STRUCT_MEMBER(std::string, text_track_text_size)
449 IPC_STRUCT_END() 454 IPC_STRUCT_END()
450 455
451 IPC_STRUCT_TRAITS_BEGIN(content::SavableSubframe) 456 IPC_STRUCT_TRAITS_BEGIN(content::SavableSubframe)
452 IPC_STRUCT_TRAITS_MEMBER(original_url) 457 IPC_STRUCT_TRAITS_MEMBER(original_url)
453 IPC_STRUCT_TRAITS_MEMBER(routing_id) 458 IPC_STRUCT_TRAITS_MEMBER(routing_id)
454 IPC_STRUCT_TRAITS_END() 459 IPC_STRUCT_TRAITS_END()
455 460
461 IPC_STRUCT_BEGIN(FrameMsg_SerializeAsMHTML_Params)
462 // Job id - used to match responses to requests.
463 IPC_STRUCT_MEMBER(int, job_id)
464
465 // Destination file handle.
466 IPC_STRUCT_MEMBER(IPC::PlatformFileForTransit, destination_file)
467
468 // MHTML boundary marker / MIME multipart boundary maker. The same
469 // |mhtml_boundary_marker| should be used for serialization of each frame.
470 IPC_STRUCT_MEMBER(std::string, mhtml_boundary_marker)
471
472 // Frame to content-id map.
473 // Keys are routing ids of either RenderFrames or RenderFrameProxies.
474 // Values are MHTML content-ids - see WebPageSerializer::generateMHTMLParts.
475 IPC_STRUCT_MEMBER(FrameMsg_SerializeAsMHTML_FrameRoutingIdToContentIdMap,
476 frame_routing_id_to_content_id)
477
478 // |digests_of_uris_to_skip| contains digests of uris of MHTML parts that
479 // should be skipped. This helps deduplicate mhtml parts across frames.
480 // SECURITY NOTE: Sha256 digests (rather than uris) are used to prevent
481 // disclosing uris to other renderer processes; the digests should be
482 // generated using SHA256HashString function from crypto/sha2.h and hashing
483 // |salt + url.spec()|.
484 IPC_STRUCT_MEMBER(std::set<std::string>, digests_of_uris_to_skip)
485
486 // Salt used for |digests_of_uris_to_skip|.
487 IPC_STRUCT_MEMBER(std::string, salt)
488
489 // If |is_last_frame| is true, then an MHTML footer will be generated.
490 IPC_STRUCT_MEMBER(bool, is_last_frame)
491 IPC_STRUCT_END()
492
456 #if defined(OS_MACOSX) || defined(OS_ANDROID) 493 #if defined(OS_MACOSX) || defined(OS_ANDROID)
457 // This message is used for supporting popup menus on Mac OS X and Android using 494 // This message is used for supporting popup menus on Mac OS X and Android using
458 // native controls. See the FrameHostMsg_ShowPopup message. 495 // native controls. See the FrameHostMsg_ShowPopup message.
459 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params) 496 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params)
460 // Position on the screen. 497 // Position on the screen.
461 IPC_STRUCT_MEMBER(gfx::Rect, bounds) 498 IPC_STRUCT_MEMBER(gfx::Rect, bounds)
462 499
463 // The height of each item in the menu. 500 // The height of each item in the menu.
464 IPC_STRUCT_MEMBER(int, item_height) 501 IPC_STRUCT_MEMBER(int, item_height)
465 502
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 // Request to enumerate and return links to all savable resources in the frame 782 // Request to enumerate and return links to all savable resources in the frame
746 // Note: this covers only the immediate frame / doesn't cover subframes. 783 // Note: this covers only the immediate frame / doesn't cover subframes.
747 IPC_MESSAGE_ROUTED0(FrameMsg_GetSavableResourceLinks) 784 IPC_MESSAGE_ROUTED0(FrameMsg_GetSavableResourceLinks)
748 785
749 // Get html data by serializing the target frame and replacing all resource 786 // Get html data by serializing the target frame and replacing all resource
750 // links with a path to the local copy passed in the message payload. 787 // links with a path to the local copy passed in the message payload.
751 IPC_MESSAGE_ROUTED1(FrameMsg_GetSerializedHtmlWithLocalLinks, 788 IPC_MESSAGE_ROUTED1(FrameMsg_GetSerializedHtmlWithLocalLinks,
752 FrameMsg_GetSerializedHtmlWithLocalLinks_Map) 789 FrameMsg_GetSerializedHtmlWithLocalLinks_Map)
753 790
754 // Serialize target frame and its resources into MHTML and write it into the 791 // Serialize target frame and its resources into MHTML and write it into the
755 // provided destination file handle. 792 // provided destination file handle. Note that when serializing multiple
756 // 793 // frames, one needs to serialize the *main* frame first (the main frame
757 // When starting generation of a new MHTML document, one needs to start by 794 // needs to go first according to RFC2557 + the main frame will trigger
758 // sending FrameMsg_SerializeAsMHTML for the *main* frame (main frame needs to 795 // generation of the MHTML header).
759 // be the first part in the MHTML document + main frame will trigger generation 796 IPC_MESSAGE_ROUTED1(FrameMsg_SerializeAsMHTML, FrameMsg_SerializeAsMHTML_Params)
760 // of the MHTML header).
761 //
762 // The same |mhtml_boundary_marker| should be used for serialization of each
763 // frame (this string will be used as a mime multipart boundary within the mhtml
764 // document).
765 //
766 // For more details about frame to content id map please see
767 // WebPageSerializer::generateMHTMLParts method.
768 //
769 // |is_last_frame| controls whether the serializer in the renderer will
770 // emit the MHTML footer.
771 IPC_MESSAGE_ROUTED5(FrameMsg_SerializeAsMHTML,
772 int /* job_id (used to match responses to requests) */,
773 IPC::PlatformFileForTransit /* destination file handle */,
774 std::string /* mhtml boundary marker */,
775 FrameMsg_SerializeAsMHTML_FrameRoutingIdToContentIdMap,
776 bool /* is last frame */)
777 797
778 IPC_MESSAGE_ROUTED1(FrameMsg_SetFrameOwnerProperties, 798 IPC_MESSAGE_ROUTED1(FrameMsg_SetFrameOwnerProperties,
779 blink::WebFrameOwnerProperties /* frame_owner_properties */) 799 blink::WebFrameOwnerProperties /* frame_owner_properties */)
780 800
781 // Request to continue running the sequential focus navigation algorithm in 801 // Request to continue running the sequential focus navigation algorithm in
782 // this frame. |source_routing_id| identifies the frame that issued this 802 // this frame. |source_routing_id| identifies the frame that issued this
783 // request. This message is sent when pressing <tab> or <shift-tab> needs to 803 // request. This message is sent when pressing <tab> or <shift-tab> needs to
784 // find the next focusable element in a cross-process frame. 804 // find the next focusable element in a cross-process frame.
785 IPC_MESSAGE_ROUTED2(FrameMsg_AdvanceFocus, 805 IPC_MESSAGE_ROUTED2(FrameMsg_AdvanceFocus,
786 blink::WebFocusType /* type */, 806 blink::WebFocusType /* type */,
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 // non-savable content (i.e. from a non-savable scheme) or if there were 1332 // non-savable content (i.e. from a non-savable scheme) or if there were
1313 // errors gathering the links. 1333 // errors gathering the links.
1314 IPC_MESSAGE_ROUTED0(FrameHostMsg_SavableResourceLinksError) 1334 IPC_MESSAGE_ROUTED0(FrameHostMsg_SavableResourceLinksError)
1315 1335
1316 // Response to FrameMsg_GetSerializedHtmlWithLocalLinks. 1336 // Response to FrameMsg_GetSerializedHtmlWithLocalLinks.
1317 IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializedHtmlWithLocalLinksResponse, 1337 IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializedHtmlWithLocalLinksResponse,
1318 std::string /* data buffer */, 1338 std::string /* data buffer */,
1319 bool /* end of data? */) 1339 bool /* end of data? */)
1320 1340
1321 // Response to FrameMsg_SerializeAsMHTML. 1341 // Response to FrameMsg_SerializeAsMHTML.
1322 IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializeAsMHTMLResponse, 1342 IPC_MESSAGE_ROUTED3(
1323 int /* job_id (used to match responses to requests) */, 1343 FrameHostMsg_SerializeAsMHTMLResponse,
1324 bool /* true if success, false if error */) 1344 int /* job_id (used to match responses to requests) */,
1345 bool /* true if success, false if error */,
1346 std::set<std::string> /* digests of uris of serialized resources */)
1325 1347
1326 // Sent when the renderer updates hint for importance of a tab. 1348 // Sent when the renderer updates hint for importance of a tab.
1327 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdatePageImportanceSignals, 1349 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdatePageImportanceSignals,
1328 content::PageImportanceSignals) 1350 content::PageImportanceSignals)
1329 1351
1330 // This message is sent from a RenderFrameProxy when sequential focus 1352 // This message is sent from a RenderFrameProxy when sequential focus
1331 // navigation needs to advance into its actual frame. |source_routing_id| 1353 // navigation needs to advance into its actual frame. |source_routing_id|
1332 // identifies the frame that issued this request. This is used when pressing 1354 // identifies the frame that issued this request. This is used when pressing
1333 // <tab> or <shift-tab> hits an out-of-process iframe when searching for the 1355 // <tab> or <shift-tab> hits an out-of-process iframe when searching for the
1334 // next focusable element. 1356 // next focusable element.
1335 IPC_MESSAGE_ROUTED2(FrameHostMsg_AdvanceFocus, 1357 IPC_MESSAGE_ROUTED2(FrameHostMsg_AdvanceFocus,
1336 blink::WebFocusType /* type */, 1358 blink::WebFocusType /* type */,
1337 int32_t /* source_routing_id */) 1359 int32_t /* source_routing_id */)
1338 1360
1339 #if defined(OS_MACOSX) || defined(OS_ANDROID) 1361 #if defined(OS_MACOSX) || defined(OS_ANDROID)
1340 1362
1341 // Message to show/hide a popup menu using native controls. 1363 // Message to show/hide a popup menu using native controls.
1342 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup, 1364 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup,
1343 FrameHostMsg_ShowPopup_Params) 1365 FrameHostMsg_ShowPopup_Params)
1344 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup) 1366 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup)
1345 1367
1346 #endif 1368 #endif
1347 1369
1348 // Adding a new message? Stick to the sort order above: first platform 1370 // Adding a new message? Stick to the sort order above: first platform
1349 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then 1371 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then
1350 // platform independent FrameHostMsg, then ifdefs for platform specific 1372 // platform independent FrameHostMsg, then ifdefs for platform specific
1351 // FrameHostMsg. 1373 // FrameHostMsg.
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/renderer/render_frame_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698