OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void enforceSandboxFlags(SandboxFlags mask); | 66 void enforceSandboxFlags(SandboxFlags mask); |
67 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } | 67 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } |
68 | 68 |
69 // Explicitly override the security origin for this security context. | 69 // Explicitly override the security origin for this security context. |
70 // Note: It is dangerous to change the security origin of a script context | 70 // Note: It is dangerous to change the security origin of a script context |
71 // that already contains content. | 71 // that already contains content. |
72 void setSecurityOrigin(PassRefPtr<SecurityOrigin>); | 72 void setSecurityOrigin(PassRefPtr<SecurityOrigin>); |
73 | 73 |
74 static SandboxFlags parseSandboxPolicy(const String& policy, String& invalid
TokensErrorMessage); | 74 static SandboxFlags parseSandboxPolicy(const String& policy, String& invalid
TokensErrorMessage); |
75 | 75 |
76 virtual void reportMemoryUsage(MemoryObjectInfo*) const; | |
77 | |
78 protected: | 76 protected: |
79 SecurityContext(); | 77 SecurityContext(); |
80 virtual ~SecurityContext(); | 78 virtual ~SecurityContext(); |
81 | 79 |
82 virtual void didUpdateSecurityOrigin(); | 80 virtual void didUpdateSecurityOrigin(); |
83 | 81 |
84 void setContentSecurityPolicy(PassOwnPtr<ContentSecurityPolicy>); | 82 void setContentSecurityPolicy(PassOwnPtr<ContentSecurityPolicy>); |
85 | 83 |
86 void didFailToInitializeSecurityOrigin() { m_haveInitializedSecurityOrigin =
false; } | 84 void didFailToInitializeSecurityOrigin() { m_haveInitializedSecurityOrigin =
false; } |
87 bool haveInitializedSecurityOrigin() const { return m_haveInitializedSecurit
yOrigin; } | 85 bool haveInitializedSecurityOrigin() const { return m_haveInitializedSecurit
yOrigin; } |
88 | 86 |
89 // Set in Document::initSecurityContext() at Document creation, per: | 87 // Set in Document::initSecurityContext() at Document creation, per: |
90 // http://www.whatwg.org/specs/web-apps/current-work/#attr-iframe-seamless | 88 // http://www.whatwg.org/specs/web-apps/current-work/#attr-iframe-seamless |
91 bool m_mayDisplaySeamlesslyWithParent; | 89 bool m_mayDisplaySeamlesslyWithParent; |
92 | 90 |
93 private: | 91 private: |
94 bool m_haveInitializedSecurityOrigin; | 92 bool m_haveInitializedSecurityOrigin; |
95 SandboxFlags m_sandboxFlags; | 93 SandboxFlags m_sandboxFlags; |
96 RefPtr<SecurityOrigin> m_securityOrigin; | 94 RefPtr<SecurityOrigin> m_securityOrigin; |
97 OwnPtr<ContentSecurityPolicy> m_contentSecurityPolicy; | 95 OwnPtr<ContentSecurityPolicy> m_contentSecurityPolicy; |
98 }; | 96 }; |
99 | 97 |
100 } // namespace WebCore | 98 } // namespace WebCore |
101 | 99 |
102 #endif // SecurityContext_h | 100 #endif // SecurityContext_h |
OLD | NEW |