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 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef ContentSecurityPolicy_h | 26 #ifndef ContentSecurityPolicy_h |
27 #define ContentSecurityPolicy_h | 27 #define ContentSecurityPolicy_h |
28 | 28 |
29 #include "bindings/core/v8/ScriptState.h" | 29 #include "bindings/core/v8/ScriptState.h" |
30 #include "core/dom/ExecutionContext.h" | 30 #include "core/dom/ExecutionContext.h" |
31 #include "core/dom/SecurityContext.h" | 31 #include "core/dom/SecurityContext.h" |
| 32 #include "core/fetch/Resource.h" |
32 #include "core/frame/ConsoleTypes.h" | 33 #include "core/frame/ConsoleTypes.h" |
33 #include "platform/network/ContentSecurityPolicyParsers.h" | 34 #include "platform/network/ContentSecurityPolicyParsers.h" |
34 #include "platform/network/HTTPParsers.h" | 35 #include "platform/network/HTTPParsers.h" |
35 #include "platform/weborigin/ReferrerPolicy.h" | 36 #include "platform/weborigin/ReferrerPolicy.h" |
36 #include "wtf/HashSet.h" | 37 #include "wtf/HashSet.h" |
37 #include "wtf/PassOwnPtr.h" | 38 #include "wtf/PassOwnPtr.h" |
38 #include "wtf/PassRefPtr.h" | 39 #include "wtf/PassRefPtr.h" |
39 #include "wtf/RefCounted.h" | 40 #include "wtf/RefCounted.h" |
40 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
41 #include "wtf/text/StringHash.h" | 42 #include "wtf/text/StringHash.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 String evalDisabledErrorMessage() const; | 226 String evalDisabledErrorMessage() const; |
226 | 227 |
227 void setInsecureRequestsPolicy(SecurityContext::InsecureRequestsPolicy); | 228 void setInsecureRequestsPolicy(SecurityContext::InsecureRequestsPolicy); |
228 SecurityContext::InsecureRequestsPolicy insecureRequestsPolicy() const { ret
urn m_insecureRequestsPolicy; }; | 229 SecurityContext::InsecureRequestsPolicy insecureRequestsPolicy() const { ret
urn m_insecureRequestsPolicy; }; |
229 | 230 |
230 bool urlMatchesSelf(const KURL&) const; | 231 bool urlMatchesSelf(const KURL&) const; |
231 bool protocolMatchesSelf(const KURL&) const; | 232 bool protocolMatchesSelf(const KURL&) const; |
232 | 233 |
233 bool experimentalFeaturesEnabled() const; | 234 bool experimentalFeaturesEnabled() const; |
234 | 235 |
| 236 bool shouldSendCSPHeader(Resource::Type) const; |
| 237 |
235 static bool shouldBypassMainWorld(const ExecutionContext*); | 238 static bool shouldBypassMainWorld(const ExecutionContext*); |
236 | 239 |
237 static bool isDirectiveName(const String&); | 240 static bool isDirectiveName(const String&); |
238 | 241 |
239 private: | 242 private: |
240 ContentSecurityPolicy(); | 243 ContentSecurityPolicy(); |
241 | 244 |
242 void applyPolicySideEffectsToExecutionContext(); | 245 void applyPolicySideEffectsToExecutionContext(); |
243 | 246 |
244 Document* document() const; | 247 Document* document() const; |
(...skipping 26 matching lines...) Expand all Loading... |
271 String m_disableEvalErrorMessage; | 274 String m_disableEvalErrorMessage; |
272 SecurityContext::InsecureRequestsPolicy m_insecureRequestsPolicy; | 275 SecurityContext::InsecureRequestsPolicy m_insecureRequestsPolicy; |
273 | 276 |
274 OwnPtr<CSPSource> m_selfSource; | 277 OwnPtr<CSPSource> m_selfSource; |
275 String m_selfProtocol; | 278 String m_selfProtocol; |
276 }; | 279 }; |
277 | 280 |
278 } | 281 } |
279 | 282 |
280 #endif | 283 #endif |
OLD | NEW |