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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2764993002: CSP: group policies in didAddContentSecurityPolicy. (Closed)
Patch Set: Group the IPC instead of splitting them. (browser -> renderer) Created 3 years, 9 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 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 3202 matching lines...) Expand 10 before | Expand all | Expand 10 after
3213 Send(new FrameHostMsg_DidChangeSandboxFlags( 3213 Send(new FrameHostMsg_DidChangeSandboxFlags(
3214 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), flags)); 3214 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), flags));
3215 } 3215 }
3216 3216
3217 void RenderFrameImpl::didSetFeaturePolicyHeader( 3217 void RenderFrameImpl::didSetFeaturePolicyHeader(
3218 const blink::WebParsedFeaturePolicy& parsed_header) { 3218 const blink::WebParsedFeaturePolicy& parsed_header) {
3219 Send(new FrameHostMsg_DidSetFeaturePolicyHeader( 3219 Send(new FrameHostMsg_DidSetFeaturePolicyHeader(
3220 routing_id_, FeaturePolicyHeaderFromWeb(parsed_header))); 3220 routing_id_, FeaturePolicyHeaderFromWeb(parsed_header)));
3221 } 3221 }
3222 3222
3223 void RenderFrameImpl::didAddContentSecurityPolicy( 3223 void RenderFrameImpl::didAddContentSecurityPolicies(
3224 const blink::WebString& header_value, 3224 const blink::WebVector<blink::WebContentSecurityPolicyPolicy>& policies) {
3225 blink::WebContentSecurityPolicyType type,
3226 blink::WebContentSecurityPolicySource source,
3227 const std::vector<blink::WebContentSecurityPolicyPolicy>& policies) {
3228 ContentSecurityPolicyHeader header;
3229 header.header_value = header_value.utf8();
3230 header.type = type;
3231 header.source = source;
3232
3233 std::vector<ContentSecurityPolicy> content_policies; 3225 std::vector<ContentSecurityPolicy> content_policies;
3234 for (const auto& policy : policies) 3226 for (const auto& policy : policies)
3235 content_policies.push_back(BuildContentSecurityPolicy(policy)); 3227 content_policies.push_back(BuildContentSecurityPolicy(policy));
3236 3228
3237 Send(new FrameHostMsg_DidAddContentSecurityPolicy(routing_id_, header, 3229 Send(new FrameHostMsg_DidAddContentSecurityPolicies(routing_id_,
3238 content_policies)); 3230 content_policies));
3239 } 3231 }
3240 3232
3241 void RenderFrameImpl::didChangeFrameOwnerProperties( 3233 void RenderFrameImpl::didChangeFrameOwnerProperties(
3242 blink::WebFrame* child_frame, 3234 blink::WebFrame* child_frame,
3243 const blink::WebFrameOwnerProperties& frame_owner_properties) { 3235 const blink::WebFrameOwnerProperties& frame_owner_properties) {
3244 Send(new FrameHostMsg_DidChangeFrameOwnerProperties( 3236 Send(new FrameHostMsg_DidChangeFrameOwnerProperties(
3245 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), 3237 routing_id_, GetRoutingIdForFrameOrProxy(child_frame),
3246 ConvertWebFrameOwnerPropertiesToFrameOwnerProperties( 3238 ConvertWebFrameOwnerPropertiesToFrameOwnerProperties(
3247 frame_owner_properties))); 3239 frame_owner_properties)));
3248 } 3240 }
(...skipping 3683 matching lines...) Expand 10 before | Expand all | Expand 10 after
6932 policy(info.defaultPolicy), 6924 policy(info.defaultPolicy),
6933 replaces_current_history_item(info.replacesCurrentHistoryItem), 6925 replaces_current_history_item(info.replacesCurrentHistoryItem),
6934 history_navigation_in_new_child_frame( 6926 history_navigation_in_new_child_frame(
6935 info.isHistoryNavigationInNewChildFrame), 6927 info.isHistoryNavigationInNewChildFrame),
6936 client_redirect(info.isClientRedirect), 6928 client_redirect(info.isClientRedirect),
6937 cache_disabled(info.isCacheDisabled), 6929 cache_disabled(info.isCacheDisabled),
6938 form(info.form), 6930 form(info.form),
6939 source_location(info.sourceLocation) {} 6931 source_location(info.sourceLocation) {}
6940 6932
6941 } // namespace content 6933 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698