#include "services/network/public/cpp/content_security_policy/csp_context.h"
#include "base/containers/contains.h"
#include "services/network/public/cpp/content_security_policy/content_security_policy.h"
#include "url/url_util.h"
namespace network {
namespace {
bool ShouldCheckPolicy(const mojom::ContentSecurityPolicyPtr& policy,
CSPContext::CheckCSPDisposition check_csp_disposition) { … }
}
CSPContext::CSPContext() = default;
CSPContext::~CSPContext() = default;
CSPCheckResult CSPContext::IsAllowedByCsp(
const std::vector<mojom::ContentSecurityPolicyPtr>& policies,
mojom::CSPDirectiveName directive_name,
const GURL& url,
const GURL& url_before_redirects,
bool has_followed_redirect,
bool is_response_check,
const mojom::SourceLocationPtr& source_location,
CheckCSPDisposition check_csp_disposition,
bool is_form_submission,
bool is_opaque_fenced_frame) { … }
bool CSPContext::SchemeShouldBypassCSP(std::string_view scheme) { … }
void CSPContext::SanitizeDataForUseInCspViolation(
mojom::CSPDirectiveName directive,
GURL* blocked_url,
network::mojom::SourceLocation* source_location) const { … }
void CSPContext::ReportContentSecurityPolicyViolation(
network::mojom::CSPViolationPtr violation) { … }
}