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

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

Issue 2764993002: CSP: group policies in didAddContentSecurityPolicy. (Closed)
Patch Set: CSP send policies in didAddContentSecurityPolicy one by one. 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 3206 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::didAddContentSecurityPolicy(
3224 const blink::WebString& header_value, 3224 const blink::WebString& header_value,
3225 blink::WebContentSecurityPolicyType type, 3225 blink::WebContentSecurityPolicyType type,
3226 blink::WebContentSecurityPolicySource source, 3226 blink::WebContentSecurityPolicySource source,
3227 const std::vector<blink::WebContentSecurityPolicyPolicy>& policies) { 3227 const blink::WebContentSecurityPolicyPolicy& policy) {
3228 ContentSecurityPolicyHeader header; 3228 ContentSecurityPolicyHeader header;
3229 header.header_value = header_value.utf8(); 3229 header.header_value = header_value.utf8();
3230 header.type = type; 3230 header.type = type;
3231 header.source = source; 3231 header.source = source;
3232 3232
3233 std::vector<ContentSecurityPolicy> content_policies; 3233 Send(new FrameHostMsg_DidAddContentSecurityPolicy(
3234 for (const auto& policy : policies) 3234 routing_id_, header, BuildContentSecurityPolicy(policy)));
3235 content_policies.push_back(BuildContentSecurityPolicy(policy));
3236
3237 Send(new FrameHostMsg_DidAddContentSecurityPolicy(routing_id_, header,
3238 content_policies));
3239 } 3235 }
3240 3236
3241 void RenderFrameImpl::didChangeFrameOwnerProperties( 3237 void RenderFrameImpl::didChangeFrameOwnerProperties(
3242 blink::WebFrame* child_frame, 3238 blink::WebFrame* child_frame,
3243 const blink::WebFrameOwnerProperties& frame_owner_properties) { 3239 const blink::WebFrameOwnerProperties& frame_owner_properties) {
3244 Send(new FrameHostMsg_DidChangeFrameOwnerProperties( 3240 Send(new FrameHostMsg_DidChangeFrameOwnerProperties(
3245 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), 3241 routing_id_, GetRoutingIdForFrameOrProxy(child_frame),
3246 ConvertWebFrameOwnerPropertiesToFrameOwnerProperties( 3242 ConvertWebFrameOwnerPropertiesToFrameOwnerProperties(
3247 frame_owner_properties))); 3243 frame_owner_properties)));
3248 } 3244 }
(...skipping 3683 matching lines...) Expand 10 before | Expand all | Expand 10 after
6932 policy(info.defaultPolicy), 6928 policy(info.defaultPolicy),
6933 replaces_current_history_item(info.replacesCurrentHistoryItem), 6929 replaces_current_history_item(info.replacesCurrentHistoryItem),
6934 history_navigation_in_new_child_frame( 6930 history_navigation_in_new_child_frame(
6935 info.isHistoryNavigationInNewChildFrame), 6931 info.isHistoryNavigationInNewChildFrame),
6936 client_redirect(info.isClientRedirect), 6932 client_redirect(info.isClientRedirect),
6937 cache_disabled(info.isCacheDisabled), 6933 cache_disabled(info.isCacheDisabled),
6938 form(info.form), 6934 form(info.form),
6939 source_location(info.sourceLocation) {} 6935 source_location(info.sourceLocation) {}
6940 6936
6941 } // namespace content 6937 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698