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 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "content/browser/frame_host/frame_tree_node_blame_context.h" | 16 #include "content/browser/frame_host/frame_tree_node_blame_context.h" |
17 #include "content/browser/frame_host/render_frame_host_impl.h" | 17 #include "content/browser/frame_host/render_frame_host_impl.h" |
18 #include "content/browser/frame_host/render_frame_host_manager.h" | 18 #include "content/browser/frame_host/render_frame_host_manager.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "content/common/content_security_policy/csp_policy.h" |
20 #include "content/common/frame_owner_properties.h" | 21 #include "content/common/frame_owner_properties.h" |
21 #include "content/common/frame_replication_state.h" | 22 #include "content/common/frame_replication_state.h" |
22 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" | 23 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" |
23 #include "url/gurl.h" | 24 #include "url/gurl.h" |
24 #include "url/origin.h" | 25 #include "url/origin.h" |
25 | 26 |
26 namespace content { | 27 namespace content { |
27 | 28 |
28 class FrameTree; | 29 class FrameTree; |
29 class NavigationRequest; | 30 class NavigationRequest; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 void SetFrameName(const std::string& name, const std::string& unique_name); | 155 void SetFrameName(const std::string& name, const std::string& unique_name); |
155 | 156 |
156 // Set the frame's feature policy from an HTTP header, clearing any existing | 157 // Set the frame's feature policy from an HTTP header, clearing any existing |
157 // policy. | 158 // policy. |
158 void SetFeaturePolicyHeader(const ParsedFeaturePolicy& parsed_header); | 159 void SetFeaturePolicyHeader(const ParsedFeaturePolicy& parsed_header); |
159 | 160 |
160 // Clear any feature policy associated with the frame. | 161 // Clear any feature policy associated with the frame. |
161 void ResetFeaturePolicy(); | 162 void ResetFeaturePolicy(); |
162 | 163 |
163 // Add CSP header to replication state and notify proxies about the update. | 164 // Add CSP header to replication state and notify proxies about the update. |
164 void AddContentSecurityPolicy(const ContentSecurityPolicyHeader& header); | 165 void AddContentSecurityPolicy(const ContentSecurityPolicyHeader& header, |
| 166 const CSPPolicy& policy); |
165 | 167 |
166 // Discards previous CSP headers and notifies proxies about the update. | 168 // Discards previous CSP headers and notifies proxies about the update. |
167 // Typically invoked after committing navigation to a new document (since the | 169 // Typically invoked after committing navigation to a new document (since the |
168 // new document comes with a fresh set of CSP http headers). | 170 // new document comes with a fresh set of CSP http headers). |
169 void ResetContentSecurityPolicy(); | 171 void ResetContentSecurityPolicy(); |
170 | 172 |
171 // Sets the current insecure request policy, and notifies proxies about the | 173 // Sets the current insecure request policy, and notifies proxies about the |
172 // update. | 174 // update. |
173 void SetInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy); | 175 void SetInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy); |
174 | 176 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 // List of objects observing this FrameTreeNode. | 378 // List of objects observing this FrameTreeNode. |
377 base::ObserverList<Observer> observers_; | 379 base::ObserverList<Observer> observers_; |
378 | 380 |
379 base::TimeTicks last_focus_time_; | 381 base::TimeTicks last_focus_time_; |
380 | 382 |
381 // A helper for tracing the snapshots of this FrameTreeNode and attributing | 383 // A helper for tracing the snapshots of this FrameTreeNode and attributing |
382 // browser process activities to this node (when possible). It is unrelated | 384 // browser process activities to this node (when possible). It is unrelated |
383 // to the core logic of FrameTreeNode. | 385 // to the core logic of FrameTreeNode. |
384 FrameTreeNodeBlameContext blame_context_; | 386 FrameTreeNodeBlameContext blame_context_; |
385 | 387 |
| 388 // A set of Content-Security-Policies to enforce on the browser-side. |
| 389 std::vector<CSPPolicy> csp_policies; |
| 390 |
386 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); | 391 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); |
387 }; | 392 }; |
388 | 393 |
389 } // namespace content | 394 } // namespace content |
390 | 395 |
391 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 396 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
OLD | NEW |