chromium/third_party/blink/renderer/core/frame/csp/csp_source.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

// Helper inline functions for Port and Scheme MatchingResult enums
bool inline RequiresUpgrade(const PortMatchingResult result) {}
bool inline RequiresUpgrade(const SchemeMatchingResult result) {}

bool inline CanUpgrade(const PortMatchingResult result) {}

bool inline CanUpgrade(const SchemeMatchingResult result) {}

}  // namespace

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) {}

}  // namespace blink