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(const std::string& name); | 48 FrameReplicationState(const std::string& name); |
41 ~FrameReplicationState(); | 49 ~FrameReplicationState(); |
42 | 50 |
43 // Current serialized security origin of the frame. Unique origins are | 51 // Current serialized security origin of the frame. Unique origins are |
44 // represented as the string "null" per RFC 6454. | 52 // represented as the string "null" per RFC 6454. |
45 url::Origin origin; | 53 url::Origin origin; |
46 | 54 |
47 // Current sandbox flags of the frame. | 55 // Current sandbox flags of the frame. |
48 SandboxFlags sandbox_flags; | 56 SandboxFlags sandbox_flags; |
49 | 57 |
50 // The assigned name of the frame. This name can be empty, unlike the unique | 58 // The assigned name of the frame. This name can be empty, unlike the unique |
51 // name generated internally in the DOM tree. | 59 // name generated internally in the DOM tree. |
52 std::string name; | 60 std::string name; |
53 | 61 |
54 // TODO(alexmos): Eventually, this structure can also hold other state that | 62 // TODO(alexmos): Eventually, this structure can also hold other state that |
55 // needs to be replicated, such as frame sizing info. | 63 // needs to be replicated, such as frame sizing info. |
56 }; | 64 }; |
57 | 65 |
58 } // namespace content | 66 } // namespace content |
59 | 67 |
60 #endif // CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ | 68 #endif // CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ |
OLD | NEW |