| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #ifndef ContentSecurityPolicy_h | 26 #ifndef ContentSecurityPolicy_h |
| 27 #define ContentSecurityPolicy_h | 27 #define ContentSecurityPolicy_h |
| 28 | 28 |
| 29 #include "bindings/v8/ScriptState.h" | 29 #include "bindings/v8/ScriptState.h" |
| 30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
| 31 #include "platform/network/HTTPParsers.h" | 31 #include "platform/network/HTTPParsers.h" |
| 32 #include "platform/weborigin/ReferrerPolicy.h" | 32 #include "platform/weborigin/ReferrerPolicy.h" |
| 33 #include "wtf/HashSet.h" | 33 #include "wtf/HashSet.h" |
| 34 #include "wtf/PassOwnPtr.h" | 34 #include "wtf/PassOwnPtr.h" |
| 35 #include "wtf/PassRefPtr.h" |
| 36 #include "wtf/RefCounted.h" |
| 35 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
| 36 #include "wtf/text/StringHash.h" | 38 #include "wtf/text/StringHash.h" |
| 37 #include "wtf/text/TextPosition.h" | 39 #include "wtf/text/TextPosition.h" |
| 38 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
| 39 | 41 |
| 40 namespace WTF { | 42 namespace WTF { |
| 41 class OrdinalNumber; | 43 class OrdinalNumber; |
| 42 } | 44 } |
| 43 | 45 |
| 44 namespace WebCore { | 46 namespace WebCore { |
| 45 | 47 |
| 46 class ContentSecurityPolicyResponseHeaders; | 48 class ContentSecurityPolicyResponseHeaders; |
| 47 class CSPDirectiveList; | 49 class CSPDirectiveList; |
| 48 class DOMStringList; | 50 class DOMStringList; |
| 49 class JSONObject; | 51 class JSONObject; |
| 50 class KURL; | 52 class KURL; |
| 51 class ExecutionContextClient; | 53 class ExecutionContextClient; |
| 52 class SecurityOrigin; | 54 class SecurityOrigin; |
| 53 | 55 |
| 54 typedef int SandboxFlags; | 56 typedef int SandboxFlags; |
| 55 typedef Vector<OwnPtr<CSPDirectiveList> > CSPDirectiveListVector; | 57 typedef Vector<OwnPtr<CSPDirectiveList> > CSPDirectiveListVector; |
| 56 | 58 |
| 57 class ContentSecurityPolicy { | 59 class ContentSecurityPolicy : public RefCounted<ContentSecurityPolicy> { |
| 58 WTF_MAKE_FAST_ALLOCATED; | 60 WTF_MAKE_FAST_ALLOCATED; |
| 59 public: | 61 public: |
| 60 static PassOwnPtr<ContentSecurityPolicy> create(ExecutionContextClient* clie
nt) | 62 static PassRefPtr<ContentSecurityPolicy> create(ExecutionContextClient* clie
nt) |
| 61 { | 63 { |
| 62 return adoptPtr(new ContentSecurityPolicy(client)); | 64 return adoptRef(new ContentSecurityPolicy(client)); |
| 63 } | 65 } |
| 64 ~ContentSecurityPolicy(); | 66 ~ContentSecurityPolicy(); |
| 65 | 67 |
| 66 void copyStateFrom(const ContentSecurityPolicy*); | 68 void copyStateFrom(const ContentSecurityPolicy*); |
| 67 | 69 |
| 68 enum HeaderType { | 70 enum HeaderType { |
| 69 Report, | 71 Report, |
| 70 Enforce, | 72 Enforce, |
| 71 }; | 73 }; |
| 72 | 74 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // We put the hash functions used on the policy object so that we only need | 185 // We put the hash functions used on the policy object so that we only need |
| 184 // to calculate a hash once and then distribute it to all of the directives | 186 // to calculate a hash once and then distribute it to all of the directives |
| 185 // for validation. | 187 // for validation. |
| 186 uint8_t m_scriptHashAlgorithmsUsed; | 188 uint8_t m_scriptHashAlgorithmsUsed; |
| 187 uint8_t m_styleHashAlgorithmsUsed; | 189 uint8_t m_styleHashAlgorithmsUsed; |
| 188 }; | 190 }; |
| 189 | 191 |
| 190 } | 192 } |
| 191 | 193 |
| 192 #endif | 194 #endif |
| OLD | NEW |