Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: content/browser/frame_host/frame_tree_node.h

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Rebase after the great Blink rename Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 // Update this frame's container policy. This is used when a parent frame
220 // updates feature-policy attributes in the <iframe> element for this frame.
221 // These attributes include allow, allowfullscreen, allowpaymentrequest, and
222 // src. Updates to the container policy will not take effect until next
223 // navigation.
224 void SetPendingContainerPolicy(
225 const ParsedFeaturePolicyHeader& container_policy);
226
227 // Set any pending sandbox flags and container policy as active, and return
228 // true if either was changed.
229 bool CommitPendingFramePolicy();
212 230
213 const FrameOwnerProperties& frame_owner_properties() { 231 const FrameOwnerProperties& frame_owner_properties() {
214 return frame_owner_properties_; 232 return frame_owner_properties_;
215 } 233 }
216 234
217 void set_frame_owner_properties( 235 void set_frame_owner_properties(
218 const FrameOwnerProperties& frame_owner_properties) { 236 const FrameOwnerProperties& frame_owner_properties) {
219 frame_owner_properties_ = frame_owner_properties; 237 frame_owner_properties_ = frame_owner_properties;
220 } 238 }
221 239
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 // proxies for this frame. 390 // proxies for this frame.
373 FrameReplicationState replication_state_; 391 FrameReplicationState replication_state_;
374 392
375 // Track the pending sandbox flags for this frame. When a parent frame 393 // Track the pending sandbox flags for this frame. When a parent frame
376 // dynamically updates sandbox flags in the <iframe> element for a child 394 // dynamically updates sandbox flags in the <iframe> element for a child
377 // frame, these updated flags are stored here and are transferred into 395 // frame, these updated flags are stored here and are transferred into
378 // replication_state_.sandbox_flags when they take effect on the next frame 396 // replication_state_.sandbox_flags when they take effect on the next frame
379 // navigation. 397 // navigation.
380 blink::WebSandboxFlags pending_sandbox_flags_; 398 blink::WebSandboxFlags pending_sandbox_flags_;
381 399
400 // Tracks the computed container policy for this frame. When the iframe
401 // allowfullscreen, allowpaymentrequest, allow or src attributes are changed,
402 // the updated policy for the frame is stored here, and transferred into
403 // replication_state_.container_policy on the next frame navigation.
404 ParsedFeaturePolicyHeader pending_container_policy_;
405
382 // Tracks the scrolling and margin properties for this frame. These 406 // Tracks the scrolling and margin properties for this frame. These
383 // properties affect the child renderer but are stored on its parent's 407 // properties affect the child renderer but are stored on its parent's
384 // frame element. When this frame's parent dynamically updates these 408 // frame element. When this frame's parent dynamically updates these
385 // properties, we update them here too. 409 // properties, we update them here too.
386 // 410 //
387 // Note that dynamic updates only take effect on the next frame navigation. 411 // Note that dynamic updates only take effect on the next frame navigation.
388 FrameOwnerProperties frame_owner_properties_; 412 FrameOwnerProperties frame_owner_properties_;
389 413
390 // Used to track this node's loading progress (from 0 to 1). 414 // Used to track this node's loading progress (from 0 to 1).
391 double loading_progress_; 415 double loading_progress_;
(...skipping 12 matching lines...) Expand all
404 // browser process activities to this node (when possible). It is unrelated 428 // browser process activities to this node (when possible). It is unrelated
405 // to the core logic of FrameTreeNode. 429 // to the core logic of FrameTreeNode.
406 FrameTreeNodeBlameContext blame_context_; 430 FrameTreeNodeBlameContext blame_context_;
407 431
408 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); 432 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode);
409 }; 433 };
410 434
411 } // namespace content 435 } // namespace content
412 436
413 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ 437 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698