| // services/network/public/mojom/first_party_sets.mojom-blink.cc is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2013 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #if defined(__clang__) |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wunused-private-field" |
| #endif |
| |
| #include "services/network/public/mojom/first_party_sets.mojom-blink.h" |
| |
| #include <math.h> |
| #include <stdint.h> |
| #include <utility> |
| |
| #include "base/debug/alias.h" |
| #include "base/hash/md5_constexpr.h" |
| #include "base/run_loop.h" |
| #include "base/strings/string_number_conversions.h" |
| #include "base/task/thread_pool/thread_pool_instance.h" |
| #include "base/trace_event/trace_event.h" |
| #include "base/trace_event/typed_macros.h" |
| #include "mojo/public/cpp/bindings/features.h" |
| #include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h" |
| #include "mojo/public/cpp/bindings/lib/generated_code_util.h" |
| #include "mojo/public/cpp/bindings/lib/message_internal.h" |
| #include "mojo/public/cpp/bindings/lib/proxy_to_responder.h" |
| #include "mojo/public/cpp/bindings/lib/send_message_helper.h" |
| #include "mojo/public/cpp/bindings/lib/serialization_util.h" |
| #include "mojo/public/cpp/bindings/lib/unserialized_message_context.h" |
| #include "mojo/public/cpp/bindings/lib/validate_params.h" |
| #include "mojo/public/cpp/bindings/lib/validation_errors.h" |
| #include "mojo/public/cpp/bindings/mojo_buildflags.h" |
| #include "mojo/public/cpp/bindings/urgent_message_scope.h" |
| #include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h" |
| #include "third_party/perfetto/include/perfetto/tracing/traced_value.h" |
| |
| #include "services/network/public/mojom/first_party_sets.mojom-params-data.h" |
| #include "services/network/public/mojom/first_party_sets.mojom-shared-message-ids.h" |
| |
| #include "services/network/public/mojom/first_party_sets.mojom-blink-import-headers.h" |
| #include "services/network/public/mojom/first_party_sets.mojom-blink-test-utils.h" |
| #include "mojo/public/cpp/bindings/lib/wtf_serialization.h" |
| |
| |
| namespace network::mojom::blink { |
| SiteIndex::SiteIndex() |
| : value() {} |
| |
| SiteIndex::SiteIndex( |
| uint32_t value_in) |
| : value(std::move(value_in)) {} |
| |
| SiteIndex::~SiteIndex() = default; |
| size_t SiteIndex::Hash(size_t seed) const { |
| seed = mojo::internal::WTFHash(seed, this->value); |
| return seed; |
| } |
| |
| void SiteIndex::WriteIntoTrace( |
| perfetto::TracedValue traced_context) const { |
| [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary(); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "value"), this->value, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type uint32_t>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| } |
| |
| bool SiteIndex::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| return Data_::Validate(data, validation_context); |
| } |
| FirstPartySetEntry::FirstPartySetEntry() |
| : primary(), |
| site_type(), |
| site_index() {} |
| |
| FirstPartySetEntry::FirstPartySetEntry( |
| const ::blink::BlinkSchemefulSite& primary_in, |
| SiteType site_type_in, |
| SiteIndexPtr site_index_in) |
| : primary(std::move(primary_in)), |
| site_type(std::move(site_type_in)), |
| site_index(std::move(site_index_in)) {} |
| |
| FirstPartySetEntry::~FirstPartySetEntry() = default; |
| |
| void FirstPartySetEntry::WriteIntoTrace( |
| perfetto::TracedValue traced_context) const { |
| [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary(); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "primary"), this->primary, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type const ::blink::BlinkSchemefulSite&>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "site_type"), this->site_type, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type SiteType>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "site_index"), this->site_index, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type SiteIndexPtr>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| } |
| |
| bool FirstPartySetEntry::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| return Data_::Validate(data, validation_context); |
| } |
| FirstPartySetMetadata::FirstPartySetMetadata() |
| : frame_entry(), |
| top_frame_entry() {} |
| |
| FirstPartySetMetadata::FirstPartySetMetadata( |
| FirstPartySetEntryPtr frame_entry_in, |
| FirstPartySetEntryPtr top_frame_entry_in) |
| : frame_entry(std::move(frame_entry_in)), |
| top_frame_entry(std::move(top_frame_entry_in)) {} |
| |
| FirstPartySetMetadata::~FirstPartySetMetadata() = default; |
| |
| void FirstPartySetMetadata::WriteIntoTrace( |
| perfetto::TracedValue traced_context) const { |
| [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary(); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "frame_entry"), this->frame_entry, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type FirstPartySetEntryPtr>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "top_frame_entry"), this->top_frame_entry, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type FirstPartySetEntryPtr>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| } |
| |
| bool FirstPartySetMetadata::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| return Data_::Validate(data, validation_context); |
| } |
| FirstPartySetEntryOverride::FirstPartySetEntryOverride() |
| : entry() {} |
| |
| FirstPartySetEntryOverride::FirstPartySetEntryOverride( |
| FirstPartySetEntryPtr entry_in) |
| : entry(std::move(entry_in)) {} |
| |
| FirstPartySetEntryOverride::~FirstPartySetEntryOverride() = default; |
| |
| void FirstPartySetEntryOverride::WriteIntoTrace( |
| perfetto::TracedValue traced_context) const { |
| [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary(); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "entry"), this->entry, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type FirstPartySetEntryPtr>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| } |
| |
| bool FirstPartySetEntryOverride::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| return Data_::Validate(data, validation_context); |
| } |
| FirstPartySetsContextConfig::FirstPartySetsContextConfig() |
| : customizations() {} |
| |
| FirstPartySetsContextConfig::FirstPartySetsContextConfig( |
| WTF::HashMap<::blink::BlinkSchemefulSite, FirstPartySetEntryOverridePtr> customizations_in) |
| : customizations(std::move(customizations_in)) {} |
| |
| FirstPartySetsContextConfig::~FirstPartySetsContextConfig() = default; |
| |
| void FirstPartySetsContextConfig::WriteIntoTrace( |
| perfetto::TracedValue traced_context) const { |
| [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary(); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "customizations"), this->customizations, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type WTF::HashMap<::blink::BlinkSchemefulSite, FirstPartySetEntryOverridePtr>>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| } |
| |
| bool FirstPartySetsContextConfig::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| return Data_::Validate(data, validation_context); |
| } |
| FirstPartySetsCacheFilter::FirstPartySetsCacheFilter() |
| : filter(), |
| browser_run_id(0) {} |
| |
| FirstPartySetsCacheFilter::FirstPartySetsCacheFilter( |
| const WTF::HashMap<::blink::BlinkSchemefulSite, int64_t>& filter_in, |
| int64_t browser_run_id_in) |
| : filter(std::move(filter_in)), |
| browser_run_id(std::move(browser_run_id_in)) {} |
| |
| FirstPartySetsCacheFilter::~FirstPartySetsCacheFilter() = default; |
| |
| void FirstPartySetsCacheFilter::WriteIntoTrace( |
| perfetto::TracedValue traced_context) const { |
| [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary(); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "filter"), this->filter, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type const WTF::HashMap<::blink::BlinkSchemefulSite, int64_t>&>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "browser_run_id"), this->browser_run_id, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type int64_t>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| } |
| |
| bool FirstPartySetsCacheFilter::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| return Data_::Validate(data, validation_context); |
| } |
| GlobalFirstPartySets::GlobalFirstPartySets() |
| : public_sets_version(), |
| sets(), |
| aliases(), |
| manual_config(), |
| manual_aliases() {} |
| |
| GlobalFirstPartySets::GlobalFirstPartySets( |
| const ::base::Version& public_sets_version_in, |
| WTF::HashMap<::blink::BlinkSchemefulSite, FirstPartySetEntryPtr> sets_in, |
| const WTF::HashMap<::blink::BlinkSchemefulSite, ::blink::BlinkSchemefulSite>& aliases_in, |
| FirstPartySetsContextConfigPtr manual_config_in, |
| const WTF::HashMap<::blink::BlinkSchemefulSite, ::blink::BlinkSchemefulSite>& manual_aliases_in) |
| : public_sets_version(std::move(public_sets_version_in)), |
| sets(std::move(sets_in)), |
| aliases(std::move(aliases_in)), |
| manual_config(std::move(manual_config_in)), |
| manual_aliases(std::move(manual_aliases_in)) {} |
| |
| GlobalFirstPartySets::~GlobalFirstPartySets() = default; |
| |
| void GlobalFirstPartySets::WriteIntoTrace( |
| perfetto::TracedValue traced_context) const { |
| [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary(); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "public_sets_version"), this->public_sets_version, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type const ::base::Version&>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "sets"), this->sets, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type WTF::HashMap<::blink::BlinkSchemefulSite, FirstPartySetEntryPtr>>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "aliases"), this->aliases, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type const WTF::HashMap<::blink::BlinkSchemefulSite, ::blink::BlinkSchemefulSite>&>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "manual_config"), this->manual_config, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type FirstPartySetsContextConfigPtr>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| perfetto::WriteIntoTracedValueWithFallback( |
| dict.AddItem( |
| "manual_aliases"), this->manual_aliases, |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| "<value of type const WTF::HashMap<::blink::BlinkSchemefulSite, ::blink::BlinkSchemefulSite>&>" |
| #else |
| "<value>" |
| #endif // BUILDFLAG(MOJO_TRACE_ENABLED) |
| ); |
| } |
| |
| bool GlobalFirstPartySets::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| return Data_::Validate(data, validation_context); |
| } |
| |
| |
| } // network::mojom::blink |
| |
| |
| namespace mojo { |
| |
| |
| // static |
| bool StructTraits<::network::mojom::blink::SiteIndex::DataView, ::network::mojom::blink::SiteIndexPtr>::Read( |
| ::network::mojom::blink::SiteIndex::DataView input, |
| ::network::mojom::blink::SiteIndexPtr* output) { |
| bool success = true; |
| ::network::mojom::blink::SiteIndexPtr result(::network::mojom::blink::SiteIndex::New()); |
| |
| if (success) |
| result->value = input.value(); |
| *output = std::move(result); |
| return success; |
| } |
| |
| |
| // static |
| bool StructTraits<::network::mojom::blink::FirstPartySetEntry::DataView, ::network::mojom::blink::FirstPartySetEntryPtr>::Read( |
| ::network::mojom::blink::FirstPartySetEntry::DataView input, |
| ::network::mojom::blink::FirstPartySetEntryPtr* output) { |
| bool success = true; |
| ::network::mojom::blink::FirstPartySetEntryPtr result(::network::mojom::blink::FirstPartySetEntry::New()); |
| |
| if (success && !input.ReadPrimary(&result->primary)) |
| success = false; |
| if (success && !input.ReadSiteType(&result->site_type)) |
| success = false; |
| if (success && !input.ReadSiteIndex(&result->site_index)) |
| success = false; |
| *output = std::move(result); |
| return success; |
| } |
| |
| |
| // static |
| bool StructTraits<::network::mojom::blink::FirstPartySetMetadata::DataView, ::network::mojom::blink::FirstPartySetMetadataPtr>::Read( |
| ::network::mojom::blink::FirstPartySetMetadata::DataView input, |
| ::network::mojom::blink::FirstPartySetMetadataPtr* output) { |
| bool success = true; |
| ::network::mojom::blink::FirstPartySetMetadataPtr result(::network::mojom::blink::FirstPartySetMetadata::New()); |
| |
| if (success && !input.ReadFrameEntry(&result->frame_entry)) |
| success = false; |
| if (success && !input.ReadTopFrameEntry(&result->top_frame_entry)) |
| success = false; |
| *output = std::move(result); |
| return success; |
| } |
| |
| |
| // static |
| bool StructTraits<::network::mojom::blink::FirstPartySetEntryOverride::DataView, ::network::mojom::blink::FirstPartySetEntryOverridePtr>::Read( |
| ::network::mojom::blink::FirstPartySetEntryOverride::DataView input, |
| ::network::mojom::blink::FirstPartySetEntryOverridePtr* output) { |
| bool success = true; |
| ::network::mojom::blink::FirstPartySetEntryOverridePtr result(::network::mojom::blink::FirstPartySetEntryOverride::New()); |
| |
| if (success && !input.ReadEntry(&result->entry)) |
| success = false; |
| *output = std::move(result); |
| return success; |
| } |
| |
| |
| // static |
| bool StructTraits<::network::mojom::blink::FirstPartySetsContextConfig::DataView, ::network::mojom::blink::FirstPartySetsContextConfigPtr>::Read( |
| ::network::mojom::blink::FirstPartySetsContextConfig::DataView input, |
| ::network::mojom::blink::FirstPartySetsContextConfigPtr* output) { |
| bool success = true; |
| ::network::mojom::blink::FirstPartySetsContextConfigPtr result(::network::mojom::blink::FirstPartySetsContextConfig::New()); |
| |
| if (success && !input.ReadCustomizations(&result->customizations)) |
| success = false; |
| *output = std::move(result); |
| return success; |
| } |
| |
| |
| // static |
| bool StructTraits<::network::mojom::blink::FirstPartySetsCacheFilter::DataView, ::network::mojom::blink::FirstPartySetsCacheFilterPtr>::Read( |
| ::network::mojom::blink::FirstPartySetsCacheFilter::DataView input, |
| ::network::mojom::blink::FirstPartySetsCacheFilterPtr* output) { |
| bool success = true; |
| ::network::mojom::blink::FirstPartySetsCacheFilterPtr result(::network::mojom::blink::FirstPartySetsCacheFilter::New()); |
| |
| if (success && !input.ReadFilter(&result->filter)) |
| success = false; |
| if (success) |
| result->browser_run_id = input.browser_run_id(); |
| *output = std::move(result); |
| return success; |
| } |
| |
| |
| // static |
| bool StructTraits<::network::mojom::blink::GlobalFirstPartySets::DataView, ::network::mojom::blink::GlobalFirstPartySetsPtr>::Read( |
| ::network::mojom::blink::GlobalFirstPartySets::DataView input, |
| ::network::mojom::blink::GlobalFirstPartySetsPtr* output) { |
| bool success = true; |
| ::network::mojom::blink::GlobalFirstPartySetsPtr result(::network::mojom::blink::GlobalFirstPartySets::New()); |
| |
| if (success && !input.ReadPublicSetsVersion(&result->public_sets_version)) |
| success = false; |
| if (success && !input.ReadSets(&result->sets)) |
| success = false; |
| if (success && !input.ReadAliases(&result->aliases)) |
| success = false; |
| if (success && !input.ReadManualConfig(&result->manual_config)) |
| success = false; |
| if (success && !input.ReadManualAliases(&result->manual_aliases)) |
| success = false; |
| *output = std::move(result); |
| return success; |
| } |
| |
| } // namespace mojo |
| |
| |
| // Symbols declared in the -test-utils.h header are defined here instead of a |
| // separate .cc file to save compile time. |
| |
| |
| namespace network::mojom::blink { |
| |
| |
| |
| |
| } // network::mojom::blink |
| |
| |
| #if defined(__clang__) |
| #pragma clang diagnostic pop |
| #endif |