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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 161 |
161 // Set the current name and notify proxies about the update. | 162 // Set the current name and notify proxies about the update. |
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 and notify proxies about the update. | 171 // Add CSP header to replication state, notify proxies about the update and |
171 void AddContentSecurityPolicy(const ContentSecurityPolicyHeader& header); | 172 // enforce it on the browser. |
| 173 void AddContentSecurityPolicy( |
| 174 const ContentSecurityPolicyHeader& header, |
| 175 const std::vector<ContentSecurityPolicy>& policies); |
172 | 176 |
173 // Discards previous CSP headers and notifies proxies about the update. | 177 // Discards previous CSP headers and notifies proxies about the update. |
174 // Typically invoked after committing navigation to a new document (since the | 178 // Typically invoked after committing navigation to a new document (since the |
175 // new document comes with a fresh set of CSP http headers). | 179 // new document comes with a fresh set of CSP http headers). |
176 void ResetContentSecurityPolicy(); | 180 void ResetContentSecurityPolicy(); |
177 | 181 |
178 // Sets the current insecure request policy, and notifies proxies about the | 182 // Sets the current insecure request policy, and notifies proxies about the |
179 // update. | 183 // update. |
180 void SetInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy); | 184 void SetInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy); |
181 | 185 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // List of objects observing this FrameTreeNode. | 397 // List of objects observing this FrameTreeNode. |
394 base::ObserverList<Observer> observers_; | 398 base::ObserverList<Observer> observers_; |
395 | 399 |
396 base::TimeTicks last_focus_time_; | 400 base::TimeTicks last_focus_time_; |
397 | 401 |
398 // A helper for tracing the snapshots of this FrameTreeNode and attributing | 402 // A helper for tracing the snapshots of this FrameTreeNode and attributing |
399 // browser process activities to this node (when possible). It is unrelated | 403 // browser process activities to this node (when possible). It is unrelated |
400 // to the core logic of FrameTreeNode. | 404 // to the core logic of FrameTreeNode. |
401 FrameTreeNodeBlameContext blame_context_; | 405 FrameTreeNodeBlameContext blame_context_; |
402 | 406 |
| 407 // A set of Content-Security-Policies to enforce on the browser-side. |
| 408 std::vector<ContentSecurityPolicy> csp_policies_; |
| 409 |
403 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); | 410 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); |
404 }; | 411 }; |
405 | 412 |
406 } // namespace content | 413 } // namespace content |
407 | 414 |
408 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 415 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
OLD | NEW |