Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 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 WebContentSecurityPolicy_h | 31 #ifndef WebContentSecurityPolicyStruct_h |
| 32 #define WebContentSecurityPolicy_h | 32 #define WebContentSecurityPolicyStruct_h |
| 33 | |
| 34 #include "public/platform/WebContentSecurityPolicy.h" | |
| 35 #include "public/platform/WebString.h" | |
| 36 #include "public/platform/WebVector.h" | |
| 33 | 37 |
| 34 namespace blink { | 38 namespace blink { |
| 35 | 39 |
| 36 enum WebContentSecurityPolicyType { | 40 struct WebContentSecurityPolicySourceExpression { |
| 37 WebContentSecurityPolicyTypeReport, | 41 WebString scheme; |
| 38 WebContentSecurityPolicyTypeEnforce, | 42 WebString host; |
| 39 WebContentSecurityPolicyTypeLast = WebContentSecurityPolicyTypeEnforce | 43 bool isHostWildcard; |
| 44 int port; | |
| 45 bool isPortWildcard; | |
| 46 WebString path; | |
| 40 }; | 47 }; |
| 41 | 48 |
| 42 enum WebContentSecurityPolicySource { | 49 struct WebContentSecurityPolicySourceList { |
| 43 WebContentSecurityPolicySourceHTTP, | 50 bool allowSelf; |
| 44 WebContentSecurityPolicySourceMeta, | 51 bool allowStar; |
| 45 WebContentSecurityPolicySourceLast = WebContentSecurityPolicySourceMeta | 52 WebVector<WebContentSecurityPolicySourceExpression> sourceList; |
|
Mike West
2017/02/13 14:10:51
Nit: `sourceList` seems wrong, given the name of t
arthursonzogni
2017/02/14 17:07:03
I agree. What about sources?
Mike West
2017/02/15 16:18:17
SGTM.
| |
| 53 }; | |
| 54 | |
| 55 struct WebContentSecurityPolicyDirective { | |
| 56 WebString name; | |
| 57 WebContentSecurityPolicySourceList sourceList; | |
| 58 }; | |
|
Mike West
2017/02/13 14:10:51
Since you're only exporting source-list directives
arthursonzogni
2017/02/14 17:07:03
I prefer to store a list of CSPDirective inside a
Mike West
2017/02/15 16:18:17
I think you're adding complexity for little benefi
| |
| 59 | |
| 60 struct WebContentSecurityPolicyPolicy { | |
|
Mike West
2017/02/13 14:10:51
Nit: ContentSecurityPolicyPolicy sounds super-weir
arthursonzogni
2017/02/14 17:07:03
Inside blink, a ContentSecurityPolicy doesn't repr
Mike West
2017/02/15 16:18:17
Blink is serving a few masters with the naming: we
| |
| 61 WebContentSecurityPolicyType disposition; | |
| 62 WebContentSecurityPolicySource source; | |
| 63 WebVector<WebContentSecurityPolicyDirective> directives; | |
| 64 WebVector<WebString> reportEndpoints; | |
| 46 }; | 65 }; |
| 47 | 66 |
| 48 } // namespace blink | 67 } // namespace blink |
| 49 | 68 |
| 50 #endif | 69 #endif |
| OLD | NEW |