1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_COMMON_FRAME_REPLICATION_STATE_H_
6 #define CONTENT_COMMON_FRAME_REPLICATION_STATE_H_
8 #include "content/common/content_export.h"
9 #include "url/origin.h"
13 // Sandboxing flags for iframes. These flags are set via an iframe's "sandbox"
14 // attribute in the renderer process and forwarded to the browser process,
15 // which replicates them to other processes as needed. For a list of sandbox
17 // http://www.whatwg.org/specs/web-apps/current-work/#attr-iframe-sandbox
18 // Must be kept in sync with blink::WebSandboxFlags. Enforced in
19 // render_frame_impl.cc.
20 enum class SandboxFlags
: int {
27 TOP_NAVIGATION
= 1 << 5,
29 AUTOMATIC_FEATURES
= 1 << 7,
30 POINTER_LOCK
= 1 << 8,
31 DOCUMENT_DOMAIN
= 1 << 9,
32 ORIENTATION_LOCK
= 1 << 10,
36 inline SandboxFlags
operator&(SandboxFlags a
, SandboxFlags b
) {
37 return static_cast<SandboxFlags
>(static_cast<int>(a
) & static_cast<int>(b
));
40 inline SandboxFlags
operator~(SandboxFlags flags
) {
41 return static_cast<SandboxFlags
>(~static_cast<int>(flags
));
44 // This structure holds information that needs to be replicated between a
45 // RenderFrame and any of its associated RenderFrameProxies.
46 struct CONTENT_EXPORT FrameReplicationState
{
47 FrameReplicationState();
48 FrameReplicationState(const std::string
& name
);
49 ~FrameReplicationState();
51 // Current serialized security origin of the frame. Unique origins are
52 // represented as the string "null" per RFC 6454.
55 // Current sandbox flags of the frame.
56 SandboxFlags sandbox_flags
;
58 // The assigned name of the frame. This name can be empty, unlike the unique
59 // name generated internally in the DOM tree.
62 // TODO(alexmos): Eventually, this structure can also hold other state that
63 // needs to be replicated, such as frame sizing info.
66 } // namespace content
68 #endif // CONTENT_COMMON_FRAME_REPLICATION_STATE_H_