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/content_security_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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 void SetFrameName(const std::string& name, const std::string& unique_name); | 163 void SetFrameName(const std::string& name, const std::string& unique_name); |
163 | 164 |
164 // Set the frame's feature policy header, clearing any existing header. | 165 // Set the frame's feature policy header, clearing any existing header. |
165 void SetFeaturePolicyHeader(const ParsedFeaturePolicyHeader& parsed_header); | 166 void SetFeaturePolicyHeader(const ParsedFeaturePolicyHeader& parsed_header); |
166 | 167 |
167 // Clear any feature policy header associated with the frame. | 168 // Clear any feature policy header associated with the frame. |
168 void ResetFeaturePolicyHeader(); | 169 void ResetFeaturePolicyHeader(); |
169 | 170 |
170 // Add CSP header to replication state, notify proxies about the update and | 171 // Add CSP header to replication state, notify proxies about the update and |
171 // enforce it on the browser. | 172 // enforce it on the browser. |
172 void AddContentSecurityPolicy(const ContentSecurityPolicyHeader& header); | 173 void AddContentSecurityPolicy( |
| 174 const ContentSecurityPolicyHeader& header, |
| 175 const std::vector<ContentSecurityPolicy>& policies); |
173 | 176 |
174 // Discards previous CSP headers and notifies proxies about the update. | 177 // Discards previous CSP headers and notifies proxies about the update. |
175 // Typically invoked after committing navigation to a new document (since the | 178 // Typically invoked after committing navigation to a new document (since the |
176 // new document comes with a fresh set of CSP http headers). | 179 // new document comes with a fresh set of CSP http headers). |
177 void ResetCspHeaders(); | 180 void ResetContentSecurityPolicy(); |
178 | 181 |
179 // Sets the current insecure request policy, and notifies proxies about the | 182 // Sets the current insecure request policy, and notifies proxies about the |
180 // update. | 183 // update. |
181 void SetInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy); | 184 void SetInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy); |
182 | 185 |
183 // Returns the currently active sandbox flags for this frame. This includes | 186 // Returns the currently active sandbox flags for this frame. This includes |
184 // flags inherited from parent frames and the currently active flags from the | 187 // flags inherited from parent frames and the currently active flags from the |
185 // <iframe> element hosting this frame. This does not include flags that | 188 // <iframe> element hosting this frame. This does not include flags that |
186 // have been updated in an <iframe> element but have not taken effect yet; | 189 // have been updated in an <iframe> element but have not taken effect yet; |
187 // use pending_sandbox_flags() for those. | 190 // use pending_sandbox_flags() for those. |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 // List of objects observing this FrameTreeNode. | 397 // List of objects observing this FrameTreeNode. |
395 base::ObserverList<Observer> observers_; | 398 base::ObserverList<Observer> observers_; |
396 | 399 |
397 base::TimeTicks last_focus_time_; | 400 base::TimeTicks last_focus_time_; |
398 | 401 |
399 // A helper for tracing the snapshots of this FrameTreeNode and attributing | 402 // A helper for tracing the snapshots of this FrameTreeNode and attributing |
400 // browser process activities to this node (when possible). It is unrelated | 403 // browser process activities to this node (when possible). It is unrelated |
401 // to the core logic of FrameTreeNode. | 404 // to the core logic of FrameTreeNode. |
402 FrameTreeNodeBlameContext blame_context_; | 405 FrameTreeNodeBlameContext blame_context_; |
403 | 406 |
| 407 // A set of Content-Security-Policies to enforce on the browser-side. |
| 408 std::vector<ContentSecurityPolicy> csp_policies_; |
| 409 |
404 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); | 410 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); |
405 }; | 411 }; |
406 | 412 |
407 } // namespace content | 413 } // namespace content |
408 | 414 |
409 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 415 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
OLD | NEW |