OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebContentSecurityPolicyStruct_h | 31 #ifndef WebContentSecurityPolicyStruct_h |
32 #define WebContentSecurityPolicyStruct_h | 32 #define WebContentSecurityPolicyStruct_h |
33 | 33 |
34 #include "public/platform/WebContentSecurityPolicy.h" | 34 #include "public/platform/WebContentSecurityPolicy.h" |
35 #include "public/platform/WebString.h" | 35 #include "public/platform/WebString.h" |
| 36 #include "public/platform/WebURL.h" |
36 #include "public/platform/WebVector.h" | 37 #include "public/platform/WebVector.h" |
37 | 38 |
38 namespace blink { | 39 namespace blink { |
39 | 40 |
40 enum WebWildcardDisposition { | 41 enum WebWildcardDisposition { |
41 WebWildcardDispositionNoWildcard, | 42 WebWildcardDispositionNoWildcard, |
42 WebWildcardDispositionHasWildcard | 43 WebWildcardDispositionHasWildcard |
43 }; | 44 }; |
44 | 45 |
45 struct WebContentSecurityPolicySourceExpression { | 46 struct WebContentSecurityPolicySourceExpression { |
(...skipping 17 matching lines...) Expand all Loading... |
63 }; | 64 }; |
64 | 65 |
65 struct WebContentSecurityPolicyPolicy { | 66 struct WebContentSecurityPolicyPolicy { |
66 WebContentSecurityPolicyType disposition; | 67 WebContentSecurityPolicyType disposition; |
67 WebContentSecurityPolicySource source; | 68 WebContentSecurityPolicySource source; |
68 WebVector<WebContentSecurityPolicyDirective> directives; | 69 WebVector<WebContentSecurityPolicyDirective> directives; |
69 WebVector<WebString> reportEndpoints; | 70 WebVector<WebString> reportEndpoints; |
70 WebString header; | 71 WebString header; |
71 }; | 72 }; |
72 | 73 |
| 74 struct WebContentSecurityPolicyViolation { |
| 75 // The name of the directive that violates the policy. |directive| might be a |
| 76 // directive that serves as a fallback to the |effective_directive|. |
| 77 WebString directive; |
| 78 |
| 79 // The name the effective directive that was checked against. |
| 80 WebString effectiveDirective; |
| 81 |
| 82 // The console message to be displayed to the user. |
| 83 WebString consoleMessage; |
| 84 |
| 85 // The URL that was blocked by the policy. |
| 86 WebURL blockedUrl; |
| 87 |
| 88 // The set of URI where a JSON-formatted report of the violation should be |
| 89 // sent. |
| 90 WebVector<WebString> reportEndpoints; |
| 91 |
| 92 // The raw content security policy header that was infringed. |
| 93 WebString header; |
| 94 |
| 95 // Each policy has an associated disposition, which is either "enforce" or |
| 96 // "report". |
| 97 WebContentSecurityPolicyType disposition; |
| 98 |
| 99 // Whether or not the violation happens after a redirect. |
| 100 bool afterRedirect; |
| 101 }; |
| 102 |
73 } // namespace blink | 103 } // namespace blink |
74 | 104 |
75 #endif | 105 #endif |
OLD | NEW |