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 CSPDirectiveList_h | 5 #ifndef CSPDirectiveList_h |
6 #define CSPDirectiveList_h | 6 #define CSPDirectiveList_h |
7 | 7 |
8 #include "core/fetch/Resource.h" | |
9 #include "core/frame/csp/ContentSecurityPolicy.h" | 8 #include "core/frame/csp/ContentSecurityPolicy.h" |
10 #include "core/frame/csp/MediaListDirective.h" | 9 #include "core/frame/csp/MediaListDirective.h" |
11 #include "core/frame/csp/SourceListDirective.h" | 10 #include "core/frame/csp/SourceListDirective.h" |
12 #include "platform/network/ContentSecurityPolicyParsers.h" | 11 #include "platform/network/ContentSecurityPolicyParsers.h" |
13 #include "platform/network/HTTPParsers.h" | 12 #include "platform/network/HTTPParsers.h" |
14 #include "platform/weborigin/KURL.h" | 13 #include "platform/weborigin/KURL.h" |
15 #include "platform/weborigin/ReferrerPolicy.h" | 14 #include "platform/weborigin/ReferrerPolicy.h" |
16 #include "wtf/OwnPtr.h" | 15 #include "wtf/OwnPtr.h" |
17 #include "wtf/Vector.h" | 16 #include "wtf/Vector.h" |
18 #include "wtf/text/WTFString.h" | 17 #include "wtf/text/WTFString.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } | 68 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } |
70 bool didSetReferrerPolicy() const { return m_didSetReferrerPolicy; } | 69 bool didSetReferrerPolicy() const { return m_didSetReferrerPolicy; } |
71 bool isReportOnly() const { return m_reportOnly; } | 70 bool isReportOnly() const { return m_reportOnly; } |
72 const Vector<String>& reportEndpoints() const { return m_reportEndpoints; } | 71 const Vector<String>& reportEndpoints() const { return m_reportEndpoints; } |
73 | 72 |
74 // Used to copy plugin-types into a plugin document in a nested | 73 // Used to copy plugin-types into a plugin document in a nested |
75 // browsing context. | 74 // browsing context. |
76 bool hasPluginTypes() const { return !!m_pluginTypes; }; | 75 bool hasPluginTypes() const { return !!m_pluginTypes; }; |
77 const String& pluginTypesText() const; | 76 const String& pluginTypesText() const; |
78 | 77 |
79 bool shouldSendCSPHeader(Resource::Type) const; | |
80 | |
81 private: | 78 private: |
82 CSPDirectiveList(ContentSecurityPolicy*, ContentSecurityPolicyHeaderType, Co
ntentSecurityPolicyHeaderSource); | 79 CSPDirectiveList(ContentSecurityPolicy*, ContentSecurityPolicyHeaderType, Co
ntentSecurityPolicyHeaderSource); |
83 | 80 |
84 bool parseDirective(const UChar* begin, const UChar* end, String& name, Stri
ng& value); | 81 bool parseDirective(const UChar* begin, const UChar* end, String& name, Stri
ng& value); |
85 void parseReportURI(const String& name, const String& value); | 82 void parseReportURI(const String& name, const String& value); |
86 void parsePluginTypes(const String& name, const String& value); | 83 void parsePluginTypes(const String& name, const String& value); |
87 void parseReflectedXSS(const String& name, const String& value); | 84 void parseReflectedXSS(const String& name, const String& value); |
88 void parseReferrer(const String& name, const String& value); | 85 void parseReferrer(const String& name, const String& value); |
89 void addDirective(const String& name, const String& value); | 86 void addDirective(const String& name, const String& value); |
90 void applySandboxPolicy(const String& name, const String& sandboxPolicy); | 87 void applySandboxPolicy(const String& name, const String& sandboxPolicy); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 152 |
156 Vector<String> m_reportEndpoints; | 153 Vector<String> m_reportEndpoints; |
157 | 154 |
158 String m_evalDisabledErrorMessage; | 155 String m_evalDisabledErrorMessage; |
159 }; | 156 }; |
160 | 157 |
161 | 158 |
162 } // namespace | 159 } // namespace |
163 | 160 |
164 #endif | 161 #endif |
OLD | NEW |