OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CONTENT_COMMON_CONTENT_SECURITY_POLICY_HEADER_ | 5 #ifndef CONTENT_COMMON_CONTENT_SECURITY_POLICY_STRUCTS_ |
6 #define CONTENT_COMMON_CONTENT_SECURITY_POLICY_HEADER_ | 6 #define CONTENT_COMMON_CONTENT_SECURITY_POLICY_STRUCTS_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
9 #include "third_party/WebKit/public/web/WebContentSecurityPolicy.h" | 10 #include "third_party/WebKit/public/web/WebContentSecurityPolicy.h" |
| 11 #include "url/gurl.h" |
10 | 12 |
11 namespace content { | 13 namespace content { |
12 | 14 |
13 // Represents a single Content Security Policy header (i.e. coming from | 15 // Represents a single Content Security Policy header (i.e. coming from |
14 // a single Content-Security-Policy header in an HTTP response, or from | 16 // a single Content-Security-Policy header in an HTTP response, or from |
15 // a single <meta http-equiv="Content-Security-Policy"...> element). | 17 // a single <meta http-equiv="Content-Security-Policy"...> element). |
16 struct ContentSecurityPolicyHeader { | 18 struct ContentSecurityPolicyHeader { |
17 std::string header_value; | 19 std::string header_value; |
18 blink::WebContentSecurityPolicyType type; | 20 blink::WebContentSecurityPolicyType type; |
19 blink::WebContentSecurityPolicySource source; | 21 blink::WebContentSecurityPolicySource source; |
20 }; | 22 }; |
21 | 23 |
| 24 // Represents a Content Security Policy violation. |
| 25 struct ContentSecurityPolicyViolation { |
| 26 ContentSecurityPolicyViolation(); |
| 27 ~ContentSecurityPolicyViolation(); |
| 28 |
| 29 std::string directive_text; |
| 30 std::string effective_directive; |
| 31 std::string console_message; |
| 32 GURL blocked_url; |
| 33 std::vector<std::string> report_endpoints; |
| 34 std::string header; |
| 35 blink::WebContentSecurityPolicyViolationType violation_type; |
| 36 bool followed_redirect; |
| 37 }; |
| 38 |
22 } // namespace content | 39 } // namespace content |
23 | 40 |
24 #endif // CONTENT_COMMON_CONTENT_SECURITY_POLICY_HEADER_ | 41 #endif // CONTENT_COMMON_CONTENT_SECURITY_POLICY_STRUCTS_ |
OLD | NEW |