Chromium Code Reviews| 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 423 | 428 |
| 424 // Size of the text track text. | 429 // Size of the text track text. |
| 425 IPC_STRUCT_MEMBER(std::string, text_track_text_size) | 430 IPC_STRUCT_MEMBER(std::string, text_track_text_size) |
| 426 IPC_STRUCT_END() | 431 IPC_STRUCT_END() |
| 427 | 432 |
| 428 IPC_STRUCT_TRAITS_BEGIN(content::SavableSubframe) | 433 IPC_STRUCT_TRAITS_BEGIN(content::SavableSubframe) |
| 429 IPC_STRUCT_TRAITS_MEMBER(original_url) | 434 IPC_STRUCT_TRAITS_MEMBER(original_url) |
| 430 IPC_STRUCT_TRAITS_MEMBER(routing_id) | 435 IPC_STRUCT_TRAITS_MEMBER(routing_id) |
| 431 IPC_STRUCT_TRAITS_END() | 436 IPC_STRUCT_TRAITS_END() |
| 432 | 437 |
| 438 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
| |
| 439 IPC_STRUCT_BEGIN(FrameMsg_SerializeAsMHTML_Params) | |
| 440 // Job id - used to match responses to requests. | |
| 441 IPC_STRUCT_MEMBER(int, job_id) | |
| 442 | |
| 443 // Destination file handle. | |
| 444 IPC_STRUCT_MEMBER(IPC::PlatformFileForTransit, destination_file) | |
| 445 | |
| 446 // MHTML boundary marker / MIME multipart boundary maker. The same | |
| 447 // |mhtml_boundary_marker| should be used for serialization of each frame. | |
| 448 IPC_STRUCT_MEMBER(std::string, mhtml_boundary_marker) | |
| 449 | |
| 450 // Frame to content-id map. | |
| 451 // Keys are routing ids of either RenderFrames or RenderFrameProxies. | |
| 452 // Values are MHTML content-ids - see WebPageSerializer::generateMHTMLParts. | |
| 453 IPC_STRUCT_MEMBER(FrameRoutingIdToContentIdMap, | |
| 454 frame_routing_id_to_content_id) | |
| 455 | |
| 456 // |digests_of_uris_to_skip| contains digests of uris of MHTML parts that | |
| 457 // should be skipped. This helps deduplicate mhtml parts across frames. | |
| 458 // SECURITY NOTE: Sha256 digests (rather than uris) are used to prevent | |
| 459 // disclosing uris to other renderer processes; the digests should be | |
| 460 // generated using SHA256HashString function from crypto/sha2.h and hashing | |
| 461 // |salt + url.spec()|. | |
| 462 IPC_STRUCT_MEMBER(std::set<std::string>, digests_of_uris_to_skip) | |
| 463 | |
| 464 // Salt used for |digests_of_uris_to_skip|. | |
| 465 IPC_STRUCT_MEMBER(std::string, salt) | |
| 466 | |
| 467 // If |is_last_frame| is true, then an MHTML footer will be generated. | |
| 468 IPC_STRUCT_MEMBER(bool, is_last_frame) | |
| 469 IPC_STRUCT_END() | |
| 470 | |
| 433 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 471 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 434 // This message is used for supporting popup menus on Mac OS X and Android using | 472 // This message is used for supporting popup menus on Mac OS X and Android using |
| 435 // native controls. See the FrameHostMsg_ShowPopup message. | 473 // native controls. See the FrameHostMsg_ShowPopup message. |
| 436 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params) | 474 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params) |
| 437 // Position on the screen. | 475 // Position on the screen. |
| 438 IPC_STRUCT_MEMBER(gfx::Rect, bounds) | 476 IPC_STRUCT_MEMBER(gfx::Rect, bounds) |
| 439 | 477 |
| 440 // The height of each item in the menu. | 478 // The height of each item in the menu. |
| 441 IPC_STRUCT_MEMBER(int, item_height) | 479 IPC_STRUCT_MEMBER(int, item_height) |
| 442 | 480 |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 715 IPC_MESSAGE_ROUTED0(FrameMsg_GetSavableResourceLinks) | 753 IPC_MESSAGE_ROUTED0(FrameMsg_GetSavableResourceLinks) |
| 716 | 754 |
| 717 // Get html data by serializing the target frame and replacing all resource | 755 // Get html data by serializing the target frame and replacing all resource |
| 718 // links with a path to the local copy passed in the message payload. | 756 // links with a path to the local copy passed in the message payload. |
| 719 using FrameMsg_GetSerializedHtmlWithLocalLinks_Map = | 757 using FrameMsg_GetSerializedHtmlWithLocalLinks_Map = |
| 720 std::map<GURL, base::FilePath>; | 758 std::map<GURL, base::FilePath>; |
| 721 IPC_MESSAGE_ROUTED1(FrameMsg_GetSerializedHtmlWithLocalLinks, | 759 IPC_MESSAGE_ROUTED1(FrameMsg_GetSerializedHtmlWithLocalLinks, |
| 722 FrameMsg_GetSerializedHtmlWithLocalLinks_Map); | 760 FrameMsg_GetSerializedHtmlWithLocalLinks_Map); |
| 723 | 761 |
| 724 // Serialize target frame and its resources into MHTML and write it into the | 762 // Serialize target frame and its resources into MHTML and write it into the |
| 725 // provided destination file handle. | 763 // provided destination file handle. Note that when serializing multiple |
| 726 // | 764 // frames, one needs to serialize the *main* frame first (the main frame |
| 727 // When starting generation of a new MHTML document, one needs to start by | 765 // needs to go first according to RFC2557 + the main frame will trigger |
| 728 // sending FrameMsg_SerializeAsMHTML for the *main* frame (main frame needs to | 766 // generation of the MHTML header). |
| 729 // be the first part in the MHTML document + main frame will trigger generation | 767 IPC_MESSAGE_ROUTED1(FrameMsg_SerializeAsMHTML, FrameMsg_SerializeAsMHTML_Params) |
| 730 // of the MHTML header). | |
| 731 // | |
| 732 // The same |mhtml_boundary_marker| should be used for serialization of each | |
| 733 // frame (this string will be used as a mime multipart boundary within the mhtml | |
| 734 // document). | |
| 735 // | |
| 736 // For more details about frame to content id map please see | |
| 737 // WebPageSerializer::generateMHTMLParts method. | |
| 738 // | |
| 739 // |is_last_frame| controls whether the serializer in the renderer will | |
| 740 // emit the MHTML footer. | |
| 741 using FrameRoutingIdToContentIdMap = std::map<int, std::string>; | |
| 742 IPC_MESSAGE_ROUTED5(FrameMsg_SerializeAsMHTML, | |
| 743 int /* job_id (used to match responses to requests) */, | |
| 744 IPC::PlatformFileForTransit /* destination file handle */, | |
| 745 std::string /* mhtml boundary marker */, | |
| 746 FrameRoutingIdToContentIdMap, | |
| 747 bool /* is last frame */) | |
| 748 | 768 |
| 749 IPC_MESSAGE_ROUTED1(FrameMsg_SetFrameOwnerProperties, | 769 IPC_MESSAGE_ROUTED1(FrameMsg_SetFrameOwnerProperties, |
| 750 blink::WebFrameOwnerProperties /* frame_owner_properties */) | 770 blink::WebFrameOwnerProperties /* frame_owner_properties */) |
| 751 | 771 |
| 752 // Request to continue running the sequential focus navigation algorithm in | 772 // Request to continue running the sequential focus navigation algorithm in |
| 753 // this frame. |source_routing_id| identifies the frame that issued this | 773 // this frame. |source_routing_id| identifies the frame that issued this |
| 754 // request. This message is sent when pressing <tab> or <shift-tab> needs to | 774 // request. This message is sent when pressing <tab> or <shift-tab> needs to |
| 755 // find the next focusable element in a cross-process frame. | 775 // find the next focusable element in a cross-process frame. |
| 756 IPC_MESSAGE_ROUTED2(FrameMsg_AdvanceFocus, | 776 IPC_MESSAGE_ROUTED2(FrameMsg_AdvanceFocus, |
| 757 blink::WebFocusType /* type */, | 777 blink::WebFocusType /* type */, |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1264 // non-savable content (i.e. from a non-savable scheme) or if there were | 1284 // non-savable content (i.e. from a non-savable scheme) or if there were |
| 1265 // errors gathering the links. | 1285 // errors gathering the links. |
| 1266 IPC_MESSAGE_ROUTED0(FrameHostMsg_SavableResourceLinksError) | 1286 IPC_MESSAGE_ROUTED0(FrameHostMsg_SavableResourceLinksError) |
| 1267 | 1287 |
| 1268 // Response to FrameMsg_GetSerializedHtmlWithLocalLinks. | 1288 // Response to FrameMsg_GetSerializedHtmlWithLocalLinks. |
| 1269 IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializedHtmlWithLocalLinksResponse, | 1289 IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializedHtmlWithLocalLinksResponse, |
| 1270 std::string /* data buffer */, | 1290 std::string /* data buffer */, |
| 1271 bool /* end of data? */) | 1291 bool /* end of data? */) |
| 1272 | 1292 |
| 1273 // Response to FrameMsg_SerializeAsMHTML. | 1293 // Response to FrameMsg_SerializeAsMHTML. |
| 1274 IPC_MESSAGE_ROUTED2(FrameHostMsg_SerializeAsMHTMLResponse, | 1294 IPC_MESSAGE_ROUTED3(FrameHostMsg_SerializeAsMHTMLResponse, |
| 1275 int /* job_id (used to match responses to requests) */, | 1295 int /* job_id (used to match responses to requests) */, |
| 1276 bool /* true if success, false if error */) | 1296 bool /* true if success, false if error */, |
| 1297 std::set<GURL> /* uris of generated mhtml parts */) | |
| 1277 | 1298 |
| 1278 // Sent when the renderer updates hint for importance of a tab. | 1299 // Sent when the renderer updates hint for importance of a tab. |
| 1279 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdatePageImportanceSignals, | 1300 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdatePageImportanceSignals, |
| 1280 content::PageImportanceSignals) | 1301 content::PageImportanceSignals) |
| 1281 | 1302 |
| 1282 // This message is sent from a RenderFrameProxy when sequential focus | 1303 // This message is sent from a RenderFrameProxy when sequential focus |
| 1283 // navigation needs to advance into its actual frame. |source_routing_id| | 1304 // navigation needs to advance into its actual frame. |source_routing_id| |
| 1284 // identifies the frame that issued this request. This is used when pressing | 1305 // identifies the frame that issued this request. This is used when pressing |
| 1285 // <tab> or <shift-tab> hits an out-of-process iframe when searching for the | 1306 // <tab> or <shift-tab> hits an out-of-process iframe when searching for the |
| 1286 // next focusable element. | 1307 // next focusable element. |
| 1287 IPC_MESSAGE_ROUTED2(FrameHostMsg_AdvanceFocus, | 1308 IPC_MESSAGE_ROUTED2(FrameHostMsg_AdvanceFocus, |
| 1288 blink::WebFocusType /* type */, | 1309 blink::WebFocusType /* type */, |
| 1289 int32_t /* source_routing_id */) | 1310 int32_t /* source_routing_id */) |
| 1290 | 1311 |
| 1291 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 1312 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 1292 | 1313 |
| 1293 // Message to show/hide a popup menu using native controls. | 1314 // Message to show/hide a popup menu using native controls. |
| 1294 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup, | 1315 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup, |
| 1295 FrameHostMsg_ShowPopup_Params) | 1316 FrameHostMsg_ShowPopup_Params) |
| 1296 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup) | 1317 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup) |
| 1297 | 1318 |
| 1298 #endif | 1319 #endif |
| 1299 | 1320 |
| 1300 // Adding a new message? Stick to the sort order above: first platform | 1321 // Adding a new message? Stick to the sort order above: first platform |
| 1301 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then | 1322 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then |
| 1302 // platform independent FrameHostMsg, then ifdefs for platform specific | 1323 // platform independent FrameHostMsg, then ifdefs for platform specific |
| 1303 // FrameHostMsg. | 1324 // FrameHostMsg. |
| OLD | NEW |