Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 DCHECK(unique_name.empty()); | 249 DCHECK(unique_name.empty()); |
| 250 } | 250 } |
| 251 | 251 |
| 252 RecordUniqueNameLength(unique_name.size()); | 252 RecordUniqueNameLength(unique_name.size()); |
| 253 render_manager_.OnDidUpdateName(name, unique_name); | 253 render_manager_.OnDidUpdateName(name, unique_name); |
| 254 replication_state_.name = name; | 254 replication_state_.name = name; |
| 255 replication_state_.unique_name = unique_name; | 255 replication_state_.unique_name = unique_name; |
| 256 } | 256 } |
| 257 | 257 |
| 258 void FrameTreeNode::SetFeaturePolicyHeader( | 258 void FrameTreeNode::SetFeaturePolicyHeader( |
| 259 const ParsedFeaturePolicy& parsed_header) { | 259 const FeaturePolicyHeader& parsed_header) { |
| 260 ResetFeaturePolicy(); | |
|
raymes
2017/01/19 02:40:56
Can this be called multiple times for the same fra
| |
| 260 replication_state_.feature_policy_header = parsed_header; | 261 replication_state_.feature_policy_header = parsed_header; |
| 262 feature_policy_->SetHeaderPolicy(parsed_header); | |
| 261 } | 263 } |
| 262 | 264 |
| 263 void FrameTreeNode::ResetFeaturePolicy() { | 265 void FrameTreeNode::ResetFeaturePolicy() { |
| 264 replication_state_.feature_policy_header.clear(); | 266 replication_state_.feature_policy_header.clear(); |
| 267 if (parent()) { | |
| 268 feature_policy_ = FeaturePolicy::CreateFromParentPolicy( | |
| 269 parent()->feature_policy_.get(), current_origin()); | |
| 270 } else { | |
| 271 feature_policy_ = | |
| 272 FeaturePolicy::CreateFromParentPolicy(nullptr, current_origin()); | |
| 273 } | |
| 265 } | 274 } |
| 266 | 275 |
| 267 void FrameTreeNode::AddContentSecurityPolicy( | 276 void FrameTreeNode::AddContentSecurityPolicy( |
| 268 const ContentSecurityPolicyHeader& header) { | 277 const ContentSecurityPolicyHeader& header) { |
| 269 replication_state_.accumulated_csp_headers.push_back(header); | 278 replication_state_.accumulated_csp_headers.push_back(header); |
| 270 render_manager_.OnDidAddContentSecurityPolicy(header); | 279 render_manager_.OnDidAddContentSecurityPolicy(header); |
| 271 } | 280 } |
| 272 | 281 |
| 273 void FrameTreeNode::ResetContentSecurityPolicy() { | 282 void FrameTreeNode::ResetContentSecurityPolicy() { |
| 274 replication_state_.accumulated_csp_headers.clear(); | 283 replication_state_.accumulated_csp_headers.clear(); |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 521 } | 530 } |
| 522 return parent_->child_at(i + relative_offset); | 531 return parent_->child_at(i + relative_offset); |
| 523 } | 532 } |
| 524 } | 533 } |
| 525 | 534 |
| 526 NOTREACHED() << "FrameTreeNode not found in its parent's children."; | 535 NOTREACHED() << "FrameTreeNode not found in its parent's children."; |
| 527 return nullptr; | 536 return nullptr; |
| 528 } | 537 } |
| 529 | 538 |
| 530 } // namespace content | 539 } // namespace content |
| OLD | NEW |