// chrome/common/actor.mojom-shared.h 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.

#ifndef CHROME_COMMON_ACTOR_MOJOM_SHARED_H_
#define CHROME_COMMON_ACTOR_MOJOM_SHARED_H_

#include <stdint.h>

#include <functional>
#include <iosfwd>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/map_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "mojo/public/cpp/system/message_pipe.h"

#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"

#include "chrome/common/actor.mojom-shared-internal.h"
#include "components/actor/public/mojom/actor_types.mojom-shared.h"
#include "mojo/public/mojom/base/time.mojom-shared.h"
#include "mojo/public/mojom/base/unguessable_token.mojom-shared.h"
#include "third_party/blink/public/mojom/content_extraction/ai_page_content.mojom-shared.h"
#include "third_party/blink/public/mojom/content_extraction/script_tools.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"




#include "chrome/common/actor.mojom-data-view.h"  // IWYU pragma: export




namespace std {

template <>
struct hash<::actor::mojom::ClickType>
    : public mojo::internal::EnumHashImpl<::actor::mojom::ClickType> {};

template <>
struct hash<::actor::mojom::ClickCount>
    : public mojo::internal::EnumHashImpl<::actor::mojom::ClickCount> {};

template <>
struct hash<::actor::mojom::ScreenshotPolicy>
    : public mojo::internal::EnumHashImpl<::actor::mojom::ScreenshotPolicy> {};

template <>
struct hash<::actor::mojom::PageContentExtractionPolicy>
    : public mojo::internal::EnumHashImpl<::actor::mojom::PageContentExtractionPolicy> {};

template <>
struct hash<::actor::mojom::AttemptLoginStatus>
    : public mojo::internal::EnumHashImpl<::actor::mojom::AttemptLoginStatus> {};

template <>
struct hash<::actor::mojom::TypeAction_Mode>
    : public mojo::internal::EnumHashImpl<::actor::mojom::TypeAction_Mode> {};

template <>
struct hash<::actor::mojom::ScrollAction_ScrollDirection>
    : public mojo::internal::EnumHashImpl<::actor::mojom::ScrollAction_ScrollDirection> {};

}  // namespace std

namespace mojo {


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ClickType, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::actor::mojom::ClickType, UserType>;

  static void Serialize(UserType input, int32_t* output) {
    *output = static_cast<int32_t>(Traits::ToMojom(input));
  }

  static bool Deserialize(int32_t input, UserType* output) {
    auto known_value = ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::actor::mojom::ClickType>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::actor::mojom::ClickType, UserType> ||
                        HasInfallibleConversion(::actor::mojom::ClickType()),
                    "::actor::mojom::ClickType does not have an infallible conversion, "
                    "use an optional return type.");
      *output = Traits::FromMojom(known_value);
      return true;
    } else {
      static_assert(
          requires {
            {
              Traits::FromMojom(known_value)
            } -> std::same_as<std::optional<UserType>>;
          }, "FromMojom must return by value or optional.");
      std::optional<UserType> from_mojom = Traits::FromMojom(known_value);
      if (from_mojom) {
        *output = *from_mojom;
      }
      return from_mojom.has_value();
    }
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ClickCount, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::actor::mojom::ClickCount, UserType>;

  static void Serialize(UserType input, int32_t* output) {
    *output = static_cast<int32_t>(Traits::ToMojom(input));
  }

  static bool Deserialize(int32_t input, UserType* output) {
    auto known_value = ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::actor::mojom::ClickCount>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::actor::mojom::ClickCount, UserType> ||
                        HasInfallibleConversion(::actor::mojom::ClickCount()),
                    "::actor::mojom::ClickCount does not have an infallible conversion, "
                    "use an optional return type.");
      *output = Traits::FromMojom(known_value);
      return true;
    } else {
      static_assert(
          requires {
            {
              Traits::FromMojom(known_value)
            } -> std::same_as<std::optional<UserType>>;
          }, "FromMojom must return by value or optional.");
      std::optional<UserType> from_mojom = Traits::FromMojom(known_value);
      if (from_mojom) {
        *output = *from_mojom;
      }
      return from_mojom.has_value();
    }
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ScreenshotPolicy, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::actor::mojom::ScreenshotPolicy, UserType>;

  static void Serialize(UserType input, int32_t* output) {
    *output = static_cast<int32_t>(Traits::ToMojom(input));
  }

  static bool Deserialize(int32_t input, UserType* output) {
    auto known_value = ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::actor::mojom::ScreenshotPolicy>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::actor::mojom::ScreenshotPolicy, UserType> ||
                        HasInfallibleConversion(::actor::mojom::ScreenshotPolicy()),
                    "::actor::mojom::ScreenshotPolicy does not have an infallible conversion, "
                    "use an optional return type.");
      *output = Traits::FromMojom(known_value);
      return true;
    } else {
      static_assert(
          requires {
            {
              Traits::FromMojom(known_value)
            } -> std::same_as<std::optional<UserType>>;
          }, "FromMojom must return by value or optional.");
      std::optional<UserType> from_mojom = Traits::FromMojom(known_value);
      if (from_mojom) {
        *output = *from_mojom;
      }
      return from_mojom.has_value();
    }
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::PageContentExtractionPolicy, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::actor::mojom::PageContentExtractionPolicy, UserType>;

  static void Serialize(UserType input, int32_t* output) {
    *output = static_cast<int32_t>(Traits::ToMojom(input));
  }

  static bool Deserialize(int32_t input, UserType* output) {
    auto known_value = ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::actor::mojom::PageContentExtractionPolicy>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::actor::mojom::PageContentExtractionPolicy, UserType> ||
                        HasInfallibleConversion(::actor::mojom::PageContentExtractionPolicy()),
                    "::actor::mojom::PageContentExtractionPolicy does not have an infallible conversion, "
                    "use an optional return type.");
      *output = Traits::FromMojom(known_value);
      return true;
    } else {
      static_assert(
          requires {
            {
              Traits::FromMojom(known_value)
            } -> std::same_as<std::optional<UserType>>;
          }, "FromMojom must return by value or optional.");
      std::optional<UserType> from_mojom = Traits::FromMojom(known_value);
      if (from_mojom) {
        *output = *from_mojom;
      }
      return from_mojom.has_value();
    }
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::AttemptLoginStatus, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::actor::mojom::AttemptLoginStatus, UserType>;

  static void Serialize(UserType input, int32_t* output) {
    *output = static_cast<int32_t>(Traits::ToMojom(input));
  }

  static bool Deserialize(int32_t input, UserType* output) {
    auto known_value = ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::actor::mojom::AttemptLoginStatus>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::actor::mojom::AttemptLoginStatus, UserType> ||
                        HasInfallibleConversion(::actor::mojom::AttemptLoginStatus()),
                    "::actor::mojom::AttemptLoginStatus does not have an infallible conversion, "
                    "use an optional return type.");
      *output = Traits::FromMojom(known_value);
      return true;
    } else {
      static_assert(
          requires {
            {
              Traits::FromMojom(known_value)
            } -> std::same_as<std::optional<UserType>>;
          }, "FromMojom must return by value or optional.");
      std::optional<UserType> from_mojom = Traits::FromMojom(known_value);
      if (from_mojom) {
        *output = *from_mojom;
      }
      return from_mojom.has_value();
    }
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::TypeAction_Mode, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::actor::mojom::TypeAction_Mode, UserType>;

  static void Serialize(UserType input, int32_t* output) {
    *output = static_cast<int32_t>(Traits::ToMojom(input));
  }

  static bool Deserialize(int32_t input, UserType* output) {
    auto known_value = ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::actor::mojom::TypeAction_Mode>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::actor::mojom::TypeAction_Mode, UserType> ||
                        HasInfallibleConversion(::actor::mojom::TypeAction_Mode()),
                    "::actor::mojom::TypeAction_Mode does not have an infallible conversion, "
                    "use an optional return type.");
      *output = Traits::FromMojom(known_value);
      return true;
    } else {
      static_assert(
          requires {
            {
              Traits::FromMojom(known_value)
            } -> std::same_as<std::optional<UserType>>;
          }, "FromMojom must return by value or optional.");
      std::optional<UserType> from_mojom = Traits::FromMojom(known_value);
      if (from_mojom) {
        *output = *from_mojom;
      }
      return from_mojom.has_value();
    }
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ScrollAction_ScrollDirection, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::actor::mojom::ScrollAction_ScrollDirection, UserType>;

  static void Serialize(UserType input, int32_t* output) {
    *output = static_cast<int32_t>(Traits::ToMojom(input));
  }

  static bool Deserialize(int32_t input, UserType* output) {
    auto known_value = ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::actor::mojom::ScrollAction_ScrollDirection>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::actor::mojom::ScrollAction_ScrollDirection, UserType> ||
                        HasInfallibleConversion(::actor::mojom::ScrollAction_ScrollDirection()),
                    "::actor::mojom::ScrollAction_ScrollDirection does not have an infallible conversion, "
                    "use an optional return type.");
      *output = Traits::FromMojom(known_value);
      return true;
    } else {
      static_assert(
          requires {
            {
              Traits::FromMojom(known_value)
            } -> std::same_as<std::optional<UserType>>;
          }, "FromMojom must return by value or optional.");
      std::optional<UserType> from_mojom = Traits::FromMojom(known_value);
      if (from_mojom) {
        *output = *from_mojom;
      }
      return from_mojom.has_value();
    }
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ObservedToolTargetDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::actor::mojom::ObservedToolTargetDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::actor::mojom::internal::ObservedToolTarget_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::node_attribute(input)) in_node_attribute = Traits::node_attribute(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->node_attribute)::BaseType> node_attribute_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::blink::mojom::AIPageContentAttributesDataView>(
      in_node_attribute,
      node_attribute_fragment);

    fragment->node_attribute.Set(
        node_attribute_fragment.is_null() ? nullptr : node_attribute_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->node_attribute.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null node_attribute in ObservedToolTarget struct");
  }

  static bool Deserialize(::actor::mojom::internal::ObservedToolTarget_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::ObservedToolTargetDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ClickActionDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::actor::mojom::ClickActionDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::actor::mojom::internal::ClickAction_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

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

    
    mojo::internal::Serialize<::actor::mojom::ClickCount>(
      Traits::count(input),
      &fragment->count);
  }

  static bool Deserialize(::actor::mojom::internal::ClickAction_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::ClickActionDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::MouseMoveActionDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::actor::mojom::MouseMoveActionDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::actor::mojom::internal::MouseMoveAction_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();
  }

  static bool Deserialize(::actor::mojom::internal::MouseMoveAction_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::MouseMoveActionDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ScrollToActionDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::actor::mojom::ScrollToActionDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::actor::mojom::internal::ScrollToAction_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();
  }

  static bool Deserialize(::actor::mojom::internal::ScrollToAction_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::ScrollToActionDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::TypeActionDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::actor::mojom::TypeActionDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::actor::mojom::internal::TypeAction_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    
    mojo::internal::Serialize<::actor::mojom::TypeAction_Mode>(
      Traits::mode(input),
      &fragment->mode);

    decltype(Traits::text(input)) in_text = Traits::text(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->text)::BaseType> text_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_text,
      text_fragment);

    fragment->text.Set(
        text_fragment.is_null() ? nullptr : text_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->text.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null text in TypeAction struct");

    fragment->follow_by_enter = Traits::follow_by_enter(input);
  }

  static bool Deserialize(::actor::mojom::internal::TypeAction_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::TypeActionDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ScrollActionDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::actor::mojom::ScrollActionDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::actor::mojom::internal::ScrollAction_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    
    mojo::internal::Serialize<::actor::mojom::ScrollAction_ScrollDirection>(
      Traits::direction(input),
      &fragment->direction);

    fragment->distance = Traits::distance(input);
  }

  static bool Deserialize(::actor::mojom::internal::ScrollAction_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::ScrollActionDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::SelectActionDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::actor::mojom::SelectActionDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::actor::mojom::internal::SelectAction_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::value(input)) in_value = Traits::value(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->value)::BaseType> value_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_value,
      value_fragment);

    fragment->value.Set(
        value_fragment.is_null() ? nullptr : value_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->value.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null value in SelectAction struct");
  }

  static bool Deserialize(::actor::mojom::internal::SelectAction_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::SelectActionDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::DragAndReleaseActionDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::actor::mojom::DragAndReleaseActionDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::actor::mojom::internal::DragAndReleaseAction_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::to_target(input)) in_to_target = Traits::to_target(input);
    mojo::internal::MessageFragment<decltype(fragment->to_target)>
        to_target_fragment(fragment.message());
    to_target_fragment.Claim(&fragment->to_target);
    
    mojo::internal::Serialize<::actor::mojom::ToolTargetDataView>(
      in_to_target,
      to_target_fragment,
      true);

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->to_target.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null to_target in DragAndReleaseAction struct");
  }

  static bool Deserialize(::actor::mojom::internal::DragAndReleaseAction_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::DragAndReleaseActionDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ScriptToolActionDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::actor::mojom::ScriptToolActionDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::actor::mojom::internal::ScriptToolAction_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::name(input)) in_name = Traits::name(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->name)::BaseType> name_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_name,
      name_fragment);

    fragment->name.Set(
        name_fragment.is_null() ? nullptr : name_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->name.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null name in ScriptToolAction struct");

    decltype(Traits::input_arguments(input)) in_input_arguments = Traits::input_arguments(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->input_arguments)::BaseType> input_arguments_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_input_arguments,
      input_arguments_fragment);

    fragment->input_arguments.Set(
        input_arguments_fragment.is_null() ? nullptr : input_arguments_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->input_arguments.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null input_arguments in ScriptToolAction struct");
  }

  static bool Deserialize(::actor::mojom::internal::ScriptToolAction_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::ScriptToolActionDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ToolInvocationDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::actor::mojom::ToolInvocationDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::actor::mojom::internal::ToolInvocation_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::task_id(input)) in_task_id = Traits::task_id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->task_id)::BaseType> task_id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::actor::mojom::TaskIdDataView>(
      in_task_id,
      task_id_fragment);

    fragment->task_id.Set(
        task_id_fragment.is_null() ? nullptr : task_id_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->task_id.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null task_id in ToolInvocation struct");

    decltype(Traits::execution_id(input)) in_execution_id = Traits::execution_id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->execution_id)::BaseType> execution_id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::UnguessableTokenDataView>(
      in_execution_id,
      execution_id_fragment);

    fragment->execution_id.Set(
        execution_id_fragment.is_null() ? nullptr : execution_id_fragment.data());

    decltype(Traits::action(input)) in_action = Traits::action(input);
    mojo::internal::MessageFragment<decltype(fragment->action)>
        action_fragment(fragment.message());
    action_fragment.Claim(&fragment->action);
    
    mojo::internal::Serialize<::actor::mojom::ToolActionDataView>(
      in_action,
      action_fragment,
      true);

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->action.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null action in ToolInvocation struct");

    decltype(Traits::target(input)) in_target = Traits::target(input);
    mojo::internal::MessageFragment<decltype(fragment->target)>
        target_fragment(fragment.message());
    target_fragment.Claim(&fragment->target);
    
    mojo::internal::Serialize<::actor::mojom::ToolTargetDataView>(
      in_target,
      target_fragment,
      true);

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->target.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null target in ToolInvocation struct");

    decltype(Traits::observed_target(input)) in_observed_target = Traits::observed_target(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->observed_target)::BaseType> observed_target_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::actor::mojom::ObservedToolTargetDataView>(
      in_observed_target,
      observed_target_fragment);

    fragment->observed_target.Set(
        observed_target_fragment.is_null() ? nullptr : observed_target_fragment.data());
  }

  static bool Deserialize(::actor::mojom::internal::ToolInvocation_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::ToolInvocationDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ScriptToolResponseDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::actor::mojom::ScriptToolResponseDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::actor::mojom::internal::ScriptToolResponse_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::input_arguments(input)) in_input_arguments = Traits::input_arguments(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->input_arguments)::BaseType> input_arguments_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_input_arguments,
      input_arguments_fragment);

    fragment->input_arguments.Set(
        input_arguments_fragment.is_null() ? nullptr : input_arguments_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->input_arguments.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null input_arguments in ScriptToolResponse struct");

    decltype(Traits::tool(input)) in_tool = Traits::tool(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->tool)::BaseType> tool_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::blink::mojom::ScriptToolDataView>(
      in_tool,
      tool_fragment);

    fragment->tool.Set(
        tool_fragment.is_null() ? nullptr : tool_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->tool.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null tool in ScriptToolResponse struct");

    decltype(Traits::result(input)) in_result = Traits::result(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->result)::BaseType> result_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_result,
      result_fragment);

    fragment->result.Set(
        result_fragment.is_null() ? nullptr : result_fragment.data());
  }

  static bool Deserialize(::actor::mojom::internal::ScriptToolResponse_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::ScriptToolResponseDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ActionResultDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::actor::mojom::ActionResultDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::actor::mojom::internal::ActionResult_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    
    mojo::internal::Serialize<::actor::mojom::ActionResultCode>(
      Traits::code(input),
      &fragment->code);

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

    decltype(Traits::message(input)) in_message = Traits::message(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->message)::BaseType> message_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_message,
      message_fragment);

    fragment->message.Set(
        message_fragment.is_null() ? nullptr : message_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->message.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null message in ActionResult struct");

    decltype(Traits::script_tool_response(input)) in_script_tool_response = Traits::script_tool_response(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->script_tool_response)::BaseType> script_tool_response_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::actor::mojom::ScriptToolResponseDataView>(
      in_script_tool_response,
      script_tool_response_fragment);

    fragment->script_tool_response.Set(
        script_tool_response_fragment.is_null() ? nullptr : script_tool_response_fragment.data());

    decltype(Traits::execution_end_time(input)) in_execution_end_time = Traits::execution_end_time(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->execution_end_time)::BaseType> execution_end_time_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::TimeTicksDataView>(
      in_execution_end_time,
      execution_end_time_fragment);

    fragment->execution_end_time.Set(
        execution_end_time_fragment.is_null() ? nullptr : execution_end_time_fragment.data());

    
    mojo::internal::Serialize<::actor::mojom::ScreenshotPolicy>(
      Traits::screenshot_policy(input),
      &fragment->screenshot_policy);

    
    mojo::internal::Serialize<::actor::mojom::PageContentExtractionPolicy>(
      Traits::page_content_policy(input),
      &fragment->page_content_policy);
    fragment->attempt_login_status_$flag = Traits::attempt_login_status(input).has_value();
    if (Traits::attempt_login_status(input).has_value()) {
      
      mojo::internal::Serialize<::actor::mojom::AttemptLoginStatus>(
        Traits::attempt_login_status(input).value(),
        &fragment->attempt_login_status_$value);
    } else {
      fragment->attempt_login_status_$value =
          static_cast<int32_t>(::actor::mojom::AttemptLoginStatus::kMinValue);
    }
  }

  static bool Deserialize(::actor::mojom::internal::ActionResult_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::ActionResultDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ToolTargetDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = UnionTraits<::actor::mojom::ToolTargetDataView, UserType>;

  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::actor::mojom::internal::ToolTarget_Data>& fragment,
                        bool inlined) {
    
    if (CallIsNullIfExists<Traits>(input)) {
       if (inlined)
        fragment->set_null();
      return;
    }

if (!inlined)
  fragment.Allocate();

    // TODO(azani): Handle unknown and objects.
    // Set the not-null flag.
fragment->size = kUnionDataSize;
fragment->tag = Traits::GetTag(input);
switch (fragment->tag) {
  case ::actor::mojom::ToolTargetDataView::Tag::kDomNodeId: {
    decltype(Traits::dom_node_id(input))
    in_dom_node_id = Traits::dom_node_id(input);
    fragment->data.f_dom_node_id = in_dom_node_id;
    break;
  }
  case ::actor::mojom::ToolTargetDataView::Tag::kCoordinateDip: {
    decltype(Traits::coordinate_dip(input))
    in_coordinate_dip = Traits::coordinate_dip(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_coordinate_dip)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::gfx::mojom::PointDataView>(
  in_coordinate_dip,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null coordinate_dip in ToolTarget union");
    fragment->data.f_coordinate_dip.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
}
  }

  static bool Deserialize(::actor::mojom::internal::ToolTarget_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input || input->is_null())
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::ToolTargetDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::ToolActionDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = UnionTraits<::actor::mojom::ToolActionDataView, UserType>;

  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::actor::mojom::internal::ToolAction_Data>& fragment,
                        bool inlined) {
    
    if (CallIsNullIfExists<Traits>(input)) {
       if (inlined)
        fragment->set_null();
      return;
    }

if (!inlined)
  fragment.Allocate();

    // TODO(azani): Handle unknown and objects.
    // Set the not-null flag.
fragment->size = kUnionDataSize;
fragment->tag = Traits::GetTag(input);
switch (fragment->tag) {
  case ::actor::mojom::ToolActionDataView::Tag::kClick: {
    decltype(Traits::click(input))
    in_click = Traits::click(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_click)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::actor::mojom::ClickActionDataView>(
  in_click,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null click in ToolAction union");
    fragment->data.f_click.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::actor::mojom::ToolActionDataView::Tag::kDragAndRelease: {
    decltype(Traits::drag_and_release(input))
    in_drag_and_release = Traits::drag_and_release(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_drag_and_release)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::actor::mojom::DragAndReleaseActionDataView>(
  in_drag_and_release,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null drag_and_release in ToolAction union");
    fragment->data.f_drag_and_release.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::actor::mojom::ToolActionDataView::Tag::kMouseMove: {
    decltype(Traits::mouse_move(input))
    in_mouse_move = Traits::mouse_move(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_mouse_move)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::actor::mojom::MouseMoveActionDataView>(
  in_mouse_move,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null mouse_move in ToolAction union");
    fragment->data.f_mouse_move.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::actor::mojom::ToolActionDataView::Tag::kScroll: {
    decltype(Traits::scroll(input))
    in_scroll = Traits::scroll(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_scroll)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::actor::mojom::ScrollActionDataView>(
  in_scroll,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null scroll in ToolAction union");
    fragment->data.f_scroll.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::actor::mojom::ToolActionDataView::Tag::kSelect: {
    decltype(Traits::select(input))
    in_select = Traits::select(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_select)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::actor::mojom::SelectActionDataView>(
  in_select,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null select in ToolAction union");
    fragment->data.f_select.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::actor::mojom::ToolActionDataView::Tag::kType: {
    decltype(Traits::type(input))
    in_type = Traits::type(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_type)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::actor::mojom::TypeActionDataView>(
  in_type,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null type in ToolAction union");
    fragment->data.f_type.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::actor::mojom::ToolActionDataView::Tag::kScriptTool: {
    decltype(Traits::script_tool(input))
    in_script_tool = Traits::script_tool(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_script_tool)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::actor::mojom::ScriptToolActionDataView>(
  in_script_tool,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null script_tool in ToolAction union");
    fragment->data.f_script_tool.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::actor::mojom::ToolActionDataView::Tag::kScrollTo: {
    decltype(Traits::scroll_to(input))
    in_scroll_to = Traits::scroll_to(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_scroll_to)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::actor::mojom::ScrollToActionDataView>(
  in_scroll_to,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null scroll_to in ToolAction union");
    fragment->data.f_scroll_to.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
}
  }

  static bool Deserialize(::actor::mojom::internal::ToolAction_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input || input->is_null())
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::ToolActionDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::actor::mojom::InitializeToolResultDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = UnionTraits<::actor::mojom::InitializeToolResultDataView, UserType>;

  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::actor::mojom::internal::InitializeToolResult_Data>& fragment,
                        bool inlined) {
    
    if (CallIsNullIfExists<Traits>(input)) {
       if (inlined)
        fragment->set_null();
      return;
    }

if (!inlined)
  fragment.Allocate();

    // TODO(azani): Handle unknown and objects.
    // Set the not-null flag.
fragment->size = kUnionDataSize;
fragment->tag = Traits::GetTag(input);
switch (fragment->tag) {
  case ::actor::mojom::InitializeToolResultDataView::Tag::kSuccessPoint: {
    decltype(Traits::success_point(input))
    in_success_point = Traits::success_point(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_success_point)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::gfx::mojom::PointDataView>(
  in_success_point,
  value_fragment);
    fragment->data.f_success_point.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::actor::mojom::InitializeToolResultDataView::Tag::kErrorResult: {
    decltype(Traits::error_result(input))
    in_error_result = Traits::error_result(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_error_result)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::actor::mojom::ActionResultDataView>(
  in_error_result,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null error_result in InitializeToolResult union");
    fragment->data.f_error_result.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
}
  }

  static bool Deserialize(::actor::mojom::internal::InitializeToolResult_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input || input->is_null())
      return CallSetToNullIfExists<Traits>(output);

    ::actor::mojom::InitializeToolResultDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal

}  // namespace mojo


namespace actor::mojom {

inline void ObservedToolTargetDataView::GetNodeAttributeDataView(
    ::blink::mojom::AIPageContentAttributesDataView* output) {
  auto pointer = data_->node_attribute.Get();
  *output = ::blink::mojom::AIPageContentAttributesDataView(pointer, message_);
}








inline void TypeActionDataView::GetTextDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->text.Get();
  *output = mojo::StringDataView(pointer, message_);
}




inline void SelectActionDataView::GetValueDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->value.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void DragAndReleaseActionDataView::GetToTargetDataView(
    ToolTargetDataView* output) {
  auto pointer = &data_->to_target;
  *output = ToolTargetDataView(pointer, message_);
}


inline void ScriptToolActionDataView::GetNameDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->name.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void ScriptToolActionDataView::GetInputArgumentsDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->input_arguments.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void ToolInvocationDataView::GetTaskIdDataView(
    ::actor::mojom::TaskIdDataView* output) {
  auto pointer = data_->task_id.Get();
  *output = ::actor::mojom::TaskIdDataView(pointer, message_);
}
inline void ToolInvocationDataView::GetExecutionIdDataView(
    ::mojo_base::mojom::UnguessableTokenDataView* output) {
  auto pointer = data_->execution_id.Get();
  *output = ::mojo_base::mojom::UnguessableTokenDataView(pointer, message_);
}
inline void ToolInvocationDataView::GetActionDataView(
    ToolActionDataView* output) {
  auto pointer = &data_->action;
  *output = ToolActionDataView(pointer, message_);
}
inline void ToolInvocationDataView::GetTargetDataView(
    ToolTargetDataView* output) {
  auto pointer = &data_->target;
  *output = ToolTargetDataView(pointer, message_);
}
inline void ToolInvocationDataView::GetObservedTargetDataView(
    ObservedToolTargetDataView* output) {
  auto pointer = data_->observed_target.Get();
  *output = ObservedToolTargetDataView(pointer, message_);
}


inline void ScriptToolResponseDataView::GetInputArgumentsDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->input_arguments.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void ScriptToolResponseDataView::GetToolDataView(
    ::blink::mojom::ScriptToolDataView* output) {
  auto pointer = data_->tool.Get();
  *output = ::blink::mojom::ScriptToolDataView(pointer, message_);
}
inline void ScriptToolResponseDataView::GetResultDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->result.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void ActionResultDataView::GetMessageDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->message.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void ActionResultDataView::GetScriptToolResponseDataView(
    ScriptToolResponseDataView* output) {
  auto pointer = data_->script_tool_response.Get();
  *output = ScriptToolResponseDataView(pointer, message_);
}
inline void ActionResultDataView::GetExecutionEndTimeDataView(
    ::mojo_base::mojom::TimeTicksDataView* output) {
  auto pointer = data_->execution_end_time.Get();
  *output = ::mojo_base::mojom::TimeTicksDataView(pointer, message_);
}


inline void ToolTargetDataView::GetCoordinateDipDataView(
    ::gfx::mojom::PointDataView* output) const {
  CHECK(is_coordinate_dip());
  *output = ::gfx::mojom::PointDataView(data_->data.f_coordinate_dip.Get(), message_);
}

inline void ToolActionDataView::GetClickDataView(
    ClickActionDataView* output) const {
  CHECK(is_click());
  *output = ClickActionDataView(data_->data.f_click.Get(), message_);
}
inline void ToolActionDataView::GetDragAndReleaseDataView(
    DragAndReleaseActionDataView* output) const {
  CHECK(is_drag_and_release());
  *output = DragAndReleaseActionDataView(data_->data.f_drag_and_release.Get(), message_);
}
inline void ToolActionDataView::GetMouseMoveDataView(
    MouseMoveActionDataView* output) const {
  CHECK(is_mouse_move());
  *output = MouseMoveActionDataView(data_->data.f_mouse_move.Get(), message_);
}
inline void ToolActionDataView::GetScrollDataView(
    ScrollActionDataView* output) const {
  CHECK(is_scroll());
  *output = ScrollActionDataView(data_->data.f_scroll.Get(), message_);
}
inline void ToolActionDataView::GetSelectDataView(
    SelectActionDataView* output) const {
  CHECK(is_select());
  *output = SelectActionDataView(data_->data.f_select.Get(), message_);
}
inline void ToolActionDataView::GetTypeDataView(
    TypeActionDataView* output) const {
  CHECK(is_type());
  *output = TypeActionDataView(data_->data.f_type.Get(), message_);
}
inline void ToolActionDataView::GetScriptToolDataView(
    ScriptToolActionDataView* output) const {
  CHECK(is_script_tool());
  *output = ScriptToolActionDataView(data_->data.f_script_tool.Get(), message_);
}
inline void ToolActionDataView::GetScrollToDataView(
    ScrollToActionDataView* output) const {
  CHECK(is_scroll_to());
  *output = ScrollToActionDataView(data_->data.f_scroll_to.Get(), message_);
}

inline void InitializeToolResultDataView::GetSuccessPointDataView(
    ::gfx::mojom::PointDataView* output) const {
  CHECK(is_success_point());
  *output = ::gfx::mojom::PointDataView(data_->data.f_success_point.Get(), message_);
}
inline void InitializeToolResultDataView::GetErrorResultDataView(
    ActionResultDataView* output) const {
  CHECK(is_error_result());
  *output = ActionResultDataView(data_->data.f_error_result.Get(), message_);
}


}  // actor::mojom

// Declare TraceFormatTraits for enums, which should be defined in ::perfetto
// namespace.

namespace perfetto {

template <>
struct  TraceFormatTraits<::actor::mojom::ClickType> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::actor::mojom::ClickType value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct  TraceFormatTraits<::actor::mojom::ClickCount> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::actor::mojom::ClickCount value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct  TraceFormatTraits<::actor::mojom::ScreenshotPolicy> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::actor::mojom::ScreenshotPolicy value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct  TraceFormatTraits<::actor::mojom::PageContentExtractionPolicy> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::actor::mojom::PageContentExtractionPolicy value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct  TraceFormatTraits<::actor::mojom::AttemptLoginStatus> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::actor::mojom::AttemptLoginStatus value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct  TraceFormatTraits<::actor::mojom::TypeAction_Mode> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::actor::mojom::TypeAction_Mode value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct  TraceFormatTraits<::actor::mojom::ScrollAction_ScrollDirection> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::actor::mojom::ScrollAction_ScrollDirection value);
};

} // namespace perfetto

#endif  // CHROME_COMMON_ACTOR_MOJOM_SHARED_H_