#include "third_party/blink/renderer/core/frame/csp/csp_source.h"
#include "services/network/public/mojom/content_security_policy.mojom-blink.h"
#include "third_party/blink/renderer/platform/weborigin/known_ports.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
namespace {
enum class SchemeMatchingResult { … };
enum class PortMatchingResult { … };
SchemeMatchingResult SchemeMatches(
const network::mojom::blink::CSPSource& source,
const String& protocol,
const String& self_protocol) { … }
bool HostMatches(const network::mojom::blink::CSPSource& source,
const StringView& host) { … }
bool HostMatches(const network::mojom::blink::CSPSource& source,
const KURL& url) { … }
bool PathMatches(const network::mojom::blink::CSPSource& source,
const String& url_path) { … }
PortMatchingResult PortMatches(const network::mojom::blink::CSPSource& source,
const String& self_protocol,
int port,
const String& protocol) { … }
bool inline RequiresUpgrade(const PortMatchingResult result) { … }
bool inline RequiresUpgrade(const SchemeMatchingResult result) { … }
bool inline CanUpgrade(const PortMatchingResult result) { … }
bool inline CanUpgrade(const SchemeMatchingResult result) { … }
}
bool CSPSourceMatches(const network::mojom::blink::CSPSource& source,
const String& self_protocol,
const KURL& url,
ResourceRequest::RedirectStatus redirect_status) { … }
bool CSPSourceMatchesAsSelf(const network::mojom::blink::CSPSource& source,
const KURL& url) { … }
bool CSPSourceIsSchemeOnly(const network::mojom::blink::CSPSource& source) { … }
}