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