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" | |
21 #include "content/common/frame_owner_properties.h" | 20 #include "content/common/frame_owner_properties.h" |
22 #include "content/common/frame_replication_state.h" | 21 #include "content/common/frame_replication_state.h" |
23 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" | 22 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" |
24 #include "url/gurl.h" | 23 #include "url/gurl.h" |
25 #include "url/origin.h" | 24 #include "url/origin.h" |
26 | 25 |
27 namespace content { | 26 namespace content { |
28 | 27 |
29 class FrameTree; | 28 class FrameTree; |
30 class NavigationRequest; | 29 class NavigationRequest; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 void SetFrameName(const std::string& name, const std::string& unique_name); | 162 void SetFrameName(const std::string& name, const std::string& unique_name); |
164 | 163 |
165 // Set the frame's feature policy header, clearing any existing header. | 164 // Set the frame's feature policy header, clearing any existing header. |
166 void SetFeaturePolicyHeader(const ParsedFeaturePolicyHeader& parsed_header); | 165 void SetFeaturePolicyHeader(const ParsedFeaturePolicyHeader& parsed_header); |
167 | 166 |
168 // Clear any feature policy header associated with the frame. | 167 // Clear any feature policy header associated with the frame. |
169 void ResetFeaturePolicyHeader(); | 168 void ResetFeaturePolicyHeader(); |
170 | 169 |
171 // Add CSP header to replication state, notify proxies about the update and | 170 // Add CSP header to replication state, notify proxies about the update and |
172 // enforce it on the browser. | 171 // enforce it on the browser. |
173 void AddContentSecurityPolicy( | 172 void AddContentSecurityPolicy(const ContentSecurityPolicyHeader& header); |
174 const ContentSecurityPolicyHeader& header, | |
175 const std::vector<ContentSecurityPolicy>& policies); | |
176 | 173 |
177 // Discards previous CSP headers and notifies proxies about the update. | 174 // Discards previous CSP headers and notifies proxies about the update. |
178 // Typically invoked after committing navigation to a new document (since the | 175 // Typically invoked after committing navigation to a new document (since the |
179 // new document comes with a fresh set of CSP http headers). | 176 // new document comes with a fresh set of CSP http headers). |
180 void ResetContentSecurityPolicy(); | 177 void ResetContentSecurityPolicy(); |
181 | 178 |
182 // Sets the current insecure request policy, and notifies proxies about the | 179 // Sets the current insecure request policy, and notifies proxies about the |
183 // update. | 180 // update. |
184 void SetInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy); | 181 void SetInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy); |
185 | 182 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 // List of objects observing this FrameTreeNode. | 394 // List of objects observing this FrameTreeNode. |
398 base::ObserverList<Observer> observers_; | 395 base::ObserverList<Observer> observers_; |
399 | 396 |
400 base::TimeTicks last_focus_time_; | 397 base::TimeTicks last_focus_time_; |
401 | 398 |
402 // A helper for tracing the snapshots of this FrameTreeNode and attributing | 399 // A helper for tracing the snapshots of this FrameTreeNode and attributing |
403 // browser process activities to this node (when possible). It is unrelated | 400 // browser process activities to this node (when possible). It is unrelated |
404 // to the core logic of FrameTreeNode. | 401 // to the core logic of FrameTreeNode. |
405 FrameTreeNodeBlameContext blame_context_; | 402 FrameTreeNodeBlameContext blame_context_; |
406 | 403 |
407 // A set of Content-Security-Policies to enforce on the browser-side. | |
408 std::vector<ContentSecurityPolicy> csp_policies_; | |
409 | |
410 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); | 404 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); |
411 }; | 405 }; |
412 | 406 |
413 } // namespace content | 407 } // namespace content |
414 | 408 |
415 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 409 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
OLD | NEW |