| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_CONTENT_SECURITY_POLICY_H_ | 5 #ifndef CONTENT_COMMON_CONTENT_SECURITY_POLICY_CONTENT_SECURITY_POLICY_H_ |
| 6 #define CONTENT_COMMON_CONTENT_SECURITY_POLICY_CONTENT_SECURITY_POLICY_H_ | 6 #define CONTENT_COMMON_CONTENT_SECURITY_POLICY_CONTENT_SECURITY_POLICY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 // Return true when the |policy| allows a request to the |url| in relation to | 39 // Return true when the |policy| allows a request to the |url| in relation to |
| 40 // the |directive| for a given |context|. | 40 // the |directive| for a given |context|. |
| 41 // Note: Any policy violation are reported to the |context|. | 41 // Note: Any policy violation are reported to the |context|. |
| 42 static bool Allow(const ContentSecurityPolicy& policy, | 42 static bool Allow(const ContentSecurityPolicy& policy, |
| 43 CSPDirective::Name directive, | 43 CSPDirective::Name directive, |
| 44 const GURL& url, | 44 const GURL& url, |
| 45 bool is_redirect, | 45 bool is_redirect, |
| 46 CSPContext* context, | 46 CSPContext* context, |
| 47 const SourceLocation& source_location); | 47 const SourceLocation& source_location); |
| 48 |
| 49 // Returns true if |policy| specifies that an insecure HTTP request should be |
| 50 // upgraded to HTTPS. |
| 51 static bool ShouldUpgradeInsecureRequest(const ContentSecurityPolicy& policy); |
| 48 }; | 52 }; |
| 49 | 53 |
| 50 } // namespace content | 54 } // namespace content |
| 51 #endif // CONTENT_COMMON_CONTENT_SECURITY_POLICY_CONTENT_SECURITY_POLICY_H_ | 55 #endif // CONTENT_COMMON_CONTENT_SECURITY_POLICY_CONTENT_SECURITY_POLICY_H_ |
| OLD | NEW |