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

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

Issue 2653623004: [WIP NOT FOR COMMIT] Feature policy: Add basic algorithm for supporting frame policies, start plumb… (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | content/child/blink_platform_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/macros.h" 10 #include "base/macros.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 const FeaturePolicyHeader& parsed_header) { 260 const FeaturePolicyHeader& parsed_header) {
261 ResetFeaturePolicy(); 261 ResetFeaturePolicy();
262 replication_state_.feature_policy_header = parsed_header; 262 replication_state_.feature_policy_header = parsed_header;
263 feature_policy_->SetHeaderPolicy(parsed_header); 263 feature_policy_->SetHeaderPolicy(parsed_header);
264 } 264 }
265 265
266 void FrameTreeNode::ResetFeaturePolicy() { 266 void FrameTreeNode::ResetFeaturePolicy() {
267 replication_state_.feature_policy_header.clear(); 267 replication_state_.feature_policy_header.clear();
268 if (parent()) { 268 if (parent()) {
269 feature_policy_ = FeaturePolicy::CreateFromParentPolicy( 269 feature_policy_ = FeaturePolicy::CreateFromParentPolicy(
270 parent()->feature_policy_.get(), current_origin()); 270 parent()->feature_policy_.get(), nullptr, current_origin());
271 } else { 271 } else {
272 feature_policy_ = 272 feature_policy_ = FeaturePolicy::CreateFromParentPolicy(nullptr, nullptr,
273 FeaturePolicy::CreateFromParentPolicy(nullptr, current_origin()); 273 current_origin());
274 } 274 }
275 } 275 }
276 276
277 void FrameTreeNode::AddContentSecurityPolicy( 277 void FrameTreeNode::AddContentSecurityPolicy(
278 const ContentSecurityPolicyHeader& header) { 278 const ContentSecurityPolicyHeader& header) {
279 replication_state_.accumulated_csp_headers.push_back(header); 279 replication_state_.accumulated_csp_headers.push_back(header);
280 render_manager_.OnDidAddContentSecurityPolicy(header); 280 render_manager_.OnDidAddContentSecurityPolicy(header);
281 } 281 }
282 282
283 void FrameTreeNode::ResetContentSecurityPolicy() { 283 void FrameTreeNode::ResetContentSecurityPolicy() {
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 } 536 }
537 return parent_->child_at(i + relative_offset); 537 return parent_->child_at(i + relative_offset);
538 } 538 }
539 } 539 }
540 540
541 NOTREACHED() << "FrameTreeNode not found in its parent's children."; 541 NOTREACHED() << "FrameTreeNode not found in its parent's children.";
542 return nullptr; 542 return nullptr;
543 } 543 }
544 544
545 } // namespace content 545 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/blink_platform_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698