// device/vr/public/mojom/vr_service.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 DEVICE_VR_PUBLIC_MOJOM_VR_SERVICE_MOJOM_SHARED_H_
#define DEVICE_VR_PUBLIC_MOJOM_VR_SERVICE_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 "device/vr/public/mojom/vr_service.mojom-shared-internal.h"
#include "device/gamepad/public/mojom/gamepad.mojom-shared.h"
#include "device/vr/public/mojom/xr_hand_tracking_data.mojom-shared.h"
#include "device/vr/public/mojom/xr_session.mojom-shared.h"
#include "mojo/public/mojom/base/big_buffer.mojom-shared.h"
#include "mojo/public/mojom/base/time.mojom-shared.h"
#include "gpu/ipc/common/exported_shared_image.mojom-shared.h"
#include "gpu/ipc/common/shared_image_metadata.mojom-shared.h"
#include "gpu/ipc/common/sync_token.mojom-shared.h"
#include "ui/display/mojom/display.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"
#include "ui/gfx/mojom/gpu_fence_handle.mojom-shared.h"
#include "ui/gfx/mojom/transform.mojom-shared.h"
#include "mojo/public/cpp/bindings/lib/interface_serialization.h"
#include "mojo/public/cpp/system/data_pipe.h"



#include "device/vr/public/mojom/vr_service.mojom-data-view.h"  // IWYU pragma: export
#include "base/component_export.h"




namespace std {

template <>
struct hash<::device::mojom::XRHandedness>
    : public mojo::internal::EnumHashImpl<::device::mojom::XRHandedness> {};

template <>
struct hash<::device::mojom::XRTargetRayMode>
    : public mojo::internal::EnumHashImpl<::device::mojom::XRTargetRayMode> {};

template <>
struct hash<::device::mojom::XRSessionFeatureRequestStatus>
    : public mojo::internal::EnumHashImpl<::device::mojom::XRSessionFeatureRequestStatus> {};

template <>
struct hash<::device::mojom::XREnvironmentBlendMode>
    : public mojo::internal::EnumHashImpl<::device::mojom::XREnvironmentBlendMode> {};

template <>
struct hash<::device::mojom::XRInteractionMode>
    : public mojo::internal::EnumHashImpl<::device::mojom::XRInteractionMode> {};

template <>
struct hash<::device::mojom::XREye>
    : public mojo::internal::EnumHashImpl<::device::mojom::XREye> {};

template <>
struct hash<::device::mojom::XRPresentationTransportMethod>
    : public mojo::internal::EnumHashImpl<::device::mojom::XRPresentationTransportMethod> {};

template <>
struct hash<::device::mojom::XRReferenceSpaceType>
    : public mojo::internal::EnumHashImpl<::device::mojom::XRReferenceSpaceType> {};

template <>
struct hash<::device::mojom::XRInputSourceSpaceType>
    : public mojo::internal::EnumHashImpl<::device::mojom::XRInputSourceSpaceType> {};

template <>
struct hash<::device::mojom::XRPlaneOrientation>
    : public mojo::internal::EnumHashImpl<::device::mojom::XRPlaneOrientation> {};

template <>
struct hash<::device::mojom::XRSemanticLabel>
    : public mojo::internal::EnumHashImpl<::device::mojom::XRSemanticLabel> {};

template <>
struct hash<::device::mojom::XRLayerLayout>
    : public mojo::internal::EnumHashImpl<::device::mojom::XRLayerLayout> {};

template <>
struct hash<::device::mojom::CreateCompositionLayerResult>
    : public mojo::internal::EnumHashImpl<::device::mojom::CreateCompositionLayerResult> {};

template <>
struct hash<::device::mojom::XrCompatibleResult>
    : public mojo::internal::EnumHashImpl<::device::mojom::XrCompatibleResult> {};

template <>
struct hash<::device::mojom::EntityTypeForHitTest>
    : public mojo::internal::EnumHashImpl<::device::mojom::EntityTypeForHitTest> {};

template <>
struct hash<::device::mojom::XRVisibilityState>
    : public mojo::internal::EnumHashImpl<::device::mojom::XRVisibilityState> {};

}  // namespace std

namespace mojo {


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::device::mojom::XRHandedness, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XRHandedness, 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<::device::mojom::XRHandedness>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XRHandedness, UserType> ||
                        HasInfallibleConversion(::device::mojom::XRHandedness()),
                    "::device::mojom::XRHandedness 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<::device::mojom::XRTargetRayMode, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XRTargetRayMode, 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<::device::mojom::XRTargetRayMode>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XRTargetRayMode, UserType> ||
                        HasInfallibleConversion(::device::mojom::XRTargetRayMode()),
                    "::device::mojom::XRTargetRayMode 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<::device::mojom::XRSessionFeatureRequestStatus, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XRSessionFeatureRequestStatus, 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<::device::mojom::XRSessionFeatureRequestStatus>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XRSessionFeatureRequestStatus, UserType> ||
                        HasInfallibleConversion(::device::mojom::XRSessionFeatureRequestStatus()),
                    "::device::mojom::XRSessionFeatureRequestStatus 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<::device::mojom::XREnvironmentBlendMode, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XREnvironmentBlendMode, 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<::device::mojom::XREnvironmentBlendMode>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XREnvironmentBlendMode, UserType> ||
                        HasInfallibleConversion(::device::mojom::XREnvironmentBlendMode()),
                    "::device::mojom::XREnvironmentBlendMode 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<::device::mojom::XRInteractionMode, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XRInteractionMode, 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<::device::mojom::XRInteractionMode>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XRInteractionMode, UserType> ||
                        HasInfallibleConversion(::device::mojom::XRInteractionMode()),
                    "::device::mojom::XRInteractionMode 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<::device::mojom::XREye, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XREye, 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<::device::mojom::XREye>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XREye, UserType> ||
                        HasInfallibleConversion(::device::mojom::XREye()),
                    "::device::mojom::XREye 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<::device::mojom::XRPresentationTransportMethod, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XRPresentationTransportMethod, 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<::device::mojom::XRPresentationTransportMethod>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XRPresentationTransportMethod, UserType> ||
                        HasInfallibleConversion(::device::mojom::XRPresentationTransportMethod()),
                    "::device::mojom::XRPresentationTransportMethod 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<::device::mojom::XRReferenceSpaceType, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XRReferenceSpaceType, 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<::device::mojom::XRReferenceSpaceType>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XRReferenceSpaceType, UserType> ||
                        HasInfallibleConversion(::device::mojom::XRReferenceSpaceType()),
                    "::device::mojom::XRReferenceSpaceType 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<::device::mojom::XRInputSourceSpaceType, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XRInputSourceSpaceType, 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<::device::mojom::XRInputSourceSpaceType>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XRInputSourceSpaceType, UserType> ||
                        HasInfallibleConversion(::device::mojom::XRInputSourceSpaceType()),
                    "::device::mojom::XRInputSourceSpaceType 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<::device::mojom::XRPlaneOrientation, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XRPlaneOrientation, 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<::device::mojom::XRPlaneOrientation>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XRPlaneOrientation, UserType> ||
                        HasInfallibleConversion(::device::mojom::XRPlaneOrientation()),
                    "::device::mojom::XRPlaneOrientation 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<::device::mojom::XRSemanticLabel, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XRSemanticLabel, 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<::device::mojom::XRSemanticLabel>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XRSemanticLabel, UserType> ||
                        HasInfallibleConversion(::device::mojom::XRSemanticLabel()),
                    "::device::mojom::XRSemanticLabel 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<::device::mojom::XRLayerLayout, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XRLayerLayout, 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<::device::mojom::XRLayerLayout>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XRLayerLayout, UserType> ||
                        HasInfallibleConversion(::device::mojom::XRLayerLayout()),
                    "::device::mojom::XRLayerLayout 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<::device::mojom::CreateCompositionLayerResult, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::CreateCompositionLayerResult, 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<::device::mojom::CreateCompositionLayerResult>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::CreateCompositionLayerResult, UserType> ||
                        HasInfallibleConversion(::device::mojom::CreateCompositionLayerResult()),
                    "::device::mojom::CreateCompositionLayerResult 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<::device::mojom::XrCompatibleResult, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XrCompatibleResult, 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<::device::mojom::XrCompatibleResult>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XrCompatibleResult, UserType> ||
                        HasInfallibleConversion(::device::mojom::XrCompatibleResult()),
                    "::device::mojom::XrCompatibleResult 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<::device::mojom::EntityTypeForHitTest, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::EntityTypeForHitTest, 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<::device::mojom::EntityTypeForHitTest>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::EntityTypeForHitTest, UserType> ||
                        HasInfallibleConversion(::device::mojom::EntityTypeForHitTest()),
                    "::device::mojom::EntityTypeForHitTest 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<::device::mojom::XRVisibilityState, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::device::mojom::XRVisibilityState, 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<::device::mojom::XRVisibilityState>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::device::mojom::XRVisibilityState, UserType> ||
                        HasInfallibleConversion(::device::mojom::XRVisibilityState()),
                    "::device::mojom::XRVisibilityState 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<::device::mojom::XRDepthConfigDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::device::mojom::XRDepthConfigDataView, UserType>;

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

    
    mojo::internal::Serialize<::device::mojom::XRDepthUsage>(
      Traits::depth_usage(input),
      &fragment->depth_usage);

    
    mojo::internal::Serialize<::device::mojom::XRDepthDataFormat>(
      Traits::depth_data_format(input),
      &fragment->depth_data_format);
    fragment->depth_type_$flag = Traits::depth_type(input).has_value();
    if (Traits::depth_type(input).has_value()) {
      
      mojo::internal::Serialize<::device::mojom::XRDepthType>(
        Traits::depth_type(input).value(),
        &fragment->depth_type_$value);
    } else {
      fragment->depth_type_$value =
          static_cast<int32_t>(::device::mojom::XRDepthType::kMinValue);
    }
  }

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

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

}  // namespace internal


namespace internal {

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

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

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

    decltype(Traits::views(input)) in_views = Traits::views(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->views)::BaseType>
        views_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& views_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRViewDataView>>(
      in_views,
      views_fragment,
      &views_validate_params);

    fragment->views.Set(
        views_fragment.is_null() ? nullptr : views_fragment.data());

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

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

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

    decltype(Traits::depth_configuration(input)) in_depth_configuration = Traits::depth_configuration(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->depth_configuration)::BaseType> depth_configuration_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRDepthConfigDataView>(
      in_depth_configuration,
      depth_configuration_fragment);

    fragment->depth_configuration.Set(
        depth_configuration_fragment.is_null() ? nullptr : depth_configuration_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::data_provider(input)) in_data_provider = Traits::data_provider(input);

    
    mojo::internal::Serialize<mojo::InterfacePtrDataView<::device::mojom::XRFrameDataProviderInterfaceBase>>(
      in_data_provider,
      &fragment->data_provider,
      &fragment.message());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(!mojo::internal::IsHandleOrInterfaceValid(fragment->data_provider)),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
      "invalid data_provider in XRSession struct");

    decltype(Traits::layer_manager(input)) in_layer_manager = Traits::layer_manager(input);

    
    mojo::internal::Serialize<mojo::InterfacePtrDataView<::device::mojom::XRLayerManagerInterfaceBase>>(
      in_layer_manager,
      &fragment->layer_manager,
      &fragment.message());

    decltype(Traits::client_receiver(input)) in_client_receiver = Traits::client_receiver(input);

    
    mojo::internal::Serialize<mojo::InterfaceRequestDataView<::device::mojom::XRSessionClientInterfaceBase>>(
      in_client_receiver,
      &fragment->client_receiver,
      &fragment.message());

    decltype(Traits::submit_frame_sink(input)) in_submit_frame_sink = Traits::submit_frame_sink(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->submit_frame_sink)::BaseType> submit_frame_sink_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRPresentationConnectionDataView>(
      in_submit_frame_sink,
      submit_frame_sink_fragment);

    fragment->submit_frame_sink.Set(
        submit_frame_sink_fragment.is_null() ? nullptr : submit_frame_sink_fragment.data());

    decltype(Traits::enabled_features(input)) in_enabled_features = Traits::enabled_features(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->enabled_features)::BaseType>
        enabled_features_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& enabled_features_validate_params =
        mojo::internal::GetArrayOfEnumsValidator<0, false, ::device::mojom::internal::XRSessionFeature_Data::Validate>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRSessionFeature>>(
      in_enabled_features,
      enabled_features_fragment,
      &enabled_features_validate_params);

    fragment->enabled_features.Set(
        enabled_features_fragment.is_null() ? nullptr : enabled_features_fragment.data());

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

    decltype(Traits::device_config(input)) in_device_config = Traits::device_config(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->device_config)::BaseType> device_config_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRSessionDeviceConfigDataView>(
      in_device_config,
      device_config_fragment);

    fragment->device_config.Set(
        device_config_fragment.is_null() ? nullptr : device_config_fragment.data());

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

    
    mojo::internal::Serialize<::device::mojom::XREnvironmentBlendMode>(
      Traits::enviroment_blend_mode(input),
      &fragment->enviroment_blend_mode);

    
    mojo::internal::Serialize<::device::mojom::XRInteractionMode>(
      Traits::interaction_mode(input),
      &fragment->interaction_mode);

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::provider(input)) in_provider = Traits::provider(input);

    
    mojo::internal::Serialize<mojo::InterfacePtrDataView<::device::mojom::XRPresentationProviderInterfaceBase>>(
      in_provider,
      &fragment->provider,
      &fragment.message());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(!mojo::internal::IsHandleOrInterfaceValid(fragment->provider)),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
      "invalid provider in XRPresentationConnection struct");

    decltype(Traits::client_receiver(input)) in_client_receiver = Traits::client_receiver(input);

    
    mojo::internal::Serialize<mojo::InterfaceRequestDataView<::device::mojom::XRPresentationClientInterfaceBase>>(
      in_client_receiver,
      &fragment->client_receiver,
      &fragment.message());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(!mojo::internal::IsHandleOrInterfaceValid(fragment->client_receiver)),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
      "invalid client_receiver in XRPresentationConnection struct");

    decltype(Traits::transport_options(input)) in_transport_options = Traits::transport_options(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->transport_options)::BaseType> transport_options_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRPresentationTransportOptionsDataView>(
      in_transport_options,
      transport_options_fragment);

    fragment->transport_options.Set(
        transport_options_fragment.is_null() ? nullptr : transport_options_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    
    mojo::internal::Serialize<::device::mojom::XRTargetRayMode>(
      Traits::target_ray_mode(input),
      &fragment->target_ray_mode);

    
    mojo::internal::Serialize<::device::mojom::XRHandedness>(
      Traits::handedness(input),
      &fragment->handedness);

    decltype(Traits::input_from_pointer(input)) in_input_from_pointer = Traits::input_from_pointer(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->input_from_pointer)::BaseType> input_from_pointer_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::TransformDataView>(
      in_input_from_pointer,
      input_from_pointer_fragment);

    fragment->input_from_pointer.Set(
        input_from_pointer_fragment.is_null() ? nullptr : input_from_pointer_fragment.data());

    decltype(Traits::profiles(input)) in_profiles = Traits::profiles(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->profiles)::BaseType>
        profiles_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& profiles_validate_params =
        mojo::internal::GetArrayValidator<0, false, &mojo::internal::GetArrayValidator<0, false, nullptr>()>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<mojo::StringDataView>>(
      in_profiles,
      profiles_fragment,
      &profiles_validate_params);

    fragment->profiles.Set(
        profiles_fragment.is_null() ? nullptr : profiles_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

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

    decltype(Traits::description(input)) in_description = Traits::description(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->description)::BaseType> description_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRInputSourceDescriptionDataView>(
      in_description,
      description_fragment);

    fragment->description.Set(
        description_fragment.is_null() ? nullptr : description_fragment.data());

    decltype(Traits::mojo_from_input(input)) in_mojo_from_input = Traits::mojo_from_input(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mojo_from_input)::BaseType> mojo_from_input_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::TransformDataView>(
      in_mojo_from_input,
      mojo_from_input_fragment);

    fragment->mojo_from_input.Set(
        mojo_from_input_fragment.is_null() ? nullptr : mojo_from_input_fragment.data());

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

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

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

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

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

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

    decltype(Traits::gamepad(input)) in_gamepad = Traits::gamepad(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->gamepad)::BaseType> gamepad_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::GamepadDataView>(
      in_gamepad,
      gamepad_fragment);

    fragment->gamepad.Set(
        gamepad_fragment.is_null() ? nullptr : gamepad_fragment.data());

    decltype(Traits::overlay_pointer_position(input)) in_overlay_pointer_position = Traits::overlay_pointer_position(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->overlay_pointer_position)::BaseType> overlay_pointer_position_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::PointFDataView>(
      in_overlay_pointer_position,
      overlay_pointer_position_fragment);

    fragment->overlay_pointer_position.Set(
        overlay_pointer_position_fragment.is_null() ? nullptr : overlay_pointer_position_fragment.data());

    decltype(Traits::hand_tracking_data(input)) in_hand_tracking_data = Traits::hand_tracking_data(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->hand_tracking_data)::BaseType> hand_tracking_data_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRHandTrackingDataDataView>(
      in_hand_tracking_data,
      hand_tracking_data_fragment);

    fragment->hand_tracking_data.Set(
        hand_tracking_data_fragment.is_null() ? nullptr : hand_tracking_data_fragment.data());
  }

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

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

}  // namespace internal


namespace internal {

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

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

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

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::orientation(input)) in_orientation = Traits::orientation(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->orientation)::BaseType> orientation_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::QuaternionDataView>(
      in_orientation,
      orientation_fragment);

    fragment->orientation.Set(
        orientation_fragment.is_null() ? nullptr : orientation_fragment.data());

    decltype(Traits::position(input)) in_position = Traits::position(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->position)::BaseType> position_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::Point3FDataView>(
      in_position,
      position_fragment);

    fragment->position.Set(
        position_fragment.is_null() ? nullptr : position_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::orientation(input)) in_orientation = Traits::orientation(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->orientation)::BaseType> orientation_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::QuaternionDataView>(
      in_orientation,
      orientation_fragment);

    fragment->orientation.Set(
        orientation_fragment.is_null() ? nullptr : orientation_fragment.data());

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

    decltype(Traits::position(input)) in_position = Traits::position(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->position)::BaseType> position_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::Point3FDataView>(
      in_position,
      position_fragment);

    fragment->position.Set(
        position_fragment.is_null() ? nullptr : position_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::origin(input)) in_origin = Traits::origin(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->origin)::BaseType> origin_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::Point3FDataView>(
      in_origin,
      origin_fragment);

    fragment->origin.Set(
        origin_fragment.is_null() ? nullptr : origin_fragment.data());

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

    decltype(Traits::direction(input)) in_direction = Traits::direction(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->direction)::BaseType> direction_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::Vector3dFDataView>(
      in_direction,
      direction_fragment);

    fragment->direction.Set(
        direction_fragment.is_null() ? nullptr : direction_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::mojo_from_result(input)) in_mojo_from_result = Traits::mojo_from_result(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mojo_from_result)::BaseType> mojo_from_result_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::PoseDataView>(
      in_mojo_from_result,
      mojo_from_result_fragment);

    fragment->mojo_from_result.Set(
        mojo_from_result_fragment.is_null() ? nullptr : mojo_from_result_fragment.data());

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

    decltype(Traits::plane_id(input)) in_plane_id = Traits::plane_id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->plane_id)::BaseType> plane_id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::PlaneIdDataView>(
      in_plane_id,
      plane_id_fragment);

    fragment->plane_id.Set(
        plane_id_fragment.is_null() ? nullptr : plane_id_fragment.data());
  }

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::field_of_view(input)) in_field_of_view = Traits::field_of_view(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->field_of_view)::BaseType> field_of_view_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::VRFieldOfViewDataView>(
      in_field_of_view,
      field_of_view_fragment);

    fragment->field_of_view.Set(
        field_of_view_fragment.is_null() ? nullptr : field_of_view_fragment.data());

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

    decltype(Traits::mojo_from_view(input)) in_mojo_from_view = Traits::mojo_from_view(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mojo_from_view)::BaseType> mojo_from_view_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::TransformDataView>(
      in_mojo_from_view,
      mojo_from_view_fragment);

    fragment->mojo_from_view.Set(
        mojo_from_view_fragment.is_null() ? nullptr : mojo_from_view_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::vertices(input)) in_vertices = Traits::vertices(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->vertices)::BaseType>
        vertices_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& vertices_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::gfx::mojom::PointFDataView>>(
      in_vertices,
      vertices_fragment,
      &vertices_validate_params);

    fragment->vertices.Set(
        vertices_fragment.is_null() ? nullptr : vertices_fragment.data());

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

    decltype(Traits::unvalidated_indices(input)) in_unvalidated_indices = Traits::unvalidated_indices(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->unvalidated_indices)::BaseType>
        unvalidated_indices_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& unvalidated_indices_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<uint32_t>>(
      in_unvalidated_indices,
      unvalidated_indices_fragment,
      &unvalidated_indices_validate_params);

    fragment->unvalidated_indices.Set(
        unvalidated_indices_fragment.is_null() ? nullptr : unvalidated_indices_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    
    mojo::internal::Serialize<::device::mojom::XREye>(
      Traits::eye(input),
      &fragment->eye);

    decltype(Traits::geometry(input)) in_geometry = Traits::geometry(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->geometry)::BaseType> geometry_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRViewGeometryDataView>(
      in_geometry,
      geometry_fragment);

    fragment->geometry.Set(
        geometry_fragment.is_null() ? nullptr : geometry_fragment.data());

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

    decltype(Traits::viewport(input)) in_viewport = Traits::viewport(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->viewport)::BaseType> viewport_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::RectDataView>(
      in_viewport,
      viewport_fragment);

    fragment->viewport.Set(
        viewport_fragment.is_null() ? nullptr : viewport_fragment.data());

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

    decltype(Traits::depth_data(input)) in_depth_data = Traits::depth_data(input);
    mojo::internal::MessageFragment<decltype(fragment->depth_data)>
        depth_data_fragment(fragment.message());
    depth_data_fragment.Claim(&fragment->depth_data);
    
    mojo::internal::Serialize<::device::mojom::XRDepthDataDataView>(
      in_depth_data,
      depth_data_fragment,
      true);

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

    decltype(Traits::visibility_mask(input)) in_visibility_mask = Traits::visibility_mask(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->visibility_mask)::BaseType> visibility_mask_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRVisibilityMaskDataView>(
      in_visibility_mask,
      visibility_mask_fragment);

    fragment->visibility_mask.Set(
        visibility_mask_fragment.is_null() ? nullptr : visibility_mask_fragment.data());

    decltype(Traits::visibility_mask_id(input)) in_visibility_mask_id = Traits::visibility_mask_id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->visibility_mask_id)::BaseType> visibility_mask_id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XrVisibilityMaskIdDataView>(
      in_visibility_mask_id,
      visibility_mask_id_fragment);

    fragment->visibility_mask_id.Set(
        visibility_mask_id_fragment.is_null() ? nullptr : visibility_mask_id_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::mojo_from_stage(input)) in_mojo_from_stage = Traits::mojo_from_stage(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mojo_from_stage)::BaseType> mojo_from_stage_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::TransformDataView>(
      in_mojo_from_stage,
      mojo_from_stage_fragment);

    fragment->mojo_from_stage.Set(
        mojo_from_stage_fragment.is_null() ? nullptr : mojo_from_stage_fragment.data());

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

    decltype(Traits::bounds(input)) in_bounds = Traits::bounds(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->bounds)::BaseType>
        bounds_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& bounds_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::gfx::mojom::Point3FDataView>>(
      in_bounds,
      bounds_fragment,
      &bounds_validate_params);

    fragment->bounds.Set(
        bounds_fragment.is_null() ? nullptr : bounds_fragment.data());
  }

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

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

}  // namespace internal


namespace internal {

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

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

    
    mojo::internal::Serialize<::device::mojom::XRPresentationTransportMethod>(
      Traits::transport_method(input),
      &fragment->transport_method);

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

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

    
    mojo::internal::Serialize<::device::mojom::XRInputSourceSpaceType>(
      Traits::input_source_space_type(input),
      &fragment->input_source_space_type);
  }

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

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

}  // namespace internal


namespace internal {

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

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

    
    mojo::internal::Serialize<::device::mojom::XRHandedness>(
      Traits::handedness(input),
      &fragment->handedness);

    
    mojo::internal::Serialize<::device::mojom::XRHandJoint>(
      Traits::joint(input),
      &fragment->joint);
  }

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

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

}  // namespace internal


namespace internal {

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

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::id(input)) in_id = Traits::id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->id)::BaseType> id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::PlaneIdDataView>(
      in_id,
      id_fragment);

    fragment->id.Set(
        id_fragment.is_null() ? nullptr : id_fragment.data());

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

    
    mojo::internal::Serialize<::device::mojom::XRPlaneOrientation>(
      Traits::orientation(input),
      &fragment->orientation);

    decltype(Traits::mojo_from_plane(input)) in_mojo_from_plane = Traits::mojo_from_plane(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mojo_from_plane)::BaseType> mojo_from_plane_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::PoseDataView>(
      in_mojo_from_plane,
      mojo_from_plane_fragment);

    fragment->mojo_from_plane.Set(
        mojo_from_plane_fragment.is_null() ? nullptr : mojo_from_plane_fragment.data());
    fragment->semantic_label_$flag = Traits::semantic_label(input).has_value();
    if (Traits::semantic_label(input).has_value()) {
      
      mojo::internal::Serialize<::device::mojom::XRSemanticLabel>(
        Traits::semantic_label(input).value(),
        &fragment->semantic_label_$value);
    } else {
      fragment->semantic_label_$value =
          static_cast<int32_t>(::device::mojom::XRSemanticLabel::kMinValue);
    }

    decltype(Traits::polygon(input)) in_polygon = Traits::polygon(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->polygon)::BaseType>
        polygon_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& polygon_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRPlanePointDataDataView>>(
      in_polygon,
      polygon_fragment,
      &polygon_validate_params);

    fragment->polygon.Set(
        polygon_fragment.is_null() ? nullptr : polygon_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::all_planes_ids(input)) in_all_planes_ids = Traits::all_planes_ids(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->all_planes_ids)::BaseType>
        all_planes_ids_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& all_planes_ids_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::PlaneIdDataView>>(
      in_all_planes_ids,
      all_planes_ids_fragment,
      &all_planes_ids_validate_params);

    fragment->all_planes_ids.Set(
        all_planes_ids_fragment.is_null() ? nullptr : all_planes_ids_fragment.data());

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

    decltype(Traits::updated_planes_data(input)) in_updated_planes_data = Traits::updated_planes_data(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->updated_planes_data)::BaseType>
        updated_planes_data_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& updated_planes_data_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRPlaneDataDataView>>(
      in_updated_planes_data,
      updated_planes_data_fragment,
      &updated_planes_data_validate_params);

    fragment->updated_planes_data.Set(
        updated_planes_data_fragment.is_null() ? nullptr : updated_planes_data_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::id(input)) in_id = Traits::id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->id)::BaseType> id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::MeshIdDataView>(
      in_id,
      id_fragment);

    fragment->id.Set(
        id_fragment.is_null() ? nullptr : id_fragment.data());

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

    decltype(Traits::mojo_from_mesh(input)) in_mojo_from_mesh = Traits::mojo_from_mesh(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mojo_from_mesh)::BaseType> mojo_from_mesh_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::PoseDataView>(
      in_mojo_from_mesh,
      mojo_from_mesh_fragment);

    fragment->mojo_from_mesh.Set(
        mojo_from_mesh_fragment.is_null() ? nullptr : mojo_from_mesh_fragment.data());

    decltype(Traits::vertices(input)) in_vertices = Traits::vertices(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->vertices)::BaseType>
        vertices_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& vertices_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<float>>(
      in_vertices,
      vertices_fragment,
      &vertices_validate_params);

    fragment->vertices.Set(
        vertices_fragment.is_null() ? nullptr : vertices_fragment.data());

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

    decltype(Traits::indices(input)) in_indices = Traits::indices(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->indices)::BaseType>
        indices_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& indices_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<uint32_t>>(
      in_indices,
      indices_fragment,
      &indices_validate_params);

    fragment->indices.Set(
        indices_fragment.is_null() ? nullptr : indices_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->indices.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null indices in XRMeshData struct");
    fragment->semantic_label_$flag = Traits::semantic_label(input).has_value();
    if (Traits::semantic_label(input).has_value()) {
      
      mojo::internal::Serialize<::device::mojom::XRSemanticLabel>(
        Traits::semantic_label(input).value(),
        &fragment->semantic_label_$value);
    } else {
      fragment->semantic_label_$value =
          static_cast<int32_t>(::device::mojom::XRSemanticLabel::kMinValue);
    }
  }

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::all_meshes_ids(input)) in_all_meshes_ids = Traits::all_meshes_ids(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->all_meshes_ids)::BaseType>
        all_meshes_ids_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& all_meshes_ids_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::MeshIdDataView>>(
      in_all_meshes_ids,
      all_meshes_ids_fragment,
      &all_meshes_ids_validate_params);

    fragment->all_meshes_ids.Set(
        all_meshes_ids_fragment.is_null() ? nullptr : all_meshes_ids_fragment.data());

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

    decltype(Traits::updated_meshes_data(input)) in_updated_meshes_data = Traits::updated_meshes_data(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->updated_meshes_data)::BaseType>
        updated_meshes_data_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& updated_meshes_data_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRMeshDataDataView>>(
      in_updated_meshes_data,
      updated_meshes_data_fragment,
      &updated_meshes_data_validate_params);

    fragment->updated_meshes_data.Set(
        updated_meshes_data_fragment.is_null() ? nullptr : updated_meshes_data_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::id(input)) in_id = Traits::id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->id)::BaseType> id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::AnchorIdDataView>(
      in_id,
      id_fragment);

    fragment->id.Set(
        id_fragment.is_null() ? nullptr : id_fragment.data());

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

    decltype(Traits::mojo_from_anchor(input)) in_mojo_from_anchor = Traits::mojo_from_anchor(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mojo_from_anchor)::BaseType> mojo_from_anchor_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::PoseDataView>(
      in_mojo_from_anchor,
      mojo_from_anchor_fragment);

    fragment->mojo_from_anchor.Set(
        mojo_from_anchor_fragment.is_null() ? nullptr : mojo_from_anchor_fragment.data());
  }

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::all_anchors_ids(input)) in_all_anchors_ids = Traits::all_anchors_ids(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->all_anchors_ids)::BaseType>
        all_anchors_ids_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& all_anchors_ids_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::AnchorIdDataView>>(
      in_all_anchors_ids,
      all_anchors_ids_fragment,
      &all_anchors_ids_validate_params);

    fragment->all_anchors_ids.Set(
        all_anchors_ids_fragment.is_null() ? nullptr : all_anchors_ids_fragment.data());

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

    decltype(Traits::updated_anchors_data(input)) in_updated_anchors_data = Traits::updated_anchors_data(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->updated_anchors_data)::BaseType>
        updated_anchors_data_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& updated_anchors_data_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRAnchorDataDataView>>(
      in_updated_anchors_data,
      updated_anchors_data_fragment,
      &updated_anchors_data_validate_params);

    fragment->updated_anchors_data.Set(
        updated_anchors_data_fragment.is_null() ? nullptr : updated_anchors_data_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::subscription_id(input)) in_subscription_id = Traits::subscription_id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->subscription_id)::BaseType> subscription_id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::HitTestSubscriptionIdDataView>(
      in_subscription_id,
      subscription_id_fragment);

    fragment->subscription_id.Set(
        subscription_id_fragment.is_null() ? nullptr : subscription_id_fragment.data());

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

    decltype(Traits::hit_test_results(input)) in_hit_test_results = Traits::hit_test_results(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->hit_test_results)::BaseType>
        hit_test_results_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& hit_test_results_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRHitResultDataView>>(
      in_hit_test_results,
      hit_test_results_fragment,
      &hit_test_results_validate_params);

    fragment->hit_test_results.Set(
        hit_test_results_fragment.is_null() ? nullptr : hit_test_results_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::subscription_id(input)) in_subscription_id = Traits::subscription_id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->subscription_id)::BaseType> subscription_id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::HitTestSubscriptionIdDataView>(
      in_subscription_id,
      subscription_id_fragment);

    fragment->subscription_id.Set(
        subscription_id_fragment.is_null() ? nullptr : subscription_id_fragment.data());

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

    decltype(Traits::input_source_id_to_hit_test_results(input)) in_input_source_id_to_hit_test_results = Traits::input_source_id_to_hit_test_results(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->input_source_id_to_hit_test_results)::BaseType>
        input_source_id_to_hit_test_results_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& input_source_id_to_hit_test_results_validate_params =
        mojo::internal::GetMapValidator<*&mojo::internal::GetArrayValidator<0, false, nullptr>(), *&mojo::internal::GetArrayValidator<0, false, &mojo::internal::GetArrayValidator<0, false, nullptr>()>()>();
    
    mojo::internal::Serialize<mojo::MapDataView<uint32_t, mojo::ArrayDataView<::device::mojom::XRHitResultDataView>>>(
      in_input_source_id_to_hit_test_results,
      input_source_id_to_hit_test_results_fragment,
      &input_source_id_to_hit_test_results_validate_params);

    fragment->input_source_id_to_hit_test_results.Set(
        input_source_id_to_hit_test_results_fragment.is_null() ? nullptr : input_source_id_to_hit_test_results_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::results(input)) in_results = Traits::results(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->results)::BaseType>
        results_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& results_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRHitTestSubscriptionResultDataDataView>>(
      in_results,
      results_fragment,
      &results_validate_params);

    fragment->results.Set(
        results_fragment.is_null() ? nullptr : results_fragment.data());

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

    decltype(Traits::transient_input_results(input)) in_transient_input_results = Traits::transient_input_results(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->transient_input_results)::BaseType>
        transient_input_results_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& transient_input_results_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRHitTestTransientInputSubscriptionResultDataDataView>>(
      in_transient_input_results,
      transient_input_results_fragment,
      &transient_input_results_validate_params);

    fragment->transient_input_results.Set(
        transient_input_results_fragment.is_null() ? nullptr : transient_input_results_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::coefficients(input)) in_coefficients = Traits::coefficients(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->coefficients)::BaseType>
        coefficients_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& coefficients_validate_params =
        mojo::internal::GetArrayValidator<9, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::RgbTupleF32DataView>>(
      in_coefficients,
      coefficients_fragment,
      &coefficients_validate_params);

    fragment->coefficients.Set(
        coefficients_fragment.is_null() ? nullptr : coefficients_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

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

    decltype(Traits::positive_x(input)) in_positive_x = Traits::positive_x(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->positive_x)::BaseType>
        positive_x_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& positive_x_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<uint16_t>>(
      in_positive_x,
      positive_x_fragment,
      &positive_x_validate_params);

    fragment->positive_x.Set(
        positive_x_fragment.is_null() ? nullptr : positive_x_fragment.data());

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

    decltype(Traits::negative_x(input)) in_negative_x = Traits::negative_x(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->negative_x)::BaseType>
        negative_x_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& negative_x_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<uint16_t>>(
      in_negative_x,
      negative_x_fragment,
      &negative_x_validate_params);

    fragment->negative_x.Set(
        negative_x_fragment.is_null() ? nullptr : negative_x_fragment.data());

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

    decltype(Traits::positive_y(input)) in_positive_y = Traits::positive_y(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->positive_y)::BaseType>
        positive_y_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& positive_y_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<uint16_t>>(
      in_positive_y,
      positive_y_fragment,
      &positive_y_validate_params);

    fragment->positive_y.Set(
        positive_y_fragment.is_null() ? nullptr : positive_y_fragment.data());

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

    decltype(Traits::negative_y(input)) in_negative_y = Traits::negative_y(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->negative_y)::BaseType>
        negative_y_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& negative_y_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<uint16_t>>(
      in_negative_y,
      negative_y_fragment,
      &negative_y_validate_params);

    fragment->negative_y.Set(
        negative_y_fragment.is_null() ? nullptr : negative_y_fragment.data());

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

    decltype(Traits::positive_z(input)) in_positive_z = Traits::positive_z(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->positive_z)::BaseType>
        positive_z_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& positive_z_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<uint16_t>>(
      in_positive_z,
      positive_z_fragment,
      &positive_z_validate_params);

    fragment->positive_z.Set(
        positive_z_fragment.is_null() ? nullptr : positive_z_fragment.data());

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

    decltype(Traits::negative_z(input)) in_negative_z = Traits::negative_z(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->negative_z)::BaseType>
        negative_z_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& negative_z_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<uint16_t>>(
      in_negative_z,
      negative_z_fragment,
      &negative_z_validate_params);

    fragment->negative_z.Set(
        negative_z_fragment.is_null() ? nullptr : negative_z_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::spherical_harmonics(input)) in_spherical_harmonics = Traits::spherical_harmonics(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->spherical_harmonics)::BaseType> spherical_harmonics_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRSphericalHarmonicsDataView>(
      in_spherical_harmonics,
      spherical_harmonics_fragment);

    fragment->spherical_harmonics.Set(
        spherical_harmonics_fragment.is_null() ? nullptr : spherical_harmonics_fragment.data());

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

    decltype(Traits::main_light_direction(input)) in_main_light_direction = Traits::main_light_direction(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->main_light_direction)::BaseType> main_light_direction_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::Vector3dFDataView>(
      in_main_light_direction,
      main_light_direction_fragment);

    fragment->main_light_direction.Set(
        main_light_direction_fragment.is_null() ? nullptr : main_light_direction_fragment.data());

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

    decltype(Traits::main_light_intensity(input)) in_main_light_intensity = Traits::main_light_intensity(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->main_light_intensity)::BaseType> main_light_intensity_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::RgbTupleF32DataView>(
      in_main_light_intensity,
      main_light_intensity_fragment);

    fragment->main_light_intensity.Set(
        main_light_intensity_fragment.is_null() ? nullptr : main_light_intensity_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::cube_map(input)) in_cube_map = Traits::cube_map(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->cube_map)::BaseType> cube_map_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRCubeMapDataView>(
      in_cube_map,
      cube_map_fragment);

    fragment->cube_map.Set(
        cube_map_fragment.is_null() ? nullptr : cube_map_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::light_probe(input)) in_light_probe = Traits::light_probe(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->light_probe)::BaseType> light_probe_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRLightProbeDataView>(
      in_light_probe,
      light_probe_fragment);

    fragment->light_probe.Set(
        light_probe_fragment.is_null() ? nullptr : light_probe_fragment.data());

    decltype(Traits::reflection_probe(input)) in_reflection_probe = Traits::reflection_probe(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->reflection_probe)::BaseType> reflection_probe_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRReflectionProbeDataView>(
      in_reflection_probe,
      reflection_probe_fragment);

    fragment->reflection_probe.Set(
        reflection_probe_fragment.is_null() ? nullptr : reflection_probe_fragment.data());
  }

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

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

}  // namespace internal


namespace internal {

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

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::pixel_data(input)) in_pixel_data = Traits::pixel_data(input);
    mojo::internal::MessageFragment<decltype(fragment->pixel_data)>
        pixel_data_fragment(fragment.message());
    pixel_data_fragment.Claim(&fragment->pixel_data);
    
    mojo::internal::Serialize<::mojo_base::mojom::BigBufferDataView>(
      in_pixel_data,
      pixel_data_fragment,
      true);

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

    decltype(Traits::norm_texture_from_norm_view(input)) in_norm_texture_from_norm_view = Traits::norm_texture_from_norm_view(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->norm_texture_from_norm_view)::BaseType> norm_texture_from_norm_view_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::TransformDataView>(
      in_norm_texture_from_norm_view,
      norm_texture_from_norm_view_fragment);

    fragment->norm_texture_from_norm_view.Set(
        norm_texture_from_norm_view_fragment.is_null() ? nullptr : norm_texture_from_norm_view_fragment.data());

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

    decltype(Traits::size(input)) in_size = Traits::size(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->size)::BaseType> size_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::SizeDataView>(
      in_size,
      size_fragment);

    fragment->size.Set(
        size_fragment.is_null() ? nullptr : size_fragment.data());

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

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

    decltype(Traits::view_geometry(input)) in_view_geometry = Traits::view_geometry(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->view_geometry)::BaseType> view_geometry_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRViewGeometryDataView>(
      in_view_geometry,
      view_geometry_fragment);

    fragment->view_geometry.Set(
        view_geometry_fragment.is_null() ? nullptr : view_geometry_fragment.data());
  }

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

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

}  // namespace internal


namespace internal {

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

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

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

    decltype(Traits::mojo_from_image(input)) in_mojo_from_image = Traits::mojo_from_image(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mojo_from_image)::BaseType> mojo_from_image_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::PoseDataView>(
      in_mojo_from_image,
      mojo_from_image_fragment);

    fragment->mojo_from_image.Set(
        mojo_from_image_fragment.is_null() ? nullptr : mojo_from_image_fragment.data());

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::images_data(input)) in_images_data = Traits::images_data(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->images_data)::BaseType>
        images_data_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& images_data_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRTrackedImageDataDataView>>(
      in_images_data,
      images_data_fragment,
      &images_data_validate_params);

    fragment->images_data.Set(
        images_data_fragment.is_null() ? nullptr : images_data_fragment.data());

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

    decltype(Traits::image_trackable_scores(input)) in_image_trackable_scores = Traits::image_trackable_scores(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->image_trackable_scores)::BaseType>
        image_trackable_scores_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& image_trackable_scores_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<bool>>(
      in_image_trackable_scores,
      image_trackable_scores_fragment,
      &image_trackable_scores_validate_params);

    fragment->image_trackable_scores.Set(
        image_trackable_scores_fragment.is_null() ? nullptr : image_trackable_scores_fragment.data());
  }

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

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

}  // namespace internal


namespace internal {

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::native_origin_from_layer(input)) in_native_origin_from_layer = Traits::native_origin_from_layer(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->native_origin_from_layer)::BaseType> native_origin_from_layer_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::TransformDataView>(
      in_native_origin_from_layer,
      native_origin_from_layer_fragment);

    fragment->native_origin_from_layer.Set(
        native_origin_from_layer_fragment.is_null() ? nullptr : native_origin_from_layer_fragment.data());

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::native_origin_from_layer(input)) in_native_origin_from_layer = Traits::native_origin_from_layer(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->native_origin_from_layer)::BaseType> native_origin_from_layer_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::TransformDataView>(
      in_native_origin_from_layer,
      native_origin_from_layer_fragment);

    fragment->native_origin_from_layer.Set(
        native_origin_from_layer_fragment.is_null() ? nullptr : native_origin_from_layer_fragment.data());

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

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::native_origin_from_layer(input)) in_native_origin_from_layer = Traits::native_origin_from_layer(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->native_origin_from_layer)::BaseType> native_origin_from_layer_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::TransformDataView>(
      in_native_origin_from_layer,
      native_origin_from_layer_fragment);

    fragment->native_origin_from_layer.Set(
        native_origin_from_layer_fragment.is_null() ? nullptr : native_origin_from_layer_fragment.data());

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

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

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::orientation(input)) in_orientation = Traits::orientation(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->orientation)::BaseType> orientation_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::QuaternionDataView>(
      in_orientation,
      orientation_fragment);

    fragment->orientation.Set(
        orientation_fragment.is_null() ? nullptr : orientation_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::layer_id(input)) in_layer_id = Traits::layer_id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->layer_id)::BaseType> layer_id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::LayerIdDataView>(
      in_layer_id,
      layer_id_fragment);

    fragment->layer_id.Set(
        layer_id_fragment.is_null() ? nullptr : layer_id_fragment.data());

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

    
    mojo::internal::Serialize<::device::mojom::XRLayerLayout>(
      Traits::layout(input),
      &fragment->layout);

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

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

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

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

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

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

    decltype(Traits::native_origin_information(input)) in_native_origin_information = Traits::native_origin_information(input);
    mojo::internal::MessageFragment<decltype(fragment->native_origin_information)>
        native_origin_information_fragment(fragment.message());
    native_origin_information_fragment.Claim(&fragment->native_origin_information);
    
    mojo::internal::Serialize<::device::mojom::XRNativeOriginInformationDataView>(
      in_native_origin_information,
      native_origin_information_fragment,
      true);

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

    decltype(Traits::layer_data(input)) in_layer_data = Traits::layer_data(input);
    mojo::internal::MessageFragment<decltype(fragment->layer_data)>
        layer_data_fragment(fragment.message());
    layer_data_fragment.Claim(&fragment->layer_data);
    
    mojo::internal::Serialize<::device::mojom::XRLayerSpecificDataDataView>(
      in_layer_data,
      layer_data_fragment,
      true);

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::read_only_data(input)) in_read_only_data = Traits::read_only_data(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->read_only_data)::BaseType> read_only_data_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRLayerReadOnlyDataDataView>(
      in_read_only_data,
      read_only_data_fragment);

    fragment->read_only_data.Set(
        read_only_data_fragment.is_null() ? nullptr : read_only_data_fragment.data());

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

    decltype(Traits::mutable_data(input)) in_mutable_data = Traits::mutable_data(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mutable_data)::BaseType> mutable_data_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRLayerMutableDataDataView>(
      in_mutable_data,
      mutable_data_fragment);

    fragment->mutable_data.Set(
        mutable_data_fragment.is_null() ? nullptr : mutable_data_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::layer_id(input)) in_layer_id = Traits::layer_id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->layer_id)::BaseType> layer_id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::LayerIdDataView>(
      in_layer_id,
      layer_id_fragment);

    fragment->layer_id.Set(
        layer_id_fragment.is_null() ? nullptr : layer_id_fragment.data());

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

    decltype(Traits::buffer_shared_image(input)) in_buffer_shared_image = Traits::buffer_shared_image(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->buffer_shared_image)::BaseType> buffer_shared_image_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gpu::mojom::ExportedSharedImageDataView>(
      in_buffer_shared_image,
      buffer_shared_image_fragment);

    fragment->buffer_shared_image.Set(
        buffer_shared_image_fragment.is_null() ? nullptr : buffer_shared_image_fragment.data());

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

    decltype(Traits::buffer_sync_token(input)) in_buffer_sync_token = Traits::buffer_sync_token(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->buffer_sync_token)::BaseType> buffer_sync_token_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gpu::mojom::SyncTokenDataView>(
      in_buffer_sync_token,
      buffer_sync_token_fragment);

    fragment->buffer_sync_token.Set(
        buffer_sync_token_fragment.is_null() ? nullptr : buffer_sync_token_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

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

    decltype(Traits::mojo_from_viewer(input)) in_mojo_from_viewer = Traits::mojo_from_viewer(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mojo_from_viewer)::BaseType> mojo_from_viewer_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::VRPoseDataView>(
      in_mojo_from_viewer,
      mojo_from_viewer_fragment);

    fragment->mojo_from_viewer.Set(
        mojo_from_viewer_fragment.is_null() ? nullptr : mojo_from_viewer_fragment.data());

    decltype(Traits::views(input)) in_views = Traits::views(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->views)::BaseType>
        views_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& views_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRViewDataView>>(
      in_views,
      views_fragment,
      &views_validate_params);

    fragment->views.Set(
        views_fragment.is_null() ? nullptr : views_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::render_info(input)) in_render_info = Traits::render_info(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->render_info)::BaseType> render_info_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRRenderInfoDataView>(
      in_render_info,
      render_info_fragment);

    fragment->render_info.Set(
        render_info_fragment.is_null() ? nullptr : render_info_fragment.data());

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

    decltype(Traits::time_delta(input)) in_time_delta = Traits::time_delta(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->time_delta)::BaseType> time_delta_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::TimeDeltaDataView>(
      in_time_delta,
      time_delta_fragment);

    fragment->time_delta.Set(
        time_delta_fragment.is_null() ? nullptr : time_delta_fragment.data());

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

    decltype(Traits::buffer_shared_image(input)) in_buffer_shared_image = Traits::buffer_shared_image(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->buffer_shared_image)::BaseType> buffer_shared_image_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gpu::mojom::ExportedSharedImageDataView>(
      in_buffer_shared_image,
      buffer_shared_image_fragment);

    fragment->buffer_shared_image.Set(
        buffer_shared_image_fragment.is_null() ? nullptr : buffer_shared_image_fragment.data());

    decltype(Traits::buffer_sync_token(input)) in_buffer_sync_token = Traits::buffer_sync_token(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->buffer_sync_token)::BaseType> buffer_sync_token_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gpu::mojom::SyncTokenDataView>(
      in_buffer_sync_token,
      buffer_sync_token_fragment);

    fragment->buffer_sync_token.Set(
        buffer_sync_token_fragment.is_null() ? nullptr : buffer_sync_token_fragment.data());

    decltype(Traits::camera_image_buffer_shared_image(input)) in_camera_image_buffer_shared_image = Traits::camera_image_buffer_shared_image(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->camera_image_buffer_shared_image)::BaseType> camera_image_buffer_shared_image_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gpu::mojom::ExportedSharedImageDataView>(
      in_camera_image_buffer_shared_image,
      camera_image_buffer_shared_image_fragment);

    fragment->camera_image_buffer_shared_image.Set(
        camera_image_buffer_shared_image_fragment.is_null() ? nullptr : camera_image_buffer_shared_image_fragment.data());

    decltype(Traits::camera_image_buffer_sync_token(input)) in_camera_image_buffer_sync_token = Traits::camera_image_buffer_sync_token(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->camera_image_buffer_sync_token)::BaseType> camera_image_buffer_sync_token_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gpu::mojom::SyncTokenDataView>(
      in_camera_image_buffer_sync_token,
      camera_image_buffer_sync_token_fragment);

    fragment->camera_image_buffer_sync_token.Set(
        camera_image_buffer_sync_token_fragment.is_null() ? nullptr : camera_image_buffer_sync_token_fragment.data());

    decltype(Traits::camera_image_size(input)) in_camera_image_size = Traits::camera_image_size(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->camera_image_size)::BaseType> camera_image_size_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::SizeDataView>(
      in_camera_image_size,
      camera_image_size_fragment);

    fragment->camera_image_size.Set(
        camera_image_size_fragment.is_null() ? nullptr : camera_image_size_fragment.data());

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

    decltype(Traits::mojo_from_floor(input)) in_mojo_from_floor = Traits::mojo_from_floor(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mojo_from_floor)::BaseType> mojo_from_floor_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gfx::mojom::TransformDataView>(
      in_mojo_from_floor,
      mojo_from_floor_fragment);

    fragment->mojo_from_floor.Set(
        mojo_from_floor_fragment.is_null() ? nullptr : mojo_from_floor_fragment.data());

    decltype(Traits::input_state(input)) in_input_state = Traits::input_state(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->input_state)::BaseType>
        input_state_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& input_state_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRInputSourceStateDataView>>(
      in_input_state,
      input_state_fragment,
      &input_state_validate_params);

    fragment->input_state.Set(
        input_state_fragment.is_null() ? nullptr : input_state_fragment.data());

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

    decltype(Traits::stage_parameters(input)) in_stage_parameters = Traits::stage_parameters(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->stage_parameters)::BaseType> stage_parameters_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::VRStageParametersDataView>(
      in_stage_parameters,
      stage_parameters_fragment);

    fragment->stage_parameters.Set(
        stage_parameters_fragment.is_null() ? nullptr : stage_parameters_fragment.data());

    decltype(Traits::detected_planes_data(input)) in_detected_planes_data = Traits::detected_planes_data(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->detected_planes_data)::BaseType> detected_planes_data_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRPlaneDetectionDataDataView>(
      in_detected_planes_data,
      detected_planes_data_fragment);

    fragment->detected_planes_data.Set(
        detected_planes_data_fragment.is_null() ? nullptr : detected_planes_data_fragment.data());

    decltype(Traits::detected_meshes_data(input)) in_detected_meshes_data = Traits::detected_meshes_data(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->detected_meshes_data)::BaseType> detected_meshes_data_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRMeshDetectionDataDataView>(
      in_detected_meshes_data,
      detected_meshes_data_fragment);

    fragment->detected_meshes_data.Set(
        detected_meshes_data_fragment.is_null() ? nullptr : detected_meshes_data_fragment.data());

    decltype(Traits::anchors_data(input)) in_anchors_data = Traits::anchors_data(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->anchors_data)::BaseType> anchors_data_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRAnchorsDataDataView>(
      in_anchors_data,
      anchors_data_fragment);

    fragment->anchors_data.Set(
        anchors_data_fragment.is_null() ? nullptr : anchors_data_fragment.data());

    decltype(Traits::composition_layers_data(input)) in_composition_layers_data = Traits::composition_layers_data(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->composition_layers_data)::BaseType>
        composition_layers_data_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& composition_layers_data_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::XRLayerFrameDataDataView>>(
      in_composition_layers_data,
      composition_layers_data_fragment,
      &composition_layers_data_validate_params);

    fragment->composition_layers_data.Set(
        composition_layers_data_fragment.is_null() ? nullptr : composition_layers_data_fragment.data());

    decltype(Traits::light_estimation_data(input)) in_light_estimation_data = Traits::light_estimation_data(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->light_estimation_data)::BaseType> light_estimation_data_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRLightEstimationDataDataView>(
      in_light_estimation_data,
      light_estimation_data_fragment);

    fragment->light_estimation_data.Set(
        light_estimation_data_fragment.is_null() ? nullptr : light_estimation_data_fragment.data());

    decltype(Traits::hit_test_subscription_results(input)) in_hit_test_subscription_results = Traits::hit_test_subscription_results(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->hit_test_subscription_results)::BaseType> hit_test_subscription_results_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRHitTestSubscriptionResultsDataDataView>(
      in_hit_test_subscription_results,
      hit_test_subscription_results_fragment);

    fragment->hit_test_subscription_results.Set(
        hit_test_subscription_results_fragment.is_null() ? nullptr : hit_test_subscription_results_fragment.data());

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

    decltype(Traits::tracked_images(input)) in_tracked_images = Traits::tracked_images(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->tracked_images)::BaseType> tracked_images_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRTrackedImagesDataDataView>(
      in_tracked_images,
      tracked_images_fragment);

    fragment->tracked_images.Set(
        tracked_images_fragment.is_null() ? nullptr : tracked_images_fragment.data());
  }

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::session(input)) in_session = Traits::session(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->session)::BaseType> session_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::XRSessionDataView>(
      in_session,
      session_fragment);

    fragment->session.Set(
        session_fragment.is_null() ? nullptr : session_fragment.data());

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

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

    decltype(Traits::metrics_recorder(input)) in_metrics_recorder = Traits::metrics_recorder(input);

    
    mojo::internal::Serialize<mojo::InterfacePtrDataView<::device::mojom::XRSessionMetricsRecorderInterfaceBase>>(
      in_metrics_recorder,
      &fragment->metrics_recorder,
      &fragment.message());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(!mojo::internal::IsHandleOrInterfaceValid(fragment->metrics_recorder)),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
      "invalid metrics_recorder in RequestSessionSuccess struct");

    decltype(Traits::xr_internals_listener(input)) in_xr_internals_listener = Traits::xr_internals_listener(input);

    
    mojo::internal::Serialize<mojo::InterfacePtrDataView<::device::mojom::WebXrInternalsRendererListenerInterfaceBase>>(
      in_xr_internals_listener,
      &fragment->xr_internals_listener,
      &fragment.message());
  }

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

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

}  // namespace internal


namespace internal {

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

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

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

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

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::layer_id(input)) in_layer_id = Traits::layer_id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->layer_id)::BaseType> layer_id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::device::mojom::LayerIdDataView>(
      in_layer_id,
      layer_id_fragment);

    fragment->layer_id.Set(
        layer_id_fragment.is_null() ? nullptr : layer_id_fragment.data());

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

    decltype(Traits::shared_image_export_result(input)) in_shared_image_export_result = Traits::shared_image_export_result(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->shared_image_export_result)::BaseType> shared_image_export_result_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::gpu::mojom::SharedImageExportResultDataView>(
      in_shared_image_export_result,
      shared_image_export_result_fragment);

    fragment->shared_image_export_result.Set(
        shared_image_export_result_fragment.is_null() ? nullptr : shared_image_export_result_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::device::mojom::internal::XRNativeOriginInformation_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 ::device::mojom::XRNativeOriginInformationDataView::Tag::kInputSourceSpaceInfo: {
    decltype(Traits::input_source_space_info(input))
    in_input_source_space_info = Traits::input_source_space_info(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_input_source_space_info)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::XRInputSourceSpaceInfoDataView>(
  in_input_source_space_info,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null input_source_space_info in XRNativeOriginInformation union");
    fragment->data.f_input_source_space_info.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::device::mojom::XRNativeOriginInformationDataView::Tag::kPlaneId: {
    decltype(Traits::plane_id(input))
    in_plane_id = Traits::plane_id(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_plane_id)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::PlaneIdDataView>(
  in_plane_id,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null plane_id in XRNativeOriginInformation union");
    fragment->data.f_plane_id.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::device::mojom::XRNativeOriginInformationDataView::Tag::kMeshId: {
    decltype(Traits::mesh_id(input))
    in_mesh_id = Traits::mesh_id(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_mesh_id)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::MeshIdDataView>(
  in_mesh_id,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null mesh_id in XRNativeOriginInformation union");
    fragment->data.f_mesh_id.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::device::mojom::XRNativeOriginInformationDataView::Tag::kAnchorId: {
    decltype(Traits::anchor_id(input))
    in_anchor_id = Traits::anchor_id(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_anchor_id)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::AnchorIdDataView>(
  in_anchor_id,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null anchor_id in XRNativeOriginInformation union");
    fragment->data.f_anchor_id.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::device::mojom::XRNativeOriginInformationDataView::Tag::kReferenceSpaceType: {
    decltype(Traits::reference_space_type(input))
    in_reference_space_type = Traits::reference_space_type(input);
        
mojo::internal::Serialize<::device::mojom::XRReferenceSpaceType>(
  in_reference_space_type,
  &fragment->data.f_reference_space_type);
    break;
  }
  case ::device::mojom::XRNativeOriginInformationDataView::Tag::kHandJointSpaceInfo: {
    decltype(Traits::hand_joint_space_info(input))
    in_hand_joint_space_info = Traits::hand_joint_space_info(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_hand_joint_space_info)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::XRHandJointSpaceInfoDataView>(
  in_hand_joint_space_info,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null hand_joint_space_info in XRNativeOriginInformation union");
    fragment->data.f_hand_joint_space_info.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::device::mojom::XRNativeOriginInformationDataView::Tag::kImageIndex: {
    decltype(Traits::image_index(input))
    in_image_index = Traits::image_index(input);
    fragment->data.f_image_index = in_image_index;
    break;
  }
}
  }

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

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

}  // namespace internal


namespace internal {

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

  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::device::mojom::internal::XRDepthData_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 ::device::mojom::XRDepthDataDataView::Tag::kDataStillValid: {
    decltype(Traits::data_still_valid(input))
    in_data_still_valid = Traits::data_still_valid(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_data_still_valid)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::XRDepthDataStillValidDataView>(
  in_data_still_valid,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null data_still_valid in XRDepthData union");
    fragment->data.f_data_still_valid.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::device::mojom::XRDepthDataDataView::Tag::kUpdatedDepthData: {
    decltype(Traits::updated_depth_data(input))
    in_updated_depth_data = Traits::updated_depth_data(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_updated_depth_data)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::XRDepthDataUpdatedDataView>(
  in_updated_depth_data,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null updated_depth_data in XRDepthData union");
    fragment->data.f_updated_depth_data.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
}
  }

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

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

}  // namespace internal


namespace internal {

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

  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::device::mojom::internal::XRLayerSpecificData_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 ::device::mojom::XRLayerSpecificDataDataView::Tag::kProjection: {
    decltype(Traits::projection(input))
    in_projection = Traits::projection(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_projection)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::XRProjectionLayerDataDataView>(
  in_projection,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null projection in XRLayerSpecificData union");
    fragment->data.f_projection.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::device::mojom::XRLayerSpecificDataDataView::Tag::kQuad: {
    decltype(Traits::quad(input))
    in_quad = Traits::quad(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_quad)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::XRQuadLayerDataDataView>(
  in_quad,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null quad in XRLayerSpecificData union");
    fragment->data.f_quad.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::device::mojom::XRLayerSpecificDataDataView::Tag::kCylinder: {
    decltype(Traits::cylinder(input))
    in_cylinder = Traits::cylinder(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_cylinder)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::XRCylinderLayerDataDataView>(
  in_cylinder,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null cylinder in XRLayerSpecificData union");
    fragment->data.f_cylinder.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::device::mojom::XRLayerSpecificDataDataView::Tag::kEquirect: {
    decltype(Traits::equirect(input))
    in_equirect = Traits::equirect(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_equirect)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::XREquirectLayerDataDataView>(
  in_equirect,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null equirect in XRLayerSpecificData union");
    fragment->data.f_equirect.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::device::mojom::XRLayerSpecificDataDataView::Tag::kCube: {
    decltype(Traits::cube(input))
    in_cube = Traits::cube(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_cube)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::XRCubeLayerDataDataView>(
  in_cube,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null cube in XRLayerSpecificData union");
    fragment->data.f_cube.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
}
  }

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

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

}  // namespace internal


namespace internal {

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

  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::device::mojom::internal::RequestSessionResult_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 ::device::mojom::RequestSessionResultDataView::Tag::kSuccess: {
    decltype(Traits::success(input))
    in_success = Traits::success(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_success)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::device::mojom::RequestSessionSuccessDataView>(
  in_success,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null success in RequestSessionResult union");
    fragment->data.f_success.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::device::mojom::RequestSessionResultDataView::Tag::kFailureReason: {
    decltype(Traits::failure_reason(input))
    in_failure_reason = Traits::failure_reason(input);
        
mojo::internal::Serialize<::device::mojom::RequestSessionError>(
  in_failure_reason,
  &fragment->data.f_failure_reason);
    break;
  }
}
  }

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

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

}  // namespace internal

}  // namespace mojo


namespace device::mojom {



inline void XRSessionDeviceConfigDataView::GetViewsDataView(
    mojo::ArrayDataView<XRViewDataView>* output) {
  auto pointer = data_->views.Get();
  *output = mojo::ArrayDataView<XRViewDataView>(pointer, message_);
}
inline void XRSessionDeviceConfigDataView::GetDepthConfigurationDataView(
    XRDepthConfigDataView* output) {
  auto pointer = data_->depth_configuration.Get();
  *output = XRDepthConfigDataView(pointer, message_);
}


inline void XRSessionDataView::GetSubmitFrameSinkDataView(
    XRPresentationConnectionDataView* output) {
  auto pointer = data_->submit_frame_sink.Get();
  *output = XRPresentationConnectionDataView(pointer, message_);
}
inline void XRSessionDataView::GetEnabledFeaturesDataView(
    mojo::ArrayDataView<::device::mojom::XRSessionFeature>* output) {
  auto pointer = data_->enabled_features.Get();
  *output = mojo::ArrayDataView<::device::mojom::XRSessionFeature>(pointer, message_);
}
inline void XRSessionDataView::GetDeviceConfigDataView(
    XRSessionDeviceConfigDataView* output) {
  auto pointer = data_->device_config.Get();
  *output = XRSessionDeviceConfigDataView(pointer, message_);
}


inline void XRPresentationConnectionDataView::GetTransportOptionsDataView(
    XRPresentationTransportOptionsDataView* output) {
  auto pointer = data_->transport_options.Get();
  *output = XRPresentationTransportOptionsDataView(pointer, message_);
}


inline void XRInputSourceDescriptionDataView::GetInputFromPointerDataView(
    ::gfx::mojom::TransformDataView* output) {
  auto pointer = data_->input_from_pointer.Get();
  *output = ::gfx::mojom::TransformDataView(pointer, message_);
}
inline void XRInputSourceDescriptionDataView::GetProfilesDataView(
    mojo::ArrayDataView<mojo::StringDataView>* output) {
  auto pointer = data_->profiles.Get();
  *output = mojo::ArrayDataView<mojo::StringDataView>(pointer, message_);
}


inline void XRInputSourceStateDataView::GetDescriptionDataView(
    XRInputSourceDescriptionDataView* output) {
  auto pointer = data_->description.Get();
  *output = XRInputSourceDescriptionDataView(pointer, message_);
}
inline void XRInputSourceStateDataView::GetMojoFromInputDataView(
    ::gfx::mojom::TransformDataView* output) {
  auto pointer = data_->mojo_from_input.Get();
  *output = ::gfx::mojom::TransformDataView(pointer, message_);
}
inline void XRInputSourceStateDataView::GetGamepadDataView(
    ::device::mojom::GamepadDataView* output) {
  auto pointer = data_->gamepad.Get();
  *output = ::device::mojom::GamepadDataView(pointer, message_);
}
inline void XRInputSourceStateDataView::GetOverlayPointerPositionDataView(
    ::gfx::mojom::PointFDataView* output) {
  auto pointer = data_->overlay_pointer_position.Get();
  *output = ::gfx::mojom::PointFDataView(pointer, message_);
}
inline void XRInputSourceStateDataView::GetHandTrackingDataDataView(
    ::device::mojom::XRHandTrackingDataDataView* output) {
  auto pointer = data_->hand_tracking_data.Get();
  *output = ::device::mojom::XRHandTrackingDataDataView(pointer, message_);
}




inline void VRPoseDataView::GetOrientationDataView(
    ::gfx::mojom::QuaternionDataView* output) {
  auto pointer = data_->orientation.Get();
  *output = ::gfx::mojom::QuaternionDataView(pointer, message_);
}
inline void VRPoseDataView::GetPositionDataView(
    ::gfx::mojom::Point3FDataView* output) {
  auto pointer = data_->position.Get();
  *output = ::gfx::mojom::Point3FDataView(pointer, message_);
}


inline void PoseDataView::GetOrientationDataView(
    ::gfx::mojom::QuaternionDataView* output) {
  auto pointer = data_->orientation.Get();
  *output = ::gfx::mojom::QuaternionDataView(pointer, message_);
}
inline void PoseDataView::GetPositionDataView(
    ::gfx::mojom::Point3FDataView* output) {
  auto pointer = data_->position.Get();
  *output = ::gfx::mojom::Point3FDataView(pointer, message_);
}












inline void XRRayDataView::GetOriginDataView(
    ::gfx::mojom::Point3FDataView* output) {
  auto pointer = data_->origin.Get();
  *output = ::gfx::mojom::Point3FDataView(pointer, message_);
}
inline void XRRayDataView::GetDirectionDataView(
    ::gfx::mojom::Vector3dFDataView* output) {
  auto pointer = data_->direction.Get();
  *output = ::gfx::mojom::Vector3dFDataView(pointer, message_);
}


inline void XRHitResultDataView::GetMojoFromResultDataView(
    PoseDataView* output) {
  auto pointer = data_->mojo_from_result.Get();
  *output = PoseDataView(pointer, message_);
}
inline void XRHitResultDataView::GetPlaneIdDataView(
    PlaneIdDataView* output) {
  auto pointer = data_->plane_id.Get();
  *output = PlaneIdDataView(pointer, message_);
}


inline void XRViewGeometryDataView::GetFieldOfViewDataView(
    VRFieldOfViewDataView* output) {
  auto pointer = data_->field_of_view.Get();
  *output = VRFieldOfViewDataView(pointer, message_);
}
inline void XRViewGeometryDataView::GetMojoFromViewDataView(
    ::gfx::mojom::TransformDataView* output) {
  auto pointer = data_->mojo_from_view.Get();
  *output = ::gfx::mojom::TransformDataView(pointer, message_);
}


inline void XRVisibilityMaskDataView::GetVerticesDataView(
    mojo::ArrayDataView<::gfx::mojom::PointFDataView>* output) {
  auto pointer = data_->vertices.Get();
  *output = mojo::ArrayDataView<::gfx::mojom::PointFDataView>(pointer, message_);
}
inline void XRVisibilityMaskDataView::GetUnvalidatedIndicesDataView(
    mojo::ArrayDataView<uint32_t>* output) {
  auto pointer = data_->unvalidated_indices.Get();
  *output = mojo::ArrayDataView<uint32_t>(pointer, message_);
}


inline void XRViewDataView::GetGeometryDataView(
    XRViewGeometryDataView* output) {
  auto pointer = data_->geometry.Get();
  *output = XRViewGeometryDataView(pointer, message_);
}
inline void XRViewDataView::GetViewportDataView(
    ::gfx::mojom::RectDataView* output) {
  auto pointer = data_->viewport.Get();
  *output = ::gfx::mojom::RectDataView(pointer, message_);
}
inline void XRViewDataView::GetDepthDataDataView(
    XRDepthDataDataView* output) {
  auto pointer = &data_->depth_data;
  *output = XRDepthDataDataView(pointer, message_);
}
inline void XRViewDataView::GetVisibilityMaskDataView(
    XRVisibilityMaskDataView* output) {
  auto pointer = data_->visibility_mask.Get();
  *output = XRVisibilityMaskDataView(pointer, message_);
}
inline void XRViewDataView::GetVisibilityMaskIdDataView(
    XrVisibilityMaskIdDataView* output) {
  auto pointer = data_->visibility_mask_id.Get();
  *output = XrVisibilityMaskIdDataView(pointer, message_);
}


inline void VRStageParametersDataView::GetMojoFromStageDataView(
    ::gfx::mojom::TransformDataView* output) {
  auto pointer = data_->mojo_from_stage.Get();
  *output = ::gfx::mojom::TransformDataView(pointer, message_);
}
inline void VRStageParametersDataView::GetBoundsDataView(
    mojo::ArrayDataView<::gfx::mojom::Point3FDataView>* output) {
  auto pointer = data_->bounds.Get();
  *output = mojo::ArrayDataView<::gfx::mojom::Point3FDataView>(pointer, message_);
}










inline void XRPlaneDataDataView::GetIdDataView(
    PlaneIdDataView* output) {
  auto pointer = data_->id.Get();
  *output = PlaneIdDataView(pointer, message_);
}
inline void XRPlaneDataDataView::GetMojoFromPlaneDataView(
    PoseDataView* output) {
  auto pointer = data_->mojo_from_plane.Get();
  *output = PoseDataView(pointer, message_);
}
inline void XRPlaneDataDataView::GetPolygonDataView(
    mojo::ArrayDataView<XRPlanePointDataDataView>* output) {
  auto pointer = data_->polygon.Get();
  *output = mojo::ArrayDataView<XRPlanePointDataDataView>(pointer, message_);
}


inline void XRPlaneDetectionDataDataView::GetAllPlanesIdsDataView(
    mojo::ArrayDataView<PlaneIdDataView>* output) {
  auto pointer = data_->all_planes_ids.Get();
  *output = mojo::ArrayDataView<PlaneIdDataView>(pointer, message_);
}
inline void XRPlaneDetectionDataDataView::GetUpdatedPlanesDataDataView(
    mojo::ArrayDataView<XRPlaneDataDataView>* output) {
  auto pointer = data_->updated_planes_data.Get();
  *output = mojo::ArrayDataView<XRPlaneDataDataView>(pointer, message_);
}


inline void XRMeshDataDataView::GetIdDataView(
    MeshIdDataView* output) {
  auto pointer = data_->id.Get();
  *output = MeshIdDataView(pointer, message_);
}
inline void XRMeshDataDataView::GetMojoFromMeshDataView(
    PoseDataView* output) {
  auto pointer = data_->mojo_from_mesh.Get();
  *output = PoseDataView(pointer, message_);
}
inline void XRMeshDataDataView::GetVerticesDataView(
    mojo::ArrayDataView<float>* output) {
  auto pointer = data_->vertices.Get();
  *output = mojo::ArrayDataView<float>(pointer, message_);
}
inline void XRMeshDataDataView::GetIndicesDataView(
    mojo::ArrayDataView<uint32_t>* output) {
  auto pointer = data_->indices.Get();
  *output = mojo::ArrayDataView<uint32_t>(pointer, message_);
}


inline void XRMeshDetectionDataDataView::GetAllMeshesIdsDataView(
    mojo::ArrayDataView<MeshIdDataView>* output) {
  auto pointer = data_->all_meshes_ids.Get();
  *output = mojo::ArrayDataView<MeshIdDataView>(pointer, message_);
}
inline void XRMeshDetectionDataDataView::GetUpdatedMeshesDataDataView(
    mojo::ArrayDataView<XRMeshDataDataView>* output) {
  auto pointer = data_->updated_meshes_data.Get();
  *output = mojo::ArrayDataView<XRMeshDataDataView>(pointer, message_);
}


inline void XRAnchorDataDataView::GetIdDataView(
    AnchorIdDataView* output) {
  auto pointer = data_->id.Get();
  *output = AnchorIdDataView(pointer, message_);
}
inline void XRAnchorDataDataView::GetMojoFromAnchorDataView(
    PoseDataView* output) {
  auto pointer = data_->mojo_from_anchor.Get();
  *output = PoseDataView(pointer, message_);
}


inline void XRAnchorsDataDataView::GetAllAnchorsIdsDataView(
    mojo::ArrayDataView<AnchorIdDataView>* output) {
  auto pointer = data_->all_anchors_ids.Get();
  *output = mojo::ArrayDataView<AnchorIdDataView>(pointer, message_);
}
inline void XRAnchorsDataDataView::GetUpdatedAnchorsDataDataView(
    mojo::ArrayDataView<XRAnchorDataDataView>* output) {
  auto pointer = data_->updated_anchors_data.Get();
  *output = mojo::ArrayDataView<XRAnchorDataDataView>(pointer, message_);
}


inline void XRHitTestSubscriptionResultDataDataView::GetSubscriptionIdDataView(
    HitTestSubscriptionIdDataView* output) {
  auto pointer = data_->subscription_id.Get();
  *output = HitTestSubscriptionIdDataView(pointer, message_);
}
inline void XRHitTestSubscriptionResultDataDataView::GetHitTestResultsDataView(
    mojo::ArrayDataView<XRHitResultDataView>* output) {
  auto pointer = data_->hit_test_results.Get();
  *output = mojo::ArrayDataView<XRHitResultDataView>(pointer, message_);
}


inline void XRHitTestTransientInputSubscriptionResultDataDataView::GetSubscriptionIdDataView(
    HitTestSubscriptionIdDataView* output) {
  auto pointer = data_->subscription_id.Get();
  *output = HitTestSubscriptionIdDataView(pointer, message_);
}
inline void XRHitTestTransientInputSubscriptionResultDataDataView::GetInputSourceIdToHitTestResultsDataView(
    mojo::MapDataView<uint32_t, mojo::ArrayDataView<XRHitResultDataView>>* output) {
  auto pointer = data_->input_source_id_to_hit_test_results.Get();
  *output = mojo::MapDataView<uint32_t, mojo::ArrayDataView<XRHitResultDataView>>(pointer, message_);
}


inline void XRHitTestSubscriptionResultsDataDataView::GetResultsDataView(
    mojo::ArrayDataView<XRHitTestSubscriptionResultDataDataView>* output) {
  auto pointer = data_->results.Get();
  *output = mojo::ArrayDataView<XRHitTestSubscriptionResultDataDataView>(pointer, message_);
}
inline void XRHitTestSubscriptionResultsDataDataView::GetTransientInputResultsDataView(
    mojo::ArrayDataView<XRHitTestTransientInputSubscriptionResultDataDataView>* output) {
  auto pointer = data_->transient_input_results.Get();
  *output = mojo::ArrayDataView<XRHitTestTransientInputSubscriptionResultDataDataView>(pointer, message_);
}




inline void XRSphericalHarmonicsDataView::GetCoefficientsDataView(
    mojo::ArrayDataView<RgbTupleF32DataView>* output) {
  auto pointer = data_->coefficients.Get();
  *output = mojo::ArrayDataView<RgbTupleF32DataView>(pointer, message_);
}


inline void XRCubeMapDataView::GetPositiveXDataView(
    mojo::ArrayDataView<uint16_t>* output) {
  auto pointer = data_->positive_x.Get();
  *output = mojo::ArrayDataView<uint16_t>(pointer, message_);
}
inline void XRCubeMapDataView::GetNegativeXDataView(
    mojo::ArrayDataView<uint16_t>* output) {
  auto pointer = data_->negative_x.Get();
  *output = mojo::ArrayDataView<uint16_t>(pointer, message_);
}
inline void XRCubeMapDataView::GetPositiveYDataView(
    mojo::ArrayDataView<uint16_t>* output) {
  auto pointer = data_->positive_y.Get();
  *output = mojo::ArrayDataView<uint16_t>(pointer, message_);
}
inline void XRCubeMapDataView::GetNegativeYDataView(
    mojo::ArrayDataView<uint16_t>* output) {
  auto pointer = data_->negative_y.Get();
  *output = mojo::ArrayDataView<uint16_t>(pointer, message_);
}
inline void XRCubeMapDataView::GetPositiveZDataView(
    mojo::ArrayDataView<uint16_t>* output) {
  auto pointer = data_->positive_z.Get();
  *output = mojo::ArrayDataView<uint16_t>(pointer, message_);
}
inline void XRCubeMapDataView::GetNegativeZDataView(
    mojo::ArrayDataView<uint16_t>* output) {
  auto pointer = data_->negative_z.Get();
  *output = mojo::ArrayDataView<uint16_t>(pointer, message_);
}


inline void XRLightProbeDataView::GetSphericalHarmonicsDataView(
    XRSphericalHarmonicsDataView* output) {
  auto pointer = data_->spherical_harmonics.Get();
  *output = XRSphericalHarmonicsDataView(pointer, message_);
}
inline void XRLightProbeDataView::GetMainLightDirectionDataView(
    ::gfx::mojom::Vector3dFDataView* output) {
  auto pointer = data_->main_light_direction.Get();
  *output = ::gfx::mojom::Vector3dFDataView(pointer, message_);
}
inline void XRLightProbeDataView::GetMainLightIntensityDataView(
    RgbTupleF32DataView* output) {
  auto pointer = data_->main_light_intensity.Get();
  *output = RgbTupleF32DataView(pointer, message_);
}


inline void XRReflectionProbeDataView::GetCubeMapDataView(
    XRCubeMapDataView* output) {
  auto pointer = data_->cube_map.Get();
  *output = XRCubeMapDataView(pointer, message_);
}


inline void XRLightEstimationDataDataView::GetLightProbeDataView(
    XRLightProbeDataView* output) {
  auto pointer = data_->light_probe.Get();
  *output = XRLightProbeDataView(pointer, message_);
}
inline void XRLightEstimationDataDataView::GetReflectionProbeDataView(
    XRReflectionProbeDataView* output) {
  auto pointer = data_->reflection_probe.Get();
  *output = XRReflectionProbeDataView(pointer, message_);
}




inline void XRDepthDataUpdatedDataView::GetPixelDataDataView(
    ::mojo_base::mojom::BigBufferDataView* output) {
  auto pointer = &data_->pixel_data;
  *output = ::mojo_base::mojom::BigBufferDataView(pointer, message_);
}
inline void XRDepthDataUpdatedDataView::GetNormTextureFromNormViewDataView(
    ::gfx::mojom::TransformDataView* output) {
  auto pointer = data_->norm_texture_from_norm_view.Get();
  *output = ::gfx::mojom::TransformDataView(pointer, message_);
}
inline void XRDepthDataUpdatedDataView::GetSizeDataView(
    ::gfx::mojom::SizeDataView* output) {
  auto pointer = data_->size.Get();
  *output = ::gfx::mojom::SizeDataView(pointer, message_);
}
inline void XRDepthDataUpdatedDataView::GetViewGeometryDataView(
    XRViewGeometryDataView* output) {
  auto pointer = data_->view_geometry.Get();
  *output = XRViewGeometryDataView(pointer, message_);
}


inline void XRTrackedImageDataDataView::GetMojoFromImageDataView(
    PoseDataView* output) {
  auto pointer = data_->mojo_from_image.Get();
  *output = PoseDataView(pointer, message_);
}


inline void XRTrackedImagesDataDataView::GetImagesDataDataView(
    mojo::ArrayDataView<XRTrackedImageDataDataView>* output) {
  auto pointer = data_->images_data.Get();
  *output = mojo::ArrayDataView<XRTrackedImageDataDataView>(pointer, message_);
}
inline void XRTrackedImagesDataDataView::GetImageTrackableScoresDataView(
    mojo::ArrayDataView<bool>* output) {
  auto pointer = data_->image_trackable_scores.Get();
  *output = mojo::ArrayDataView<bool>(pointer, message_);
}






inline void XRQuadLayerDataDataView::GetNativeOriginFromLayerDataView(
    ::gfx::mojom::TransformDataView* output) {
  auto pointer = data_->native_origin_from_layer.Get();
  *output = ::gfx::mojom::TransformDataView(pointer, message_);
}


inline void XRCylinderLayerDataDataView::GetNativeOriginFromLayerDataView(
    ::gfx::mojom::TransformDataView* output) {
  auto pointer = data_->native_origin_from_layer.Get();
  *output = ::gfx::mojom::TransformDataView(pointer, message_);
}


inline void XREquirectLayerDataDataView::GetNativeOriginFromLayerDataView(
    ::gfx::mojom::TransformDataView* output) {
  auto pointer = data_->native_origin_from_layer.Get();
  *output = ::gfx::mojom::TransformDataView(pointer, message_);
}


inline void XRCubeLayerDataDataView::GetOrientationDataView(
    ::gfx::mojom::QuaternionDataView* output) {
  auto pointer = data_->orientation.Get();
  *output = ::gfx::mojom::QuaternionDataView(pointer, message_);
}


inline void XRLayerReadOnlyDataDataView::GetLayerIdDataView(
    LayerIdDataView* output) {
  auto pointer = data_->layer_id.Get();
  *output = LayerIdDataView(pointer, message_);
}


inline void XRLayerMutableDataDataView::GetNativeOriginInformationDataView(
    XRNativeOriginInformationDataView* output) {
  auto pointer = &data_->native_origin_information;
  *output = XRNativeOriginInformationDataView(pointer, message_);
}
inline void XRLayerMutableDataDataView::GetLayerDataDataView(
    XRLayerSpecificDataDataView* output) {
  auto pointer = &data_->layer_data;
  *output = XRLayerSpecificDataDataView(pointer, message_);
}


inline void XRCompositionLayerDataDataView::GetReadOnlyDataDataView(
    XRLayerReadOnlyDataDataView* output) {
  auto pointer = data_->read_only_data.Get();
  *output = XRLayerReadOnlyDataDataView(pointer, message_);
}
inline void XRCompositionLayerDataDataView::GetMutableDataDataView(
    XRLayerMutableDataDataView* output) {
  auto pointer = data_->mutable_data.Get();
  *output = XRLayerMutableDataDataView(pointer, message_);
}


inline void XRLayerFrameDataDataView::GetLayerIdDataView(
    LayerIdDataView* output) {
  auto pointer = data_->layer_id.Get();
  *output = LayerIdDataView(pointer, message_);
}
inline void XRLayerFrameDataDataView::GetBufferSharedImageDataView(
    ::gpu::mojom::ExportedSharedImageDataView* output) {
  auto pointer = data_->buffer_shared_image.Get();
  *output = ::gpu::mojom::ExportedSharedImageDataView(pointer, message_);
}
inline void XRLayerFrameDataDataView::GetBufferSyncTokenDataView(
    ::gpu::mojom::SyncTokenDataView* output) {
  auto pointer = data_->buffer_sync_token.Get();
  *output = ::gpu::mojom::SyncTokenDataView(pointer, message_);
}


inline void XRRenderInfoDataView::GetMojoFromViewerDataView(
    VRPoseDataView* output) {
  auto pointer = data_->mojo_from_viewer.Get();
  *output = VRPoseDataView(pointer, message_);
}
inline void XRRenderInfoDataView::GetViewsDataView(
    mojo::ArrayDataView<XRViewDataView>* output) {
  auto pointer = data_->views.Get();
  *output = mojo::ArrayDataView<XRViewDataView>(pointer, message_);
}


inline void XRFrameDataDataView::GetRenderInfoDataView(
    XRRenderInfoDataView* output) {
  auto pointer = data_->render_info.Get();
  *output = XRRenderInfoDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetTimeDeltaDataView(
    ::mojo_base::mojom::TimeDeltaDataView* output) {
  auto pointer = data_->time_delta.Get();
  *output = ::mojo_base::mojom::TimeDeltaDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetBufferSharedImageDataView(
    ::gpu::mojom::ExportedSharedImageDataView* output) {
  auto pointer = data_->buffer_shared_image.Get();
  *output = ::gpu::mojom::ExportedSharedImageDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetBufferSyncTokenDataView(
    ::gpu::mojom::SyncTokenDataView* output) {
  auto pointer = data_->buffer_sync_token.Get();
  *output = ::gpu::mojom::SyncTokenDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetCameraImageBufferSharedImageDataView(
    ::gpu::mojom::ExportedSharedImageDataView* output) {
  auto pointer = data_->camera_image_buffer_shared_image.Get();
  *output = ::gpu::mojom::ExportedSharedImageDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetCameraImageBufferSyncTokenDataView(
    ::gpu::mojom::SyncTokenDataView* output) {
  auto pointer = data_->camera_image_buffer_sync_token.Get();
  *output = ::gpu::mojom::SyncTokenDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetCameraImageSizeDataView(
    ::gfx::mojom::SizeDataView* output) {
  auto pointer = data_->camera_image_size.Get();
  *output = ::gfx::mojom::SizeDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetMojoFromFloorDataView(
    ::gfx::mojom::TransformDataView* output) {
  auto pointer = data_->mojo_from_floor.Get();
  *output = ::gfx::mojom::TransformDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetInputStateDataView(
    mojo::ArrayDataView<XRInputSourceStateDataView>* output) {
  auto pointer = data_->input_state.Get();
  *output = mojo::ArrayDataView<XRInputSourceStateDataView>(pointer, message_);
}
inline void XRFrameDataDataView::GetStageParametersDataView(
    VRStageParametersDataView* output) {
  auto pointer = data_->stage_parameters.Get();
  *output = VRStageParametersDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetDetectedPlanesDataDataView(
    XRPlaneDetectionDataDataView* output) {
  auto pointer = data_->detected_planes_data.Get();
  *output = XRPlaneDetectionDataDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetDetectedMeshesDataDataView(
    XRMeshDetectionDataDataView* output) {
  auto pointer = data_->detected_meshes_data.Get();
  *output = XRMeshDetectionDataDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetAnchorsDataDataView(
    XRAnchorsDataDataView* output) {
  auto pointer = data_->anchors_data.Get();
  *output = XRAnchorsDataDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetCompositionLayersDataDataView(
    mojo::ArrayDataView<XRLayerFrameDataDataView>* output) {
  auto pointer = data_->composition_layers_data.Get();
  *output = mojo::ArrayDataView<XRLayerFrameDataDataView>(pointer, message_);
}
inline void XRFrameDataDataView::GetLightEstimationDataDataView(
    XRLightEstimationDataDataView* output) {
  auto pointer = data_->light_estimation_data.Get();
  *output = XRLightEstimationDataDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetHitTestSubscriptionResultsDataView(
    XRHitTestSubscriptionResultsDataDataView* output) {
  auto pointer = data_->hit_test_subscription_results.Get();
  *output = XRHitTestSubscriptionResultsDataDataView(pointer, message_);
}
inline void XRFrameDataDataView::GetTrackedImagesDataView(
    XRTrackedImagesDataDataView* output) {
  auto pointer = data_->tracked_images.Get();
  *output = XRTrackedImagesDataDataView(pointer, message_);
}


inline void RequestSessionSuccessDataView::GetSessionDataView(
    XRSessionDataView* output) {
  auto pointer = data_->session.Get();
  *output = XRSessionDataView(pointer, message_);
}




inline void XRLayerUpdateDataView::GetLayerIdDataView(
    LayerIdDataView* output) {
  auto pointer = data_->layer_id.Get();
  *output = LayerIdDataView(pointer, message_);
}
inline void XRLayerUpdateDataView::GetSharedImageExportResultDataView(
    ::gpu::mojom::SharedImageExportResultDataView* output) {
  auto pointer = data_->shared_image_export_result.Get();
  *output = ::gpu::mojom::SharedImageExportResultDataView(pointer, message_);
}


inline void XRNativeOriginInformationDataView::GetInputSourceSpaceInfoDataView(
    XRInputSourceSpaceInfoDataView* output) const {
  CHECK(is_input_source_space_info());
  *output = XRInputSourceSpaceInfoDataView(data_->data.f_input_source_space_info.Get(), message_);
}
inline void XRNativeOriginInformationDataView::GetPlaneIdDataView(
    PlaneIdDataView* output) const {
  CHECK(is_plane_id());
  *output = PlaneIdDataView(data_->data.f_plane_id.Get(), message_);
}
inline void XRNativeOriginInformationDataView::GetMeshIdDataView(
    MeshIdDataView* output) const {
  CHECK(is_mesh_id());
  *output = MeshIdDataView(data_->data.f_mesh_id.Get(), message_);
}
inline void XRNativeOriginInformationDataView::GetAnchorIdDataView(
    AnchorIdDataView* output) const {
  CHECK(is_anchor_id());
  *output = AnchorIdDataView(data_->data.f_anchor_id.Get(), message_);
}
inline void XRNativeOriginInformationDataView::GetHandJointSpaceInfoDataView(
    XRHandJointSpaceInfoDataView* output) const {
  CHECK(is_hand_joint_space_info());
  *output = XRHandJointSpaceInfoDataView(data_->data.f_hand_joint_space_info.Get(), message_);
}

inline void XRDepthDataDataView::GetDataStillValidDataView(
    XRDepthDataStillValidDataView* output) const {
  CHECK(is_data_still_valid());
  *output = XRDepthDataStillValidDataView(data_->data.f_data_still_valid.Get(), message_);
}
inline void XRDepthDataDataView::GetUpdatedDepthDataDataView(
    XRDepthDataUpdatedDataView* output) const {
  CHECK(is_updated_depth_data());
  *output = XRDepthDataUpdatedDataView(data_->data.f_updated_depth_data.Get(), message_);
}

inline void XRLayerSpecificDataDataView::GetProjectionDataView(
    XRProjectionLayerDataDataView* output) const {
  CHECK(is_projection());
  *output = XRProjectionLayerDataDataView(data_->data.f_projection.Get(), message_);
}
inline void XRLayerSpecificDataDataView::GetQuadDataView(
    XRQuadLayerDataDataView* output) const {
  CHECK(is_quad());
  *output = XRQuadLayerDataDataView(data_->data.f_quad.Get(), message_);
}
inline void XRLayerSpecificDataDataView::GetCylinderDataView(
    XRCylinderLayerDataDataView* output) const {
  CHECK(is_cylinder());
  *output = XRCylinderLayerDataDataView(data_->data.f_cylinder.Get(), message_);
}
inline void XRLayerSpecificDataDataView::GetEquirectDataView(
    XREquirectLayerDataDataView* output) const {
  CHECK(is_equirect());
  *output = XREquirectLayerDataDataView(data_->data.f_equirect.Get(), message_);
}
inline void XRLayerSpecificDataDataView::GetCubeDataView(
    XRCubeLayerDataDataView* output) const {
  CHECK(is_cube());
  *output = XRCubeLayerDataDataView(data_->data.f_cube.Get(), message_);
}

inline void RequestSessionResultDataView::GetSuccessDataView(
    RequestSessionSuccessDataView* output) const {
  CHECK(is_success());
  *output = RequestSessionSuccessDataView(data_->data.f_success.Get(), message_);
}


}  // device::mojom

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

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XRHandedness> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XRHandedness value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XRTargetRayMode> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XRTargetRayMode value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XRSessionFeatureRequestStatus> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XRSessionFeatureRequestStatus value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XREnvironmentBlendMode> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XREnvironmentBlendMode value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XRInteractionMode> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XRInteractionMode value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XREye> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XREye value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XRPresentationTransportMethod> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XRPresentationTransportMethod value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XRReferenceSpaceType> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XRReferenceSpaceType value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XRInputSourceSpaceType> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XRInputSourceSpaceType value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XRPlaneOrientation> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XRPlaneOrientation value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XRSemanticLabel> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XRSemanticLabel value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XRLayerLayout> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XRLayerLayout value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::CreateCompositionLayerResult> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::CreateCompositionLayerResult value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XrCompatibleResult> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XrCompatibleResult value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::EntityTypeForHitTest> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::EntityTypeForHitTest value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct COMPONENT_EXPORT(DEVICE_VR_SERVICE_MOJO_BINDINGS_SHARED) TraceFormatTraits<::device::mojom::XRVisibilityState> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::device::mojom::XRVisibilityState value);
};

} // namespace perfetto

#endif  // DEVICE_VR_PUBLIC_MOJOM_VR_SERVICE_MOJOM_SHARED_H_