OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_COMMON_FRAME_REPLICATION_STATE_H_ | 5 #ifndef CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ |
6 #define CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ | 6 #define CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "url/origin.h" | 9 #include "url/origin.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 SCRIPTS = 1 << 4, | 26 SCRIPTS = 1 << 4, |
27 TOP_NAVIGATION = 1 << 5, | 27 TOP_NAVIGATION = 1 << 5, |
28 POPUPS = 1 << 6, | 28 POPUPS = 1 << 6, |
29 AUTOMATIC_FEATURES = 1 << 7, | 29 AUTOMATIC_FEATURES = 1 << 7, |
30 POINTER_LOCK = 1 << 8, | 30 POINTER_LOCK = 1 << 8, |
31 DOCUMENT_DOMAIN = 1 << 9, | 31 DOCUMENT_DOMAIN = 1 << 9, |
32 ORIENTATION_LOCK = 1 << 10, | 32 ORIENTATION_LOCK = 1 << 10, |
33 ALL = -1 | 33 ALL = -1 |
34 }; | 34 }; |
35 | 35 |
| 36 inline SandboxFlags operator&(SandboxFlags a, SandboxFlags b) { |
| 37 return static_cast<SandboxFlags>(static_cast<int>(a) & static_cast<int>(b)); |
| 38 } |
| 39 |
| 40 inline SandboxFlags operator~(SandboxFlags flags) { |
| 41 return static_cast<SandboxFlags>(~static_cast<int>(flags)); |
| 42 } |
| 43 |
36 // This structure holds information that needs to be replicated between a | 44 // This structure holds information that needs to be replicated between a |
37 // RenderFrame and any of its associated RenderFrameProxies. | 45 // RenderFrame and any of its associated RenderFrameProxies. |
38 struct CONTENT_EXPORT FrameReplicationState { | 46 struct CONTENT_EXPORT FrameReplicationState { |
39 FrameReplicationState(); | 47 FrameReplicationState(); |
40 ~FrameReplicationState(); | 48 ~FrameReplicationState(); |
41 | 49 |
42 // Current serialized security origin of the frame. Unique origins are | 50 // Current serialized security origin of the frame. Unique origins are |
43 // represented as the string "null" per RFC 6454. | 51 // represented as the string "null" per RFC 6454. |
44 url::Origin origin; | 52 url::Origin origin; |
45 | 53 |
46 // Current sandbox flags of the frame. | 54 // Current sandbox flags of the frame. |
47 SandboxFlags sandbox_flags; | 55 SandboxFlags sandbox_flags; |
48 | 56 |
49 // TODO(alexmos): Eventually, this structure can also hold other state that | 57 // TODO(alexmos): Eventually, this structure can also hold other state that |
50 // needs to be replicated, such as frame sizing info. | 58 // needs to be replicated, such as frame sizing info. |
51 }; | 59 }; |
52 | 60 |
53 } // namespace content | 61 } // namespace content |
54 | 62 |
55 #endif // CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ | 63 #endif // CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ |
OLD | NEW |