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