summaryrefslogtreecommitdiff
path: root/chromium/content/common/frame_replication_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/common/frame_replication_state.h')
-rw-r--r--chromium/content/common/frame_replication_state.h45
1 files changed, 33 insertions, 12 deletions
diff --git a/chromium/content/common/frame_replication_state.h b/chromium/content/common/frame_replication_state.h
index 88978490e3f..f6373491a19 100644
--- a/chromium/content/common/frame_replication_state.h
+++ b/chromium/content/common/frame_replication_state.h
@@ -21,8 +21,11 @@ struct CONTENT_EXPORT FrameReplicationState {
FrameReplicationState();
FrameReplicationState(blink::WebTreeScopeType scope,
const std::string& name,
+ const std::string& unique_name,
blink::WebSandboxFlags sandbox_flags,
- bool should_enforce_strict_mixed_content_checking);
+ bool should_enforce_strict_mixed_content_checking,
+ bool has_potentially_trustworthy_unique_origin);
+ FrameReplicationState(const FrameReplicationState& other);
~FrameReplicationState();
// Current origin of the frame. This field is updated whenever a frame
@@ -37,20 +40,21 @@ struct CONTENT_EXPORT FrameReplicationState {
// compromized renderer.
url::Origin origin;
- // Current sandbox flags of the frame. |sandbox_flags| are initialized for
- // new child frames using the value of the <iframe> element's "sandbox"
- // attribute. They are updated dynamically whenever a parent frame updates an
- // <iframe>'s sandbox attribute via JavaScript.
+ // Sandbox flags currently in effect for the frame. |sandbox_flags| are
+ // initialized for new child frames using the value of the <iframe> element's
+ // "sandbox" attribute, combined with any sandbox flags in effect for the
+ // parent frame.
//
- // Updates to |sandbox_flags| are sent to proxies, but only after a
- // subsequent navigation of the (sandboxed) frame, since the flags only take
- // effect on navigation (see also FrameTreeNode::effective_sandbox_flags_).
- // The proxies need updated flags so that they can be inherited properly if a
- // proxy ever becomes a parent of a local frame.
+ // When a parent frame updates an <iframe>'s sandbox attribute via
+ // JavaScript, |sandbox_flags| are updated only after the child frame commits
+ // a navigation that makes the updated flags take effect. This is also the
+ // point at which updates are sent to proxies (see
+ // CommitPendingSandboxFlags()). The proxies need updated flags so that they
+ // can be inherited properly if a proxy ever becomes a parent of a local
+ // frame.
blink::WebSandboxFlags sandbox_flags;
- // The assigned name of the frame. This name can be empty, unlike the unique
- // name generated internally in the DOM tree.
+ // The assigned name of the frame (see WebFrame::assignedName()).
//
// |name| is set when a new child frame is created using the value of the
// <iframe> element's "name" attribute (see
@@ -62,6 +66,19 @@ struct CONTENT_EXPORT FrameReplicationState {
// frame using its updated name (e.g., using window.open(url, frame_name)).
std::string name;
+ // Unique name of the frame (see WebFrame::uniqueName()).
+ //
+ // |unique_name| is used in heuristics that try to identify the same frame
+ // across different, unrelated navigations (i.e. to refer to the frame
+ // when going back/forward in session history OR when refering to the frame
+ // in layout tests results).
+ //
+ // |unique_name| needs to be replicated to ensure that unique name for a given
+ // frame is the same across all renderers - without replication a renderer
+ // might arrive at a different value when recalculating the unique name from
+ // scratch.
+ std::string unique_name;
+
// Whether the frame is in a document tree or a shadow tree, per the Shadow
// DOM spec: https://w3c.github.io/webcomponents/spec/shadow/
// Note: This should really be const, as it can never change once a frame is
@@ -75,6 +92,10 @@ struct CONTENT_EXPORT FrameReplicationState {
// frames live in different processes.
bool should_enforce_strict_mixed_content_checking;
+ // True if a frame's origin is unique and should be considered potentially
+ // trustworthy.
+ bool has_potentially_trustworthy_unique_origin;
+
// TODO(alexmos): Eventually, this structure can also hold other state that
// needs to be replicated, such as frame sizing info.
};