chromium/services/network/public/cpp/cookie_manager_mojom_traits.h

// Copyright 2017 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_COOKIE_MANAGER_MOJOM_TRAITS_H_
#define SERVICES_NETWORK_PUBLIC_CPP_COOKIE_MANAGER_MOJOM_TRAITS_H_

#include <bitset>
#include <optional>
#include <vector>

#include "mojo/public/cpp/bindings/enum_traits.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_access_result.h"
#include "net/cookies/cookie_change_dispatcher.h"
#include "net/cookies/cookie_constants.h"
#include "net/cookies/cookie_inclusion_status.h"
#include "net/cookies/cookie_options.h"
#include "net/cookies/cookie_partition_key_collection.h"
#include "services/network/public/cpp/cookie_manager_shared_mojom_traits.h"
#include "services/network/public/mojom/cookie_manager.mojom-forward.h"
#include "services/network/public/mojom/cookie_manager.mojom.h"
#include "services/network/public/mojom/cookie_partition_key.mojom.h"

namespace mojo {

template <>
struct EnumTraits<network::mojom::CookieSourceType, net::CookieSourceType> {};

template <>
struct EnumTraits<network::mojom::CookiePriority, net::CookiePriority> {};

template <>
struct EnumTraits<network::mojom::CookieSameSite, net::CookieSameSite> {};

template <>
struct EnumTraits<network::mojom::CookieEffectiveSameSite,
                  net::CookieEffectiveSameSite> {};

template <>
struct EnumTraits<network::mojom::CookieAccessSemantics,
                  net::CookieAccessSemantics> {};

template <>
struct EnumTraits<network::mojom::ContextType,
                  net::CookieOptions::SameSiteCookieContext::ContextType> {};

template <>
struct EnumTraits<network::mojom::CookieSameSiteContextMetadataDowngradeType,
                  net::CookieOptions::SameSiteCookieContext::ContextMetadata::
                      ContextDowngradeType> {};

template <>
struct EnumTraits<network::mojom::ContextRedirectTypeBug1221316,
                  net::CookieOptions::SameSiteCookieContext::ContextMetadata::
                      ContextRedirectTypeBug1221316> {};

template <>
struct EnumTraits<
    network::mojom::HttpMethod,
    net::CookieOptions::SameSiteCookieContext::ContextMetadata::HttpMethod> {};

template <>
struct EnumTraits<network::mojom::CookieSourceScheme, net::CookieSourceScheme> {};

template <>
struct EnumTraits<network::mojom::CookieChangeCause, net::CookieChangeCause> {};

template <>
struct StructTraits<
    network::mojom::CookieSameSiteContextMetadataDataView,
    net::CookieOptions::SameSiteCookieContext::ContextMetadata> {};

template <>
struct StructTraits<network::mojom::CookieSameSiteContextDataView,
                    net::CookieOptions::SameSiteCookieContext> {};

template <>
struct StructTraits<network::mojom::CookieOptionsDataView, net::CookieOptions> {};

template <>
struct EnumTraits<network::mojom::AncestorChainBit,
                  net::CookiePartitionKey::AncestorChainBit> {};

template <>
struct StructTraits<network::mojom::CookiePartitionKeyDataView,
                    net::CookiePartitionKey> {};

template <>
struct StructTraits<network::mojom::CookiePartitionKeyCollectionDataView,
                    net::CookiePartitionKeyCollection> {};

template <>
struct StructTraits<network::mojom::CanonicalCookieDataView,
                    net::CanonicalCookie> {};

template <>
struct StructTraits<network::mojom::CookieAndLineWithAccessResultDataView,
                    net::CookieAndLineWithAccessResult> {};

template <>
struct StructTraits<network::mojom::CookieAccessResultDataView,
                    net::CookieAccessResult> {};

template <>
struct StructTraits<network::mojom::CookieWithAccessResultDataView,
                    net::CookieWithAccessResult> {};

template <>
struct StructTraits<network::mojom::CookieChangeInfoDataView,
                    net::CookieChangeInfo> {};

}  // namespace mojo

#endif  // SERVICES_NETWORK_PUBLIC_CPP_COOKIE_MANAGER_MOJOM_TRAITS_H_