// ui/accessibility/mojom/ax_relative_bounds.mojom-blink.cc is auto generated by mojom_bindings_generator.py, do not edit

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

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif

#include "ui/accessibility/mojom/ax_relative_bounds.mojom-blink.h"
#include <stdint.h>
#include <utility>
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "ui/accessibility/mojom/ax_relative_bounds.mojom-params-data.h"
#include "ui/accessibility/mojom/ax_relative_bounds.mojom-shared-message-ids.h"

#include "ui/accessibility/mojom/ax_relative_bounds.mojom-blink-import-headers.h"
#include "ui/accessibility/mojom/ax_relative_bounds.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"


namespace ax::mojom::blink {
AXRelativeBounds::AXRelativeBounds()
    : offset_container_id(),
      bounds(),
      transform() {}

AXRelativeBounds::AXRelativeBounds(
    int32_t offset_container_id_in,
    const ::gfx::RectF& bounds_in,
    const ::gfx::Transform& transform_in)
    : offset_container_id(std::move(offset_container_id_in)),
      bounds(std::move(bounds_in)),
      transform(std::move(transform_in)) {}

AXRelativeBounds::~AXRelativeBounds() = default;

void AXRelativeBounds::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "offset_container_id"), this->offset_container_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int32_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "bounds"), this->bounds,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const ::gfx::RectF&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "transform"), this->transform,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const ::gfx::Transform&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool AXRelativeBounds::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}


}  // ax::mojom::blink


namespace mojo {


// static
bool StructTraits<::ax::mojom::blink::AXRelativeBounds::DataView, ::ax::mojom::blink::AXRelativeBoundsPtr>::Read(
    ::ax::mojom::blink::AXRelativeBounds::DataView input,
    ::ax::mojom::blink::AXRelativeBoundsPtr* output) {
  bool success = true;
  ::ax::mojom::blink::AXRelativeBoundsPtr result(::ax::mojom::blink::AXRelativeBounds::New());
  
      if (success)
        result->offset_container_id = input.offset_container_id();
      if (success && !input.ReadBounds(&result->bounds))
        success = false;
      if (success && !input.ReadTransform(&result->transform))
        success = false;
  *output = std::move(result);
  return success;
}

}  // namespace mojo


// Symbols declared in the -test-utils.h header are defined here instead of a
// separate .cc file to save compile time.


namespace ax::mojom::blink {




}  // ax::mojom::blink


#if defined(__clang__)
#pragma clang diagnostic pop
#endif