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" | |
37 #include "public/platform/WebVector.h" | 36 #include "public/platform/WebVector.h" |
38 | 37 |
39 namespace blink { | 38 namespace blink { |
40 | 39 |
41 enum WebWildcardDisposition { | 40 enum WebWildcardDisposition { |
42 WebWildcardDispositionNoWildcard, | 41 WebWildcardDispositionNoWildcard, |
43 WebWildcardDispositionHasWildcard | 42 WebWildcardDispositionHasWildcard |
44 }; | 43 }; |
45 | 44 |
46 struct WebContentSecurityPolicySourceExpression { | 45 struct WebContentSecurityPolicySourceExpression { |
(...skipping 17 matching lines...) Expand all Loading... |
64 }; | 63 }; |
65 | 64 |
66 struct WebContentSecurityPolicyPolicy { | 65 struct WebContentSecurityPolicyPolicy { |
67 WebContentSecurityPolicyType disposition; | 66 WebContentSecurityPolicyType disposition; |
68 WebContentSecurityPolicySource source; | 67 WebContentSecurityPolicySource source; |
69 WebVector<WebContentSecurityPolicyDirective> directives; | 68 WebVector<WebContentSecurityPolicyDirective> directives; |
70 WebVector<WebString> reportEndpoints; | 69 WebVector<WebString> reportEndpoints; |
71 WebString header; | 70 WebString header; |
72 }; | 71 }; |
73 | 72 |
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 | |
103 } // namespace blink | 73 } // namespace blink |
104 | 74 |
105 #endif | 75 #endif |
OLD | NEW |