Chromium Code Reviews| 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> |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 blink::WebSandboxFlags pending_sandbox_flags() const { | 199 blink::WebSandboxFlags pending_sandbox_flags() const { |
| 200 return pending_sandbox_flags_; | 200 return pending_sandbox_flags_; |
| 201 } | 201 } |
| 202 | 202 |
| 203 // Update this frame's sandbox flags. This is used when a parent frame | 203 // Update this frame's sandbox flags. This is used when a parent frame |
| 204 // updates sandbox flags in the <iframe> element for this frame. These flags | 204 // updates sandbox flags in the <iframe> element for this frame. These flags |
| 205 // won't take effect until next navigation. If this frame's parent is itself | 205 // won't take effect until next navigation. If this frame's parent is itself |
| 206 // sandboxed, the parent's sandbox flags are combined with |sandbox_flags|. | 206 // sandboxed, the parent's sandbox flags are combined with |sandbox_flags|. |
| 207 void SetPendingSandboxFlags(blink::WebSandboxFlags sandbox_flags); | 207 void SetPendingSandboxFlags(blink::WebSandboxFlags sandbox_flags); |
| 208 | 208 |
| 209 // Set any pending sandbox flags as active, and return true if the sandbox | 209 // Returns the currently active container policy for this frame, which is set |
| 210 // flags were changed. | 210 // by the iframe allowfullscreen, allowpaymentrequest, and allow attributes, |
| 211 bool CommitPendingSandboxFlags(); | 211 // along with the origin of the iframe's src attribute (which may be different |
|
lunalu1
2017/04/05 22:30:03
This is just a comment: we need layout tests for u
| |
| 212 // from the URL of the document currently loaded into the frame). This does | |
| 213 // not include policy changes that have been made by updating the containing | |
| 214 // iframe element attributes since the frame was last navigated. | |
| 215 const ParsedFeaturePolicyHeader& effective_container_policy() const { | |
| 216 return replication_state_.container_policy; | |
| 217 } | |
| 218 | |
| 219 // Returns the latest computed container policy for this frame, which is set | |
| 220 // by the iframe allowfullscreen, allowpaymentrequest, and allow attributes, | |
| 221 // along with the origin of the iframe's src attribute (which may be different | |
| 222 // from the URL of the document currently loaded into the frame). The returned | |
| 223 // policy may not have taken effect, since the policy is snapshotted on | |
| 224 // navigation. | |
| 225 const ParsedFeaturePolicyHeader& pending_container_policy() const { | |
| 226 return pending_container_policy_; | |
| 227 } | |
| 228 | |
| 229 // Update this frame's container policy. This is used when a parent frame | |
| 230 // updates feature-policy attributes in the <iframe> element for this frame. | |
| 231 // These attributes include allow, allowfullscreen, allowpaymentrequest, and | |
| 232 // src. Updates to the container policy will not take effect until next | |
| 233 // navigation. | |
| 234 void SetPendingContainerPolicy( | |
| 235 const ParsedFeaturePolicyHeader& container_policy); | |
| 236 | |
| 237 // Set any pending sandbox flags and container policy as active, and return | |
| 238 // true if either was changed. | |
| 239 bool CommitPendingFramePolicy(); | |
| 212 | 240 |
| 213 const FrameOwnerProperties& frame_owner_properties() { | 241 const FrameOwnerProperties& frame_owner_properties() { |
| 214 return frame_owner_properties_; | 242 return frame_owner_properties_; |
| 215 } | 243 } |
| 216 | 244 |
| 217 void set_frame_owner_properties( | 245 void set_frame_owner_properties( |
| 218 const FrameOwnerProperties& frame_owner_properties) { | 246 const FrameOwnerProperties& frame_owner_properties) { |
| 219 frame_owner_properties_ = frame_owner_properties; | 247 frame_owner_properties_ = frame_owner_properties; |
| 220 } | 248 } |
| 221 | 249 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 372 // proxies for this frame. | 400 // proxies for this frame. |
| 373 FrameReplicationState replication_state_; | 401 FrameReplicationState replication_state_; |
| 374 | 402 |
| 375 // Track the pending sandbox flags for this frame. When a parent frame | 403 // Track the pending sandbox flags for this frame. When a parent frame |
| 376 // dynamically updates sandbox flags in the <iframe> element for a child | 404 // dynamically updates sandbox flags in the <iframe> element for a child |
| 377 // frame, these updated flags are stored here and are transferred into | 405 // frame, these updated flags are stored here and are transferred into |
| 378 // replication_state_.sandbox_flags when they take effect on the next frame | 406 // replication_state_.sandbox_flags when they take effect on the next frame |
| 379 // navigation. | 407 // navigation. |
| 380 blink::WebSandboxFlags pending_sandbox_flags_; | 408 blink::WebSandboxFlags pending_sandbox_flags_; |
| 381 | 409 |
| 410 // Tracks the computed container policy for this frame. When the iframe | |
| 411 // allowfullscreen, allowpaymentrequest, allow or src attributes are changed, | |
|
alexmos
2017/04/06 00:44:22
I thought allowfullscreen took effect immediately,
iclelland
2017/04/09 03:25:54
Yes, it would -- there was an intent to make this
alexmos
2017/04/11 01:17:49
Acknowledged.
| |
| 412 // the updated policy for the frame is stored here, and transferred into | |
| 413 // replication_state_.container_policy on the next frame navigation. | |
| 414 ParsedFeaturePolicyHeader pending_container_policy_; | |
| 415 | |
| 382 // Tracks the scrolling and margin properties for this frame. These | 416 // Tracks the scrolling and margin properties for this frame. These |
| 383 // properties affect the child renderer but are stored on its parent's | 417 // properties affect the child renderer but are stored on its parent's |
| 384 // frame element. When this frame's parent dynamically updates these | 418 // frame element. When this frame's parent dynamically updates these |
| 385 // properties, we update them here too. | 419 // properties, we update them here too. |
| 386 // | 420 // |
| 387 // Note that dynamic updates only take effect on the next frame navigation. | 421 // Note that dynamic updates only take effect on the next frame navigation. |
| 388 FrameOwnerProperties frame_owner_properties_; | 422 FrameOwnerProperties frame_owner_properties_; |
| 389 | 423 |
| 390 // Used to track this node's loading progress (from 0 to 1). | 424 // Used to track this node's loading progress (from 0 to 1). |
| 391 double loading_progress_; | 425 double loading_progress_; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 404 // browser process activities to this node (when possible). It is unrelated | 438 // browser process activities to this node (when possible). It is unrelated |
| 405 // to the core logic of FrameTreeNode. | 439 // to the core logic of FrameTreeNode. |
| 406 FrameTreeNodeBlameContext blame_context_; | 440 FrameTreeNodeBlameContext blame_context_; |
| 407 | 441 |
| 408 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); | 442 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); |
| 409 }; | 443 }; |
| 410 | 444 |
| 411 } // namespace content | 445 } // namespace content |
| 412 | 446 |
| 413 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 447 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
| OLD | NEW |