// ui/gfx/mojom/rrect_f.mojom-send-validation.h is auto generated by mojom_bindings_generator.py, do not edit

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

#ifndef UI_GFX_MOJOM_RRECT_F_MOJOM_SEND_VALIDATION_H_
#define UI_GFX_MOJOM_RRECT_F_MOJOM_SEND_VALIDATION_H_

#include "ui/gfx/mojom/rrect_f.mojom-shared-internal.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"

#include "ui/gfx/mojom/rrect_f.mojom-data-view.h"

#include "mojo/public/cpp/bindings/lib/send_validation_type.h"
#include "mojo/public/cpp/bindings/lib/send_validation.h"
#include "mojo/public/cpp/bindings/lib/has_send_validation_helper.h"

namespace mojo::internal {
template <typename MaybeConstUserType>
struct HasSendValidationSerialize<::gfx::mojom::RRectFType, MaybeConstUserType>
    : std::false_type {};

template <typename MaybeConstUserType, mojo::internal::SendValidation send_validation>
struct SendValidationSerializer<::gfx::mojom::RRectFDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::gfx::mojom::RRectFDataView, UserType>;
  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::gfx::mojom::internal::RRectF_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

      
      mojo::internal::Serialize<::gfx::mojom::RRectFType>(
        Traits::type(input),
        &fragment->type);

      decltype(Traits::rect(input)) in_rect = Traits::rect(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->rect)::BaseType> rect_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::gfx::mojom::RectFDataView, send_validation>(
        in_rect,
        rect_fragment);

      fragment->rect.Set(
          rect_fragment.is_null() ? nullptr : rect_fragment.data());

      
      MOJO_INTERNAL_CHECK_SERIALIZATION(
        send_validation,
        !(fragment->rect.is_null()),
        mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
        "null rect in RRectF struct");

      decltype(Traits::upper_left(input)) in_upper_left = Traits::upper_left(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->upper_left)::BaseType> upper_left_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::gfx::mojom::Vector2dFDataView, send_validation>(
        in_upper_left,
        upper_left_fragment);

      fragment->upper_left.Set(
          upper_left_fragment.is_null() ? nullptr : upper_left_fragment.data());

      
      MOJO_INTERNAL_CHECK_SERIALIZATION(
        send_validation,
        !(fragment->upper_left.is_null()),
        mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
        "null upper_left in RRectF struct");

      decltype(Traits::upper_right(input)) in_upper_right = Traits::upper_right(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->upper_right)::BaseType> upper_right_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::gfx::mojom::Vector2dFDataView, send_validation>(
        in_upper_right,
        upper_right_fragment);

      fragment->upper_right.Set(
          upper_right_fragment.is_null() ? nullptr : upper_right_fragment.data());

      
      MOJO_INTERNAL_CHECK_SERIALIZATION(
        send_validation,
        !(fragment->upper_right.is_null()),
        mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
        "null upper_right in RRectF struct");

      decltype(Traits::lower_right(input)) in_lower_right = Traits::lower_right(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->lower_right)::BaseType> lower_right_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::gfx::mojom::Vector2dFDataView, send_validation>(
        in_lower_right,
        lower_right_fragment);

      fragment->lower_right.Set(
          lower_right_fragment.is_null() ? nullptr : lower_right_fragment.data());

      
      MOJO_INTERNAL_CHECK_SERIALIZATION(
        send_validation,
        !(fragment->lower_right.is_null()),
        mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
        "null lower_right in RRectF struct");

      decltype(Traits::lower_left(input)) in_lower_left = Traits::lower_left(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->lower_left)::BaseType> lower_left_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::gfx::mojom::Vector2dFDataView, send_validation>(
        in_lower_left,
        lower_left_fragment);

      fragment->lower_left.Set(
          lower_left_fragment.is_null() ? nullptr : lower_left_fragment.data());

      
      MOJO_INTERNAL_CHECK_SERIALIZATION(
        send_validation,
        !(fragment->lower_left.is_null()),
        mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
        "null lower_left in RRectF struct");
  }
};

}  // namespace mojo::internal

#endif  // UI_GFX_MOJOM_RRECT_F_MOJOM_SEND_VALIDATION_H_