// third_party/blink/public/mojom/frame/frame_visual_properties.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 THIRD_PARTY_BLINK_PUBLIC_MOJOM_FRAME_FRAME_VISUAL_PROPERTIES_MOJOM_SEND_VALIDATION_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_FRAME_FRAME_VISUAL_PROPERTIES_MOJOM_SEND_VALIDATION_H_

#include "third_party/blink/public/mojom/frame/frame_visual_properties.mojom-shared-internal.h"
#include "cc/mojom/browser_controls_params.mojom-shared.h"
#include "services/viz/public/mojom/compositing/local_surface_id.mojom-shared.h"
#include "ui/display/mojom/screen_infos.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"

#include "third_party/blink/public/mojom/frame/frame_visual_properties.mojom-data-view.h"

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

namespace mojo::internal {

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

      decltype(Traits::screen_infos(input)) in_screen_infos = Traits::screen_infos(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->screen_infos)::BaseType> screen_infos_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::display::mojom::ScreenInfosDataView, send_validation>(
        in_screen_infos,
        screen_infos_fragment);

      fragment->screen_infos.Set(
          screen_infos_fragment.is_null() ? nullptr : screen_infos_fragment.data());

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

      fragment->auto_resize_enabled = Traits::auto_resize_enabled(input);

      fragment->is_pinch_gesture_active = Traits::is_pinch_gesture_active(input);

      fragment->zoom_level = Traits::zoom_level(input);

      fragment->css_zoom_factor = Traits::css_zoom_factor(input);

      fragment->page_scale_factor = Traits::page_scale_factor(input);

      fragment->compositing_scale_factor = Traits::compositing_scale_factor(input);

      fragment->cursor_accessibility_scale_factor = Traits::cursor_accessibility_scale_factor(input);

      decltype(Traits::visible_viewport_size(input)) in_visible_viewport_size = Traits::visible_viewport_size(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->visible_viewport_size)::BaseType> visible_viewport_size_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::gfx::mojom::SizeDataView, send_validation>(
        in_visible_viewport_size,
        visible_viewport_size_fragment);

      fragment->visible_viewport_size.Set(
          visible_viewport_size_fragment.is_null() ? nullptr : visible_viewport_size_fragment.data());

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

      decltype(Traits::min_size_for_auto_resize(input)) in_min_size_for_auto_resize = Traits::min_size_for_auto_resize(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->min_size_for_auto_resize)::BaseType> min_size_for_auto_resize_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::gfx::mojom::SizeDataView, send_validation>(
        in_min_size_for_auto_resize,
        min_size_for_auto_resize_fragment);

      fragment->min_size_for_auto_resize.Set(
          min_size_for_auto_resize_fragment.is_null() ? nullptr : min_size_for_auto_resize_fragment.data());

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

      decltype(Traits::max_size_for_auto_resize(input)) in_max_size_for_auto_resize = Traits::max_size_for_auto_resize(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->max_size_for_auto_resize)::BaseType> max_size_for_auto_resize_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::gfx::mojom::SizeDataView, send_validation>(
        in_max_size_for_auto_resize,
        max_size_for_auto_resize_fragment);

      fragment->max_size_for_auto_resize.Set(
          max_size_for_auto_resize_fragment.is_null() ? nullptr : max_size_for_auto_resize_fragment.data());

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

      decltype(Traits::root_widget_viewport_segments(input)) in_root_widget_viewport_segments = Traits::root_widget_viewport_segments(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->root_widget_viewport_segments)::BaseType>
          root_widget_viewport_segments_fragment(fragment.message());
      constexpr const mojo::internal::ContainerValidateParams& root_widget_viewport_segments_validate_params =
          mojo::internal::GetArrayValidator<0, false, nullptr>();
      
      mojo::internal::Serialize<mojo::ArrayDataView<::gfx::mojom::RectDataView>, send_validation>(
        in_root_widget_viewport_segments,
        root_widget_viewport_segments_fragment,
        &root_widget_viewport_segments_validate_params);

      fragment->root_widget_viewport_segments.Set(
          root_widget_viewport_segments_fragment.is_null() ? nullptr : root_widget_viewport_segments_fragment.data());

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

      decltype(Traits::compositor_viewport(input)) in_compositor_viewport = Traits::compositor_viewport(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->compositor_viewport)::BaseType> compositor_viewport_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::gfx::mojom::RectDataView, send_validation>(
        in_compositor_viewport,
        compositor_viewport_fragment);

      fragment->compositor_viewport.Set(
          compositor_viewport_fragment.is_null() ? nullptr : compositor_viewport_fragment.data());

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

      decltype(Traits::rect_in_local_root(input)) in_rect_in_local_root = Traits::rect_in_local_root(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->rect_in_local_root)::BaseType> rect_in_local_root_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::gfx::mojom::RectDataView, send_validation>(
        in_rect_in_local_root,
        rect_in_local_root_fragment);

      fragment->rect_in_local_root.Set(
          rect_in_local_root_fragment.is_null() ? nullptr : rect_in_local_root_fragment.data());

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

      decltype(Traits::local_frame_size(input)) in_local_frame_size = Traits::local_frame_size(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->local_frame_size)::BaseType> local_frame_size_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::gfx::mojom::SizeDataView, send_validation>(
        in_local_frame_size,
        local_frame_size_fragment);

      fragment->local_frame_size.Set(
          local_frame_size_fragment.is_null() ? nullptr : local_frame_size_fragment.data());

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

      decltype(Traits::local_surface_id(input)) in_local_surface_id = Traits::local_surface_id(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->local_surface_id)::BaseType> local_surface_id_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::viz::mojom::LocalSurfaceIdDataView, send_validation>(
        in_local_surface_id,
        local_surface_id_fragment);

      fragment->local_surface_id.Set(
          local_surface_id_fragment.is_null() ? nullptr : local_surface_id_fragment.data());

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

}  // namespace mojo::internal

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_FRAME_FRAME_VISUAL_PROPERTIES_MOJOM_SEND_VALIDATION_H_