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

Side by Side Diff: content/browser/frame_host/frame_tree_node.cc

Issue 2612793002: Implement ContentSecurityPolicy on the browser-side. (Closed)
Patch Set: Add the TODO and bug ids that was forgotten. Created 3 years, 10 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/browser/frame_host/frame_tree_node.h" 5 #include "content/browser/frame_host/frame_tree_node.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 void FrameTreeNode::SetFeaturePolicyHeader( 284 void FrameTreeNode::SetFeaturePolicyHeader(
285 const ParsedFeaturePolicyHeader& parsed_header) { 285 const ParsedFeaturePolicyHeader& parsed_header) {
286 replication_state_.feature_policy_header = parsed_header; 286 replication_state_.feature_policy_header = parsed_header;
287 } 287 }
288 288
289 void FrameTreeNode::ResetFeaturePolicyHeader() { 289 void FrameTreeNode::ResetFeaturePolicyHeader() {
290 replication_state_.feature_policy_header.clear(); 290 replication_state_.feature_policy_header.clear();
291 } 291 }
292 292
293 void FrameTreeNode::AddContentSecurityPolicy( 293 void FrameTreeNode::AddContentSecurityPolicy(
294 const ContentSecurityPolicyHeader& header) { 294 const ContentSecurityPolicyHeader& header,
295 const std::vector<ContentSecurityPolicy>& policies) {
295 replication_state_.accumulated_csp_headers.push_back(header); 296 replication_state_.accumulated_csp_headers.push_back(header);
296 render_manager_.OnDidAddContentSecurityPolicy(header); 297 render_manager_.OnDidAddContentSecurityPolicy(header);
298 csp_policies_.insert(csp_policies_.end(), policies.begin(), policies.end());
297 } 299 }
298 300
299 void FrameTreeNode::ResetContentSecurityPolicy() { 301 void FrameTreeNode::ResetContentSecurityPolicy() {
300 replication_state_.accumulated_csp_headers.clear(); 302 replication_state_.accumulated_csp_headers.clear();
301 render_manager_.OnDidResetContentSecurityPolicy(); 303 render_manager_.OnDidResetContentSecurityPolicy();
304 csp_policies_.clear();
302 } 305 }
303 306
304 void FrameTreeNode::SetInsecureRequestPolicy( 307 void FrameTreeNode::SetInsecureRequestPolicy(
305 blink::WebInsecureRequestPolicy policy) { 308 blink::WebInsecureRequestPolicy policy) {
306 if (policy == replication_state_.insecure_request_policy) 309 if (policy == replication_state_.insecure_request_policy)
307 return; 310 return;
308 render_manager_.OnEnforceInsecureRequestPolicy(policy); 311 render_manager_.OnEnforceInsecureRequestPolicy(policy);
309 replication_state_.insecure_request_policy = policy; 312 replication_state_.insecure_request_policy = policy;
310 } 313 }
311 314
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 } 556 }
554 return parent_->child_at(i + relative_offset); 557 return parent_->child_at(i + relative_offset);
555 } 558 }
556 } 559 }
557 560
558 NOTREACHED() << "FrameTreeNode not found in its parent's children."; 561 NOTREACHED() << "FrameTreeNode not found in its parent's children.";
559 return nullptr; 562 return nullptr;
560 } 563 }
561 564
562 } // namespace content 565 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698