// components/surface_embed/common/surface_embed.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 "components/surface_embed/common/surface_embed.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 "components/surface_embed/common/surface_embed.mojom-params-data.h"
namespace surface_embed {
namespace mojom {

namespace internal {


// static
bool RenderThrottlingStatus_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 RenderThrottlingStatus_Data* object =
      static_cast<const RenderThrottlingStatus_Data*>(data);

  return true;
}

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


// static
bool SurfaceEmbed_SetFrameSinkId_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 SurfaceEmbed_SetFrameSinkId_Params_Data* object =
      static_cast<const SurfaceEmbed_SetFrameSinkId_Params_Data*>(data);

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

  return true;
}

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


// static
bool SurfaceEmbed_UpdateLocalSurfaceIdFromChild_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 SurfaceEmbed_UpdateLocalSurfaceIdFromChild_Params_Data* object =
      static_cast<const SurfaceEmbed_UpdateLocalSurfaceIdFromChild_Params_Data*>(data);

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

  return true;
}

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


// static
bool SurfaceEmbed_ChildProcessGone_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 SurfaceEmbed_ChildProcessGone_Params_Data* object =
      static_cast<const SurfaceEmbed_ChildProcessGone_Params_Data*>(data);

  return true;
}

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


// static
bool SurfaceEmbed_RequestFocusOnEmbedElement_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 SurfaceEmbed_RequestFocusOnEmbedElement_Params_Data* object =
      static_cast<const SurfaceEmbed_RequestFocusOnEmbedElement_Params_Data*>(data);

  return true;
}

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


// static
bool SurfaceEmbed_RequestFocusOnEmbedElement_ResponseParams_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 SurfaceEmbed_RequestFocusOnEmbedElement_ResponseParams_Data* object =
      static_cast<const SurfaceEmbed_RequestFocusOnEmbedElement_ResponseParams_Data*>(data);

  return true;
}

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


// static
bool SurfaceEmbed_AdvanceFocusFromEmbedElement_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 SurfaceEmbed_AdvanceFocusFromEmbedElement_Params_Data* object =
      static_cast<const SurfaceEmbed_AdvanceFocusFromEmbedElement_Params_Data*>(data);

  return true;
}

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


// static
bool SurfaceEmbedHost_SetSurfaceEmbed_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 SurfaceEmbedHost_SetSurfaceEmbed_Params_Data* object =
      static_cast<const SurfaceEmbedHost_SetSurfaceEmbed_Params_Data*>(data);

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

  return true;
}

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


// static
bool SurfaceEmbedHost_AttachConnector_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 SurfaceEmbedHost_AttachConnector_Params_Data* object =
      static_cast<const SurfaceEmbedHost_AttachConnector_Params_Data*>(data);

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

  return true;
}

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


// static
bool SurfaceEmbedHost_SynchronizeVisualProperties_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 SurfaceEmbedHost_SynchronizeVisualProperties_Params_Data* object =
      static_cast<const SurfaceEmbedHost_SynchronizeVisualProperties_Params_Data*>(data);

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

  return true;
}

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


// static
bool SurfaceEmbedHost_OnEmbedElementFocused_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 SurfaceEmbedHost_OnEmbedElementFocused_Params_Data* object =
      static_cast<const SurfaceEmbedHost_OnEmbedElementFocused_Params_Data*>(data);


  if (!::blink::mojom::internal::FocusType_Data
        ::Validate(object->focus_type, validation_context))
    return false;

  return true;
}

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


// static
bool SurfaceEmbedHost_OnEmbedElementThrottlingStatusChanged_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 SurfaceEmbedHost_OnEmbedElementThrottlingStatusChanged_Params_Data* object =
      static_cast<const SurfaceEmbedHost_OnEmbedElementThrottlingStatusChanged_Params_Data*>(data);

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

  return true;
}

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


// static
bool SurfaceEmbedHost_SetParentAccessibilityInfo_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 SurfaceEmbedHost_SetParentAccessibilityInfo_Params_Data* object =
      static_cast<const SurfaceEmbedHost_SetParentAccessibilityInfo_Params_Data*>(data);

  return true;
}

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

}  // namespace internal
}  // namespace mojom
}  // namespace surface_embed