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/fetch/Resource.h" |
9 #include "core/frame/csp/ContentSecurityPolicy.h" | 9 #include "core/frame/csp/ContentSecurityPolicy.h" |
10 #include "core/frame/csp/MediaListDirective.h" | 10 #include "core/frame/csp/MediaListDirective.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 template <class CSPDirectiveType> | 184 template <class CSPDirectiveType> |
185 void setCSPDirective(const String& name, | 185 void setCSPDirective(const String& name, |
186 const String& value, | 186 const String& value, |
187 Member<CSPDirectiveType>&); | 187 Member<CSPDirectiveType>&); |
188 | 188 |
189 SourceListDirective* operativeDirective(SourceListDirective*) const; | 189 SourceListDirective* operativeDirective(SourceListDirective*) const; |
190 SourceListDirective* operativeDirective(SourceListDirective*, | 190 SourceListDirective* operativeDirective(SourceListDirective*, |
191 SourceListDirective* override) const; | 191 SourceListDirective* override) const; |
192 void reportViolation(const String& directiveText, | 192 void reportViolation(const String& directiveText, |
193 const ContentSecurityPolicy::DirectiveType&, | 193 const String& effectiveDirective, |
194 const String& consoleMessage, | 194 const String& consoleMessage, |
195 const KURL& blockedURL, | 195 const KURL& blockedURL, |
196 ResourceRequest::RedirectStatus) const; | 196 ResourceRequest::RedirectStatus) const; |
197 void reportViolationWithFrame(const String& directiveText, | 197 void reportViolationWithFrame(const String& directiveText, |
198 const ContentSecurityPolicy::DirectiveType&, | 198 const String& effectiveDirective, |
199 const String& consoleMessage, | 199 const String& consoleMessage, |
200 const KURL& blockedURL, | 200 const KURL& blockedURL, |
201 LocalFrame*) const; | 201 LocalFrame*) const; |
202 void reportViolationWithLocation(const String& directiveText, | 202 void reportViolationWithLocation(const String& directiveText, |
203 const ContentSecurityPolicy::DirectiveType&, | 203 const String& effectiveDirective, |
204 const String& consoleMessage, | 204 const String& consoleMessage, |
205 const KURL& blockedURL, | 205 const KURL& blockedURL, |
206 const String& contextURL, | 206 const String& contextURL, |
207 const WTF::OrdinalNumber& contextLine, | 207 const WTF::OrdinalNumber& contextLine, |
208 Element*) const; | 208 Element*) const; |
209 void reportViolationWithState( | 209 void reportViolationWithState( |
210 const String& directiveText, | 210 const String& directiveText, |
211 const ContentSecurityPolicy::DirectiveType&, | 211 const String& effectiveDirective, |
212 const String& message, | 212 const String& message, |
213 const KURL& blockedURL, | 213 const KURL& blockedURL, |
214 ScriptState*, | 214 ScriptState*, |
215 const ContentSecurityPolicy::ExceptionStatus) const; | 215 const ContentSecurityPolicy::ExceptionStatus) const; |
216 | 216 |
217 bool checkEval(SourceListDirective*) const; | 217 bool checkEval(SourceListDirective*) const; |
218 bool checkInline(SourceListDirective*) const; | 218 bool checkInline(SourceListDirective*) const; |
219 bool checkDynamic(SourceListDirective*) const; | 219 bool checkDynamic(SourceListDirective*) const; |
220 bool isMatchingNoncePresent(SourceListDirective*, const String&) const; | 220 bool isMatchingNoncePresent(SourceListDirective*, const String&) const; |
221 bool checkHash(SourceListDirective*, const CSPHashValue&) const; | 221 bool checkHash(SourceListDirective*, const CSPHashValue&) const; |
(...skipping 18 matching lines...) Expand all Loading... |
240 ContentSecurityPolicy::ExceptionStatus = | 240 ContentSecurityPolicy::ExceptionStatus = |
241 ContentSecurityPolicy::WillNotThrowException) const; | 241 ContentSecurityPolicy::WillNotThrowException) const; |
242 bool checkInlineAndReportViolation(SourceListDirective*, | 242 bool checkInlineAndReportViolation(SourceListDirective*, |
243 const String& consoleMessage, | 243 const String& consoleMessage, |
244 Element*, | 244 Element*, |
245 const String& contextURL, | 245 const String& contextURL, |
246 const WTF::OrdinalNumber& contextLine, | 246 const WTF::OrdinalNumber& contextLine, |
247 bool isScript, | 247 bool isScript, |
248 const String& hashValue) const; | 248 const String& hashValue) const; |
249 | 249 |
250 bool checkSourceAndReportViolation( | 250 bool checkSourceAndReportViolation(SourceListDirective*, |
251 SourceListDirective*, | 251 const KURL&, |
252 const KURL&, | 252 const String& effectiveDirective, |
253 const ContentSecurityPolicy::DirectiveType&, | 253 ResourceRequest::RedirectStatus) const; |
254 ResourceRequest::RedirectStatus) const; | |
255 bool checkMediaTypeAndReportViolation(MediaListDirective*, | 254 bool checkMediaTypeAndReportViolation(MediaListDirective*, |
256 const String& type, | 255 const String& type, |
257 const String& typeAttribute, | 256 const String& typeAttribute, |
258 const String& consoleMessage) const; | 257 const String& consoleMessage) const; |
259 bool checkAncestorsAndReportViolation(SourceListDirective*, | 258 bool checkAncestorsAndReportViolation(SourceListDirective*, |
260 LocalFrame*, | 259 LocalFrame*, |
261 const KURL&) const; | 260 const KURL&) const; |
262 bool checkRequestWithoutIntegrityAndReportViolation( | 261 bool checkRequestWithoutIntegrityAndReportViolation( |
263 WebURLRequest::RequestContext, | 262 WebURLRequest::RequestContext, |
264 const KURL&, | 263 const KURL&, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 uint8_t m_requireSRIFor; | 298 uint8_t m_requireSRIFor; |
300 | 299 |
301 Vector<String> m_reportEndpoints; | 300 Vector<String> m_reportEndpoints; |
302 | 301 |
303 String m_evalDisabledErrorMessage; | 302 String m_evalDisabledErrorMessage; |
304 }; | 303 }; |
305 | 304 |
306 } // namespace blink | 305 } // namespace blink |
307 | 306 |
308 #endif | 307 #endif |
OLD | NEW |