| // 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 "services/ui/public/interfaces/window_tree.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 ui { |
| namespace mojom { |
| |
| namespace internal { |
| |
| |
| // static |
| bool WindowTree_NewWindow_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 WindowTree_NewWindow_Params_Data* object = static_cast<const WindowTree_NewWindow_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; |
| } |
| |
| const mojo::internal::ContainerValidateParams properties_validate_params( |
| new mojo::internal::ContainerValidateParams(0, false, new mojo::internal::ContainerValidateParams(0, false, nullptr)), new mojo::internal::ContainerValidateParams(0, false, new mojo::internal::ContainerValidateParams(0, false, nullptr))); |
| if (!mojo::internal::ValidateContainer(object->properties, validation_context, |
| &properties_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_NewTopLevelWindow_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 WindowTree_NewTopLevelWindow_Params_Data* object = static_cast<const WindowTree_NewTopLevelWindow_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->properties, "null properties field in WindowTree_NewTopLevelWindow_Params", |
| validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams properties_validate_params( |
| new mojo::internal::ContainerValidateParams(0, false, new mojo::internal::ContainerValidateParams(0, false, nullptr)), new mojo::internal::ContainerValidateParams(0, false, new mojo::internal::ContainerValidateParams(0, false, nullptr))); |
| if (!mojo::internal::ValidateContainer(object->properties, validation_context, |
| &properties_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_DeleteWindow_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 WindowTree_DeleteWindow_Params_Data* object = static_cast<const WindowTree_DeleteWindow_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetCapture_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 WindowTree_SetCapture_Params_Data* object = static_cast<const WindowTree_SetCapture_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_ReleaseCapture_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 WindowTree_ReleaseCapture_Params_Data* object = static_cast<const WindowTree_ReleaseCapture_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_StartPointerWatcher_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 WindowTree_StartPointerWatcher_Params_Data* object = static_cast<const WindowTree_StartPointerWatcher_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_StopPointerWatcher_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 WindowTree_StopPointerWatcher_Params_Data* object = static_cast<const WindowTree_StopPointerWatcher_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetWindowBounds_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 WindowTree_SetWindowBounds_Params_Data* object = static_cast<const WindowTree_SetWindowBounds_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->bounds, "null bounds field in WindowTree_SetWindowBounds_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->bounds, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidateStruct(object->local_surface_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetClientArea_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 WindowTree_SetClientArea_Params_Data* object = static_cast<const WindowTree_SetClientArea_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->insets, "null insets field in WindowTree_SetClientArea_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->insets, validation_context)) |
| return false; |
| |
| const mojo::internal::ContainerValidateParams additional_client_areas_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->additional_client_areas, validation_context, |
| &additional_client_areas_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetHitTestMask_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 WindowTree_SetHitTestMask_Params_Data* object = static_cast<const WindowTree_SetHitTestMask_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->mask, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetCanAcceptDrops_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 WindowTree_SetCanAcceptDrops_Params_Data* object = static_cast<const WindowTree_SetCanAcceptDrops_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetWindowVisibility_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 WindowTree_SetWindowVisibility_Params_Data* object = static_cast<const WindowTree_SetWindowVisibility_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; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetWindowProperty_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 WindowTree_SetWindowProperty_Params_Data* object = static_cast<const WindowTree_SetWindowProperty_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->name, "null name field in WindowTree_SetWindowProperty_Params", |
| validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams name_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->name, validation_context, |
| &name_validate_params)) { |
| return false; |
| } |
| |
| const mojo::internal::ContainerValidateParams value_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->value, validation_context, |
| &value_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetWindowOpacity_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 WindowTree_SetWindowOpacity_Params_Data* object = static_cast<const WindowTree_SetWindowOpacity_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; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_AttachCompositorFrameSink_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 WindowTree_AttachCompositorFrameSink_Params_Data* object = static_cast<const WindowTree_AttachCompositorFrameSink_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::ValidateHandleOrInterfaceNonNullable( |
| object->compositor_frame_sink, |
| "invalid compositor_frame_sink field in WindowTree_AttachCompositorFrameSink_Params", validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateHandleOrInterface(object->compositor_frame_sink, |
| validation_context)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidateHandleOrInterfaceNonNullable( |
| object->client, |
| "invalid client field in WindowTree_AttachCompositorFrameSink_Params", validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateHandleOrInterface(object->client, |
| validation_context)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_AddWindow_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 WindowTree_AddWindow_Params_Data* object = static_cast<const WindowTree_AddWindow_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; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_RemoveWindowFromParent_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 WindowTree_RemoveWindowFromParent_Params_Data* object = static_cast<const WindowTree_RemoveWindowFromParent_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_AddTransientWindow_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 WindowTree_AddTransientWindow_Params_Data* object = static_cast<const WindowTree_AddTransientWindow_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; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_RemoveTransientWindowFromParent_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 WindowTree_RemoveTransientWindowFromParent_Params_Data* object = static_cast<const WindowTree_RemoveTransientWindowFromParent_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetModalType_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 WindowTree_SetModalType_Params_Data* object = static_cast<const WindowTree_SetModalType_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 (!::ui::mojom::internal::ModalType_Data |
| ::Validate(object->type, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_ReorderWindow_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 WindowTree_ReorderWindow_Params_Data* object = static_cast<const WindowTree_ReorderWindow_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 (!::ui::mojom::internal::OrderDirection_Data |
| ::Validate(object->direction, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_GetWindowTree_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 WindowTree_GetWindowTree_Params_Data* object = static_cast<const WindowTree_GetWindowTree_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_GetWindowTree_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 WindowTree_GetWindowTree_ResponseParams_Data* object = static_cast<const WindowTree_GetWindowTree_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; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->windows, "null windows field in WindowTree_GetWindowTree_ResponseParams", |
| validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams windows_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->windows, validation_context, |
| &windows_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_Embed_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 WindowTree_Embed_Params_Data* object = static_cast<const WindowTree_Embed_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::ValidateHandleOrInterfaceNonNullable( |
| object->client, |
| "invalid client field in WindowTree_Embed_Params", validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateHandleOrInterface(object->client, |
| validation_context)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_Embed_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 WindowTree_Embed_ResponseParams_Data* object = static_cast<const WindowTree_Embed_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetFocus_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 WindowTree_SetFocus_Params_Data* object = static_cast<const WindowTree_SetFocus_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetCanFocus_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 WindowTree_SetCanFocus_Params_Data* object = static_cast<const WindowTree_SetCanFocus_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetCursor_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 WindowTree_SetCursor_Params_Data* object = static_cast<const WindowTree_SetCursor_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->cursor, "null cursor field in WindowTree_SetCursor_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->cursor, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetWindowTextInputState_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 WindowTree_SetWindowTextInputState_Params_Data* object = static_cast<const WindowTree_SetWindowTextInputState_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->state, "null state field in WindowTree_SetWindowTextInputState_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->state, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetImeVisibility_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 WindowTree_SetImeVisibility_Params_Data* object = static_cast<const WindowTree_SetImeVisibility_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->state, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_SetEventTargetingPolicy_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 WindowTree_SetEventTargetingPolicy_Params_Data* object = static_cast<const WindowTree_SetEventTargetingPolicy_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 (!::ui::mojom::internal::EventTargetingPolicy_Data |
| ::Validate(object->policy, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_OnWindowInputEventAck_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 WindowTree_OnWindowInputEventAck_Params_Data* object = static_cast<const WindowTree_OnWindowInputEventAck_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 (!::ui::mojom::internal::EventResult_Data |
| ::Validate(object->result, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_DeactivateWindow_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 WindowTree_DeactivateWindow_Params_Data* object = static_cast<const WindowTree_DeactivateWindow_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_StackAbove_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 WindowTree_StackAbove_Params_Data* object = static_cast<const WindowTree_StackAbove_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; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_StackAtTop_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 WindowTree_StackAtTop_Params_Data* object = static_cast<const WindowTree_StackAtTop_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_GetWindowManagerClient_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 WindowTree_GetWindowManagerClient_Params_Data* object = static_cast<const WindowTree_GetWindowManagerClient_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->internal, |
| "invalid internal field in WindowTree_GetWindowManagerClient_Params", validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateHandleOrInterface(object->internal, |
| validation_context)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_GetCursorLocationMemory_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 WindowTree_GetCursorLocationMemory_Params_Data* object = static_cast<const WindowTree_GetCursorLocationMemory_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_GetCursorLocationMemory_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 WindowTree_GetCursorLocationMemory_ResponseParams_Data* object = static_cast<const WindowTree_GetCursorLocationMemory_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; |
| } |
| |
| if (!mojo::internal::ValidateHandleOrInterfaceNonNullable( |
| object->cursor_buffer, |
| "invalid cursor_buffer field in WindowTree_GetCursorLocationMemory_ResponseParams", validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateHandleOrInterface(object->cursor_buffer, |
| validation_context)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_PerformWindowMove_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 WindowTree_PerformWindowMove_Params_Data* object = static_cast<const WindowTree_PerformWindowMove_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 (!::ui::mojom::internal::MoveLoopSource_Data |
| ::Validate(object->source, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->cursor, "null cursor field in WindowTree_PerformWindowMove_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->cursor, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_CancelWindowMove_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 WindowTree_CancelWindowMove_Params_Data* object = static_cast<const WindowTree_CancelWindowMove_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_PerformDragDrop_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 WindowTree_PerformDragDrop_Params_Data* object = static_cast<const WindowTree_PerformDragDrop_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 56 }}; |
| |
| 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->screen_location, "null screen_location field in WindowTree_PerformDragDrop_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->screen_location, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->drag_data, "null drag_data field in WindowTree_PerformDragDrop_Params", |
| validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams drag_data_validate_params( |
| new mojo::internal::ContainerValidateParams(0, false, new mojo::internal::ContainerValidateParams(0, false, nullptr)), new mojo::internal::ContainerValidateParams(0, false, new mojo::internal::ContainerValidateParams(0, false, nullptr))); |
| if (!mojo::internal::ValidateContainer(object->drag_data, validation_context, |
| &drag_data_validate_params)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidateStruct(object->drag_image, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->drag_image_offset, "null drag_image_offset field in WindowTree_PerformDragDrop_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->drag_image_offset, validation_context)) |
| return false; |
| |
| |
| if (!::ui::mojom::internal::PointerKind_Data |
| ::Validate(object->source, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTree_CancelDragDrop_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 WindowTree_CancelDragDrop_Params_Data* object = static_cast<const WindowTree_CancelDragDrop_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnEmbed_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 WindowTreeClient_OnEmbed_Params_Data* object = static_cast<const WindowTreeClient_OnEmbed_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 56 }}; |
| |
| 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->root, "null root field in WindowTreeClient_OnEmbed_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->root, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidateHandleOrInterface(object->tree, |
| validation_context)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->frame_sink_id, "null frame_sink_id field in WindowTreeClient_OnEmbed_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->frame_sink_id, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidateStruct(object->local_surface_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnEmbeddedAppDisconnected_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 WindowTreeClient_OnEmbeddedAppDisconnected_Params_Data* object = static_cast<const WindowTreeClient_OnEmbeddedAppDisconnected_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnUnembed_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 WindowTreeClient_OnUnembed_Params_Data* object = static_cast<const WindowTreeClient_OnUnembed_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnCaptureChanged_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 WindowTreeClient_OnCaptureChanged_Params_Data* object = static_cast<const WindowTreeClient_OnCaptureChanged_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnFrameSinkIdAllocated_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 WindowTreeClient_OnFrameSinkIdAllocated_Params_Data* object = static_cast<const WindowTreeClient_OnFrameSinkIdAllocated_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->frame_sink_id, "null frame_sink_id field in WindowTreeClient_OnFrameSinkIdAllocated_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->frame_sink_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnTopLevelCreated_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 WindowTreeClient_OnTopLevelCreated_Params_Data* object = static_cast<const WindowTreeClient_OnTopLevelCreated_Params_Data*>(data); |
| |
| static constexpr struct { |
| uint32_t version; |
| uint32_t num_bytes; |
| } kVersionSizes[] = {{ 0, 48 }}; |
| |
| 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->data, "null data field in WindowTreeClient_OnTopLevelCreated_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->data, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->frame_sink_id, "null frame_sink_id field in WindowTreeClient_OnTopLevelCreated_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->frame_sink_id, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidateStruct(object->local_surface_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnWindowBoundsChanged_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 WindowTreeClient_OnWindowBoundsChanged_Params_Data* object = static_cast<const WindowTreeClient_OnWindowBoundsChanged_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->old_bounds, "null old_bounds field in WindowTreeClient_OnWindowBoundsChanged_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->old_bounds, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->new_bounds, "null new_bounds field in WindowTreeClient_OnWindowBoundsChanged_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->new_bounds, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidateStruct(object->local_surface_id, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnClientAreaChanged_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 WindowTreeClient_OnClientAreaChanged_Params_Data* object = static_cast<const WindowTreeClient_OnClientAreaChanged_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->new_client_area, "null new_client_area field in WindowTreeClient_OnClientAreaChanged_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->new_client_area, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->new_additional_client_areas, "null new_additional_client_areas field in WindowTreeClient_OnClientAreaChanged_Params", |
| validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams new_additional_client_areas_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->new_additional_client_areas, validation_context, |
| &new_additional_client_areas_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnTransientWindowAdded_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 WindowTreeClient_OnTransientWindowAdded_Params_Data* object = static_cast<const WindowTreeClient_OnTransientWindowAdded_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnTransientWindowRemoved_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 WindowTreeClient_OnTransientWindowRemoved_Params_Data* object = static_cast<const WindowTreeClient_OnTransientWindowRemoved_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnWindowHierarchyChanged_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 WindowTreeClient_OnWindowHierarchyChanged_Params_Data* object = static_cast<const WindowTreeClient_OnWindowHierarchyChanged_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->windows, "null windows field in WindowTreeClient_OnWindowHierarchyChanged_Params", |
| validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams windows_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->windows, validation_context, |
| &windows_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnWindowReordered_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 WindowTreeClient_OnWindowReordered_Params_Data* object = static_cast<const WindowTreeClient_OnWindowReordered_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 (!::ui::mojom::internal::OrderDirection_Data |
| ::Validate(object->direction, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnWindowDeleted_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 WindowTreeClient_OnWindowDeleted_Params_Data* object = static_cast<const WindowTreeClient_OnWindowDeleted_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnWindowVisibilityChanged_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 WindowTreeClient_OnWindowVisibilityChanged_Params_Data* object = static_cast<const WindowTreeClient_OnWindowVisibilityChanged_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnWindowOpacityChanged_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 WindowTreeClient_OnWindowOpacityChanged_Params_Data* object = static_cast<const WindowTreeClient_OnWindowOpacityChanged_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; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnWindowParentDrawnStateChanged_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 WindowTreeClient_OnWindowParentDrawnStateChanged_Params_Data* object = static_cast<const WindowTreeClient_OnWindowParentDrawnStateChanged_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnWindowSharedPropertyChanged_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 WindowTreeClient_OnWindowSharedPropertyChanged_Params_Data* object = static_cast<const WindowTreeClient_OnWindowSharedPropertyChanged_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->name, "null name field in WindowTreeClient_OnWindowSharedPropertyChanged_Params", |
| validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams name_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->name, validation_context, |
| &name_validate_params)) { |
| return false; |
| } |
| |
| const mojo::internal::ContainerValidateParams new_data_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->new_data, validation_context, |
| &new_data_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnWindowInputEvent_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 WindowTreeClient_OnWindowInputEvent_Params_Data* object = static_cast<const WindowTreeClient_OnWindowInputEvent_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->event, "null event field in WindowTreeClient_OnWindowInputEvent_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->event, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnPointerEventObserved_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 WindowTreeClient_OnPointerEventObserved_Params_Data* object = static_cast<const WindowTreeClient_OnPointerEventObserved_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->event, "null event field in WindowTreeClient_OnPointerEventObserved_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->event, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnWindowFocused_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 WindowTreeClient_OnWindowFocused_Params_Data* object = static_cast<const WindowTreeClient_OnWindowFocused_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnWindowCursorChanged_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 WindowTreeClient_OnWindowCursorChanged_Params_Data* object = static_cast<const WindowTreeClient_OnWindowCursorChanged_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->cursor, "null cursor field in WindowTreeClient_OnWindowCursorChanged_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->cursor, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnWindowSurfaceChanged_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 WindowTreeClient_OnWindowSurfaceChanged_Params_Data* object = static_cast<const WindowTreeClient_OnWindowSurfaceChanged_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->surface_info, "null surface_info field in WindowTreeClient_OnWindowSurfaceChanged_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->surface_info, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnDragDropStart_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 WindowTreeClient_OnDragDropStart_Params_Data* object = static_cast<const WindowTreeClient_OnDragDropStart_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->drag_data, "null drag_data field in WindowTreeClient_OnDragDropStart_Params", |
| validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams drag_data_validate_params( |
| new mojo::internal::ContainerValidateParams(0, false, new mojo::internal::ContainerValidateParams(0, false, nullptr)), new mojo::internal::ContainerValidateParams(0, false, new mojo::internal::ContainerValidateParams(0, false, nullptr))); |
| if (!mojo::internal::ValidateContainer(object->drag_data, validation_context, |
| &drag_data_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnDragEnter_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 WindowTreeClient_OnDragEnter_Params_Data* object = static_cast<const WindowTreeClient_OnDragEnter_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->screen_position, "null screen_position field in WindowTreeClient_OnDragEnter_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->screen_position, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnDragEnter_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 WindowTreeClient_OnDragEnter_ResponseParams_Data* object = static_cast<const WindowTreeClient_OnDragEnter_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnDragOver_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 WindowTreeClient_OnDragOver_Params_Data* object = static_cast<const WindowTreeClient_OnDragOver_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->screen_position, "null screen_position field in WindowTreeClient_OnDragOver_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->screen_position, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnDragOver_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 WindowTreeClient_OnDragOver_ResponseParams_Data* object = static_cast<const WindowTreeClient_OnDragOver_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnDragLeave_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 WindowTreeClient_OnDragLeave_Params_Data* object = static_cast<const WindowTreeClient_OnDragLeave_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnCompleteDrop_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 WindowTreeClient_OnCompleteDrop_Params_Data* object = static_cast<const WindowTreeClient_OnCompleteDrop_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->screen_position, "null screen_position field in WindowTreeClient_OnCompleteDrop_Params", |
| validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->screen_position, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnCompleteDrop_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 WindowTreeClient_OnCompleteDrop_ResponseParams_Data* object = static_cast<const WindowTreeClient_OnCompleteDrop_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnPerformDragDropCompleted_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 WindowTreeClient_OnPerformDragDropCompleted_Params_Data* object = static_cast<const WindowTreeClient_OnPerformDragDropCompleted_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; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnDragDropDone_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 WindowTreeClient_OnDragDropDone_Params_Data* object = static_cast<const WindowTreeClient_OnDragDropDone_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_OnChangeCompleted_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 WindowTreeClient_OnChangeCompleted_Params_Data* object = static_cast<const WindowTreeClient_OnChangeCompleted_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_RequestClose_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 WindowTreeClient_RequestClose_Params_Data* object = static_cast<const WindowTreeClient_RequestClose_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; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeClient_GetWindowManager_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 WindowTreeClient_GetWindowManager_Params_Data* object = static_cast<const WindowTreeClient_GetWindowManager_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->internal, |
| "invalid internal field in WindowTreeClient_GetWindowManager_Params", validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateHandleOrInterface(object->internal, |
| validation_context)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| |
| // static |
| bool WindowTreeFactory_CreateWindowTree_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 WindowTreeFactory_CreateWindowTree_Params_Data* object = static_cast<const WindowTreeFactory_CreateWindowTree_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::ValidateHandleOrInterfaceNonNullable( |
| object->tree_request, |
| "invalid tree_request field in WindowTreeFactory_CreateWindowTree_Params", validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateHandleOrInterface(object->tree_request, |
| validation_context)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidateHandleOrInterfaceNonNullable( |
| object->client, |
| "invalid client field in WindowTreeFactory_CreateWindowTree_Params", validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateHandleOrInterface(object->client, |
| validation_context)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| |
| } // namespace internal |
| } // namespace mojom |
| } // namespace ui |
| |
| #if defined(_MSC_VER) |
| #pragma warning(pop) |
| #endif |