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

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 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 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 <map>
9 #include <set>
10 #include <string>
11 #include <vector>
12
8 #include "cc/surfaces/surface_id.h" 13 #include "cc/surfaces/surface_id.h"
9 #include "cc/surfaces/surface_sequence.h" 14 #include "cc/surfaces/surface_sequence.h"
10 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
11 #include "content/common/content_param_traits.h" 16 #include "content/common/content_param_traits.h"
12 #include "content/common/frame_message_enums.h" 17 #include "content/common/frame_message_enums.h"
13 #include "content/common/frame_param.h" 18 #include "content/common/frame_param.h"
14 #include "content/common/frame_replication_state.h" 19 #include "content/common/frame_replication_state.h"
15 #include "content/common/navigation_gesture.h" 20 #include "content/common/navigation_gesture.h"
16 #include "content/common/navigation_params.h" 21 #include "content/common/navigation_params.h"
17 #include "content/common/resource_request_body.h" 22 #include "content/common/resource_request_body.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 425
421 // Size of the text track text. 426 // Size of the text track text.
422 IPC_STRUCT_MEMBER(std::string, text_track_text_size) 427 IPC_STRUCT_MEMBER(std::string, text_track_text_size)
423 IPC_STRUCT_END() 428 IPC_STRUCT_END()
424 429
425 IPC_STRUCT_TRAITS_BEGIN(content::SavableSubframe) 430 IPC_STRUCT_TRAITS_BEGIN(content::SavableSubframe)
426 IPC_STRUCT_TRAITS_MEMBER(original_url) 431 IPC_STRUCT_TRAITS_MEMBER(original_url)
427 IPC_STRUCT_TRAITS_MEMBER(routing_id) 432 IPC_STRUCT_TRAITS_MEMBER(routing_id)
428 IPC_STRUCT_TRAITS_END() 433 IPC_STRUCT_TRAITS_END()
429 434
435 using FrameRoutingIdToContentIdMap = std::map<int, std::string>;
436 IPC_STRUCT_BEGIN(FrameMsg_SerializeAsMHTML_Params)
437 // Job id - used to match responses to requests.
438 IPC_STRUCT_MEMBER(int, job_id)
439
440 // Destination file handle.
441 IPC_STRUCT_MEMBER(IPC::PlatformFileForTransit, destination_file)
442
443 // MHTML boundary marker.
444 //
445 // When serializing the first, main frame of an MHTML document,
446 // |mhtml_boundary_marker| should be an empty string. Otherwise it needs to
447 // be
448 // the marker generated and reported back by the previous
449 // FrameHostMsg_SerializeAsMHTMLResponse.
450 IPC_STRUCT_MEMBER(std::string, mhtml_boundary_marker)
451
452 // Frame to content-id map.
453 // Keys are routing ids of either RenderFrames or RenderFrameProxies.
454 // Values are MHTML content-ids - see WebPageSerializer::generateMHTMLParts.
455 IPC_STRUCT_MEMBER(FrameRoutingIdToContentIdMap,
456 frame_routing_id_to_content_id)
457
458 // |digests_of_uris_to_skip| contains digests of uris of MHTML parts that
459 // should be skipped. This helps deduplicate mhtml parts across frames.
460 // SECURITY NOTE: Sha256 digests (rather than uris) are used to prevent
461 // disclosing uris to other renderer processes; the digests should be
462 // generated using SHA256HashString function from crypto/sha2.h and hashing
463 // |salt + url.spec()|.
464 IPC_STRUCT_MEMBER(std::set<std::string>, digests_of_uris_to_skip)
465
466 // Salt used for |digests_of_uris_to_skip|.
467 IPC_STRUCT_MEMBER(std::string, salt)
468
469 // If |is_last_frame| is true, then an MHTML footer will be generated.
470 IPC_STRUCT_MEMBER(bool, is_last_frame)
471 IPC_STRUCT_END()
472
430 #if defined(OS_MACOSX) || defined(OS_ANDROID) 473 #if defined(OS_MACOSX) || defined(OS_ANDROID)
431 // This message is used for supporting popup menus on Mac OS X and Android using 474 // This message is used for supporting popup menus on Mac OS X and Android using
432 // native controls. See the FrameHostMsg_ShowPopup message. 475 // native controls. See the FrameHostMsg_ShowPopup message.
433 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params) 476 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params)
434 // Position on the screen. 477 // Position on the screen.
435 IPC_STRUCT_MEMBER(gfx::Rect, bounds) 478 IPC_STRUCT_MEMBER(gfx::Rect, bounds)
436 479
437 // The height of each item in the menu. 480 // The height of each item in the menu.
438 IPC_STRUCT_MEMBER(int, item_height) 481 IPC_STRUCT_MEMBER(int, item_height)
439 482
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 756
714 // Get html data by serializing the target frame and replacing all resource 757 // Get html data by serializing the target frame and replacing all resource
715 // links with a path to the local copy passed in the message payload. 758 // links with a path to the local copy passed in the message payload.
716 IPC_MESSAGE_ROUTED3(FrameMsg_GetSerializedHtmlWithLocalLinks, 759 IPC_MESSAGE_ROUTED3(FrameMsg_GetSerializedHtmlWithLocalLinks,
717 std::vector<GURL> /* urls that have local copy */, 760 std::vector<GURL> /* urls that have local copy */,
718 std::vector<base::FilePath> /* paths of local copy */, 761 std::vector<base::FilePath> /* paths of local copy */,
719 base::FilePath /* local directory path */) 762 base::FilePath /* local directory path */)
720 763
721 // Serialize target frame and its resources into MHTML and write it into the 764 // Serialize target frame and its resources into MHTML and write it into the
722 // provided destination file handle. 765 // provided destination file handle.
723 // 766 IPC_MESSAGE_ROUTED1(FrameMsg_SerializeAsMHTML, FrameMsg_SerializeAsMHTML_Params)
724 // When starting generation of a new MHTML document, one needs to start by
725 // sending FrameMsg_SerializeAsMHTML for the *main* frame (when handling the
726 // main frame, the renderer generates MHTML header + mhtml boundary marker).
727 //
728 // When serializing the first, main frame of an MHTML document,
729 // |mhtml_boundary_marker| should be an empty string. Otherwise it needs to be
730 // the marker generated and reported back by the previous
731 // FrameHostMsg_SerializeAsMHTMLResponse.
732 //
733 // For more details about frame to content id map please see
734 // WebPageSerializer::generateMHTMLParts method.
735 //
736 // |is_last_frame| controls whether the serializer in the renderer will
737 // emit the MHTML footer.
738 using FrameRoutingIdToContentIdMap = std::map<int, std::string>;
739 IPC_MESSAGE_ROUTED5(FrameMsg_SerializeAsMHTML,
740 int /* job_id (used to match responses to requests) */,
741 IPC::PlatformFileForTransit /* destination file handle */,
742 std::string /* mhtml boundary marker */,
743 FrameRoutingIdToContentIdMap,
744 bool /* is last frame */)
745 767
746 IPC_MESSAGE_ROUTED1(FrameMsg_SetFrameOwnerProperties, 768 IPC_MESSAGE_ROUTED1(FrameMsg_SetFrameOwnerProperties,
747 blink::WebFrameOwnerProperties /* frame_owner_properties */) 769 blink::WebFrameOwnerProperties /* frame_owner_properties */)
748 770
749 #if defined(ENABLE_PLUGINS) 771 #if defined(ENABLE_PLUGINS)
750 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist. 772 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist.
751 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist, 773 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist,
752 std::set<url::Origin> /* origin_whitelist */) 774 std::set<url::Origin> /* origin_whitelist */)
753 #endif // defined(ENABLE_PLUGINS) 775 #endif // defined(ENABLE_PLUGINS)
754 776
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 // non-savable content (i.e. from a non-savable scheme) or if there were 1288 // non-savable content (i.e. from a non-savable scheme) or if there were
1267 // errors gathering the links. 1289 // errors gathering the links.
1268 IPC_MESSAGE_ROUTED0(FrameHostMsg_SavableResourceLinksError) 1290 IPC_MESSAGE_ROUTED0(FrameHostMsg_SavableResourceLinksError)
1269 1291
1270 // Response to FrameMsg_GetSerializedHtmlWithLocalLinks. 1292 // Response to FrameMsg_GetSerializedHtmlWithLocalLinks.
1271 IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializedHtmlWithLocalLinksResponse, 1293 IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializedHtmlWithLocalLinksResponse,
1272 std::string /* data buffer */, 1294 std::string /* data buffer */,
1273 bool /* end of data? */) 1295 bool /* end of data? */)
1274 1296
1275 // Response to FrameMsg_SerializeAsMHTML. 1297 // Response to FrameMsg_SerializeAsMHTML.
1276 IPC_MESSAGE_ROUTED3(FrameHostMsg_SerializeAsMHTMLResponse, 1298 IPC_MESSAGE_ROUTED4(FrameHostMsg_SerializeAsMHTMLResponse,
1277 int /* job_id (used to match responses to requests) */, 1299 int /* job_id (used to match responses to requests) */,
1278 bool /* true if success, false if error */, 1300 bool /* true if success, false if error */,
1279 std::string /* mhtml boundary marker that was used */) 1301 std::string /* mhtml boundary marker that was used */,
1302 std::set<GURL> /* uris of generated mhtml parts */)
1280 1303
1281 // Sent when the renderer updates hint for importance of a tab. 1304 // Sent when the renderer updates hint for importance of a tab.
1282 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdatePageImportanceSignals, 1305 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdatePageImportanceSignals,
1283 content::PageImportanceSignals) 1306 content::PageImportanceSignals)
1284 1307
1285 #if defined(OS_MACOSX) || defined(OS_ANDROID) 1308 #if defined(OS_MACOSX) || defined(OS_ANDROID)
1286 1309
1287 // Message to show/hide a popup menu using native controls. 1310 // Message to show/hide a popup menu using native controls.
1288 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup, 1311 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup,
1289 FrameHostMsg_ShowPopup_Params) 1312 FrameHostMsg_ShowPopup_Params)
1290 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup) 1313 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup)
1291 1314
1292 #endif 1315 #endif
1293 1316
1294 // Adding a new message? Stick to the sort order above: first platform 1317 // Adding a new message? Stick to the sort order above: first platform
1295 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then 1318 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then
1296 // platform independent FrameHostMsg, then ifdefs for platform specific 1319 // platform independent FrameHostMsg, then ifdefs for platform specific
1297 // FrameHostMsg. 1320 // FrameHostMsg.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698