// services/viz/privileged/mojom/compositing/display_private.mojom-shared.cc is auto generated by mojom_bindings_generator.py, do not edit

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "services/viz/privileged/mojom/compositing/display_private.mojom-shared.h"
#include <utility>
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/lib/validation_util.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "services/viz/privileged/mojom/compositing/display_private.mojom-params-data.h"
namespace viz {
namespace mojom {

namespace internal {


// static
bool FrameRateVelocityPoint_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const FrameRateVelocityPoint_Data* object =
      static_cast<const FrameRateVelocityPoint_Data*>(data);

  return true;
}

FrameRateVelocityPoint_Data::FrameRateVelocityPoint_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool AdaptiveRefreshRateInfo_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const AdaptiveRefreshRateInfo_Data* object =
      static_cast<const AdaptiveRefreshRateInfo_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->velocity_mapping, 3, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& velocity_mapping_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->velocity_mapping, validation_context,
                                         &velocity_mapping_validate_params)) {
    return false;
  }

  return true;
}

AdaptiveRefreshRateInfo_Data::AdaptiveRefreshRateInfo_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_SetDisplayVisible_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_SetDisplayVisible_Params_Data* object =
      static_cast<const DisplayPrivate_SetDisplayVisible_Params_Data*>(data);

  return true;
}

DisplayPrivate_SetDisplayVisible_Params_Data::DisplayPrivate_SetDisplayVisible_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_Resize_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_Resize_Params_Data* object =
      static_cast<const DisplayPrivate_Resize_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->size, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->size, validation_context))
    return false;

  return true;
}

DisplayPrivate_Resize_Params_Data::DisplayPrivate_Resize_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_SetDisplayColorMatrix_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_SetDisplayColorMatrix_Params_Data* object =
      static_cast<const DisplayPrivate_SetDisplayColorMatrix_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->color_matrix, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->color_matrix, validation_context))
    return false;

  return true;
}

DisplayPrivate_SetDisplayColorMatrix_Params_Data::DisplayPrivate_SetDisplayColorMatrix_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_SetDisplayColorSpaces_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_SetDisplayColorSpaces_Params_Data* object =
      static_cast<const DisplayPrivate_SetDisplayColorSpaces_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->display_color_spaces, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->display_color_spaces, validation_context))
    return false;

  return true;
}

DisplayPrivate_SetDisplayColorSpaces_Params_Data::DisplayPrivate_SetDisplayColorSpaces_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_SetOutputIsSecure_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_SetOutputIsSecure_Params_Data* object =
      static_cast<const DisplayPrivate_SetOutputIsSecure_Params_Data*>(data);

  return true;
}

DisplayPrivate_SetOutputIsSecure_Params_Data::DisplayPrivate_SetOutputIsSecure_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_SetDisplayVSyncParameters_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_SetDisplayVSyncParameters_Params_Data* object =
      static_cast<const DisplayPrivate_SetDisplayVSyncParameters_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->timebase, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->timebase, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->interval, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->interval, validation_context))
    return false;

  return true;
}

DisplayPrivate_SetDisplayVSyncParameters_Params_Data::DisplayPrivate_SetDisplayVSyncParameters_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_ForceImmediateDrawAndSwapIfPossible_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_ForceImmediateDrawAndSwapIfPossible_Params_Data* object =
      static_cast<const DisplayPrivate_ForceImmediateDrawAndSwapIfPossible_Params_Data*>(data);

  return true;
}

DisplayPrivate_ForceImmediateDrawAndSwapIfPossible_Params_Data::DisplayPrivate_ForceImmediateDrawAndSwapIfPossible_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_UpdateRefreshRate_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_UpdateRefreshRate_Params_Data* object =
      static_cast<const DisplayPrivate_UpdateRefreshRate_Params_Data*>(data);

  return true;
}

DisplayPrivate_UpdateRefreshRate_Params_Data::DisplayPrivate_UpdateRefreshRate_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_SetAdaptiveRefreshRateInfo_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_SetAdaptiveRefreshRateInfo_Params_Data* object =
      static_cast<const DisplayPrivate_SetAdaptiveRefreshRateInfo_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->info, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->info, validation_context))
    return false;

  return true;
}

DisplayPrivate_SetAdaptiveRefreshRateInfo_Params_Data::DisplayPrivate_SetAdaptiveRefreshRateInfo_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_SetSupportedRefreshRates_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_SetSupportedRefreshRates_Params_Data* object =
      static_cast<const DisplayPrivate_SetSupportedRefreshRates_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->refresh_rates, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& refresh_rates_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->refresh_rates, validation_context,
                                         &refresh_rates_validate_params)) {
    return false;
  }

  return true;
}

DisplayPrivate_SetSupportedRefreshRates_Params_Data::DisplayPrivate_SetSupportedRefreshRates_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_PreserveChildSurfaceControls_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_PreserveChildSurfaceControls_Params_Data* object =
      static_cast<const DisplayPrivate_PreserveChildSurfaceControls_Params_Data*>(data);

  return true;
}

DisplayPrivate_PreserveChildSurfaceControls_Params_Data::DisplayPrivate_PreserveChildSurfaceControls_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_SetSwapCompletionCallbackEnabled_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_SetSwapCompletionCallbackEnabled_Params_Data* object =
      static_cast<const DisplayPrivate_SetSwapCompletionCallbackEnabled_Params_Data*>(data);

  return true;
}

DisplayPrivate_SetSwapCompletionCallbackEnabled_Params_Data::DisplayPrivate_SetSwapCompletionCallbackEnabled_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_AddVSyncParameterObserver_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_AddVSyncParameterObserver_Params_Data* object =
      static_cast<const DisplayPrivate_AddVSyncParameterObserver_Params_Data*>(data);

  if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
          object->observer, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateHandleOrInterface(object->observer,
                                                 validation_context)) {
    return false;
  }

  return true;
}

DisplayPrivate_AddVSyncParameterObserver_Params_Data::DisplayPrivate_AddVSyncParameterObserver_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_SetDelegatedInkPointRenderer_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_SetDelegatedInkPointRenderer_Params_Data* object =
      static_cast<const DisplayPrivate_SetDelegatedInkPointRenderer_Params_Data*>(data);

  if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
          object->receiver, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateHandleOrInterface(object->receiver,
                                                 validation_context)) {
    return false;
  }

  return true;
}

DisplayPrivate_SetDelegatedInkPointRenderer_Params_Data::DisplayPrivate_SetDelegatedInkPointRenderer_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_SetStandaloneBeginFrameObserver_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_SetStandaloneBeginFrameObserver_Params_Data* object =
      static_cast<const DisplayPrivate_SetStandaloneBeginFrameObserver_Params_Data*>(data);

  if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
          object->observer, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateHandleOrInterface(object->observer,
                                                 validation_context)) {
    return false;
  }

  return true;
}

DisplayPrivate_SetStandaloneBeginFrameObserver_Params_Data::DisplayPrivate_SetStandaloneBeginFrameObserver_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayPrivate_SetMaxVSyncAndVrr_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayPrivate_SetMaxVSyncAndVrr_Params_Data* object =
      static_cast<const DisplayPrivate_SetMaxVSyncAndVrr_Params_Data*>(data);

  if (!mojo::internal::ValidateStruct(object->max_vsync_interval, validation_context))
    return false;


  if (!::display::mojom::internal::VariableRefreshRateState_Data
        ::Validate(object->vrr_state, validation_context))
    return false;

  return true;
}

DisplayPrivate_SetMaxVSyncAndVrr_Params_Data::DisplayPrivate_SetMaxVSyncAndVrr_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayClient_DidCompleteSwapWithSize_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayClient_DidCompleteSwapWithSize_Params_Data* object =
      static_cast<const DisplayClient_DidCompleteSwapWithSize_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->size, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->size, validation_context))
    return false;

  return true;
}

DisplayClient_DidCompleteSwapWithSize_Params_Data::DisplayClient_DidCompleteSwapWithSize_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayClient_OnContextCreationResult_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayClient_OnContextCreationResult_Params_Data* object =
      static_cast<const DisplayClient_OnContextCreationResult_Params_Data*>(data);


  if (!::gpu::mojom::internal::ContextResult_Data
        ::Validate(object->result, validation_context))
    return false;

  return true;
}

DisplayClient_OnContextCreationResult_Params_Data::DisplayClient_OnContextCreationResult_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayClient_SetWideColorEnabled_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayClient_SetWideColorEnabled_Params_Data* object =
      static_cast<const DisplayClient_SetWideColorEnabled_Params_Data*>(data);

  return true;
}

DisplayClient_SetWideColorEnabled_Params_Data::DisplayClient_SetWideColorEnabled_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DisplayClient_SetPreferredRefreshRate_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DisplayClient_SetPreferredRefreshRate_Params_Data* object =
      static_cast<const DisplayClient_SetPreferredRefreshRate_Params_Data*>(data);

  return true;
}

DisplayClient_SetPreferredRefreshRate_Params_Data::DisplayClient_SetPreferredRefreshRate_Params_Data()
    : header_({sizeof(*this), 0}) {}

}  // namespace internal
}  // namespace mojom
}  // namespace viz