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 <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(header) | |
|
alexmos
2016/08/09 18:01:19
Does |report_endpoints| also need to be here?
Łukasz Anforowicz
2016/08/09 22:23:20
Ooops. Thanks for catching this. Done.
| |
| 566 IPC_STRUCT_TRAITS_MEMBER(violation_type) | |
| 567 IPC_STRUCT_TRAITS_MEMBER(followed_redirect) | |
| 568 IPC_STRUCT_TRAITS_END() | |
| 569 | |
| 560 IPC_STRUCT_TRAITS_BEGIN(content::ContentSecurityPolicyHeader) | 570 IPC_STRUCT_TRAITS_BEGIN(content::ContentSecurityPolicyHeader) |
| 561 IPC_STRUCT_TRAITS_MEMBER(header_value) | 571 IPC_STRUCT_TRAITS_MEMBER(header_value) |
| 562 IPC_STRUCT_TRAITS_MEMBER(type) | 572 IPC_STRUCT_TRAITS_MEMBER(type) |
| 563 IPC_STRUCT_TRAITS_MEMBER(source) | 573 IPC_STRUCT_TRAITS_MEMBER(source) |
| 564 IPC_STRUCT_TRAITS_END() | 574 IPC_STRUCT_TRAITS_END() |
| 565 | 575 |
| 566 IPC_STRUCT_TRAITS_BEGIN(content::FileChooserFileInfo) | 576 IPC_STRUCT_TRAITS_BEGIN(content::FileChooserFileInfo) |
| 567 IPC_STRUCT_TRAITS_MEMBER(file_path) | 577 IPC_STRUCT_TRAITS_MEMBER(file_path) |
| 568 IPC_STRUCT_TRAITS_MEMBER(display_name) | 578 IPC_STRUCT_TRAITS_MEMBER(display_name) |
| 569 IPC_STRUCT_TRAITS_MEMBER(file_system_url) | 579 IPC_STRUCT_TRAITS_MEMBER(file_system_url) |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 804 std::string /* name */, | 814 std::string /* name */, |
| 805 std::string /* unique_name */) | 815 std::string /* unique_name */) |
| 806 | 816 |
| 807 // Updates replicated ContentSecurityPolicy in a frame proxy. | 817 // Updates replicated ContentSecurityPolicy in a frame proxy. |
| 808 IPC_MESSAGE_ROUTED1(FrameMsg_AddContentSecurityPolicy, | 818 IPC_MESSAGE_ROUTED1(FrameMsg_AddContentSecurityPolicy, |
| 809 content::ContentSecurityPolicyHeader) | 819 content::ContentSecurityPolicyHeader) |
| 810 | 820 |
| 811 // Resets ContentSecurityPolicy in a frame proxy / in RemoteSecurityContext. | 821 // Resets ContentSecurityPolicy in a frame proxy / in RemoteSecurityContext. |
| 812 IPC_MESSAGE_ROUTED0(FrameMsg_ResetContentSecurityPolicy) | 822 IPC_MESSAGE_ROUTED0(FrameMsg_ResetContentSecurityPolicy) |
| 813 | 823 |
| 824 // Reports Content Security Policy violation from within the target frame. | |
|
alexmos
2016/08/09 18:01:19
I was a bit confused by what "from within the targ
Łukasz Anforowicz
2016/08/09 22:23:20
Done (I think).
| |
| 825 // This is useful if the CSP violation has been detected in another process | |
| 826 // (e.g. in another renderer process - https://crbug.com/611232 or [in the | |
| 827 // future] in the browser process - https://crbug.com/376522). In this case | |
| 828 // we need to notify the frame where Content Security Policy originated from | |
| 829 // so that *this* frame can raise SecurityPolicyViolationEvent event (and do | |
|
alexmos
2016/08/09 18:01:19
nit: I'd remove the parens and simplify their cont
Łukasz Anforowicz
2016/08/09 22:23:20
Done.
| |
| 830 // other things needed to finish reporting the violation). | |
| 831 IPC_MESSAGE_ROUTED1(FrameMsg_ReportContentSecurityPolicyViolation, | |
| 832 content::ContentSecurityPolicyViolation) | |
| 833 | |
| 814 // Update a proxy's replicated enforcement of insecure request policy. | 834 // Update a proxy's replicated enforcement of insecure request policy. |
| 815 // Used when the frame's policy is changed in another process. | 835 // Used when the frame's policy is changed in another process. |
| 816 IPC_MESSAGE_ROUTED1(FrameMsg_EnforceInsecureRequestPolicy, | 836 IPC_MESSAGE_ROUTED1(FrameMsg_EnforceInsecureRequestPolicy, |
| 817 blink::WebInsecureRequestPolicy) | 837 blink::WebInsecureRequestPolicy) |
| 818 | 838 |
| 819 // Update a proxy's replicated origin. Used when the frame is navigated to a | 839 // Update a proxy's replicated origin. Used when the frame is navigated to a |
| 820 // new origin. | 840 // new origin. |
| 821 IPC_MESSAGE_ROUTED2(FrameMsg_DidUpdateOrigin, | 841 IPC_MESSAGE_ROUTED2(FrameMsg_DidUpdateOrigin, |
| 822 url::Origin /* origin */, | 842 url::Origin /* origin */, |
| 823 bool /* is potentially trustworthy unique origin */) | 843 bool /* is potentially trustworthy unique origin */) |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1055 | 1075 |
| 1056 // Notifies the browser process about a new Content Security Policy that needs | 1076 // Notifies the browser process about a new Content Security Policy that needs |
| 1057 // to be applies to the frame. This message is sent when a frame commits | 1077 // to be applies to the frame. This message is sent when a frame commits |
| 1058 // navigation to a new location (reporting accumulated policies from HTTP | 1078 // navigation to a new location (reporting accumulated policies from HTTP |
| 1059 // headers and/or policies that might have been inherited from the parent frame) | 1079 // headers and/or policies that might have been inherited from the parent frame) |
| 1060 // or when a new policy has been discovered afterwards (i.e. found in a | 1080 // or when a new policy has been discovered afterwards (i.e. found in a |
| 1061 // dynamically added or a static <meta> element). | 1081 // dynamically added or a static <meta> element). |
| 1062 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAddContentSecurityPolicy, | 1082 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAddContentSecurityPolicy, |
| 1063 content::ContentSecurityPolicyHeader) | 1083 content::ContentSecurityPolicyHeader) |
| 1064 | 1084 |
| 1085 // Asks the browser to forward a Content Security Policy violation from a frame | |
| 1086 // proxy to the real frame. See also | |
| 1087 // FrameMsg_ReportContentSecurityPolicyViolation. | |
| 1088 IPC_MESSAGE_ROUTED1(FrameHostMsg_ForwardContentSecurityPolicyViolation, | |
| 1089 content::ContentSecurityPolicyViolation) | |
| 1090 | |
| 1065 // Sent when the frame starts enforcing an insecure request policy. Sending | 1091 // Sent when the frame starts enforcing an insecure request policy. Sending |
| 1066 // this information in DidCommitProvisionalLoad isn't sufficient; this | 1092 // this information in DidCommitProvisionalLoad isn't sufficient; this |
| 1067 // message is needed because, for example, a document can dynamically insert | 1093 // message is needed because, for example, a document can dynamically insert |
| 1068 // a <meta> tag that causes strict mixed content checking to be enforced. | 1094 // a <meta> tag that causes strict mixed content checking to be enforced. |
| 1069 IPC_MESSAGE_ROUTED1(FrameHostMsg_EnforceInsecureRequestPolicy, | 1095 IPC_MESSAGE_ROUTED1(FrameHostMsg_EnforceInsecureRequestPolicy, |
| 1070 blink::WebInsecureRequestPolicy) | 1096 blink::WebInsecureRequestPolicy) |
| 1071 | 1097 |
| 1072 // Sent when the frame is set to a unique origin. TODO(estark): this IPC | 1098 // Sent when the frame is set to a unique origin. TODO(estark): this IPC |
| 1073 // only exists to support dynamic sandboxing via a CSP delivered in a | 1099 // only exists to support dynamic sandboxing via a CSP delivered in a |
| 1074 // <meta> tag. This is not supposed to be allowed per the CSP spec and | 1100 // <meta> tag. This is not supposed to be allowed per the CSP spec and |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1568 // nearest find result in the sending frame. | 1594 // nearest find result in the sending frame. |
| 1569 IPC_MESSAGE_ROUTED2(FrameHostMsg_GetNearestFindResult_Reply, | 1595 IPC_MESSAGE_ROUTED2(FrameHostMsg_GetNearestFindResult_Reply, |
| 1570 int /* nfr_request_id */, | 1596 int /* nfr_request_id */, |
| 1571 float /* distance */) | 1597 float /* distance */) |
| 1572 #endif | 1598 #endif |
| 1573 | 1599 |
| 1574 // Adding a new message? Stick to the sort order above: first platform | 1600 // Adding a new message? Stick to the sort order above: first platform |
| 1575 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then | 1601 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then |
| 1576 // platform independent FrameHostMsg, then ifdefs for platform specific | 1602 // platform independent FrameHostMsg, then ifdefs for platform specific |
| 1577 // FrameHostMsg. | 1603 // FrameHostMsg. |
| OLD | NEW |