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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <set> | 12 #include <set> |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "cc/surfaces/surface_id.h" | 17 #include "cc/surfaces/surface_id.h" |
18 #include "cc/surfaces/surface_sequence.h" | 18 #include "cc/surfaces/surface_sequence.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/common/content_param_traits.h" | 20 #include "content/common/content_param_traits.h" |
21 #include "content/common/content_security_policy_header.h" | 21 #include "content/common/content_security_policy_structs.h" |
22 #include "content/common/frame_message_enums.h" | 22 #include "content/common/frame_message_enums.h" |
23 #include "content/common/frame_owner_properties.h" | 23 #include "content/common/frame_owner_properties.h" |
24 #include "content/common/frame_replication_state.h" | 24 #include "content/common/frame_replication_state.h" |
25 #include "content/common/navigation_gesture.h" | 25 #include "content/common/navigation_gesture.h" |
26 #include "content/common/navigation_params.h" | 26 #include "content/common/navigation_params.h" |
27 #include "content/common/savable_subframe.h" | 27 #include "content/common/savable_subframe.h" |
28 #include "content/public/common/color_suggestion.h" | 28 #include "content/public/common/color_suggestion.h" |
29 #include "content/public/common/common_param_traits.h" | 29 #include "content/public/common/common_param_traits.h" |
30 #include "content/public/common/console_message_level.h" | 30 #include "content/public/common/console_message_level.h" |
31 #include "content/public/common/context_menu_params.h" | 31 #include "content/public/common/context_menu_params.h" |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 | 550 |
551 IPC_STRUCT_BEGIN(FrameHostMsg_CreateChildFrame_Params) | 551 IPC_STRUCT_BEGIN(FrameHostMsg_CreateChildFrame_Params) |
552 IPC_STRUCT_MEMBER(int32_t, parent_routing_id) | 552 IPC_STRUCT_MEMBER(int32_t, parent_routing_id) |
553 IPC_STRUCT_MEMBER(blink::WebTreeScopeType, scope) | 553 IPC_STRUCT_MEMBER(blink::WebTreeScopeType, scope) |
554 IPC_STRUCT_MEMBER(std::string, frame_name) | 554 IPC_STRUCT_MEMBER(std::string, frame_name) |
555 IPC_STRUCT_MEMBER(std::string, frame_unique_name) | 555 IPC_STRUCT_MEMBER(std::string, frame_unique_name) |
556 IPC_STRUCT_MEMBER(blink::WebSandboxFlags, sandbox_flags) | 556 IPC_STRUCT_MEMBER(blink::WebSandboxFlags, sandbox_flags) |
557 IPC_STRUCT_MEMBER(content::FrameOwnerProperties, frame_owner_properties) | 557 IPC_STRUCT_MEMBER(content::FrameOwnerProperties, frame_owner_properties) |
558 IPC_STRUCT_END() | 558 IPC_STRUCT_END() |
559 | 559 |
| 560 IPC_STRUCT_TRAITS_BEGIN(content::ContentSecurityPolicyViolation) |
| 561 IPC_STRUCT_TRAITS_MEMBER(directive_text) |
| 562 IPC_STRUCT_TRAITS_MEMBER(effective_directive) |
| 563 IPC_STRUCT_TRAITS_MEMBER(console_message) |
| 564 IPC_STRUCT_TRAITS_MEMBER(blocked_url) |
| 565 IPC_STRUCT_TRAITS_MEMBER(report_endpoints) |
| 566 IPC_STRUCT_TRAITS_MEMBER(header) |
| 567 IPC_STRUCT_TRAITS_MEMBER(violation_type) |
| 568 IPC_STRUCT_TRAITS_MEMBER(followed_redirect) |
| 569 IPC_STRUCT_TRAITS_END() |
| 570 |
560 IPC_STRUCT_TRAITS_BEGIN(content::ContentSecurityPolicyHeader) | 571 IPC_STRUCT_TRAITS_BEGIN(content::ContentSecurityPolicyHeader) |
561 IPC_STRUCT_TRAITS_MEMBER(header_value) | 572 IPC_STRUCT_TRAITS_MEMBER(header_value) |
562 IPC_STRUCT_TRAITS_MEMBER(type) | 573 IPC_STRUCT_TRAITS_MEMBER(type) |
563 IPC_STRUCT_TRAITS_MEMBER(source) | 574 IPC_STRUCT_TRAITS_MEMBER(source) |
564 IPC_STRUCT_TRAITS_END() | 575 IPC_STRUCT_TRAITS_END() |
565 | 576 |
566 IPC_STRUCT_TRAITS_BEGIN(content::FileChooserFileInfo) | 577 IPC_STRUCT_TRAITS_BEGIN(content::FileChooserFileInfo) |
567 IPC_STRUCT_TRAITS_MEMBER(file_path) | 578 IPC_STRUCT_TRAITS_MEMBER(file_path) |
568 IPC_STRUCT_TRAITS_MEMBER(display_name) | 579 IPC_STRUCT_TRAITS_MEMBER(display_name) |
569 IPC_STRUCT_TRAITS_MEMBER(file_system_url) | 580 IPC_STRUCT_TRAITS_MEMBER(file_system_url) |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 std::string /* name */, | 815 std::string /* name */, |
805 std::string /* unique_name */) | 816 std::string /* unique_name */) |
806 | 817 |
807 // Updates replicated ContentSecurityPolicy in a frame proxy. | 818 // Updates replicated ContentSecurityPolicy in a frame proxy. |
808 IPC_MESSAGE_ROUTED1(FrameMsg_AddContentSecurityPolicy, | 819 IPC_MESSAGE_ROUTED1(FrameMsg_AddContentSecurityPolicy, |
809 content::ContentSecurityPolicyHeader) | 820 content::ContentSecurityPolicyHeader) |
810 | 821 |
811 // Resets ContentSecurityPolicy in a frame proxy / in RemoteSecurityContext. | 822 // Resets ContentSecurityPolicy in a frame proxy / in RemoteSecurityContext. |
812 IPC_MESSAGE_ROUTED0(FrameMsg_ResetContentSecurityPolicy) | 823 IPC_MESSAGE_ROUTED0(FrameMsg_ResetContentSecurityPolicy) |
813 | 824 |
| 825 // Asks the frame to report a Content Security Policy violation that was |
| 826 // detected in another process (i.e. in another renderer process - |
| 827 // https://crbug.com/611232 [e.g. when frame-src is violated when the |
| 828 // parent frame is remote] or [in the future] in the browser process - |
| 829 // https://crbug.com/376522). In this case we use the IPC message below |
| 830 // to notify the frame where Content Security Policy originated from, so |
| 831 // that *this* frame can raise SecurityPolicyViolationEvent event and |
| 832 // finish reporting the violation. |
| 833 IPC_MESSAGE_ROUTED1(FrameMsg_ReportContentSecurityPolicyViolation, |
| 834 content::ContentSecurityPolicyViolation) |
| 835 |
814 // Update a proxy's replicated enforcement of insecure request policy. | 836 // Update a proxy's replicated enforcement of insecure request policy. |
815 // Used when the frame's policy is changed in another process. | 837 // Used when the frame's policy is changed in another process. |
816 IPC_MESSAGE_ROUTED1(FrameMsg_EnforceInsecureRequestPolicy, | 838 IPC_MESSAGE_ROUTED1(FrameMsg_EnforceInsecureRequestPolicy, |
817 blink::WebInsecureRequestPolicy) | 839 blink::WebInsecureRequestPolicy) |
818 | 840 |
819 // Update a proxy's replicated origin. Used when the frame is navigated to a | 841 // Update a proxy's replicated origin. Used when the frame is navigated to a |
820 // new origin. | 842 // new origin. |
821 IPC_MESSAGE_ROUTED2(FrameMsg_DidUpdateOrigin, | 843 IPC_MESSAGE_ROUTED2(FrameMsg_DidUpdateOrigin, |
822 url::Origin /* origin */, | 844 url::Origin /* origin */, |
823 bool /* is potentially trustworthy unique origin */) | 845 bool /* is potentially trustworthy unique origin */) |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 | 1081 |
1060 // Notifies the browser process about a new Content Security Policy that needs | 1082 // Notifies the browser process about a new Content Security Policy that needs |
1061 // to be applies to the frame. This message is sent when a frame commits | 1083 // to be applies to the frame. This message is sent when a frame commits |
1062 // navigation to a new location (reporting accumulated policies from HTTP | 1084 // navigation to a new location (reporting accumulated policies from HTTP |
1063 // headers and/or policies that might have been inherited from the parent frame) | 1085 // headers and/or policies that might have been inherited from the parent frame) |
1064 // or when a new policy has been discovered afterwards (i.e. found in a | 1086 // or when a new policy has been discovered afterwards (i.e. found in a |
1065 // dynamically added or a static <meta> element). | 1087 // dynamically added or a static <meta> element). |
1066 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAddContentSecurityPolicy, | 1088 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAddContentSecurityPolicy, |
1067 content::ContentSecurityPolicyHeader) | 1089 content::ContentSecurityPolicyHeader) |
1068 | 1090 |
| 1091 // Asks the browser to forward a Content Security Policy violation from a frame |
| 1092 // proxy to the real frame. See also |
| 1093 // FrameMsg_ReportContentSecurityPolicyViolation. |
| 1094 IPC_MESSAGE_ROUTED2( |
| 1095 FrameHostMsg_ForwardContentSecurityPolicyViolation, |
| 1096 url::Origin /* Origin of frame declaring the violated CSP */, |
| 1097 content::ContentSecurityPolicyViolation) |
| 1098 |
1069 // Sent when the frame starts enforcing an insecure request policy. Sending | 1099 // Sent when the frame starts enforcing an insecure request policy. Sending |
1070 // this information in DidCommitProvisionalLoad isn't sufficient; this | 1100 // this information in DidCommitProvisionalLoad isn't sufficient; this |
1071 // message is needed because, for example, a document can dynamically insert | 1101 // message is needed because, for example, a document can dynamically insert |
1072 // a <meta> tag that causes strict mixed content checking to be enforced. | 1102 // a <meta> tag that causes strict mixed content checking to be enforced. |
1073 IPC_MESSAGE_ROUTED1(FrameHostMsg_EnforceInsecureRequestPolicy, | 1103 IPC_MESSAGE_ROUTED1(FrameHostMsg_EnforceInsecureRequestPolicy, |
1074 blink::WebInsecureRequestPolicy) | 1104 blink::WebInsecureRequestPolicy) |
1075 | 1105 |
1076 // Sent when the frame is set to a unique origin. TODO(estark): this IPC | 1106 // Sent when the frame is set to a unique origin. TODO(estark): this IPC |
1077 // only exists to support dynamic sandboxing via a CSP delivered in a | 1107 // only exists to support dynamic sandboxing via a CSP delivered in a |
1078 // <meta> tag. This is not supposed to be allowed per the CSP spec and | 1108 // <meta> tag. This is not supposed to be allowed per the CSP spec and |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 // nearest find result in the sending frame. | 1599 // nearest find result in the sending frame. |
1570 IPC_MESSAGE_ROUTED2(FrameHostMsg_GetNearestFindResult_Reply, | 1600 IPC_MESSAGE_ROUTED2(FrameHostMsg_GetNearestFindResult_Reply, |
1571 int /* nfr_request_id */, | 1601 int /* nfr_request_id */, |
1572 float /* distance */) | 1602 float /* distance */) |
1573 #endif | 1603 #endif |
1574 | 1604 |
1575 // Adding a new message? Stick to the sort order above: first platform | 1605 // Adding a new message? Stick to the sort order above: first platform |
1576 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then | 1606 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then |
1577 // platform independent FrameHostMsg, then ifdefs for platform specific | 1607 // platform independent FrameHostMsg, then ifdefs for platform specific |
1578 // FrameHostMsg. | 1608 // FrameHostMsg. |
OLD | NEW |