Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: content/common/frame_messages.h

Issue 2612793002: Implement ContentSecurityPolicy on the browser-side. (Closed)
Patch Set: Temporary re-add the parser + transmit parsed CSP over IPC. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/csp_policy.h"
21 #include "content/common/content_security_policy_header.h" 22 #include "content/common/content_security_policy_header.h"
22 #include "content/common/download/mhtml_save_status.h" 23 #include "content/common/download/mhtml_save_status.h"
23 #include "content/common/frame_message_enums.h" 24 #include "content/common/frame_message_enums.h"
24 #include "content/common/frame_owner_properties.h" 25 #include "content/common/frame_owner_properties.h"
25 #include "content/common/frame_replication_state.h" 26 #include "content/common/frame_replication_state.h"
26 #include "content/common/navigation_gesture.h" 27 #include "content/common/navigation_gesture.h"
27 #include "content/common/navigation_params.h" 28 #include "content/common/navigation_params.h"
28 #include "content/common/savable_subframe.h" 29 #include "content/common/savable_subframe.h"
29 #include "content/public/common/color_suggestion.h" 30 #include "content/public/common/color_suggestion.h"
30 #include "content/public/common/common_param_traits.h" 31 #include "content/public/common/common_param_traits.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 content::STOP_FIND_ACTION_LAST) 103 content::STOP_FIND_ACTION_LAST)
103 IPC_ENUM_TRAITS(blink::WebSandboxFlags) // Bitmask. 104 IPC_ENUM_TRAITS(blink::WebSandboxFlags) // Bitmask.
104 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebTreeScopeType, 105 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebTreeScopeType,
105 blink::WebTreeScopeType::Last) 106 blink::WebTreeScopeType::Last)
106 IPC_ENUM_TRAITS_MAX_VALUE(ui::MenuSourceType, ui::MENU_SOURCE_TYPE_LAST) 107 IPC_ENUM_TRAITS_MAX_VALUE(ui::MenuSourceType, ui::MENU_SOURCE_TYPE_LAST)
107 IPC_ENUM_TRAITS_MIN_MAX_VALUE(content::PreviewsState, 108 IPC_ENUM_TRAITS_MIN_MAX_VALUE(content::PreviewsState,
108 content::PREVIEWS_UNSPECIFIED, 109 content::PREVIEWS_UNSPECIFIED,
109 content::PREVIEWS_STATE_LAST) 110 content::PREVIEWS_STATE_LAST)
110 IPC_ENUM_TRAITS_MAX_VALUE(content::FileChooserParams::Mode, 111 IPC_ENUM_TRAITS_MAX_VALUE(content::FileChooserParams::Mode,
111 content::FileChooserParams::Save) 112 content::FileChooserParams::Save)
113 IPC_ENUM_TRAITS_MAX_VALUE(content::CSPDirective::Name,
114 content::CSPDirective::NAME_LAST);
112 115
113 IPC_STRUCT_TRAITS_BEGIN(blink::WebFindOptions) 116 IPC_STRUCT_TRAITS_BEGIN(blink::WebFindOptions)
114 IPC_STRUCT_TRAITS_MEMBER(forward) 117 IPC_STRUCT_TRAITS_MEMBER(forward)
115 IPC_STRUCT_TRAITS_MEMBER(matchCase) 118 IPC_STRUCT_TRAITS_MEMBER(matchCase)
116 IPC_STRUCT_TRAITS_MEMBER(findNext) 119 IPC_STRUCT_TRAITS_MEMBER(findNext)
117 IPC_STRUCT_TRAITS_MEMBER(force) 120 IPC_STRUCT_TRAITS_MEMBER(force)
118 IPC_STRUCT_TRAITS_END() 121 IPC_STRUCT_TRAITS_END()
119 122
120 IPC_STRUCT_TRAITS_BEGIN(content::ColorSuggestion) 123 IPC_STRUCT_TRAITS_BEGIN(content::ColorSuggestion)
121 IPC_STRUCT_TRAITS_MEMBER(color) 124 IPC_STRUCT_TRAITS_MEMBER(color)
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 523
521 IPC_STRUCT_BEGIN(FrameHostMsg_CreateChildFrame_Params) 524 IPC_STRUCT_BEGIN(FrameHostMsg_CreateChildFrame_Params)
522 IPC_STRUCT_MEMBER(int32_t, parent_routing_id) 525 IPC_STRUCT_MEMBER(int32_t, parent_routing_id)
523 IPC_STRUCT_MEMBER(blink::WebTreeScopeType, scope) 526 IPC_STRUCT_MEMBER(blink::WebTreeScopeType, scope)
524 IPC_STRUCT_MEMBER(std::string, frame_name) 527 IPC_STRUCT_MEMBER(std::string, frame_name)
525 IPC_STRUCT_MEMBER(std::string, frame_unique_name) 528 IPC_STRUCT_MEMBER(std::string, frame_unique_name)
526 IPC_STRUCT_MEMBER(blink::WebSandboxFlags, sandbox_flags) 529 IPC_STRUCT_MEMBER(blink::WebSandboxFlags, sandbox_flags)
527 IPC_STRUCT_MEMBER(content::FrameOwnerProperties, frame_owner_properties) 530 IPC_STRUCT_MEMBER(content::FrameOwnerProperties, frame_owner_properties)
528 IPC_STRUCT_END() 531 IPC_STRUCT_END()
529 532
533 IPC_STRUCT_TRAITS_BEGIN(content::CSPSource)
534 IPC_STRUCT_TRAITS_MEMBER(scheme)
535 IPC_STRUCT_TRAITS_MEMBER(host)
536 IPC_STRUCT_TRAITS_MEMBER(is_host_wildcard)
537 IPC_STRUCT_TRAITS_MEMBER(port)
538 IPC_STRUCT_TRAITS_MEMBER(is_port_wildcard)
539 IPC_STRUCT_TRAITS_MEMBER(path)
540 IPC_STRUCT_TRAITS_END()
541
542 IPC_STRUCT_TRAITS_BEGIN(content::CSPSourceList)
543 IPC_STRUCT_TRAITS_MEMBER(allow_self)
544 IPC_STRUCT_TRAITS_MEMBER(allow_star)
545 IPC_STRUCT_TRAITS_MEMBER(source_list)
546 IPC_STRUCT_TRAITS_END()
547
548 IPC_STRUCT_TRAITS_BEGIN(content::CSPDirective)
549 IPC_STRUCT_TRAITS_MEMBER(name)
550 IPC_STRUCT_TRAITS_MEMBER(source_list)
551 IPC_STRUCT_TRAITS_END()
552
553 IPC_STRUCT_TRAITS_BEGIN(content::CSPPolicy)
554 IPC_STRUCT_TRAITS_MEMBER(disposition)
555 IPC_STRUCT_TRAITS_MEMBER(source)
556 IPC_STRUCT_TRAITS_MEMBER(directives)
557 IPC_STRUCT_TRAITS_MEMBER(report_end_points)
558 IPC_STRUCT_TRAITS_END()
559
530 IPC_STRUCT_TRAITS_BEGIN(content::ContentSecurityPolicyHeader) 560 IPC_STRUCT_TRAITS_BEGIN(content::ContentSecurityPolicyHeader)
531 IPC_STRUCT_TRAITS_MEMBER(header_value) 561 IPC_STRUCT_TRAITS_MEMBER(header_value)
532 IPC_STRUCT_TRAITS_MEMBER(type) 562 IPC_STRUCT_TRAITS_MEMBER(type)
533 IPC_STRUCT_TRAITS_MEMBER(source) 563 IPC_STRUCT_TRAITS_MEMBER(source)
534 IPC_STRUCT_TRAITS_END() 564 IPC_STRUCT_TRAITS_END()
535 565
536 IPC_STRUCT_TRAITS_BEGIN(content::FormFieldData) 566 IPC_STRUCT_TRAITS_BEGIN(content::FormFieldData)
537 IPC_STRUCT_TRAITS_MEMBER(text) 567 IPC_STRUCT_TRAITS_MEMBER(text)
538 IPC_STRUCT_TRAITS_MEMBER(placeholder) 568 IPC_STRUCT_TRAITS_MEMBER(placeholder)
539 IPC_STRUCT_TRAITS_MEMBER(text_input_type) 569 IPC_STRUCT_TRAITS_MEMBER(text_input_type)
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 // a list of an origin whitelist for each feature in the policy. 1050 // a list of an origin whitelist for each feature in the policy.
1021 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidSetFeaturePolicyHeader, 1051 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidSetFeaturePolicyHeader,
1022 content::ParsedFeaturePolicy /* parsed_header */) 1052 content::ParsedFeaturePolicy /* parsed_header */)
1023 1053
1024 // Notifies the browser process about a new Content Security Policy that needs 1054 // Notifies the browser process about a new Content Security Policy that needs
1025 // to be applies to the frame. This message is sent when a frame commits 1055 // to be applies to the frame. This message is sent when a frame commits
1026 // navigation to a new location (reporting accumulated policies from HTTP 1056 // navigation to a new location (reporting accumulated policies from HTTP
1027 // headers and/or policies that might have been inherited from the parent frame) 1057 // headers and/or policies that might have been inherited from the parent frame)
1028 // or when a new policy has been discovered afterwards (i.e. found in a 1058 // or when a new policy has been discovered afterwards (i.e. found in a
1029 // dynamically added or a static <meta> element). 1059 // dynamically added or a static <meta> element).
1030 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAddContentSecurityPolicy, 1060 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidAddContentSecurityPolicy,
1031 content::ContentSecurityPolicyHeader) 1061 content::ContentSecurityPolicyHeader,
1062 content::CSPPolicy);
1032 1063
1033 // Sent when the frame starts enforcing an insecure request policy. Sending 1064 // Sent when the frame starts enforcing an insecure request policy. Sending
1034 // this information in DidCommitProvisionalLoad isn't sufficient; this 1065 // this information in DidCommitProvisionalLoad isn't sufficient; this
1035 // message is needed because, for example, a document can dynamically insert 1066 // message is needed because, for example, a document can dynamically insert
1036 // a <meta> tag that causes strict mixed content checking to be enforced. 1067 // a <meta> tag that causes strict mixed content checking to be enforced.
1037 IPC_MESSAGE_ROUTED1(FrameHostMsg_EnforceInsecureRequestPolicy, 1068 IPC_MESSAGE_ROUTED1(FrameHostMsg_EnforceInsecureRequestPolicy,
1038 blink::WebInsecureRequestPolicy) 1069 blink::WebInsecureRequestPolicy)
1039 1070
1040 // Sent when the frame is set to a unique origin. TODO(estark): this IPC 1071 // Sent when the frame is set to a unique origin. TODO(estark): this IPC
1041 // only exists to support dynamic sandboxing via a CSP delivered in a 1072 // only exists to support dynamic sandboxing via a CSP delivered in a
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 // nearest find result in the sending frame. 1585 // nearest find result in the sending frame.
1555 IPC_MESSAGE_ROUTED2(FrameHostMsg_GetNearestFindResult_Reply, 1586 IPC_MESSAGE_ROUTED2(FrameHostMsg_GetNearestFindResult_Reply,
1556 int /* nfr_request_id */, 1587 int /* nfr_request_id */,
1557 float /* distance */) 1588 float /* distance */)
1558 #endif 1589 #endif
1559 1590
1560 // Adding a new message? Stick to the sort order above: first platform 1591 // Adding a new message? Stick to the sort order above: first platform
1561 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then 1592 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then
1562 // platform independent FrameHostMsg, then ifdefs for platform specific 1593 // platform independent FrameHostMsg, then ifdefs for platform specific
1563 // FrameHostMsg. 1594 // FrameHostMsg.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698