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