| 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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/metrics/histogram_macros.h" | 13 #include "base/metrics/histogram_macros.h" |
| 14 #include "base/profiler/scoped_tracker.h" | 14 #include "base/profiler/scoped_tracker.h" |
| 15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "content/browser/frame_host/csp_context_impl.h" |
| 16 #include "content/browser/frame_host/frame_tree.h" | 17 #include "content/browser/frame_host/frame_tree.h" |
| 17 #include "content/browser/frame_host/navigation_request.h" | 18 #include "content/browser/frame_host/navigation_request.h" |
| 18 #include "content/browser/frame_host/navigator.h" | 19 #include "content/browser/frame_host/navigator.h" |
| 19 #include "content/browser/frame_host/render_frame_host_impl.h" | 20 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 20 #include "content/browser/renderer_host/render_view_host_impl.h" | 21 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 21 #include "content/common/frame_messages.h" | 22 #include "content/common/frame_messages.h" |
| 22 #include "content/common/site_isolation_policy.h" | 23 #include "content/common/site_isolation_policy.h" |
| 23 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
| 24 #include "content/public/common/browser_side_navigation_policy.h" | 25 #include "content/public/common/browser_side_navigation_policy.h" |
| 25 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 26 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 void FrameTreeNode::SetFeaturePolicyHeader( | 285 void FrameTreeNode::SetFeaturePolicyHeader( |
| 285 const ParsedFeaturePolicyHeader& parsed_header) { | 286 const ParsedFeaturePolicyHeader& parsed_header) { |
| 286 replication_state_.feature_policy_header = parsed_header; | 287 replication_state_.feature_policy_header = parsed_header; |
| 287 } | 288 } |
| 288 | 289 |
| 289 void FrameTreeNode::ResetFeaturePolicyHeader() { | 290 void FrameTreeNode::ResetFeaturePolicyHeader() { |
| 290 replication_state_.feature_policy_header.clear(); | 291 replication_state_.feature_policy_header.clear(); |
| 291 } | 292 } |
| 292 | 293 |
| 293 void FrameTreeNode::AddContentSecurityPolicy( | 294 void FrameTreeNode::AddContentSecurityPolicy( |
| 294 const ContentSecurityPolicyHeader& header, | 295 const ContentSecurityPolicyHeader& header) { |
| 295 const std::vector<ContentSecurityPolicy>& policies) { | |
| 296 replication_state_.accumulated_csp_headers.push_back(header); | 296 replication_state_.accumulated_csp_headers.push_back(header); |
| 297 render_manager_.OnDidAddContentSecurityPolicy(header); | 297 render_manager_.OnDidAddContentSecurityPolicy(header); |
| 298 csp_policies_.insert(csp_policies_.end(), policies.begin(), policies.end()); | |
| 299 } | 298 } |
| 300 | 299 |
| 301 void FrameTreeNode::ResetContentSecurityPolicy() { | 300 void FrameTreeNode::ResetContentSecurityPolicy() { |
| 302 replication_state_.accumulated_csp_headers.clear(); | 301 replication_state_.accumulated_csp_headers.clear(); |
| 303 render_manager_.OnDidResetContentSecurityPolicy(); | 302 render_manager_.OnDidResetContentSecurityPolicy(); |
| 304 csp_policies_.clear(); | |
| 305 } | 303 } |
| 306 | 304 |
| 307 void FrameTreeNode::SetInsecureRequestPolicy( | 305 void FrameTreeNode::SetInsecureRequestPolicy( |
| 308 blink::WebInsecureRequestPolicy policy) { | 306 blink::WebInsecureRequestPolicy policy) { |
| 309 if (policy == replication_state_.insecure_request_policy) | 307 if (policy == replication_state_.insecure_request_policy) |
| 310 return; | 308 return; |
| 311 render_manager_.OnEnforceInsecureRequestPolicy(policy); | 309 render_manager_.OnEnforceInsecureRequestPolicy(policy); |
| 312 replication_state_.insecure_request_policy = policy; | 310 replication_state_.insecure_request_policy = policy; |
| 313 } | 311 } |
| 314 | 312 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } | 554 } |
| 557 return parent_->child_at(i + relative_offset); | 555 return parent_->child_at(i + relative_offset); |
| 558 } | 556 } |
| 559 } | 557 } |
| 560 | 558 |
| 561 NOTREACHED() << "FrameTreeNode not found in its parent's children."; | 559 NOTREACHED() << "FrameTreeNode not found in its parent's children."; |
| 562 return nullptr; | 560 return nullptr; |
| 563 } | 561 } |
| 564 | 562 |
| 565 } // namespace content | 563 } // namespace content |
| OLD | NEW |