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

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

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

Powered by Google App Engine
This is Rietveld 408576698