chromium/services/network/public/cpp/cors/origin_access_entry.h

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

#ifndef SERVICES_NETWORK_PUBLIC_CPP_CORS_ORIGIN_ACCESS_ENTRY_H_
#define SERVICES_NETWORK_PUBLIC_CPP_CORS_ORIGIN_ACCESS_ENTRY_H_

#include <string>

#include "base/component_export.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "services/network/public/mojom/cors.mojom-shared.h"
#include "services/network/public/mojom/cors_origin_pattern.mojom-shared.h"

namespace url {
class Origin;
}  // namespace url

namespace network {

namespace mojom {
class CorsOriginPattern;
}  // namespace mojom

namespace cors {

// Returns true if the host and subdomain are the same, or if subdomain is a
// subdomain of host. (e.g., bar.foo.com is a subdomain of foo.com).
bool COMPONENT_EXPORT(NETWORK_CPP)
    IsSubdomainOfHost(const std::string& subdomain, const std::string& host);

// A class to hold a protocol and domain and port triple and to provide methods
// to determine if a given origin or domain matches. The class can have a
// setting to control if the matching methods accept a partial match.
class COMPONENT_EXPORT(NETWORK_CPP) OriginAccessEntry final {};

}  // namespace cors

}  // namespace network

#endif  // SERVICES_NETWORK_PUBLIC_CPP_CORS_ORIGIN_ACCESS_ENTRY_H_