| // chromeos/ash/services/connectivity/public/mojom/passpoint.mojom-shared.cc is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2016 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include "chromeos/ash/services/connectivity/public/mojom/passpoint.mojom-shared.h" |
| |
| // Used to support stream output operator for enums. |
| // TODO(dcheng): Consider omitting this somehow if not needed. |
| #include <ostream> |
| #include <utility> |
| |
| #include "base/strings/stringprintf.h" |
| #include "mojo/public/cpp/bindings/lib/validate_params.h" |
| #include "mojo/public/cpp/bindings/lib/validation_errors.h" |
| #include "mojo/public/cpp/bindings/lib/validation_util.h" |
| #include "third_party/perfetto/include/perfetto/tracing/traced_value.h" |
| |
| #include "chromeos/ash/services/connectivity/public/mojom/passpoint.mojom-params-data.h" |
| namespace chromeos { |
| namespace connectivity { |
| namespace mojom { |
| |
| namespace internal { |
| |
| |
| // static |
| bool PasspointSubscription_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 56, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const PasspointSubscription_Data* object = |
| static_cast<const PasspointSubscription_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->id, 1, validation_context)) { |
| return false; |
| } |
| constexpr const mojo::internal::ContainerValidateParams& id_validate_params = |
| mojo::internal::GetArrayValidator<0, false, nullptr>(); |
| if (!mojo::internal::ValidateContainer(object->id, validation_context, |
| &id_validate_params)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->domains, 2, validation_context)) { |
| return false; |
| } |
| constexpr const mojo::internal::ContainerValidateParams& domains_validate_params = |
| mojo::internal::GetArrayValidator<0, false, &mojo::internal::GetArrayValidator<0, false, nullptr>()>(); |
| if (!mojo::internal::ValidateContainer(object->domains, validation_context, |
| &domains_validate_params)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->friendly_name, 3, validation_context)) { |
| return false; |
| } |
| constexpr const mojo::internal::ContainerValidateParams& friendly_name_validate_params = |
| mojo::internal::GetArrayValidator<0, false, nullptr>(); |
| if (!mojo::internal::ValidateContainer(object->friendly_name, validation_context, |
| &friendly_name_validate_params)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->provisioning_source, 4, validation_context)) { |
| return false; |
| } |
| constexpr const mojo::internal::ContainerValidateParams& provisioning_source_validate_params = |
| mojo::internal::GetArrayValidator<0, false, nullptr>(); |
| if (!mojo::internal::ValidateContainer(object->provisioning_source, validation_context, |
| &provisioning_source_validate_params)) { |
| return false; |
| } |
| |
| constexpr const mojo::internal::ContainerValidateParams& trusted_ca_validate_params = |
| mojo::internal::GetArrayValidator<0, false, nullptr>(); |
| if (!mojo::internal::ValidateContainer(object->trusted_ca, validation_context, |
| &trusted_ca_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| PasspointSubscription_Data::PasspointSubscription_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool PasspointEventsListener_OnPasspointSubscriptionAdded_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const PasspointEventsListener_OnPasspointSubscriptionAdded_Params_Data* object = |
| static_cast<const PasspointEventsListener_OnPasspointSubscriptionAdded_Params_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->subscription, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->subscription, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| PasspointEventsListener_OnPasspointSubscriptionAdded_Params_Data::PasspointEventsListener_OnPasspointSubscriptionAdded_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool PasspointEventsListener_OnPasspointSubscriptionRemoved_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const PasspointEventsListener_OnPasspointSubscriptionRemoved_Params_Data* object = |
| static_cast<const PasspointEventsListener_OnPasspointSubscriptionRemoved_Params_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->subscription, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->subscription, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| PasspointEventsListener_OnPasspointSubscriptionRemoved_Params_Data::PasspointEventsListener_OnPasspointSubscriptionRemoved_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool PasspointService_GetPasspointSubscription_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const PasspointService_GetPasspointSubscription_Params_Data* object = |
| static_cast<const PasspointService_GetPasspointSubscription_Params_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->id, 1, validation_context)) { |
| return false; |
| } |
| constexpr const mojo::internal::ContainerValidateParams& id_validate_params = |
| mojo::internal::GetArrayValidator<0, false, nullptr>(); |
| if (!mojo::internal::ValidateContainer(object->id, validation_context, |
| &id_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| PasspointService_GetPasspointSubscription_Params_Data::PasspointService_GetPasspointSubscription_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool PasspointService_GetPasspointSubscription_ResponseParams_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const PasspointService_GetPasspointSubscription_ResponseParams_Data* object = |
| static_cast<const PasspointService_GetPasspointSubscription_ResponseParams_Data*>(data); |
| |
| if (!mojo::internal::ValidateStruct(object->result, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| PasspointService_GetPasspointSubscription_ResponseParams_Data::PasspointService_GetPasspointSubscription_ResponseParams_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool PasspointService_ListPasspointSubscriptions_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 8, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const PasspointService_ListPasspointSubscriptions_Params_Data* object = |
| static_cast<const PasspointService_ListPasspointSubscriptions_Params_Data*>(data); |
| |
| return true; |
| } |
| |
| PasspointService_ListPasspointSubscriptions_Params_Data::PasspointService_ListPasspointSubscriptions_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool PasspointService_ListPasspointSubscriptions_ResponseParams_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const PasspointService_ListPasspointSubscriptions_ResponseParams_Data* object = |
| static_cast<const PasspointService_ListPasspointSubscriptions_ResponseParams_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->result, 1, validation_context)) { |
| return false; |
| } |
| constexpr const mojo::internal::ContainerValidateParams& result_validate_params = |
| mojo::internal::GetArrayValidator<0, false, nullptr>(); |
| if (!mojo::internal::ValidateContainer(object->result, validation_context, |
| &result_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| PasspointService_ListPasspointSubscriptions_ResponseParams_Data::PasspointService_ListPasspointSubscriptions_ResponseParams_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool PasspointService_DeletePasspointSubscription_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const PasspointService_DeletePasspointSubscription_Params_Data* object = |
| static_cast<const PasspointService_DeletePasspointSubscription_Params_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->id, 1, validation_context)) { |
| return false; |
| } |
| constexpr const mojo::internal::ContainerValidateParams& id_validate_params = |
| mojo::internal::GetArrayValidator<0, false, nullptr>(); |
| if (!mojo::internal::ValidateContainer(object->id, validation_context, |
| &id_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| PasspointService_DeletePasspointSubscription_Params_Data::PasspointService_DeletePasspointSubscription_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool PasspointService_DeletePasspointSubscription_ResponseParams_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const PasspointService_DeletePasspointSubscription_ResponseParams_Data* object = |
| static_cast<const PasspointService_DeletePasspointSubscription_ResponseParams_Data*>(data); |
| |
| return true; |
| } |
| |
| PasspointService_DeletePasspointSubscription_ResponseParams_Data::PasspointService_DeletePasspointSubscription_ResponseParams_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool PasspointService_RegisterPasspointListener_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const PasspointService_RegisterPasspointListener_Params_Data* object = |
| static_cast<const PasspointService_RegisterPasspointListener_Params_Data*>(data); |
| |
| if (!mojo::internal::ValidateHandleOrInterfaceNonNullable( |
| object->listener, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateHandleOrInterface(object->listener, |
| validation_context)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| PasspointService_RegisterPasspointListener_Params_Data::PasspointService_RegisterPasspointListener_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| } // namespace internal |
| } // namespace mojom |
| } // namespace connectivity |
| } // namespace chromeos |