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

// Copyright 2022 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_FIRST_PARTY_SETS_MOJOM_TRAITS_H_
#define SERVICES_NETWORK_PUBLIC_CPP_FIRST_PARTY_SETS_MOJOM_TRAITS_H_

#include "base/containers/flat_map.h"
#include "base/version.h"
#include "mojo/public/cpp/bindings/enum_traits.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "net/base/schemeful_site.h"
#include "net/first_party_sets/first_party_set_entry.h"
#include "net/first_party_sets/first_party_set_entry_override.h"
#include "net/first_party_sets/first_party_set_metadata.h"
#include "net/first_party_sets/first_party_sets_cache_filter.h"
#include "net/first_party_sets/first_party_sets_context_config.h"
#include "net/first_party_sets/global_first_party_sets.h"
#include "services/network/public/mojom/first_party_sets.mojom-shared.h"

namespace mojo {

template <>
struct COMPONENT_EXPORT(FIRST_PARTY_SETS_MOJOM_TRAITS)
    StructTraits<network::mojom::SiteIndexDataView,
                 net::FirstPartySetEntry::SiteIndex> {};

template <>
struct COMPONENT_EXPORT(FIRST_PARTY_SETS_MOJOM_TRAITS)
    EnumTraits<network::mojom::SiteType, net::SiteType> {};

template <>
struct COMPONENT_EXPORT(FIRST_PARTY_SETS_MOJOM_TRAITS)
    StructTraits<network::mojom::FirstPartySetEntryDataView,
                 net::FirstPartySetEntry> {};

template <>
struct COMPONENT_EXPORT(FIRST_PARTY_SETS_MOJOM_TRAITS)
    StructTraits<network::mojom::FirstPartySetMetadataDataView,
                 net::FirstPartySetMetadata> {};

template <>
struct COMPONENT_EXPORT(FIRST_PARTY_SETS_MOJOM_TRAITS)
    StructTraits<network::mojom::GlobalFirstPartySetsDataView,
                 net::GlobalFirstPartySets> {};

template <>
struct COMPONENT_EXPORT(FIRST_PARTY_SETS_MOJOM_TRAITS)
    StructTraits<network::mojom::FirstPartySetEntryOverrideDataView,
                 net::FirstPartySetEntryOverride> {};

template <>
struct COMPONENT_EXPORT(FIRST_PARTY_SETS_MOJOM_TRAITS)
    StructTraits<network::mojom::FirstPartySetsContextConfigDataView,
                 net::FirstPartySetsContextConfig> {};

template <>
struct COMPONENT_EXPORT(FIRST_PARTY_SETS_MOJOM_TRAITS)
    StructTraits<network::mojom::FirstPartySetsCacheFilterDataView,
                 net::FirstPartySetsCacheFilter> {};

}  // namespace mojo

#endif  // SERVICES_NETWORK_PUBLIC_CPP_FIRST_PARTY_SETS_MOJOM_TRAITS_H_