Index: content/common/content_security_policy/csp_context.cc |
diff --git a/content/common/content_security_policy/csp_context.cc b/content/common/content_security_policy/csp_context.cc |
index 3c3b0fe533f71b8f64712e4184fc5ef6ae82da97..59a97efc2121defb2457e0b712c864e122864d09 100644 |
--- a/content/common/content_security_policy/csp_context.cc |
+++ b/content/common/content_security_policy/csp_context.cc |
@@ -10,15 +10,16 @@ CSPContext::CSPContext() : has_self_(false) {} |
CSPContext::~CSPContext() {} |
-bool CSPContext::IsAllowedByCsp(CSPDirective::Name directive_name, |
- const GURL& url, |
- bool is_redirect) { |
+bool CSPContext::EnforceCsp(CSPDirective::Name directive_name, |
+ const GURL& url, |
+ bool is_redirect, |
+ const SourceLocation& source_location) { |
if (SchemeShouldBypassCSP(url.scheme_piece())) |
return true; |
for (const auto& policy : policies_) { |
- if (!ContentSecurityPolicy::Allow(policy, directive_name, url, this, |
- is_redirect)) |
+ if (!ContentSecurityPolicy::Allow(policy, directive_name, url, is_redirect, |
+ this, source_location)) |
return false; |
} |
return true; |
@@ -59,10 +60,6 @@ bool CSPContext::ProtocolMatchesSelf(const GURL& url) { |
return url.SchemeIs(self_scheme_); |
} |
-void CSPContext::LogToConsole(const std::string& message) { |
- return; |
-} |
- |
bool CSPContext::SchemeShouldBypassCSP(const base::StringPiece& scheme) { |
return false; |
} |
@@ -88,7 +85,8 @@ CSPViolationParams::CSPViolationParams( |
const std::vector<std::string>& report_endpoints, |
const std::string& header, |
const blink::WebContentSecurityPolicyType& disposition, |
- bool after_redirect) |
+ bool after_redirect, |
+ const SourceLocation& source_location) |
: directive(directive), |
effective_directive(effective_directive), |
console_message(console_message), |
@@ -96,7 +94,8 @@ CSPViolationParams::CSPViolationParams( |
report_endpoints(report_endpoints), |
header(header), |
disposition(disposition), |
- after_redirect(after_redirect) {} |
+ after_redirect(after_redirect), |
+ source_location(source_location) {} |
CSPViolationParams::CSPViolationParams(const CSPViolationParams& other) = |
default; |