| // Copyright 2016 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #if defined(_MSC_VER) |
| #pragma warning(push) |
| #pragma warning(disable:4065) |
| #endif |
| |
| #include "ash/public/interfaces/login_screen.mojom-shared.h" |
| |
| #include <utility> |
| |
| #include "base/logging.h" |
| #include "mojo/public/cpp/bindings/lib/validate_params.h" |
| #include "mojo/public/cpp/bindings/lib/validation_context.h" |
| #include "mojo/public/cpp/bindings/lib/validation_errors.h" |
| #include "mojo/public/cpp/bindings/lib/validation_util.h" |
| namespace ash { |
| namespace mojom { |
| |
| namespace internal { |
| |
| |
| // static |
| bool LoginScreen_SetClient_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_SetClient_Params_Data* object = static_cast<const LoginScreen_SetClient_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidateHandleOrInterfaceNonNullable( |
| object->client, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateHandleOrInterface(object->client, |
| validation_context)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_SetClient_Params_Data::LoginScreen_SetClient_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_ShowLockScreen_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_ShowLockScreen_Params_Data* object = static_cast<const LoginScreen_ShowLockScreen_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 8 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_ShowLockScreen_Params_Data::LoginScreen_ShowLockScreen_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_ShowLockScreen_ResponseParams_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_ShowLockScreen_ResponseParams_Data* object = static_cast<const LoginScreen_ShowLockScreen_ResponseParams_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_ShowLockScreen_ResponseParams_Data::LoginScreen_ShowLockScreen_ResponseParams_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_ShowLoginScreen_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_ShowLoginScreen_Params_Data* object = static_cast<const LoginScreen_ShowLoginScreen_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 8 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_ShowLoginScreen_Params_Data::LoginScreen_ShowLoginScreen_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_ShowLoginScreen_ResponseParams_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_ShowLoginScreen_ResponseParams_Data* object = static_cast<const LoginScreen_ShowLoginScreen_ResponseParams_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_ShowLoginScreen_ResponseParams_Data::LoginScreen_ShowLoginScreen_ResponseParams_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_ShowErrorMessage_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_ShowErrorMessage_Params_Data* object = static_cast<const LoginScreen_ShowErrorMessage_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 32 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->error_text, 2, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams error_text_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->error_text, validation_context, |
| &error_text_validate_params)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->help_link_text, 3, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams help_link_text_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->help_link_text, validation_context, |
| &help_link_text_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_ShowErrorMessage_Params_Data::LoginScreen_ShowErrorMessage_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_ClearErrors_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_ClearErrors_Params_Data* object = static_cast<const LoginScreen_ClearErrors_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 8 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_ClearErrors_Params_Data::LoginScreen_ClearErrors_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_ShowUserPodCustomIcon_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_ShowUserPodCustomIcon_Params_Data* object = static_cast<const LoginScreen_ShowUserPodCustomIcon_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 24 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->icon, 2, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->icon, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreen_ShowUserPodCustomIcon_Params_Data::LoginScreen_ShowUserPodCustomIcon_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_HideUserPodCustomIcon_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_HideUserPodCustomIcon_Params_Data* object = static_cast<const LoginScreen_HideUserPodCustomIcon_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreen_HideUserPodCustomIcon_Params_Data::LoginScreen_HideUserPodCustomIcon_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_SetAuthType_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_SetAuthType_Params_Data* object = static_cast<const LoginScreen_SetAuthType_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 32 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| |
| if (!::proximity_auth::mojom::internal::AuthType_Data |
| ::Validate(object->auth_type, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->initial_value, 3, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->initial_value, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreen_SetAuthType_Params_Data::LoginScreen_SetAuthType_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_LoadUsers_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_LoadUsers_Params_Data* object = static_cast<const LoginScreen_LoadUsers_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 24 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->users, 1, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams users_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->users, validation_context, |
| &users_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_LoadUsers_Params_Data::LoginScreen_LoadUsers_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_SetPinEnabledForUser_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_SetPinEnabledForUser_Params_Data* object = static_cast<const LoginScreen_SetPinEnabledForUser_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 24 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreen_SetPinEnabledForUser_Params_Data::LoginScreen_SetPinEnabledForUser_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_SetAvatarForUser_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_SetAvatarForUser_Params_Data* object = static_cast<const LoginScreen_SetAvatarForUser_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 24 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->avatar, 2, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->avatar, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreen_SetAvatarForUser_Params_Data::LoginScreen_SetAvatarForUser_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_SetAuthEnabledForUser_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_SetAuthEnabledForUser_Params_Data* object = static_cast<const LoginScreen_SetAuthEnabledForUser_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 32 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidateStruct(object->auth_reenabled_time, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreen_SetAuthEnabledForUser_Params_Data::LoginScreen_SetAuthEnabledForUser_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_HandleFocusLeavingLockScreenApps_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_HandleFocusLeavingLockScreenApps_Params_Data* object = static_cast<const LoginScreen_HandleFocusLeavingLockScreenApps_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_HandleFocusLeavingLockScreenApps_Params_Data::LoginScreen_HandleFocusLeavingLockScreenApps_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_SetDevChannelInfo_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_SetDevChannelInfo_Params_Data* object = static_cast<const LoginScreen_SetDevChannelInfo_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 32 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->os_version_label_text, 1, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams os_version_label_text_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->os_version_label_text, validation_context, |
| &os_version_label_text_validate_params)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->enterprise_info_text, 2, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams enterprise_info_text_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->enterprise_info_text, validation_context, |
| &enterprise_info_text_validate_params)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->bluetooth_name, 3, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams bluetooth_name_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->bluetooth_name, validation_context, |
| &bluetooth_name_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_SetDevChannelInfo_Params_Data::LoginScreen_SetDevChannelInfo_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_IsReadyForPassword_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_IsReadyForPassword_Params_Data* object = static_cast<const LoginScreen_IsReadyForPassword_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 8 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_IsReadyForPassword_Params_Data::LoginScreen_IsReadyForPassword_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_IsReadyForPassword_ResponseParams_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_IsReadyForPassword_ResponseParams_Data* object = static_cast<const LoginScreen_IsReadyForPassword_ResponseParams_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_IsReadyForPassword_ResponseParams_Data::LoginScreen_IsReadyForPassword_ResponseParams_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_SetPublicSessionDisplayName_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_SetPublicSessionDisplayName_Params_Data* object = static_cast<const LoginScreen_SetPublicSessionDisplayName_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 24 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->display_name, 2, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams display_name_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->display_name, validation_context, |
| &display_name_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_SetPublicSessionDisplayName_Params_Data::LoginScreen_SetPublicSessionDisplayName_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_SetPublicSessionLocales_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_SetPublicSessionLocales_Params_Data* object = static_cast<const LoginScreen_SetPublicSessionLocales_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 40 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->locales, 2, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams locales_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->locales, validation_context, |
| &locales_validate_params)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->default_locale, 3, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams default_locale_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->default_locale, validation_context, |
| &default_locale_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_SetPublicSessionLocales_Params_Data::LoginScreen_SetPublicSessionLocales_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_SetPublicSessionKeyboardLayouts_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_SetPublicSessionKeyboardLayouts_Params_Data* object = static_cast<const LoginScreen_SetPublicSessionKeyboardLayouts_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 32 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->locale, 2, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams locale_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->locale, validation_context, |
| &locale_validate_params)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->keyboard_layouts, 3, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams keyboard_layouts_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->keyboard_layouts, validation_context, |
| &keyboard_layouts_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_SetPublicSessionKeyboardLayouts_Params_Data::LoginScreen_SetPublicSessionKeyboardLayouts_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_SetFingerprintUnlockState_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_SetFingerprintUnlockState_Params_Data* object = static_cast<const LoginScreen_SetFingerprintUnlockState_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 24 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| |
| if (!::ash::mojom::internal::FingerprintUnlockState_Data |
| ::Validate(object->state, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreen_SetFingerprintUnlockState_Params_Data::LoginScreen_SetFingerprintUnlockState_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_SetKioskApps_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_SetKioskApps_Params_Data* object = static_cast<const LoginScreen_SetKioskApps_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->kiosk_apps, 1, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams kiosk_apps_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->kiosk_apps, validation_context, |
| &kiosk_apps_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_SetKioskApps_Params_Data::LoginScreen_SetKioskApps_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreen_NotifyOobeDialogVisibility_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreen_NotifyOobeDialogVisibility_Params_Data* object = static_cast<const LoginScreen_NotifyOobeDialogVisibility_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreen_NotifyOobeDialogVisibility_Params_Data::LoginScreen_NotifyOobeDialogVisibility_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_AuthenticateUser_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_AuthenticateUser_Params_Data* object = static_cast<const LoginScreenClient_AuthenticateUser_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 32 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->password, 2, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams password_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->password, validation_context, |
| &password_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreenClient_AuthenticateUser_Params_Data::LoginScreenClient_AuthenticateUser_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_AuthenticateUser_ResponseParams_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_AuthenticateUser_ResponseParams_Data* object = static_cast<const LoginScreenClient_AuthenticateUser_ResponseParams_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreenClient_AuthenticateUser_ResponseParams_Data::LoginScreenClient_AuthenticateUser_ResponseParams_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_AttemptUnlock_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_AttemptUnlock_Params_Data* object = static_cast<const LoginScreenClient_AttemptUnlock_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreenClient_AttemptUnlock_Params_Data::LoginScreenClient_AttemptUnlock_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_HardlockPod_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_HardlockPod_Params_Data* object = static_cast<const LoginScreenClient_HardlockPod_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreenClient_HardlockPod_Params_Data::LoginScreenClient_HardlockPod_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_RecordClickOnLockIcon_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_RecordClickOnLockIcon_Params_Data* object = static_cast<const LoginScreenClient_RecordClickOnLockIcon_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreenClient_RecordClickOnLockIcon_Params_Data::LoginScreenClient_RecordClickOnLockIcon_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_OnFocusPod_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_OnFocusPod_Params_Data* object = static_cast<const LoginScreenClient_OnFocusPod_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreenClient_OnFocusPod_Params_Data::LoginScreenClient_OnFocusPod_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_OnNoPodFocused_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_OnNoPodFocused_Params_Data* object = static_cast<const LoginScreenClient_OnNoPodFocused_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 8 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreenClient_OnNoPodFocused_Params_Data::LoginScreenClient_OnNoPodFocused_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_LoadWallpaper_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_LoadWallpaper_Params_Data* object = static_cast<const LoginScreenClient_LoadWallpaper_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreenClient_LoadWallpaper_Params_Data::LoginScreenClient_LoadWallpaper_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_SignOutUser_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_SignOutUser_Params_Data* object = static_cast<const LoginScreenClient_SignOutUser_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 8 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreenClient_SignOutUser_Params_Data::LoginScreenClient_SignOutUser_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_CancelAddUser_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_CancelAddUser_Params_Data* object = static_cast<const LoginScreenClient_CancelAddUser_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 8 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreenClient_CancelAddUser_Params_Data::LoginScreenClient_CancelAddUser_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_LoginAsGuest_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_LoginAsGuest_Params_Data* object = static_cast<const LoginScreenClient_LoginAsGuest_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 8 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreenClient_LoginAsGuest_Params_Data::LoginScreenClient_LoginAsGuest_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_OnMaxIncorrectPasswordAttempted_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_OnMaxIncorrectPasswordAttempted_Params_Data* object = static_cast<const LoginScreenClient_OnMaxIncorrectPasswordAttempted_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreenClient_OnMaxIncorrectPasswordAttempted_Params_Data::LoginScreenClient_OnMaxIncorrectPasswordAttempted_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_FocusLockScreenApps_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_FocusLockScreenApps_Params_Data* object = static_cast<const LoginScreenClient_FocusLockScreenApps_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreenClient_FocusLockScreenApps_Params_Data::LoginScreenClient_FocusLockScreenApps_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_ShowGaiaSignin_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_ShowGaiaSignin_Params_Data* object = static_cast<const LoginScreenClient_ShowGaiaSignin_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 24 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidateStruct(object->prefilled_account, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreenClient_ShowGaiaSignin_Params_Data::LoginScreenClient_ShowGaiaSignin_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_OnRemoveUserWarningShown_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_OnRemoveUserWarningShown_Params_Data* object = static_cast<const LoginScreenClient_OnRemoveUserWarningShown_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 8 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreenClient_OnRemoveUserWarningShown_Params_Data::LoginScreenClient_OnRemoveUserWarningShown_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_RemoveUser_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_RemoveUser_Params_Data* object = static_cast<const LoginScreenClient_RemoveUser_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| LoginScreenClient_RemoveUser_Params_Data::LoginScreenClient_RemoveUser_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_LaunchPublicSession_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_LaunchPublicSession_Params_Data* object = static_cast<const LoginScreenClient_LaunchPublicSession_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 32 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->locale, 2, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams locale_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->locale, validation_context, |
| &locale_validate_params)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->input_method, 3, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams input_method_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->input_method, validation_context, |
| &input_method_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreenClient_LaunchPublicSession_Params_Data::LoginScreenClient_LaunchPublicSession_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_RequestPublicSessionKeyboardLayouts_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_RequestPublicSessionKeyboardLayouts_Params_Data* object = static_cast<const LoginScreenClient_RequestPublicSessionKeyboardLayouts_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 24 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->account_id, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->account_id, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->locale, 2, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams locale_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->locale, validation_context, |
| &locale_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreenClient_RequestPublicSessionKeyboardLayouts_Params_Data::LoginScreenClient_RequestPublicSessionKeyboardLayouts_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_ShowFeedback_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_ShowFeedback_Params_Data* object = static_cast<const LoginScreenClient_ShowFeedback_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 8 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreenClient_ShowFeedback_Params_Data::LoginScreenClient_ShowFeedback_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool LoginScreenClient_LaunchKioskApp_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| |
| if (!ValidateStructHeaderAndClaimMemory(data, validation_context)) |
| return false; |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| const LoginScreenClient_LaunchKioskApp_Params_Data* object = static_cast<const LoginScreenClient_LaunchKioskApp_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 16 }}; |
| |
| if (object->header_.version <= |
| kVersionSizes[arraysize(kVersionSizes) - 1].version) { |
| // Scan in reverse order to optimize for more recent versions. |
| for (int i = arraysize(kVersionSizes) - 1; i >= 0; --i) { |
| if (object->header_.version >= kVersionSizes[i].version) { |
| if (object->header_.num_bytes == kVersionSizes[i].num_bytes) |
| break; |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| } |
| } else if (object->header_.num_bytes < |
| kVersionSizes[arraysize(kVersionSizes) - 1].num_bytes) { |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER); |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->app_id, 1, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams app_id_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->app_id, validation_context, |
| &app_id_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| LoginScreenClient_LaunchKioskApp_Params_Data::LoginScreenClient_LaunchKioskApp_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| } // namespace internal |
| } // namespace mojom |
| } // namespace ash |
| |
| #if defined(_MSC_VER) |
| #pragma warning(pop) |
| #endif |