// device/vr/public/mojom/vr_service.mojom-blink.cc is auto generated by mojom_bindings_generator.py, do not edit

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

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

#include "device/vr/public/mojom/vr_service.mojom-blink.h"

#include <math.h>
#include <stdint.h>
#include <utility>

#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/common/task_annotator.h"
#include "base/trace_event/trace_conversion_helper.h"
#include "base/trace_event/traced_value.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_context.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"

#include "device/vr/public/mojom/vr_service.mojom-params-data.h"
#include "device/vr/public/mojom/vr_service.mojom-shared-message-ids.h"

#include "device/vr/public/mojom/vr_service.mojom-blink-import-headers.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"


#ifndef DEVICE_VR_PUBLIC_MOJOM_VR_SERVICE_MOJOM_BLINK_JUMBO_H_
#define DEVICE_VR_PUBLIC_MOJOM_VR_SERVICE_MOJOM_BLINK_JUMBO_H_
#endif
namespace device {
namespace mojom {
namespace blink {
constexpr uint64_t XRCubeMap::kNumComponentsPerPixel;
XRSessionOptions::XRSessionOptions()
    : mode(),
      required_features(),
      optional_features() {}

XRSessionOptions::XRSessionOptions(
    XRSessionMode mode_in,
    WTF::Vector<XRSessionFeature> required_features_in,
    WTF::Vector<XRSessionFeature> optional_features_in)
    : mode(std::move(mode_in)),
      required_features(std::move(required_features_in)),
      optional_features(std::move(optional_features_in)) {}

XRSessionOptions::~XRSessionOptions() = default;

void XRSessionOptions::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("mode", base::trace_event::ValueToString(this->mode));
  value->BeginArray("required_features");
  for (const auto& item0 : this->required_features) {
    value->AppendString(base::trace_event::ValueToString(item0));
  }
  value->EndArray();
  value->BeginArray("optional_features");
  for (const auto& item0 : this->optional_features) {
    value->AppendString(base::trace_event::ValueToString(item0));
  }
  value->EndArray();
}

bool XRSessionOptions::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRSession::XRSession()
    : data_provider(),
      client_receiver(),
      display_info(),
      submit_frame_sink(),
      enabled_features(),
      uses_input_eventing(),
      default_framebuffer_scale(1.0f) {}

XRSession::XRSession(
    ::mojo::PendingRemote<XRFrameDataProvider> data_provider_in,
    ::mojo::PendingReceiver<XRSessionClient> client_receiver_in,
    VRDisplayInfoPtr display_info_in,
    XRPresentationConnectionPtr submit_frame_sink_in,
    WTF::Vector<XRSessionFeature> enabled_features_in,
    bool uses_input_eventing_in,
    float default_framebuffer_scale_in)
    : data_provider(std::move(data_provider_in)),
      client_receiver(std::move(client_receiver_in)),
      display_info(std::move(display_info_in)),
      submit_frame_sink(std::move(submit_frame_sink_in)),
      enabled_features(std::move(enabled_features_in)),
      uses_input_eventing(std::move(uses_input_eventing_in)),
      default_framebuffer_scale(std::move(default_framebuffer_scale_in)) {}

XRSession::~XRSession() = default;

void XRSession::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetBoolean("data_provider", this->data_provider.is_valid());
  value->SetBoolean("client_receiver", this->client_receiver.is_valid());
  if (this->display_info.is_null()) {
    value->SetString("display_info", "nullptr");
  } else {
    value->BeginDictionary("display_info");
    this->display_info->AsValueInto(value);
    value->EndDictionary();
  }
  if (this->submit_frame_sink.is_null()) {
    value->SetString("submit_frame_sink", "nullptr");
  } else {
    value->BeginDictionary("submit_frame_sink");
    this->submit_frame_sink->AsValueInto(value);
    value->EndDictionary();
  }
  value->BeginArray("enabled_features");
  for (const auto& item0 : this->enabled_features) {
    value->AppendString(base::trace_event::ValueToString(item0));
  }
  value->EndArray();
  value->SetBoolean("uses_input_eventing", this->uses_input_eventing);
  value->SetDouble("default_framebuffer_scale", this->default_framebuffer_scale);
}

bool XRSession::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRPresentationConnection::XRPresentationConnection()
    : provider(),
      client_receiver(),
      transport_options() {}

XRPresentationConnection::XRPresentationConnection(
    ::mojo::PendingRemote<XRPresentationProvider> provider_in,
    ::mojo::PendingReceiver<XRPresentationClient> client_receiver_in,
    XRPresentationTransportOptionsPtr transport_options_in)
    : provider(std::move(provider_in)),
      client_receiver(std::move(client_receiver_in)),
      transport_options(std::move(transport_options_in)) {}

XRPresentationConnection::~XRPresentationConnection() = default;

void XRPresentationConnection::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetBoolean("provider", this->provider.is_valid());
  value->SetBoolean("client_receiver", this->client_receiver.is_valid());
  if (this->transport_options.is_null()) {
    value->SetString("transport_options", "nullptr");
  } else {
    value->BeginDictionary("transport_options");
    this->transport_options->AsValueInto(value);
    value->EndDictionary();
  }
}

bool XRPresentationConnection::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRInputSourceDescription::XRInputSourceDescription()
    : target_ray_mode(),
      handedness(),
      input_from_pointer(),
      profiles() {}

XRInputSourceDescription::XRInputSourceDescription(
    XRTargetRayMode target_ray_mode_in,
    XRHandedness handedness_in,
    const base::Optional<::gfx::Transform>& input_from_pointer_in,
    WTF::Vector<WTF::String> profiles_in)
    : target_ray_mode(std::move(target_ray_mode_in)),
      handedness(std::move(handedness_in)),
      input_from_pointer(std::move(input_from_pointer_in)),
      profiles(std::move(profiles_in)) {}

XRInputSourceDescription::~XRInputSourceDescription() = default;

void XRInputSourceDescription::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("target_ray_mode", base::trace_event::ValueToString(this->target_ray_mode));
  value->SetString("handedness", base::trace_event::ValueToString(this->handedness));
  value->SetString("input_from_pointer", base::trace_event::ValueToString(this->input_from_pointer, "<value of type const base::Optional<::gfx::Transform>&>"));
  value->BeginArray("profiles");
  for (const auto& item0 : this->profiles) {
    value->AppendString(item0.Utf8());
  }
  value->EndArray();
}

bool XRInputSourceDescription::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRInputSourceState::XRInputSourceState()
    : source_id(),
      description(),
      mojo_from_input(),
      emulated_position(),
      is_auxiliary(),
      primary_input_pressed(),
      primary_input_clicked(),
      primary_squeeze_pressed(),
      primary_squeeze_clicked(),
      gamepad(),
      overlay_pointer_position() {}

XRInputSourceState::XRInputSourceState(
    uint32_t source_id_in,
    XRInputSourceDescriptionPtr description_in,
    const base::Optional<::gfx::Transform>& mojo_from_input_in,
    bool emulated_position_in,
    bool is_auxiliary_in,
    bool primary_input_pressed_in,
    bool primary_input_clicked_in,
    bool primary_squeeze_pressed_in,
    bool primary_squeeze_clicked_in,
    const base::Optional<::device::Gamepad>& gamepad_in,
    const base::Optional<::gfx::PointF>& overlay_pointer_position_in)
    : source_id(std::move(source_id_in)),
      description(std::move(description_in)),
      mojo_from_input(std::move(mojo_from_input_in)),
      emulated_position(std::move(emulated_position_in)),
      is_auxiliary(std::move(is_auxiliary_in)),
      primary_input_pressed(std::move(primary_input_pressed_in)),
      primary_input_clicked(std::move(primary_input_clicked_in)),
      primary_squeeze_pressed(std::move(primary_squeeze_pressed_in)),
      primary_squeeze_clicked(std::move(primary_squeeze_clicked_in)),
      gamepad(std::move(gamepad_in)),
      overlay_pointer_position(std::move(overlay_pointer_position_in)) {}

XRInputSourceState::~XRInputSourceState() = default;

void XRInputSourceState::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("source_id", base::NumberToString(this->source_id));
  if (this->description.is_null()) {
    value->SetString("description", "nullptr");
  } else {
    value->BeginDictionary("description");
    this->description->AsValueInto(value);
    value->EndDictionary();
  }
  value->SetString("mojo_from_input", base::trace_event::ValueToString(this->mojo_from_input, "<value of type const base::Optional<::gfx::Transform>&>"));
  value->SetBoolean("emulated_position", this->emulated_position);
  value->SetBoolean("is_auxiliary", this->is_auxiliary);
  value->SetBoolean("primary_input_pressed", this->primary_input_pressed);
  value->SetBoolean("primary_input_clicked", this->primary_input_clicked);
  value->SetBoolean("primary_squeeze_pressed", this->primary_squeeze_pressed);
  value->SetBoolean("primary_squeeze_clicked", this->primary_squeeze_clicked);
  value->SetString("gamepad", base::trace_event::ValueToString(this->gamepad, "<value of type const base::Optional<::device::Gamepad>&>"));
  value->SetString("overlay_pointer_position", base::trace_event::ValueToString(this->overlay_pointer_position, "<value of type const base::Optional<::gfx::PointF>&>"));
}

bool XRInputSourceState::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
VRFieldOfView::VRFieldOfView()
    : up_degrees(),
      down_degrees(),
      left_degrees(),
      right_degrees() {}

VRFieldOfView::VRFieldOfView(
    float up_degrees_in,
    float down_degrees_in,
    float left_degrees_in,
    float right_degrees_in)
    : up_degrees(std::move(up_degrees_in)),
      down_degrees(std::move(down_degrees_in)),
      left_degrees(std::move(left_degrees_in)),
      right_degrees(std::move(right_degrees_in)) {}

VRFieldOfView::~VRFieldOfView() = default;
size_t VRFieldOfView::Hash(size_t seed) const {
  seed = mojo::internal::WTFHash(seed, this->up_degrees);
  seed = mojo::internal::WTFHash(seed, this->down_degrees);
  seed = mojo::internal::WTFHash(seed, this->left_degrees);
  seed = mojo::internal::WTFHash(seed, this->right_degrees);
  return seed;
}

void VRFieldOfView::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetDouble("up_degrees", this->up_degrees);
  value->SetDouble("down_degrees", this->down_degrees);
  value->SetDouble("left_degrees", this->left_degrees);
  value->SetDouble("right_degrees", this->right_degrees);
}

bool VRFieldOfView::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
VRPose::VRPose()
    : orientation(),
      position(),
      emulated_position() {}

VRPose::VRPose(
    const base::Optional<::gfx::Quaternion>& orientation_in,
    const base::Optional<::gfx::Point3F>& position_in,
    bool emulated_position_in)
    : orientation(std::move(orientation_in)),
      position(std::move(position_in)),
      emulated_position(std::move(emulated_position_in)) {}

VRPose::~VRPose() = default;

void VRPose::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("orientation", base::trace_event::ValueToString(this->orientation, "<value of type const base::Optional<::gfx::Quaternion>&>"));
  value->SetString("position", base::trace_event::ValueToString(this->position, "<value of type const base::Optional<::gfx::Point3F>&>"));
  value->SetBoolean("emulated_position", this->emulated_position);
}

bool VRPose::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
Pose::Pose()
    : orientation(),
      position() {}

Pose::Pose(
    const ::gfx::Quaternion& orientation_in,
    const ::gfx::Point3F& position_in)
    : orientation(std::move(orientation_in)),
      position(std::move(position_in)) {}

Pose::~Pose() = default;

void Pose::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("orientation", base::trace_event::ValueToString(this->orientation, "<value of type const ::gfx::Quaternion&>"));
  value->SetString("position", base::trace_event::ValueToString(this->position, "<value of type const ::gfx::Point3F&>"));
}

bool Pose::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRRay::XRRay()
    : origin(),
      direction() {}

XRRay::XRRay(
    const ::gfx::Point3F& origin_in,
    const ::gfx::Vector3dF& direction_in)
    : origin(std::move(origin_in)),
      direction(std::move(direction_in)) {}

XRRay::~XRRay() = default;

void XRRay::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("origin", base::trace_event::ValueToString(this->origin, "<value of type const ::gfx::Point3F&>"));
  value->SetString("direction", base::trace_event::ValueToString(this->direction, "<value of type const ::gfx::Vector3dF&>"));
}

bool XRRay::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRHitResult::XRHitResult()
    : mojo_from_result(),
      plane_id() {}

XRHitResult::XRHitResult(
    const ::device::Pose& mojo_from_result_in,
    uint64_t plane_id_in)
    : mojo_from_result(std::move(mojo_from_result_in)),
      plane_id(std::move(plane_id_in)) {}

XRHitResult::~XRHitResult() = default;

void XRHitResult::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("mojo_from_result", base::trace_event::ValueToString(this->mojo_from_result, "<value of type const ::device::Pose&>"));
  value->SetString("plane_id", base::NumberToString(this->plane_id));
}

bool XRHitResult::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
VREyeParameters::VREyeParameters()
    : field_of_view(),
      head_from_eye(),
      render_width(),
      render_height() {}

VREyeParameters::VREyeParameters(
    VRFieldOfViewPtr field_of_view_in,
    const ::gfx::Transform& head_from_eye_in,
    uint32_t render_width_in,
    uint32_t render_height_in)
    : field_of_view(std::move(field_of_view_in)),
      head_from_eye(std::move(head_from_eye_in)),
      render_width(std::move(render_width_in)),
      render_height(std::move(render_height_in)) {}

VREyeParameters::~VREyeParameters() = default;

void VREyeParameters::AsValueInto(base::trace_event::TracedValue* value) const {
  if (this->field_of_view.is_null()) {
    value->SetString("field_of_view", "nullptr");
  } else {
    value->BeginDictionary("field_of_view");
    this->field_of_view->AsValueInto(value);
    value->EndDictionary();
  }
  value->SetString("head_from_eye", base::trace_event::ValueToString(this->head_from_eye, "<value of type const ::gfx::Transform&>"));
  value->SetString("render_width", base::NumberToString(this->render_width));
  value->SetString("render_height", base::NumberToString(this->render_height));
}

bool VREyeParameters::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
VRStageParameters::VRStageParameters()
    : mojo_from_floor(),
      bounds() {}

VRStageParameters::VRStageParameters(
    const ::gfx::Transform& mojo_from_floor_in,
    base::Optional<WTF::Vector<::gfx::Point3F>> bounds_in)
    : mojo_from_floor(std::move(mojo_from_floor_in)),
      bounds(std::move(bounds_in)) {}

VRStageParameters::~VRStageParameters() = default;

void VRStageParameters::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("mojo_from_floor", base::trace_event::ValueToString(this->mojo_from_floor, "<value of type const ::gfx::Transform&>"));
  if (this->bounds.has_value()) {
    value->BeginArray("bounds");
    for (const auto& item0 : this->bounds.value()) {
      value->AppendString(base::trace_event::ValueToString(item0, "<value of type const ::gfx::Point3F&>"));
    }
    value->EndArray();
  } else {
    value->SetString("bounds", "base::nullopt");
  }
}

bool VRStageParameters::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
VRDisplayInfo::VRDisplayInfo()
    : stage_parameters(),
      left_eye(),
      right_eye() {}

VRDisplayInfo::VRDisplayInfo(
    VRStageParametersPtr stage_parameters_in,
    VREyeParametersPtr left_eye_in,
    VREyeParametersPtr right_eye_in)
    : stage_parameters(std::move(stage_parameters_in)),
      left_eye(std::move(left_eye_in)),
      right_eye(std::move(right_eye_in)) {}

VRDisplayInfo::~VRDisplayInfo() = default;

void VRDisplayInfo::AsValueInto(base::trace_event::TracedValue* value) const {
  if (this->stage_parameters.is_null()) {
    value->SetString("stage_parameters", "nullptr");
  } else {
    value->BeginDictionary("stage_parameters");
    this->stage_parameters->AsValueInto(value);
    value->EndDictionary();
  }
  if (this->left_eye.is_null()) {
    value->SetString("left_eye", "nullptr");
  } else {
    value->BeginDictionary("left_eye");
    this->left_eye->AsValueInto(value);
    value->EndDictionary();
  }
  if (this->right_eye.is_null()) {
    value->SetString("right_eye", "nullptr");
  } else {
    value->BeginDictionary("right_eye");
    this->right_eye->AsValueInto(value);
    value->EndDictionary();
  }
}

bool VRDisplayInfo::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRPresentationTransportOptions::XRPresentationTransportOptions()
    : transport_method(),
      wait_for_transfer_notification(),
      wait_for_render_notification(),
      wait_for_gpu_fence() {}

XRPresentationTransportOptions::XRPresentationTransportOptions(
    XRPresentationTransportMethod transport_method_in,
    bool wait_for_transfer_notification_in,
    bool wait_for_render_notification_in,
    bool wait_for_gpu_fence_in)
    : transport_method(std::move(transport_method_in)),
      wait_for_transfer_notification(std::move(wait_for_transfer_notification_in)),
      wait_for_render_notification(std::move(wait_for_render_notification_in)),
      wait_for_gpu_fence(std::move(wait_for_gpu_fence_in)) {}

XRPresentationTransportOptions::~XRPresentationTransportOptions() = default;
size_t XRPresentationTransportOptions::Hash(size_t seed) const {
  seed = mojo::internal::WTFHash(seed, this->transport_method);
  seed = mojo::internal::WTFHash(seed, this->wait_for_transfer_notification);
  seed = mojo::internal::WTFHash(seed, this->wait_for_render_notification);
  seed = mojo::internal::WTFHash(seed, this->wait_for_gpu_fence);
  return seed;
}

void XRPresentationTransportOptions::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("transport_method", base::trace_event::ValueToString(this->transport_method));
  value->SetBoolean("wait_for_transfer_notification", this->wait_for_transfer_notification);
  value->SetBoolean("wait_for_render_notification", this->wait_for_render_notification);
  value->SetBoolean("wait_for_gpu_fence", this->wait_for_gpu_fence);
}

bool XRPresentationTransportOptions::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRPlanePointData::XRPlanePointData()
    : x(),
      z() {}

XRPlanePointData::XRPlanePointData(
    float x_in,
    float z_in)
    : x(std::move(x_in)),
      z(std::move(z_in)) {}

XRPlanePointData::~XRPlanePointData() = default;
size_t XRPlanePointData::Hash(size_t seed) const {
  seed = mojo::internal::WTFHash(seed, this->x);
  seed = mojo::internal::WTFHash(seed, this->z);
  return seed;
}

void XRPlanePointData::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetDouble("x", this->x);
  value->SetDouble("z", this->z);
}

bool XRPlanePointData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRPlaneData::XRPlaneData()
    : id(),
      orientation(),
      mojo_from_plane(),
      polygon() {}

XRPlaneData::XRPlaneData(
    uint64_t id_in,
    XRPlaneOrientation orientation_in,
    const base::Optional<::device::Pose>& mojo_from_plane_in,
    WTF::Vector<XRPlanePointDataPtr> polygon_in)
    : id(std::move(id_in)),
      orientation(std::move(orientation_in)),
      mojo_from_plane(std::move(mojo_from_plane_in)),
      polygon(std::move(polygon_in)) {}

XRPlaneData::~XRPlaneData() = default;

void XRPlaneData::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("id", base::NumberToString(this->id));
  value->SetString("orientation", base::trace_event::ValueToString(this->orientation));
  value->SetString("mojo_from_plane", base::trace_event::ValueToString(this->mojo_from_plane, "<value of type const base::Optional<::device::Pose>&>"));
  value->BeginArray("polygon");
  for (const auto& item0 : this->polygon) {
    if (item0.is_null()) {
      value->AppendString("nullptr");
    } else {
      value->BeginDictionary();
      item0->AsValueInto(value);
      value->EndDictionary();
    }
  }
  value->EndArray();
}

bool XRPlaneData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRPlaneDetectionData::XRPlaneDetectionData()
    : all_planes_ids(),
      updated_planes_data() {}

XRPlaneDetectionData::XRPlaneDetectionData(
    WTF::Vector<uint64_t> all_planes_ids_in,
    WTF::Vector<XRPlaneDataPtr> updated_planes_data_in)
    : all_planes_ids(std::move(all_planes_ids_in)),
      updated_planes_data(std::move(updated_planes_data_in)) {}

XRPlaneDetectionData::~XRPlaneDetectionData() = default;

void XRPlaneDetectionData::AsValueInto(base::trace_event::TracedValue* value) const {
  value->BeginArray("all_planes_ids");
  for (const auto& item0 : this->all_planes_ids) {
    value->AppendString(base::NumberToString(item0));
  }
  value->EndArray();
  value->BeginArray("updated_planes_data");
  for (const auto& item0 : this->updated_planes_data) {
    if (item0.is_null()) {
      value->AppendString("nullptr");
    } else {
      value->BeginDictionary();
      item0->AsValueInto(value);
      value->EndDictionary();
    }
  }
  value->EndArray();
}

bool XRPlaneDetectionData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRAnchorData::XRAnchorData()
    : id(),
      mojo_from_anchor() {}

XRAnchorData::XRAnchorData(
    uint64_t id_in,
    const base::Optional<::device::Pose>& mojo_from_anchor_in)
    : id(std::move(id_in)),
      mojo_from_anchor(std::move(mojo_from_anchor_in)) {}

XRAnchorData::~XRAnchorData() = default;

void XRAnchorData::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("id", base::NumberToString(this->id));
  value->SetString("mojo_from_anchor", base::trace_event::ValueToString(this->mojo_from_anchor, "<value of type const base::Optional<::device::Pose>&>"));
}

bool XRAnchorData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRAnchorsData::XRAnchorsData()
    : all_anchors_ids(),
      updated_anchors_data() {}

XRAnchorsData::XRAnchorsData(
    WTF::Vector<uint64_t> all_anchors_ids_in,
    WTF::Vector<XRAnchorDataPtr> updated_anchors_data_in)
    : all_anchors_ids(std::move(all_anchors_ids_in)),
      updated_anchors_data(std::move(updated_anchors_data_in)) {}

XRAnchorsData::~XRAnchorsData() = default;

void XRAnchorsData::AsValueInto(base::trace_event::TracedValue* value) const {
  value->BeginArray("all_anchors_ids");
  for (const auto& item0 : this->all_anchors_ids) {
    value->AppendString(base::NumberToString(item0));
  }
  value->EndArray();
  value->BeginArray("updated_anchors_data");
  for (const auto& item0 : this->updated_anchors_data) {
    if (item0.is_null()) {
      value->AppendString("nullptr");
    } else {
      value->BeginDictionary();
      item0->AsValueInto(value);
      value->EndDictionary();
    }
  }
  value->EndArray();
}

bool XRAnchorsData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRHitTestSubscriptionResultData::XRHitTestSubscriptionResultData()
    : subscription_id(),
      hit_test_results() {}

XRHitTestSubscriptionResultData::XRHitTestSubscriptionResultData(
    uint64_t subscription_id_in,
    WTF::Vector<XRHitResultPtr> hit_test_results_in)
    : subscription_id(std::move(subscription_id_in)),
      hit_test_results(std::move(hit_test_results_in)) {}

XRHitTestSubscriptionResultData::~XRHitTestSubscriptionResultData() = default;

void XRHitTestSubscriptionResultData::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("subscription_id", base::NumberToString(this->subscription_id));
  value->BeginArray("hit_test_results");
  for (const auto& item0 : this->hit_test_results) {
    if (item0.is_null()) {
      value->AppendString("nullptr");
    } else {
      value->BeginDictionary();
      item0->AsValueInto(value);
      value->EndDictionary();
    }
  }
  value->EndArray();
}

bool XRHitTestSubscriptionResultData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRHitTestTransientInputSubscriptionResultData::XRHitTestTransientInputSubscriptionResultData()
    : subscription_id(),
      input_source_id_to_hit_test_results() {}

XRHitTestTransientInputSubscriptionResultData::XRHitTestTransientInputSubscriptionResultData(
    uint64_t subscription_id_in,
    WTF::HashMap<uint32_t, WTF::Vector<XRHitResultPtr>> input_source_id_to_hit_test_results_in)
    : subscription_id(std::move(subscription_id_in)),
      input_source_id_to_hit_test_results(std::move(input_source_id_to_hit_test_results_in)) {}

XRHitTestTransientInputSubscriptionResultData::~XRHitTestTransientInputSubscriptionResultData() = default;

void XRHitTestTransientInputSubscriptionResultData::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("subscription_id", base::NumberToString(this->subscription_id));
  value->BeginDictionary("input_source_id_to_hit_test_results");
  for (const auto& item0 : this->input_source_id_to_hit_test_results) {
    value->BeginArrayWithCopiedName(base::trace_event::ValueToString(item0.key, "<value of type uint32_t>"));
    for (const auto& item1 : item0.value) {
      if (item1.is_null()) {
        value->AppendString("nullptr");
      } else {
        value->BeginDictionary();
        item1->AsValueInto(value);
        value->EndDictionary();
      }
    }
    value->EndArray();
  }
  value->EndDictionary();
}

bool XRHitTestTransientInputSubscriptionResultData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRHitTestSubscriptionResultsData::XRHitTestSubscriptionResultsData()
    : results(),
      transient_input_results() {}

XRHitTestSubscriptionResultsData::XRHitTestSubscriptionResultsData(
    WTF::Vector<XRHitTestSubscriptionResultDataPtr> results_in,
    WTF::Vector<XRHitTestTransientInputSubscriptionResultDataPtr> transient_input_results_in)
    : results(std::move(results_in)),
      transient_input_results(std::move(transient_input_results_in)) {}

XRHitTestSubscriptionResultsData::~XRHitTestSubscriptionResultsData() = default;

void XRHitTestSubscriptionResultsData::AsValueInto(base::trace_event::TracedValue* value) const {
  value->BeginArray("results");
  for (const auto& item0 : this->results) {
    if (item0.is_null()) {
      value->AppendString("nullptr");
    } else {
      value->BeginDictionary();
      item0->AsValueInto(value);
      value->EndDictionary();
    }
  }
  value->EndArray();
  value->BeginArray("transient_input_results");
  for (const auto& item0 : this->transient_input_results) {
    if (item0.is_null()) {
      value->AppendString("nullptr");
    } else {
      value->BeginDictionary();
      item0->AsValueInto(value);
      value->EndDictionary();
    }
  }
  value->EndArray();
}

bool XRHitTestSubscriptionResultsData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
RgbTupleF32::RgbTupleF32()
    : red(),
      green(),
      blue() {}

RgbTupleF32::RgbTupleF32(
    float red_in,
    float green_in,
    float blue_in)
    : red(std::move(red_in)),
      green(std::move(green_in)),
      blue(std::move(blue_in)) {}

RgbTupleF32::~RgbTupleF32() = default;

void RgbTupleF32::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetDouble("red", this->red);
  value->SetDouble("green", this->green);
  value->SetDouble("blue", this->blue);
}

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

XRSphericalHarmonics::XRSphericalHarmonics(
    WTF::Vector<::device::RgbTupleF32> coefficients_in)
    : coefficients(std::move(coefficients_in)) {}

XRSphericalHarmonics::~XRSphericalHarmonics() = default;

void XRSphericalHarmonics::AsValueInto(base::trace_event::TracedValue* value) const {
  value->BeginArray("coefficients");
  for (const auto& item0 : this->coefficients) {
    value->AppendString(base::trace_event::ValueToString(item0, "<value of type const ::device::RgbTupleF32&>"));
  }
  value->EndArray();
}

bool XRSphericalHarmonics::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
RgbaTupleF16::RgbaTupleF16()
    : red(),
      green(),
      blue(),
      alpha() {}

RgbaTupleF16::RgbaTupleF16(
    uint16_t red_in,
    uint16_t green_in,
    uint16_t blue_in,
    uint16_t alpha_in)
    : red(std::move(red_in)),
      green(std::move(green_in)),
      blue(std::move(blue_in)),
      alpha(std::move(alpha_in)) {}

RgbaTupleF16::~RgbaTupleF16() = default;

void RgbaTupleF16::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetInteger("red", this->red);
  value->SetInteger("green", this->green);
  value->SetInteger("blue", this->blue);
  value->SetInteger("alpha", this->alpha);
}

bool RgbaTupleF16::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRCubeMap::XRCubeMap()
    : width_and_height(),
      positive_x(),
      negative_x(),
      positive_y(),
      negative_y(),
      positive_z(),
      negative_z() {}

XRCubeMap::XRCubeMap(
    uint32_t width_and_height_in,
    WTF::Vector<::device::RgbaTupleF16> positive_x_in,
    WTF::Vector<::device::RgbaTupleF16> negative_x_in,
    WTF::Vector<::device::RgbaTupleF16> positive_y_in,
    WTF::Vector<::device::RgbaTupleF16> negative_y_in,
    WTF::Vector<::device::RgbaTupleF16> positive_z_in,
    WTF::Vector<::device::RgbaTupleF16> negative_z_in)
    : width_and_height(std::move(width_and_height_in)),
      positive_x(std::move(positive_x_in)),
      negative_x(std::move(negative_x_in)),
      positive_y(std::move(positive_y_in)),
      negative_y(std::move(negative_y_in)),
      positive_z(std::move(positive_z_in)),
      negative_z(std::move(negative_z_in)) {}

XRCubeMap::~XRCubeMap() = default;

void XRCubeMap::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("width_and_height", base::NumberToString(this->width_and_height));
  value->BeginArray("positive_x");
  for (const auto& item0 : this->positive_x) {
    value->AppendString(base::trace_event::ValueToString(item0, "<value of type const ::device::RgbaTupleF16&>"));
  }
  value->EndArray();
  value->BeginArray("negative_x");
  for (const auto& item0 : this->negative_x) {
    value->AppendString(base::trace_event::ValueToString(item0, "<value of type const ::device::RgbaTupleF16&>"));
  }
  value->EndArray();
  value->BeginArray("positive_y");
  for (const auto& item0 : this->positive_y) {
    value->AppendString(base::trace_event::ValueToString(item0, "<value of type const ::device::RgbaTupleF16&>"));
  }
  value->EndArray();
  value->BeginArray("negative_y");
  for (const auto& item0 : this->negative_y) {
    value->AppendString(base::trace_event::ValueToString(item0, "<value of type const ::device::RgbaTupleF16&>"));
  }
  value->EndArray();
  value->BeginArray("positive_z");
  for (const auto& item0 : this->positive_z) {
    value->AppendString(base::trace_event::ValueToString(item0, "<value of type const ::device::RgbaTupleF16&>"));
  }
  value->EndArray();
  value->BeginArray("negative_z");
  for (const auto& item0 : this->negative_z) {
    value->AppendString(base::trace_event::ValueToString(item0, "<value of type const ::device::RgbaTupleF16&>"));
  }
  value->EndArray();
}

bool XRCubeMap::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRLightProbe::XRLightProbe()
    : spherical_harmonics(),
      main_light_direction(),
      main_light_intensity() {}

XRLightProbe::XRLightProbe(
    XRSphericalHarmonicsPtr spherical_harmonics_in,
    const ::gfx::Vector3dF& main_light_direction_in,
    const ::device::RgbTupleF32& main_light_intensity_in)
    : spherical_harmonics(std::move(spherical_harmonics_in)),
      main_light_direction(std::move(main_light_direction_in)),
      main_light_intensity(std::move(main_light_intensity_in)) {}

XRLightProbe::~XRLightProbe() = default;

void XRLightProbe::AsValueInto(base::trace_event::TracedValue* value) const {
  if (this->spherical_harmonics.is_null()) {
    value->SetString("spherical_harmonics", "nullptr");
  } else {
    value->BeginDictionary("spherical_harmonics");
    this->spherical_harmonics->AsValueInto(value);
    value->EndDictionary();
  }
  value->SetString("main_light_direction", base::trace_event::ValueToString(this->main_light_direction, "<value of type const ::gfx::Vector3dF&>"));
  value->SetString("main_light_intensity", base::trace_event::ValueToString(this->main_light_intensity, "<value of type const ::device::RgbTupleF32&>"));
}

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

XRReflectionProbe::XRReflectionProbe(
    XRCubeMapPtr cube_map_in)
    : cube_map(std::move(cube_map_in)) {}

XRReflectionProbe::~XRReflectionProbe() = default;

void XRReflectionProbe::AsValueInto(base::trace_event::TracedValue* value) const {
  if (this->cube_map.is_null()) {
    value->SetString("cube_map", "nullptr");
  } else {
    value->BeginDictionary("cube_map");
    this->cube_map->AsValueInto(value);
    value->EndDictionary();
  }
}

bool XRReflectionProbe::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRLightEstimationData::XRLightEstimationData()
    : light_probe(),
      reflection_probe() {}

XRLightEstimationData::XRLightEstimationData(
    XRLightProbePtr light_probe_in,
    XRReflectionProbePtr reflection_probe_in)
    : light_probe(std::move(light_probe_in)),
      reflection_probe(std::move(reflection_probe_in)) {}

XRLightEstimationData::~XRLightEstimationData() = default;

void XRLightEstimationData::AsValueInto(base::trace_event::TracedValue* value) const {
  if (this->light_probe.is_null()) {
    value->SetString("light_probe", "nullptr");
  } else {
    value->BeginDictionary("light_probe");
    this->light_probe->AsValueInto(value);
    value->EndDictionary();
  }
  if (this->reflection_probe.is_null()) {
    value->SetString("reflection_probe", "nullptr");
  } else {
    value->BeginDictionary("reflection_probe");
    this->reflection_probe->AsValueInto(value);
    value->EndDictionary();
  }
}

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

XRDepthDataStillValid::~XRDepthDataStillValid() = default;
size_t XRDepthDataStillValid::Hash(size_t seed) const {
  return seed;
}

void XRDepthDataStillValid::AsValueInto(base::trace_event::TracedValue* value) const {
}

bool XRDepthDataStillValid::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRDepthDataUpdated::XRDepthDataUpdated()
    : time_delta(),
      pixel_data(),
      norm_texture_from_norm_view(),
      size() {}

XRDepthDataUpdated::XRDepthDataUpdated(
    ::base::TimeDelta time_delta_in,
    ::mojo_base::BigBuffer pixel_data_in,
    const ::gfx::Transform& norm_texture_from_norm_view_in,
    const ::gfx::Size& size_in)
    : time_delta(std::move(time_delta_in)),
      pixel_data(std::move(pixel_data_in)),
      norm_texture_from_norm_view(std::move(norm_texture_from_norm_view_in)),
      size(std::move(size_in)) {}

XRDepthDataUpdated::~XRDepthDataUpdated() = default;

void XRDepthDataUpdated::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("time_delta", base::trace_event::ValueToString(this->time_delta, "<value of type ::base::TimeDelta>"));
  value->SetString("pixel_data", base::trace_event::ValueToString(this->pixel_data, "<value of type ::mojo_base::BigBuffer>"));
  value->SetString("norm_texture_from_norm_view", base::trace_event::ValueToString(this->norm_texture_from_norm_view, "<value of type const ::gfx::Transform&>"));
  value->SetString("size", base::trace_event::ValueToString(this->size, "<value of type const ::gfx::Size&>"));
}

bool XRDepthDataUpdated::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRFrameData::XRFrameData()
    : pose(),
      time_delta(),
      buffer_holder(),
      camera_image_buffer_holder(),
      depth_data(),
      mojo_space_reset(),
      frame_id(),
      left_eye(),
      right_eye(),
      input_state(),
      stage_parameters_updated(),
      stage_parameters(),
      detected_planes_data(),
      anchors_data(),
      light_estimation_data(),
      hit_test_subscription_results() {}

XRFrameData::XRFrameData(
    VRPosePtr pose_in,
    ::base::TimeDelta time_delta_in,
    const base::Optional<::gpu::MailboxHolder>& buffer_holder_in,
    const base::Optional<::gpu::MailboxHolder>& camera_image_buffer_holder_in,
    XRDepthDataPtr depth_data_in,
    bool mojo_space_reset_in,
    int16_t frame_id_in,
    VREyeParametersPtr left_eye_in,
    VREyeParametersPtr right_eye_in,
    base::Optional<WTF::Vector<XRInputSourceStatePtr>> input_state_in,
    bool stage_parameters_updated_in,
    VRStageParametersPtr stage_parameters_in,
    XRPlaneDetectionDataPtr detected_planes_data_in,
    XRAnchorsDataPtr anchors_data_in,
    XRLightEstimationDataPtr light_estimation_data_in,
    XRHitTestSubscriptionResultsDataPtr hit_test_subscription_results_in)
    : pose(std::move(pose_in)),
      time_delta(std::move(time_delta_in)),
      buffer_holder(std::move(buffer_holder_in)),
      camera_image_buffer_holder(std::move(camera_image_buffer_holder_in)),
      depth_data(std::move(depth_data_in)),
      mojo_space_reset(std::move(mojo_space_reset_in)),
      frame_id(std::move(frame_id_in)),
      left_eye(std::move(left_eye_in)),
      right_eye(std::move(right_eye_in)),
      input_state(std::move(input_state_in)),
      stage_parameters_updated(std::move(stage_parameters_updated_in)),
      stage_parameters(std::move(stage_parameters_in)),
      detected_planes_data(std::move(detected_planes_data_in)),
      anchors_data(std::move(anchors_data_in)),
      light_estimation_data(std::move(light_estimation_data_in)),
      hit_test_subscription_results(std::move(hit_test_subscription_results_in)) {}

XRFrameData::~XRFrameData() = default;

void XRFrameData::AsValueInto(base::trace_event::TracedValue* value) const {
  if (this->pose.is_null()) {
    value->SetString("pose", "nullptr");
  } else {
    value->BeginDictionary("pose");
    this->pose->AsValueInto(value);
    value->EndDictionary();
  }
  value->SetString("time_delta", base::trace_event::ValueToString(this->time_delta, "<value of type ::base::TimeDelta>"));
  value->SetString("buffer_holder", base::trace_event::ValueToString(this->buffer_holder, "<value of type const base::Optional<::gpu::MailboxHolder>&>"));
  value->SetString("camera_image_buffer_holder", base::trace_event::ValueToString(this->camera_image_buffer_holder, "<value of type const base::Optional<::gpu::MailboxHolder>&>"));
  value->SetString("depth_data", base::trace_event::ValueToString(this->depth_data, "<value of type XRDepthDataPtr>"));
  value->SetBoolean("mojo_space_reset", this->mojo_space_reset);
  value->SetInteger("frame_id", this->frame_id);
  if (this->left_eye.is_null()) {
    value->SetString("left_eye", "nullptr");
  } else {
    value->BeginDictionary("left_eye");
    this->left_eye->AsValueInto(value);
    value->EndDictionary();
  }
  if (this->right_eye.is_null()) {
    value->SetString("right_eye", "nullptr");
  } else {
    value->BeginDictionary("right_eye");
    this->right_eye->AsValueInto(value);
    value->EndDictionary();
  }
  if (this->input_state.has_value()) {
    value->BeginArray("input_state");
    for (const auto& item0 : this->input_state.value()) {
      if (item0.is_null()) {
        value->AppendString("nullptr");
      } else {
        value->BeginDictionary();
        item0->AsValueInto(value);
        value->EndDictionary();
      }
    }
    value->EndArray();
  } else {
    value->SetString("input_state", "base::nullopt");
  }
  value->SetBoolean("stage_parameters_updated", this->stage_parameters_updated);
  if (this->stage_parameters.is_null()) {
    value->SetString("stage_parameters", "nullptr");
  } else {
    value->BeginDictionary("stage_parameters");
    this->stage_parameters->AsValueInto(value);
    value->EndDictionary();
  }
  if (this->detected_planes_data.is_null()) {
    value->SetString("detected_planes_data", "nullptr");
  } else {
    value->BeginDictionary("detected_planes_data");
    this->detected_planes_data->AsValueInto(value);
    value->EndDictionary();
  }
  if (this->anchors_data.is_null()) {
    value->SetString("anchors_data", "nullptr");
  } else {
    value->BeginDictionary("anchors_data");
    this->anchors_data->AsValueInto(value);
    value->EndDictionary();
  }
  if (this->light_estimation_data.is_null()) {
    value->SetString("light_estimation_data", "nullptr");
  } else {
    value->BeginDictionary("light_estimation_data");
    this->light_estimation_data->AsValueInto(value);
    value->EndDictionary();
  }
  if (this->hit_test_subscription_results.is_null()) {
    value->SetString("hit_test_subscription_results", "nullptr");
  } else {
    value->BeginDictionary("hit_test_subscription_results");
    this->hit_test_subscription_results->AsValueInto(value);
    value->EndDictionary();
  }
}

bool XRFrameData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
RequestSessionSuccess::RequestSessionSuccess()
    : session(),
      metrics_recorder() {}

RequestSessionSuccess::RequestSessionSuccess(
    XRSessionPtr session_in,
    ::mojo::PendingRemote<XRSessionMetricsRecorder> metrics_recorder_in)
    : session(std::move(session_in)),
      metrics_recorder(std::move(metrics_recorder_in)) {}

RequestSessionSuccess::~RequestSessionSuccess() = default;

void RequestSessionSuccess::AsValueInto(base::trace_event::TracedValue* value) const {
  if (this->session.is_null()) {
    value->SetString("session", "nullptr");
  } else {
    value->BeginDictionary("session");
    this->session->AsValueInto(value);
    value->EndDictionary();
  }
  value->SetBoolean("metrics_recorder", this->metrics_recorder.is_valid());
}

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

XRFrameDataRequestOptions::XRFrameDataRequestOptions(
    bool include_lighting_estimation_data_in)
    : include_lighting_estimation_data(std::move(include_lighting_estimation_data_in)) {}

XRFrameDataRequestOptions::~XRFrameDataRequestOptions() = default;
size_t XRFrameDataRequestOptions::Hash(size_t seed) const {
  seed = mojo::internal::WTFHash(seed, this->include_lighting_estimation_data);
  return seed;
}

void XRFrameDataRequestOptions::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetBoolean("include_lighting_estimation_data", this->include_lighting_estimation_data);
}

bool XRFrameDataRequestOptions::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
XRNativeOriginInformation::XRNativeOriginInformation() : tag_(Tag::INPUT_SOURCE_ID) {
  data_.input_source_id = uint32_t();
}

XRNativeOriginInformation::~XRNativeOriginInformation() {
  DestroyActive();
}


void XRNativeOriginInformation::set_input_source_id(
    uint32_t input_source_id) {
  if (tag_ != Tag::INPUT_SOURCE_ID) {
    DestroyActive();
    tag_ = Tag::INPUT_SOURCE_ID;
  }
  data_.input_source_id = input_source_id;
}
void XRNativeOriginInformation::set_plane_id(
    uint64_t plane_id) {
  if (tag_ != Tag::PLANE_ID) {
    DestroyActive();
    tag_ = Tag::PLANE_ID;
  }
  data_.plane_id = plane_id;
}
void XRNativeOriginInformation::set_anchor_id(
    uint64_t anchor_id) {
  if (tag_ != Tag::ANCHOR_ID) {
    DestroyActive();
    tag_ = Tag::ANCHOR_ID;
  }
  data_.anchor_id = anchor_id;
}
void XRNativeOriginInformation::set_reference_space_type(
    XRReferenceSpaceType reference_space_type) {
  if (tag_ != Tag::REFERENCE_SPACE_TYPE) {
    DestroyActive();
    tag_ = Tag::REFERENCE_SPACE_TYPE;
  }
  data_.reference_space_type = reference_space_type;
}

void XRNativeOriginInformation::DestroyActive() {
  switch (tag_) {

    case Tag::INPUT_SOURCE_ID:

      break;
    case Tag::PLANE_ID:

      break;
    case Tag::ANCHOR_ID:

      break;
    case Tag::REFERENCE_SPACE_TYPE:

      break;
  }
}
size_t XRNativeOriginInformation::Hash(size_t seed) const {
  seed = mojo::internal::HashCombine(seed, static_cast<uint32_t>(tag_));
  switch (tag_) {

    case Tag::INPUT_SOURCE_ID:
      return mojo::internal::WTFHash(seed, data_.input_source_id);
    case Tag::PLANE_ID:
      return mojo::internal::WTFHash(seed, data_.plane_id);
    case Tag::ANCHOR_ID:
      return mojo::internal::WTFHash(seed, data_.anchor_id);
    case Tag::REFERENCE_SPACE_TYPE:
      return mojo::internal::WTFHash(seed, data_.reference_space_type);
    default:
      NOTREACHED();
      return seed;
  }
}

bool XRNativeOriginInformation::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context, false);
}
XRDepthData::XRDepthData() : tag_(Tag::DATA_STILL_VALID) {
  data_.data_still_valid = new XRDepthDataStillValidPtr;
}

XRDepthData::~XRDepthData() {
  DestroyActive();
}


void XRDepthData::set_data_still_valid(
    XRDepthDataStillValidPtr data_still_valid) {
  if (tag_ == Tag::DATA_STILL_VALID) {
    *(data_.data_still_valid) = std::move(data_still_valid);
  } else {
    DestroyActive();
    tag_ = Tag::DATA_STILL_VALID;
    data_.data_still_valid = new XRDepthDataStillValidPtr(
        std::move(data_still_valid));
  }
}
void XRDepthData::set_updated_depth_data(
    XRDepthDataUpdatedPtr updated_depth_data) {
  if (tag_ == Tag::UPDATED_DEPTH_DATA) {
    *(data_.updated_depth_data) = std::move(updated_depth_data);
  } else {
    DestroyActive();
    tag_ = Tag::UPDATED_DEPTH_DATA;
    data_.updated_depth_data = new XRDepthDataUpdatedPtr(
        std::move(updated_depth_data));
  }
}

void XRDepthData::DestroyActive() {
  switch (tag_) {

    case Tag::DATA_STILL_VALID:

      delete data_.data_still_valid;
      break;
    case Tag::UPDATED_DEPTH_DATA:

      delete data_.updated_depth_data;
      break;
  }
}

bool XRDepthData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context, false);
}
RequestSessionResult::RequestSessionResult() : tag_(Tag::SUCCESS) {
  data_.success = new RequestSessionSuccessPtr;
}

RequestSessionResult::~RequestSessionResult() {
  DestroyActive();
}


void RequestSessionResult::set_success(
    RequestSessionSuccessPtr success) {
  if (tag_ == Tag::SUCCESS) {
    *(data_.success) = std::move(success);
  } else {
    DestroyActive();
    tag_ = Tag::SUCCESS;
    data_.success = new RequestSessionSuccessPtr(
        std::move(success));
  }
}
void RequestSessionResult::set_failure_reason(
    RequestSessionError failure_reason) {
  if (tag_ != Tag::FAILURE_REASON) {
    DestroyActive();
    tag_ = Tag::FAILURE_REASON;
  }
  data_.failure_reason = failure_reason;
}

void RequestSessionResult::DestroyActive() {
  switch (tag_) {

    case Tag::SUCCESS:

      delete data_.success;
      break;
    case Tag::FAILURE_REASON:

      break;
  }
}

bool RequestSessionResult::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context, false);
}
const char VRService::Name_[] = "device.mojom.VRService";
bool VRService::MakeXrCompatible(XrCompatibleResult* out_xr_compatible_result) {
  NOTREACHED();
  return false;
}

class VRService_RequestSession_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  VRService_RequestSession_ForwardToCallback(
      VRService::RequestSessionCallback callback
      ) : callback_(std::move(callback)) {
  }
  bool Accept(mojo::Message* message) override;
 private:
  VRService::RequestSessionCallback callback_;
  DISALLOW_COPY_AND_ASSIGN(VRService_RequestSession_ForwardToCallback);
};

class VRService_SupportsSession_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  VRService_SupportsSession_ForwardToCallback(
      VRService::SupportsSessionCallback callback
      ) : callback_(std::move(callback)) {
  }
  bool Accept(mojo::Message* message) override;
 private:
  VRService::SupportsSessionCallback callback_;
  DISALLOW_COPY_AND_ASSIGN(VRService_SupportsSession_ForwardToCallback);
};

class VRService_ExitPresent_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  VRService_ExitPresent_ForwardToCallback(
      VRService::ExitPresentCallback callback
      ) : callback_(std::move(callback)) {
  }
  bool Accept(mojo::Message* message) override;
 private:
  VRService::ExitPresentCallback callback_;
  DISALLOW_COPY_AND_ASSIGN(VRService_ExitPresent_ForwardToCallback);
};
class VRService_MakeXrCompatible_HandleSyncResponse
    : public mojo::MessageReceiver {
 public:
  VRService_MakeXrCompatible_HandleSyncResponse(
      bool* result, XrCompatibleResult* out_xr_compatible_result)
      : result_(result), out_xr_compatible_result_(out_xr_compatible_result) {
    DCHECK(!*result_);
  }
  bool Accept(mojo::Message* message) override;
 private:
  bool* result_;
  XrCompatibleResult* out_xr_compatible_result_;DISALLOW_COPY_AND_ASSIGN(VRService_MakeXrCompatible_HandleSyncResponse);
};

class VRService_MakeXrCompatible_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  VRService_MakeXrCompatible_ForwardToCallback(
      VRService::MakeXrCompatibleCallback callback
      ) : callback_(std::move(callback)) {
  }
  bool Accept(mojo::Message* message) override;
 private:
  VRService::MakeXrCompatibleCallback callback_;
  DISALLOW_COPY_AND_ASSIGN(VRService_MakeXrCompatible_ForwardToCallback);
};

VRServiceProxy::VRServiceProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void VRServiceProxy::SetClient(
    ::mojo::PendingRemote<VRServiceClient> in_client) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::VRService::SetClient", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetBoolean("client", in_client.is_valid());
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kVRService_SetClient_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::VRService_SetClient_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  mojo::internal::Serialize<mojo::InterfacePtrDataView<::device::mojom::VRServiceClientInterfaceBase>>(
      in_client, &params->client, &serialization_context);
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      !mojo::internal::IsHandleOrInterfaceValid(params->client),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
      "invalid client in VRService.SetClient request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VRService::Name_);
  message.set_method_name("SetClient");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void VRServiceProxy::RequestSession(
    XRSessionOptionsPtr in_options, RequestSessionCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::VRService::RequestSession", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      if (in_options.is_null()) {
        raw_value->SetString("options", "nullptr");
      } else {
        raw_value->BeginDictionary("options");
        in_options->AsValueInto(raw_value);
        raw_value->EndDictionary();
      }
      return value;
    }());
#endif
  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kVRService_RequestSession_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::VRService_RequestSession_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->options)::BaseType::BufferWriter
      options_writer;
  mojo::internal::Serialize<::device::mojom::XRSessionOptionsDataView>(
      in_options, buffer, &options_writer, &serialization_context);
  params->options.Set(
      options_writer.is_null() ? nullptr : options_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->options.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null options in VRService.RequestSession request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VRService::Name_);
  message.set_method_name("RequestSession");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new VRService_RequestSession_ForwardToCallback(
          std::move(callback)));
  ignore_result(receiver_->AcceptWithResponder(&message, std::move(responder)));
}

void VRServiceProxy::SupportsSession(
    XRSessionOptionsPtr in_options, SupportsSessionCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::VRService::SupportsSession", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      if (in_options.is_null()) {
        raw_value->SetString("options", "nullptr");
      } else {
        raw_value->BeginDictionary("options");
        in_options->AsValueInto(raw_value);
        raw_value->EndDictionary();
      }
      return value;
    }());
#endif
  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kVRService_SupportsSession_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::VRService_SupportsSession_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->options)::BaseType::BufferWriter
      options_writer;
  mojo::internal::Serialize<::device::mojom::XRSessionOptionsDataView>(
      in_options, buffer, &options_writer, &serialization_context);
  params->options.Set(
      options_writer.is_null() ? nullptr : options_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->options.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null options in VRService.SupportsSession request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VRService::Name_);
  message.set_method_name("SupportsSession");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new VRService_SupportsSession_ForwardToCallback(
          std::move(callback)));
  ignore_result(receiver_->AcceptWithResponder(&message, std::move(responder)));
}

void VRServiceProxy::ExitPresent(
    ExitPresentCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "device::mojom::VRService::ExitPresent");
#endif
  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kVRService_ExitPresent_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::VRService_ExitPresent_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VRService::Name_);
  message.set_method_name("ExitPresent");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new VRService_ExitPresent_ForwardToCallback(
          std::move(callback)));
  ignore_result(receiver_->AcceptWithResponder(&message, std::move(responder)));
}

void VRServiceProxy::SetFramesThrottled(
    bool in_throttled) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::VRService::SetFramesThrottled", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetBoolean("throttled", in_throttled);
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kVRService_SetFramesThrottled_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::VRService_SetFramesThrottled_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->throttled = in_throttled;
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VRService::Name_);
  message.set_method_name("SetFramesThrottled");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}
bool VRServiceProxy::MakeXrCompatible(
    XrCompatibleResult* out_param_xr_compatible_result) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_BEGIN0("mojom", "device::mojom::VRService::MakeXrCompatible");
#endif
  const bool kExpectsResponse = true;
  const bool kIsSync = true;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kVRService_MakeXrCompatible_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::VRService_MakeXrCompatible_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VRService::Name_);
  message.set_method_name("MakeXrCompatible");
#endif

  bool result = false;
  std::unique_ptr<mojo::MessageReceiver> responder(
      new VRService_MakeXrCompatible_HandleSyncResponse(
          &result, out_param_xr_compatible_result));
  ignore_result(receiver_->AcceptWithResponder(&message, std::move(responder)));
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_END1(
    "mojom", "device::mojom::VRService::MakeXrCompatible", "sync_response_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      if (out_param_xr_compatible_result) {
        raw_value->SetString("xr_compatible_result", base::trace_event::ValueToString((*out_param_xr_compatible_result)));
      } else {
        raw_value->SetString("xr_compatible_result", "nullptr");
      }
      return value;
    }());
#endif
  return result;
}

void VRServiceProxy::MakeXrCompatible(
    MakeXrCompatibleCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "device::mojom::VRService::MakeXrCompatible");
#endif
  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kVRService_MakeXrCompatible_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::VRService_MakeXrCompatible_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VRService::Name_);
  message.set_method_name("MakeXrCompatible");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new VRService_MakeXrCompatible_ForwardToCallback(
          std::move(callback)));
  ignore_result(receiver_->AcceptWithResponder(&message, std::move(responder)));
}
class VRService_RequestSession_ProxyToResponder {
 public:
  static VRService::RequestSessionCallback CreateCallback(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder) {
    std::unique_ptr<VRService_RequestSession_ProxyToResponder> proxy(
        new VRService_RequestSession_ProxyToResponder(
            request_id, is_sync, responder));
    return base::BindOnce(&VRService_RequestSession_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~VRService_RequestSession_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
    // If the Callback was dropped then deleting the responder will close
    // the pipe so the calling application knows to stop waiting for a reply.
    responder_ = nullptr;
  }

 private:
  VRService_RequestSession_ProxyToResponder(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder)
      : request_id_(request_id),
        is_sync_(is_sync),
        responder_(std::move(*responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
//    DCHECK(!connected)
//        << "VRService::RequestSessionCallback was destroyed without "
//        << "first either being run or its corresponding binding being closed. "
//        << "It is an error to drop response callbacks which still correspond "
//        << "to an open interface pipe.";
  }
#endif

  void Run(
      RequestSessionResultPtr in_result);

  uint64_t request_id_;
  bool is_sync_;
  std::unique_ptr<mojo::MessageReceiverWithStatus> responder_;

  DISALLOW_COPY_AND_ASSIGN(VRService_RequestSession_ProxyToResponder);
};

bool VRService_RequestSession_ForwardToCallback::Accept(
    mojo::Message* message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1("mojom", "device::mojom::VRService::RequestSessionCallback",
               "message", message->name());
#endif
  mojo::internal::MessageDispatchContext dispatch_context(message);

  DCHECK(message->is_serialized());
  internal::VRService_RequestSession_ResponseParams_Data* params =
      reinterpret_cast<
          internal::VRService_RequestSession_ResponseParams_Data*>(
              message->mutable_payload());
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  
  bool success = true;
  RequestSessionResultPtr p_result{};
  VRService_RequestSession_ResponseParamsDataView input_data_view(params, &serialization_context);
  
  if (success && !input_data_view.ReadResult(&p_result))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        VRService::Name_, 1, true);
    return false;
  }
  if (!callback_.is_null())
    std::move(callback_).Run(
std::move(p_result));
  return true;
}

void VRService_RequestSession_ProxyToResponder::Run(
    RequestSessionResultPtr in_result) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_BEGIN1(
    "mojom", "(Impl)device::mojom::VRService::RequestSessionCallback", "async_response_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("result", base::trace_event::ValueToString(in_result, "<value of type RequestSessionResultPtr>"));
      return value;
    }());
#endif
  
  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kVRService_RequestSession_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::VRService_RequestSession_ResponseParams_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->result)::BufferWriter result_writer;
  result_writer.AllocateInline(buffer, &params->result);
  mojo::internal::Serialize<::device::mojom::RequestSessionResultDataView>(
      in_result, buffer, &result_writer, true, &serialization_context);
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->result.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null result in ");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_END1("mojom", "(Impl)device::mojom::VRService::RequestSessionCallback", "message",
                   message.name());
#endif

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VRService::Name_);
  message.set_method_name("RequestSession");
#endif

  message.set_request_id(request_id_);
  ignore_result(responder_->Accept(&message));
  // TODO(darin): Accept() returning false indicates a malformed message, and
  // that may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class VRService_SupportsSession_ProxyToResponder {
 public:
  static VRService::SupportsSessionCallback CreateCallback(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder) {
    std::unique_ptr<VRService_SupportsSession_ProxyToResponder> proxy(
        new VRService_SupportsSession_ProxyToResponder(
            request_id, is_sync, responder));
    return base::BindOnce(&VRService_SupportsSession_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~VRService_SupportsSession_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
    // If the Callback was dropped then deleting the responder will close
    // the pipe so the calling application knows to stop waiting for a reply.
    responder_ = nullptr;
  }

 private:
  VRService_SupportsSession_ProxyToResponder(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder)
      : request_id_(request_id),
        is_sync_(is_sync),
        responder_(std::move(*responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
//    DCHECK(!connected)
//        << "VRService::SupportsSessionCallback was destroyed without "
//        << "first either being run or its corresponding binding being closed. "
//        << "It is an error to drop response callbacks which still correspond "
//        << "to an open interface pipe.";
  }
#endif

  void Run(
      bool in_supports_session);

  uint64_t request_id_;
  bool is_sync_;
  std::unique_ptr<mojo::MessageReceiverWithStatus> responder_;

  DISALLOW_COPY_AND_ASSIGN(VRService_SupportsSession_ProxyToResponder);
};

bool VRService_SupportsSession_ForwardToCallback::Accept(
    mojo::Message* message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1("mojom", "device::mojom::VRService::SupportsSessionCallback",
               "message", message->name());
#endif
  mojo::internal::MessageDispatchContext dispatch_context(message);

  DCHECK(message->is_serialized());
  internal::VRService_SupportsSession_ResponseParams_Data* params =
      reinterpret_cast<
          internal::VRService_SupportsSession_ResponseParams_Data*>(
              message->mutable_payload());
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  
  bool success = true;
  bool p_supports_session{};
  VRService_SupportsSession_ResponseParamsDataView input_data_view(params, &serialization_context);
  
  if (success)
    p_supports_session = input_data_view.supports_session();
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        VRService::Name_, 2, true);
    return false;
  }
  if (!callback_.is_null())
    std::move(callback_).Run(
std::move(p_supports_session));
  return true;
}

void VRService_SupportsSession_ProxyToResponder::Run(
    bool in_supports_session) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_BEGIN1(
    "mojom", "(Impl)device::mojom::VRService::SupportsSessionCallback", "async_response_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetBoolean("supports_session", in_supports_session);
      return value;
    }());
#endif
  
  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kVRService_SupportsSession_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::VRService_SupportsSession_ResponseParams_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->supports_session = in_supports_session;
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_END1("mojom", "(Impl)device::mojom::VRService::SupportsSessionCallback", "message",
                   message.name());
#endif

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VRService::Name_);
  message.set_method_name("SupportsSession");
#endif

  message.set_request_id(request_id_);
  ignore_result(responder_->Accept(&message));
  // TODO(darin): Accept() returning false indicates a malformed message, and
  // that may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class VRService_ExitPresent_ProxyToResponder {
 public:
  static VRService::ExitPresentCallback CreateCallback(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder) {
    std::unique_ptr<VRService_ExitPresent_ProxyToResponder> proxy(
        new VRService_ExitPresent_ProxyToResponder(
            request_id, is_sync, responder));
    return base::BindOnce(&VRService_ExitPresent_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~VRService_ExitPresent_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
    // If the Callback was dropped then deleting the responder will close
    // the pipe so the calling application knows to stop waiting for a reply.
    responder_ = nullptr;
  }

 private:
  VRService_ExitPresent_ProxyToResponder(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder)
      : request_id_(request_id),
        is_sync_(is_sync),
        responder_(std::move(*responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
//    DCHECK(!connected)
//        << "VRService::ExitPresentCallback was destroyed without "
//        << "first either being run or its corresponding binding being closed. "
//        << "It is an error to drop response callbacks which still correspond "
//        << "to an open interface pipe.";
  }
#endif

  void Run(
      );

  uint64_t request_id_;
  bool is_sync_;
  std::unique_ptr<mojo::MessageReceiverWithStatus> responder_;

  DISALLOW_COPY_AND_ASSIGN(VRService_ExitPresent_ProxyToResponder);
};

bool VRService_ExitPresent_ForwardToCallback::Accept(
    mojo::Message* message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1("mojom", "device::mojom::VRService::ExitPresentCallback",
               "message", message->name());
#endif
  mojo::internal::MessageDispatchContext dispatch_context(message);

  DCHECK(message->is_serialized());
  internal::VRService_ExitPresent_ResponseParams_Data* params =
      reinterpret_cast<
          internal::VRService_ExitPresent_ResponseParams_Data*>(
              message->mutable_payload());
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  
  bool success = true;
  VRService_ExitPresent_ResponseParamsDataView input_data_view(params, &serialization_context);
  
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        VRService::Name_, 3, true);
    return false;
  }
  if (!callback_.is_null())
    std::move(callback_).Run();
  return true;
}

void VRService_ExitPresent_ProxyToResponder::Run(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_BEGIN0("mojom", "(Impl)device::mojom::VRService::ExitPresentCallback");
#endif
  
  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kVRService_ExitPresent_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::VRService_ExitPresent_ResponseParams_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_END1("mojom", "(Impl)device::mojom::VRService::ExitPresentCallback", "message",
                   message.name());
#endif

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VRService::Name_);
  message.set_method_name("ExitPresent");
#endif

  message.set_request_id(request_id_);
  ignore_result(responder_->Accept(&message));
  // TODO(darin): Accept() returning false indicates a malformed message, and
  // that may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class VRService_MakeXrCompatible_ProxyToResponder {
 public:
  static VRService::MakeXrCompatibleCallback CreateCallback(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder) {
    std::unique_ptr<VRService_MakeXrCompatible_ProxyToResponder> proxy(
        new VRService_MakeXrCompatible_ProxyToResponder(
            request_id, is_sync, responder));
    return base::BindOnce(&VRService_MakeXrCompatible_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~VRService_MakeXrCompatible_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
    // If the Callback was dropped then deleting the responder will close
    // the pipe so the calling application knows to stop waiting for a reply.
    responder_ = nullptr;
  }

 private:
  VRService_MakeXrCompatible_ProxyToResponder(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder)
      : request_id_(request_id),
        is_sync_(is_sync),
        responder_(std::move(*responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
//    DCHECK(!connected)
//        << "VRService::MakeXrCompatibleCallback was destroyed without "
//        << "first either being run or its corresponding binding being closed. "
//        << "It is an error to drop response callbacks which still correspond "
//        << "to an open interface pipe.";
  }
#endif

  void Run(
      XrCompatibleResult in_xr_compatible_result);

  uint64_t request_id_;
  bool is_sync_;
  std::unique_ptr<mojo::MessageReceiverWithStatus> responder_;

  DISALLOW_COPY_AND_ASSIGN(VRService_MakeXrCompatible_ProxyToResponder);
};

bool VRService_MakeXrCompatible_ForwardToCallback::Accept(
    mojo::Message* message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1("mojom", "device::mojom::VRService::MakeXrCompatibleCallback",
               "message", message->name());
#endif
  mojo::internal::MessageDispatchContext dispatch_context(message);

  DCHECK(message->is_serialized());
  internal::VRService_MakeXrCompatible_ResponseParams_Data* params =
      reinterpret_cast<
          internal::VRService_MakeXrCompatible_ResponseParams_Data*>(
              message->mutable_payload());
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  
  bool success = true;
  XrCompatibleResult p_xr_compatible_result{};
  VRService_MakeXrCompatible_ResponseParamsDataView input_data_view(params, &serialization_context);
  
  if (success && !input_data_view.ReadXrCompatibleResult(&p_xr_compatible_result))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        VRService::Name_, 5, true);
    return false;
  }
  if (!callback_.is_null())
    std::move(callback_).Run(
std::move(p_xr_compatible_result));
  return true;
}

void VRService_MakeXrCompatible_ProxyToResponder::Run(
    XrCompatibleResult in_xr_compatible_result) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_BEGIN1(
    "mojom", "(Impl)device::mojom::VRService::MakeXrCompatibleCallback", "async_response_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("xr_compatible_result", base::trace_event::ValueToString(in_xr_compatible_result));
      return value;
    }());
#endif
  
  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kVRService_MakeXrCompatible_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::VRService_MakeXrCompatible_ResponseParams_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  mojo::internal::Serialize<::device::mojom::XrCompatibleResult>(
      in_xr_compatible_result, &params->xr_compatible_result);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_END1("mojom", "(Impl)device::mojom::VRService::MakeXrCompatibleCallback", "message",
                   message.name());
#endif

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VRService::Name_);
  message.set_method_name("MakeXrCompatible");
#endif

  message.set_request_id(request_id_);
  ignore_result(responder_->Accept(&message));
  // TODO(darin): Accept() returning false indicates a malformed message, and
  // that may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
bool VRService_MakeXrCompatible_HandleSyncResponse::Accept(
    mojo::Message* message) {

  DCHECK(message->is_serialized());
  internal::VRService_MakeXrCompatible_ResponseParams_Data* params =
      reinterpret_cast<internal::VRService_MakeXrCompatible_ResponseParams_Data*>(
          message->mutable_payload());
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  
  bool success = true;
  XrCompatibleResult p_xr_compatible_result{};
  VRService_MakeXrCompatible_ResponseParamsDataView input_data_view(params, &serialization_context);
  
  if (success && !input_data_view.ReadXrCompatibleResult(&p_xr_compatible_result))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        VRService::Name_, 5, true);
    return false;
  }
  *out_xr_compatible_result_ = std::move(p_xr_compatible_result);
  mojo::internal::SyncMessageResponseSetup::SetCurrentSyncResponseMessage(
      message);
  *result_ = true;
  return true;
}

// static
bool VRServiceStubDispatch::Accept(
    VRService* impl,
    mojo::Message* message) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  switch (message->header()->name) {
    case internal::kVRService_SetClient_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::VRService::SetClient",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::VRService::SetClient");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::VRService_SetClient_Params_Data* params =
          reinterpret_cast<internal::VRService_SetClient_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      ::mojo::PendingRemote<VRServiceClient> p_client{};
      VRService_SetClient_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success) {
        p_client =
            input_data_view.TakeClient<decltype(p_client)>();
      }
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VRService::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SetClient(
std::move(p_client));
      return true;
    }
    case internal::kVRService_RequestSession_Name: {
      break;
    }
    case internal::kVRService_SupportsSession_Name: {
      break;
    }
    case internal::kVRService_ExitPresent_Name: {
      break;
    }
    case internal::kVRService_SetFramesThrottled_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::VRService::SetFramesThrottled",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::VRService::SetFramesThrottled");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::VRService_SetFramesThrottled_Params_Data* params =
          reinterpret_cast<internal::VRService_SetFramesThrottled_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      bool p_throttled{};
      VRService_SetFramesThrottled_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_throttled = input_data_view.throttled();
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VRService::Name_, 4, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SetFramesThrottled(
std::move(p_throttled));
      return true;
    }
    case internal::kVRService_MakeXrCompatible_Name: {
      break;
    }
  }
  return false;
}

// static
bool VRServiceStubDispatch::AcceptWithResponder(
    VRService* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  const bool message_is_sync = message->has_flag(mojo::Message::kFlagIsSync);
  const uint64_t request_id = message->request_id();
  ALLOW_UNUSED_LOCAL(message_is_sync);
  ALLOW_UNUSED_LOCAL(request_id);
  switch (message->header()->name) {
    case internal::kVRService_SetClient_Name: {
      break;
    }
    case internal::kVRService_RequestSession_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::VRService::RequestSession",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::VRService::RequestSession");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      internal::VRService_RequestSession_Params_Data* params =
          reinterpret_cast<
              internal::VRService_RequestSession_Params_Data*>(
                  message->mutable_payload());
      
      bool success = true;
      XRSessionOptionsPtr p_options{};
      VRService_RequestSession_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadOptions(&p_options))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VRService::Name_, 1, false);
        return false;
      }
      VRService::RequestSessionCallback callback =
          VRService_RequestSession_ProxyToResponder::CreateCallback(
              message->request_id(), message_is_sync, &responder);
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->RequestSession(
std::move(p_options), std::move(callback));
      return true;
    }
    case internal::kVRService_SupportsSession_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::VRService::SupportsSession",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::VRService::SupportsSession");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      internal::VRService_SupportsSession_Params_Data* params =
          reinterpret_cast<
              internal::VRService_SupportsSession_Params_Data*>(
                  message->mutable_payload());
      
      bool success = true;
      XRSessionOptionsPtr p_options{};
      VRService_SupportsSession_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadOptions(&p_options))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VRService::Name_, 2, false);
        return false;
      }
      VRService::SupportsSessionCallback callback =
          VRService_SupportsSession_ProxyToResponder::CreateCallback(
              message->request_id(), message_is_sync, &responder);
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SupportsSession(
std::move(p_options), std::move(callback));
      return true;
    }
    case internal::kVRService_ExitPresent_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::VRService::ExitPresent",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::VRService::ExitPresent");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      internal::VRService_ExitPresent_Params_Data* params =
          reinterpret_cast<
              internal::VRService_ExitPresent_Params_Data*>(
                  message->mutable_payload());
      
      bool success = true;
      VRService_ExitPresent_ParamsDataView input_data_view(params, &serialization_context);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VRService::Name_, 3, false);
        return false;
      }
      VRService::ExitPresentCallback callback =
          VRService_ExitPresent_ProxyToResponder::CreateCallback(
              message->request_id(), message_is_sync, &responder);
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->ExitPresent(std::move(callback));
      return true;
    }
    case internal::kVRService_SetFramesThrottled_Name: {
      break;
    }
    case internal::kVRService_MakeXrCompatible_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::VRService::MakeXrCompatible",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::VRService::MakeXrCompatible");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      internal::VRService_MakeXrCompatible_Params_Data* params =
          reinterpret_cast<
              internal::VRService_MakeXrCompatible_Params_Data*>(
                  message->mutable_payload());
      
      bool success = true;
      VRService_MakeXrCompatible_ParamsDataView input_data_view(params, &serialization_context);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VRService::Name_, 5, false);
        return false;
      }
      VRService::MakeXrCompatibleCallback callback =
          VRService_MakeXrCompatible_ProxyToResponder::CreateCallback(
              message->request_id(), message_is_sync, &responder);
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->MakeXrCompatible(std::move(callback));
      return true;
    }
  }
  return false;
}


static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kVRServiceValidationInfo[] = {
    {internal::kVRService_SetClient_Name,
     {&internal::VRService_SetClient_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kVRService_RequestSession_Name,
     {&internal::VRService_RequestSession_Params_Data::Validate,
      &internal::VRService_RequestSession_ResponseParams_Data::Validate}},
    {internal::kVRService_SupportsSession_Name,
     {&internal::VRService_SupportsSession_Params_Data::Validate,
      &internal::VRService_SupportsSession_ResponseParams_Data::Validate}},
    {internal::kVRService_ExitPresent_Name,
     {&internal::VRService_ExitPresent_Params_Data::Validate,
      &internal::VRService_ExitPresent_ResponseParams_Data::Validate}},
    {internal::kVRService_SetFramesThrottled_Name,
     {&internal::VRService_SetFramesThrottled_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kVRService_MakeXrCompatible_Name,
     {&internal::VRService_MakeXrCompatible_Params_Data::Validate,
      &internal::VRService_MakeXrCompatible_ResponseParams_Data::Validate}},
};

bool VRServiceRequestValidator::Accept(mojo::Message* message) {
  const char* name = ::device::mojom::blink::VRService::Name_;
  return mojo::internal::ValidateRequestGeneric(message, name, kVRServiceValidationInfo);
}

bool VRServiceResponseValidator::Accept(mojo::Message* message) {
  const char* name = ::device::mojom::blink::VRService::Name_;
  return mojo::internal::ValidateResponseGeneric(message, name, kVRServiceValidationInfo);

}
const char XRSessionMetricsRecorder::Name_[] = "device.mojom.XRSessionMetricsRecorder";

XRSessionMetricsRecorderProxy::XRSessionMetricsRecorderProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void XRSessionMetricsRecorderProxy::ReportFeatureUsed(
    XRSessionFeature in_feature) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRSessionMetricsRecorder::ReportFeatureUsed", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("feature", base::trace_event::ValueToString(in_feature));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRSessionMetricsRecorder_ReportFeatureUsed_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRSessionMetricsRecorder_ReportFeatureUsed_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  mojo::internal::Serialize<::device::mojom::XRSessionFeature>(
      in_feature, &params->feature);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRSessionMetricsRecorder::Name_);
  message.set_method_name("ReportFeatureUsed");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

// static
bool XRSessionMetricsRecorderStubDispatch::Accept(
    XRSessionMetricsRecorder* impl,
    mojo::Message* message) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  switch (message->header()->name) {
    case internal::kXRSessionMetricsRecorder_ReportFeatureUsed_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRSessionMetricsRecorder::ReportFeatureUsed",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRSessionMetricsRecorder::ReportFeatureUsed");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRSessionMetricsRecorder_ReportFeatureUsed_Params_Data* params =
          reinterpret_cast<internal::XRSessionMetricsRecorder_ReportFeatureUsed_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      XRSessionFeature p_feature{};
      XRSessionMetricsRecorder_ReportFeatureUsed_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadFeature(&p_feature))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRSessionMetricsRecorder::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->ReportFeatureUsed(
std::move(p_feature));
      return true;
    }
  }
  return false;
}

// static
bool XRSessionMetricsRecorderStubDispatch::AcceptWithResponder(
    XRSessionMetricsRecorder* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  const bool message_is_sync = message->has_flag(mojo::Message::kFlagIsSync);
  const uint64_t request_id = message->request_id();
  ALLOW_UNUSED_LOCAL(message_is_sync);
  ALLOW_UNUSED_LOCAL(request_id);
  switch (message->header()->name) {
    case internal::kXRSessionMetricsRecorder_ReportFeatureUsed_Name: {
      break;
    }
  }
  return false;
}


static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kXRSessionMetricsRecorderValidationInfo[] = {
    {internal::kXRSessionMetricsRecorder_ReportFeatureUsed_Name,
     {&internal::XRSessionMetricsRecorder_ReportFeatureUsed_Params_Data::Validate,
      nullptr /* no response */}},
};

bool XRSessionMetricsRecorderRequestValidator::Accept(mojo::Message* message) {
  const char* name = ::device::mojom::blink::XRSessionMetricsRecorder::Name_;
  return mojo::internal::ValidateRequestGeneric(message, name, kXRSessionMetricsRecorderValidationInfo);
}

const char VRServiceClient::Name_[] = "device.mojom.VRServiceClient";

VRServiceClientProxy::VRServiceClientProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void VRServiceClientProxy::OnDeviceChanged(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "device::mojom::VRServiceClient::OnDeviceChanged");
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kVRServiceClient_OnDeviceChanged_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::VRServiceClient_OnDeviceChanged_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VRServiceClient::Name_);
  message.set_method_name("OnDeviceChanged");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

// static
bool VRServiceClientStubDispatch::Accept(
    VRServiceClient* impl,
    mojo::Message* message) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  switch (message->header()->name) {
    case internal::kVRServiceClient_OnDeviceChanged_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::VRServiceClient::OnDeviceChanged",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::VRServiceClient::OnDeviceChanged");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::VRServiceClient_OnDeviceChanged_Params_Data* params =
          reinterpret_cast<internal::VRServiceClient_OnDeviceChanged_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      VRServiceClient_OnDeviceChanged_ParamsDataView input_data_view(params, &serialization_context);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VRServiceClient::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnDeviceChanged();
      return true;
    }
  }
  return false;
}

// static
bool VRServiceClientStubDispatch::AcceptWithResponder(
    VRServiceClient* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  const bool message_is_sync = message->has_flag(mojo::Message::kFlagIsSync);
  const uint64_t request_id = message->request_id();
  ALLOW_UNUSED_LOCAL(message_is_sync);
  ALLOW_UNUSED_LOCAL(request_id);
  switch (message->header()->name) {
    case internal::kVRServiceClient_OnDeviceChanged_Name: {
      break;
    }
  }
  return false;
}


static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kVRServiceClientValidationInfo[] = {
    {internal::kVRServiceClient_OnDeviceChanged_Name,
     {&internal::VRServiceClient_OnDeviceChanged_Params_Data::Validate,
      nullptr /* no response */}},
};

bool VRServiceClientRequestValidator::Accept(mojo::Message* message) {
  const char* name = ::device::mojom::blink::VRServiceClient::Name_;
  return mojo::internal::ValidateRequestGeneric(message, name, kVRServiceClientValidationInfo);
}

const char XREnvironmentIntegrationProvider::Name_[] = "device.mojom.XREnvironmentIntegrationProvider";

class XREnvironmentIntegrationProvider_SubscribeToHitTest_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  XREnvironmentIntegrationProvider_SubscribeToHitTest_ForwardToCallback(
      XREnvironmentIntegrationProvider::SubscribeToHitTestCallback callback
      ) : callback_(std::move(callback)) {
  }
  bool Accept(mojo::Message* message) override;
 private:
  XREnvironmentIntegrationProvider::SubscribeToHitTestCallback callback_;
  DISALLOW_COPY_AND_ASSIGN(XREnvironmentIntegrationProvider_SubscribeToHitTest_ForwardToCallback);
};

class XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ForwardToCallback(
      XREnvironmentIntegrationProvider::SubscribeToHitTestForTransientInputCallback callback
      ) : callback_(std::move(callback)) {
  }
  bool Accept(mojo::Message* message) override;
 private:
  XREnvironmentIntegrationProvider::SubscribeToHitTestForTransientInputCallback callback_;
  DISALLOW_COPY_AND_ASSIGN(XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ForwardToCallback);
};

class XREnvironmentIntegrationProvider_CreateAnchor_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  XREnvironmentIntegrationProvider_CreateAnchor_ForwardToCallback(
      XREnvironmentIntegrationProvider::CreateAnchorCallback callback
      ) : callback_(std::move(callback)) {
  }
  bool Accept(mojo::Message* message) override;
 private:
  XREnvironmentIntegrationProvider::CreateAnchorCallback callback_;
  DISALLOW_COPY_AND_ASSIGN(XREnvironmentIntegrationProvider_CreateAnchor_ForwardToCallback);
};

class XREnvironmentIntegrationProvider_CreatePlaneAnchor_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  XREnvironmentIntegrationProvider_CreatePlaneAnchor_ForwardToCallback(
      XREnvironmentIntegrationProvider::CreatePlaneAnchorCallback callback
      ) : callback_(std::move(callback)) {
  }
  bool Accept(mojo::Message* message) override;
 private:
  XREnvironmentIntegrationProvider::CreatePlaneAnchorCallback callback_;
  DISALLOW_COPY_AND_ASSIGN(XREnvironmentIntegrationProvider_CreatePlaneAnchor_ForwardToCallback);
};

XREnvironmentIntegrationProviderProxy::XREnvironmentIntegrationProviderProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void XREnvironmentIntegrationProviderProxy::SubscribeToHitTest(
    XRNativeOriginInformationPtr in_native_origin_information, const WTF::Vector<EntityTypeForHitTest>& in_entity_types, XRRayPtr in_ray, SubscribeToHitTestCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XREnvironmentIntegrationProvider::SubscribeToHitTest", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("native_origin_information", base::trace_event::ValueToString(in_native_origin_information, "<value of type XRNativeOriginInformationPtr>"));
      raw_value->BeginArray("entity_types");
      for (const auto& item0 : in_entity_types) {
        raw_value->AppendString(base::trace_event::ValueToString(item0));
      }
      raw_value->EndArray();
      if (in_ray.is_null()) {
        raw_value->SetString("ray", "nullptr");
      } else {
        raw_value->BeginDictionary("ray");
        in_ray->AsValueInto(raw_value);
        raw_value->EndDictionary();
      }
      return value;
    }());
#endif
  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXREnvironmentIntegrationProvider_SubscribeToHitTest_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XREnvironmentIntegrationProvider_SubscribeToHitTest_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->native_origin_information)::BufferWriter native_origin_information_writer;
  native_origin_information_writer.AllocateInline(buffer, &params->native_origin_information);
  mojo::internal::Serialize<::device::mojom::XRNativeOriginInformationDataView>(
      in_native_origin_information, buffer, &native_origin_information_writer, true, &serialization_context);
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->native_origin_information.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null native_origin_information in XREnvironmentIntegrationProvider.SubscribeToHitTest request");
  typename decltype(params->entity_types)::BaseType::BufferWriter
      entity_types_writer;
  const mojo::internal::ContainerValidateParams entity_types_validate_params(
      0, ::device::mojom::internal::EntityTypeForHitTest_Data::Validate);
  mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::EntityTypeForHitTest>>(
      in_entity_types, buffer, &entity_types_writer, &entity_types_validate_params,
      &serialization_context);
  params->entity_types.Set(
      entity_types_writer.is_null() ? nullptr : entity_types_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->entity_types.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null entity_types in XREnvironmentIntegrationProvider.SubscribeToHitTest request");
  typename decltype(params->ray)::BaseType::BufferWriter
      ray_writer;
  mojo::internal::Serialize<::device::mojom::XRRayDataView>(
      in_ray, buffer, &ray_writer, &serialization_context);
  params->ray.Set(
      ray_writer.is_null() ? nullptr : ray_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->ray.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null ray in XREnvironmentIntegrationProvider.SubscribeToHitTest request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XREnvironmentIntegrationProvider::Name_);
  message.set_method_name("SubscribeToHitTest");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new XREnvironmentIntegrationProvider_SubscribeToHitTest_ForwardToCallback(
          std::move(callback)));
  ignore_result(receiver_->AcceptWithResponder(&message, std::move(responder)));
}

void XREnvironmentIntegrationProviderProxy::SubscribeToHitTestForTransientInput(
    const WTF::String& in_profile_name, const WTF::Vector<EntityTypeForHitTest>& in_entity_types, XRRayPtr in_ray, SubscribeToHitTestForTransientInputCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XREnvironmentIntegrationProvider::SubscribeToHitTestForTransientInput", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("profile_name", in_profile_name.Utf8());
      raw_value->BeginArray("entity_types");
      for (const auto& item0 : in_entity_types) {
        raw_value->AppendString(base::trace_event::ValueToString(item0));
      }
      raw_value->EndArray();
      if (in_ray.is_null()) {
        raw_value->SetString("ray", "nullptr");
      } else {
        raw_value->BeginDictionary("ray");
        in_ray->AsValueInto(raw_value);
        raw_value->EndDictionary();
      }
      return value;
    }());
#endif
  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->profile_name)::BaseType::BufferWriter
      profile_name_writer;
  mojo::internal::Serialize<mojo::StringDataView>(
      in_profile_name, buffer, &profile_name_writer, &serialization_context);
  params->profile_name.Set(
      profile_name_writer.is_null() ? nullptr : profile_name_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->profile_name.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null profile_name in XREnvironmentIntegrationProvider.SubscribeToHitTestForTransientInput request");
  typename decltype(params->entity_types)::BaseType::BufferWriter
      entity_types_writer;
  const mojo::internal::ContainerValidateParams entity_types_validate_params(
      0, ::device::mojom::internal::EntityTypeForHitTest_Data::Validate);
  mojo::internal::Serialize<mojo::ArrayDataView<::device::mojom::EntityTypeForHitTest>>(
      in_entity_types, buffer, &entity_types_writer, &entity_types_validate_params,
      &serialization_context);
  params->entity_types.Set(
      entity_types_writer.is_null() ? nullptr : entity_types_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->entity_types.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null entity_types in XREnvironmentIntegrationProvider.SubscribeToHitTestForTransientInput request");
  typename decltype(params->ray)::BaseType::BufferWriter
      ray_writer;
  mojo::internal::Serialize<::device::mojom::XRRayDataView>(
      in_ray, buffer, &ray_writer, &serialization_context);
  params->ray.Set(
      ray_writer.is_null() ? nullptr : ray_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->ray.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null ray in XREnvironmentIntegrationProvider.SubscribeToHitTestForTransientInput request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XREnvironmentIntegrationProvider::Name_);
  message.set_method_name("SubscribeToHitTestForTransientInput");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ForwardToCallback(
          std::move(callback)));
  ignore_result(receiver_->AcceptWithResponder(&message, std::move(responder)));
}

void XREnvironmentIntegrationProviderProxy::UnsubscribeFromHitTest(
    uint64_t in_subscription_id) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XREnvironmentIntegrationProvider::UnsubscribeFromHitTest", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("subscription_id", base::NumberToString(in_subscription_id));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXREnvironmentIntegrationProvider_UnsubscribeFromHitTest_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XREnvironmentIntegrationProvider_UnsubscribeFromHitTest_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->subscription_id = in_subscription_id;
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XREnvironmentIntegrationProvider::Name_);
  message.set_method_name("UnsubscribeFromHitTest");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void XREnvironmentIntegrationProviderProxy::CreateAnchor(
    XRNativeOriginInformationPtr in_native_origin_information, const ::device::Pose& in_native_origin_from_anchor, CreateAnchorCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XREnvironmentIntegrationProvider::CreateAnchor", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("native_origin_information", base::trace_event::ValueToString(in_native_origin_information, "<value of type XRNativeOriginInformationPtr>"));
      raw_value->SetString("native_origin_from_anchor", base::trace_event::ValueToString(in_native_origin_from_anchor, "<value of type const ::device::Pose&>"));
      return value;
    }());
#endif
  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXREnvironmentIntegrationProvider_CreateAnchor_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XREnvironmentIntegrationProvider_CreateAnchor_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->native_origin_information)::BufferWriter native_origin_information_writer;
  native_origin_information_writer.AllocateInline(buffer, &params->native_origin_information);
  mojo::internal::Serialize<::device::mojom::XRNativeOriginInformationDataView>(
      in_native_origin_information, buffer, &native_origin_information_writer, true, &serialization_context);
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->native_origin_information.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null native_origin_information in XREnvironmentIntegrationProvider.CreateAnchor request");
  typename decltype(params->native_origin_from_anchor)::BaseType::BufferWriter
      native_origin_from_anchor_writer;
  mojo::internal::Serialize<::device::mojom::PoseDataView>(
      in_native_origin_from_anchor, buffer, &native_origin_from_anchor_writer, &serialization_context);
  params->native_origin_from_anchor.Set(
      native_origin_from_anchor_writer.is_null() ? nullptr : native_origin_from_anchor_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->native_origin_from_anchor.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null native_origin_from_anchor in XREnvironmentIntegrationProvider.CreateAnchor request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XREnvironmentIntegrationProvider::Name_);
  message.set_method_name("CreateAnchor");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new XREnvironmentIntegrationProvider_CreateAnchor_ForwardToCallback(
          std::move(callback)));
  ignore_result(receiver_->AcceptWithResponder(&message, std::move(responder)));
}

void XREnvironmentIntegrationProviderProxy::CreatePlaneAnchor(
    XRNativeOriginInformationPtr in_native_origin_information, const ::device::Pose& in_native_origin_from_anchor, uint64_t in_plane_id, CreatePlaneAnchorCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XREnvironmentIntegrationProvider::CreatePlaneAnchor", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("native_origin_information", base::trace_event::ValueToString(in_native_origin_information, "<value of type XRNativeOriginInformationPtr>"));
      raw_value->SetString("native_origin_from_anchor", base::trace_event::ValueToString(in_native_origin_from_anchor, "<value of type const ::device::Pose&>"));
      raw_value->SetString("plane_id", base::NumberToString(in_plane_id));
      return value;
    }());
#endif
  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXREnvironmentIntegrationProvider_CreatePlaneAnchor_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XREnvironmentIntegrationProvider_CreatePlaneAnchor_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->native_origin_information)::BufferWriter native_origin_information_writer;
  native_origin_information_writer.AllocateInline(buffer, &params->native_origin_information);
  mojo::internal::Serialize<::device::mojom::XRNativeOriginInformationDataView>(
      in_native_origin_information, buffer, &native_origin_information_writer, true, &serialization_context);
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->native_origin_information.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null native_origin_information in XREnvironmentIntegrationProvider.CreatePlaneAnchor request");
  typename decltype(params->native_origin_from_anchor)::BaseType::BufferWriter
      native_origin_from_anchor_writer;
  mojo::internal::Serialize<::device::mojom::PoseDataView>(
      in_native_origin_from_anchor, buffer, &native_origin_from_anchor_writer, &serialization_context);
  params->native_origin_from_anchor.Set(
      native_origin_from_anchor_writer.is_null() ? nullptr : native_origin_from_anchor_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->native_origin_from_anchor.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null native_origin_from_anchor in XREnvironmentIntegrationProvider.CreatePlaneAnchor request");
  params->plane_id = in_plane_id;
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XREnvironmentIntegrationProvider::Name_);
  message.set_method_name("CreatePlaneAnchor");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new XREnvironmentIntegrationProvider_CreatePlaneAnchor_ForwardToCallback(
          std::move(callback)));
  ignore_result(receiver_->AcceptWithResponder(&message, std::move(responder)));
}

void XREnvironmentIntegrationProviderProxy::DetachAnchor(
    uint64_t in_anchor_id) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XREnvironmentIntegrationProvider::DetachAnchor", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("anchor_id", base::NumberToString(in_anchor_id));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXREnvironmentIntegrationProvider_DetachAnchor_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XREnvironmentIntegrationProvider_DetachAnchor_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->anchor_id = in_anchor_id;
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XREnvironmentIntegrationProvider::Name_);
  message.set_method_name("DetachAnchor");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}
class XREnvironmentIntegrationProvider_SubscribeToHitTest_ProxyToResponder {
 public:
  static XREnvironmentIntegrationProvider::SubscribeToHitTestCallback CreateCallback(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder) {
    std::unique_ptr<XREnvironmentIntegrationProvider_SubscribeToHitTest_ProxyToResponder> proxy(
        new XREnvironmentIntegrationProvider_SubscribeToHitTest_ProxyToResponder(
            request_id, is_sync, responder));
    return base::BindOnce(&XREnvironmentIntegrationProvider_SubscribeToHitTest_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~XREnvironmentIntegrationProvider_SubscribeToHitTest_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
    // If the Callback was dropped then deleting the responder will close
    // the pipe so the calling application knows to stop waiting for a reply.
    responder_ = nullptr;
  }

 private:
  XREnvironmentIntegrationProvider_SubscribeToHitTest_ProxyToResponder(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder)
      : request_id_(request_id),
        is_sync_(is_sync),
        responder_(std::move(*responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
//    DCHECK(!connected)
//        << "XREnvironmentIntegrationProvider::SubscribeToHitTestCallback was destroyed without "
//        << "first either being run or its corresponding binding being closed. "
//        << "It is an error to drop response callbacks which still correspond "
//        << "to an open interface pipe.";
  }
#endif

  void Run(
      SubscribeToHitTestResult in_result, uint64_t in_subscription_id);

  uint64_t request_id_;
  bool is_sync_;
  std::unique_ptr<mojo::MessageReceiverWithStatus> responder_;

  DISALLOW_COPY_AND_ASSIGN(XREnvironmentIntegrationProvider_SubscribeToHitTest_ProxyToResponder);
};

bool XREnvironmentIntegrationProvider_SubscribeToHitTest_ForwardToCallback::Accept(
    mojo::Message* message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1("mojom", "device::mojom::XREnvironmentIntegrationProvider::SubscribeToHitTestCallback",
               "message", message->name());
#endif
  mojo::internal::MessageDispatchContext dispatch_context(message);

  DCHECK(message->is_serialized());
  internal::XREnvironmentIntegrationProvider_SubscribeToHitTest_ResponseParams_Data* params =
      reinterpret_cast<
          internal::XREnvironmentIntegrationProvider_SubscribeToHitTest_ResponseParams_Data*>(
              message->mutable_payload());
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  
  bool success = true;
  SubscribeToHitTestResult p_result{};
  uint64_t p_subscription_id{};
  XREnvironmentIntegrationProvider_SubscribeToHitTest_ResponseParamsDataView input_data_view(params, &serialization_context);
  
  if (success && !input_data_view.ReadResult(&p_result))
    success = false;
  if (success)
    p_subscription_id = input_data_view.subscription_id();
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        XREnvironmentIntegrationProvider::Name_, 0, true);
    return false;
  }
  if (!callback_.is_null())
    std::move(callback_).Run(
std::move(p_result), 
std::move(p_subscription_id));
  return true;
}

void XREnvironmentIntegrationProvider_SubscribeToHitTest_ProxyToResponder::Run(
    SubscribeToHitTestResult in_result, uint64_t in_subscription_id) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_BEGIN1(
    "mojom", "(Impl)device::mojom::XREnvironmentIntegrationProvider::SubscribeToHitTestCallback", "async_response_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("result", base::trace_event::ValueToString(in_result));
      raw_value->SetString("subscription_id", base::NumberToString(in_subscription_id));
      return value;
    }());
#endif
  
  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXREnvironmentIntegrationProvider_SubscribeToHitTest_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XREnvironmentIntegrationProvider_SubscribeToHitTest_ResponseParams_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  mojo::internal::Serialize<::device::mojom::SubscribeToHitTestResult>(
      in_result, &params->result);
  params->subscription_id = in_subscription_id;
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_END1("mojom", "(Impl)device::mojom::XREnvironmentIntegrationProvider::SubscribeToHitTestCallback", "message",
                   message.name());
#endif

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XREnvironmentIntegrationProvider::Name_);
  message.set_method_name("SubscribeToHitTest");
#endif

  message.set_request_id(request_id_);
  ignore_result(responder_->Accept(&message));
  // TODO(darin): Accept() returning false indicates a malformed message, and
  // that may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ProxyToResponder {
 public:
  static XREnvironmentIntegrationProvider::SubscribeToHitTestForTransientInputCallback CreateCallback(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder) {
    std::unique_ptr<XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ProxyToResponder> proxy(
        new XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ProxyToResponder(
            request_id, is_sync, responder));
    return base::BindOnce(&XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
    // If the Callback was dropped then deleting the responder will close
    // the pipe so the calling application knows to stop waiting for a reply.
    responder_ = nullptr;
  }

 private:
  XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ProxyToResponder(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder)
      : request_id_(request_id),
        is_sync_(is_sync),
        responder_(std::move(*responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
//    DCHECK(!connected)
//        << "XREnvironmentIntegrationProvider::SubscribeToHitTestForTransientInputCallback was destroyed without "
//        << "first either being run or its corresponding binding being closed. "
//        << "It is an error to drop response callbacks which still correspond "
//        << "to an open interface pipe.";
  }
#endif

  void Run(
      SubscribeToHitTestResult in_result, uint64_t in_subscription_id);

  uint64_t request_id_;
  bool is_sync_;
  std::unique_ptr<mojo::MessageReceiverWithStatus> responder_;

  DISALLOW_COPY_AND_ASSIGN(XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ProxyToResponder);
};

bool XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ForwardToCallback::Accept(
    mojo::Message* message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1("mojom", "device::mojom::XREnvironmentIntegrationProvider::SubscribeToHitTestForTransientInputCallback",
               "message", message->name());
#endif
  mojo::internal::MessageDispatchContext dispatch_context(message);

  DCHECK(message->is_serialized());
  internal::XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ResponseParams_Data* params =
      reinterpret_cast<
          internal::XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ResponseParams_Data*>(
              message->mutable_payload());
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  
  bool success = true;
  SubscribeToHitTestResult p_result{};
  uint64_t p_subscription_id{};
  XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ResponseParamsDataView input_data_view(params, &serialization_context);
  
  if (success && !input_data_view.ReadResult(&p_result))
    success = false;
  if (success)
    p_subscription_id = input_data_view.subscription_id();
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        XREnvironmentIntegrationProvider::Name_, 1, true);
    return false;
  }
  if (!callback_.is_null())
    std::move(callback_).Run(
std::move(p_result), 
std::move(p_subscription_id));
  return true;
}

void XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ProxyToResponder::Run(
    SubscribeToHitTestResult in_result, uint64_t in_subscription_id) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_BEGIN1(
    "mojom", "(Impl)device::mojom::XREnvironmentIntegrationProvider::SubscribeToHitTestForTransientInputCallback", "async_response_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("result", base::trace_event::ValueToString(in_result));
      raw_value->SetString("subscription_id", base::NumberToString(in_subscription_id));
      return value;
    }());
#endif
  
  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ResponseParams_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  mojo::internal::Serialize<::device::mojom::SubscribeToHitTestResult>(
      in_result, &params->result);
  params->subscription_id = in_subscription_id;
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_END1("mojom", "(Impl)device::mojom::XREnvironmentIntegrationProvider::SubscribeToHitTestForTransientInputCallback", "message",
                   message.name());
#endif

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XREnvironmentIntegrationProvider::Name_);
  message.set_method_name("SubscribeToHitTestForTransientInput");
#endif

  message.set_request_id(request_id_);
  ignore_result(responder_->Accept(&message));
  // TODO(darin): Accept() returning false indicates a malformed message, and
  // that may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class XREnvironmentIntegrationProvider_CreateAnchor_ProxyToResponder {
 public:
  static XREnvironmentIntegrationProvider::CreateAnchorCallback CreateCallback(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder) {
    std::unique_ptr<XREnvironmentIntegrationProvider_CreateAnchor_ProxyToResponder> proxy(
        new XREnvironmentIntegrationProvider_CreateAnchor_ProxyToResponder(
            request_id, is_sync, responder));
    return base::BindOnce(&XREnvironmentIntegrationProvider_CreateAnchor_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~XREnvironmentIntegrationProvider_CreateAnchor_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
    // If the Callback was dropped then deleting the responder will close
    // the pipe so the calling application knows to stop waiting for a reply.
    responder_ = nullptr;
  }

 private:
  XREnvironmentIntegrationProvider_CreateAnchor_ProxyToResponder(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder)
      : request_id_(request_id),
        is_sync_(is_sync),
        responder_(std::move(*responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
//    DCHECK(!connected)
//        << "XREnvironmentIntegrationProvider::CreateAnchorCallback was destroyed without "
//        << "first either being run or its corresponding binding being closed. "
//        << "It is an error to drop response callbacks which still correspond "
//        << "to an open interface pipe.";
  }
#endif

  void Run(
      CreateAnchorResult in_result, uint64_t in_anchor_id);

  uint64_t request_id_;
  bool is_sync_;
  std::unique_ptr<mojo::MessageReceiverWithStatus> responder_;

  DISALLOW_COPY_AND_ASSIGN(XREnvironmentIntegrationProvider_CreateAnchor_ProxyToResponder);
};

bool XREnvironmentIntegrationProvider_CreateAnchor_ForwardToCallback::Accept(
    mojo::Message* message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1("mojom", "device::mojom::XREnvironmentIntegrationProvider::CreateAnchorCallback",
               "message", message->name());
#endif
  mojo::internal::MessageDispatchContext dispatch_context(message);

  DCHECK(message->is_serialized());
  internal::XREnvironmentIntegrationProvider_CreateAnchor_ResponseParams_Data* params =
      reinterpret_cast<
          internal::XREnvironmentIntegrationProvider_CreateAnchor_ResponseParams_Data*>(
              message->mutable_payload());
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  
  bool success = true;
  CreateAnchorResult p_result{};
  uint64_t p_anchor_id{};
  XREnvironmentIntegrationProvider_CreateAnchor_ResponseParamsDataView input_data_view(params, &serialization_context);
  
  if (success && !input_data_view.ReadResult(&p_result))
    success = false;
  if (success)
    p_anchor_id = input_data_view.anchor_id();
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        XREnvironmentIntegrationProvider::Name_, 3, true);
    return false;
  }
  if (!callback_.is_null())
    std::move(callback_).Run(
std::move(p_result), 
std::move(p_anchor_id));
  return true;
}

void XREnvironmentIntegrationProvider_CreateAnchor_ProxyToResponder::Run(
    CreateAnchorResult in_result, uint64_t in_anchor_id) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_BEGIN1(
    "mojom", "(Impl)device::mojom::XREnvironmentIntegrationProvider::CreateAnchorCallback", "async_response_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("result", base::trace_event::ValueToString(in_result));
      raw_value->SetString("anchor_id", base::NumberToString(in_anchor_id));
      return value;
    }());
#endif
  
  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXREnvironmentIntegrationProvider_CreateAnchor_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XREnvironmentIntegrationProvider_CreateAnchor_ResponseParams_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  mojo::internal::Serialize<::device::mojom::CreateAnchorResult>(
      in_result, &params->result);
  params->anchor_id = in_anchor_id;
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_END1("mojom", "(Impl)device::mojom::XREnvironmentIntegrationProvider::CreateAnchorCallback", "message",
                   message.name());
#endif

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XREnvironmentIntegrationProvider::Name_);
  message.set_method_name("CreateAnchor");
#endif

  message.set_request_id(request_id_);
  ignore_result(responder_->Accept(&message));
  // TODO(darin): Accept() returning false indicates a malformed message, and
  // that may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class XREnvironmentIntegrationProvider_CreatePlaneAnchor_ProxyToResponder {
 public:
  static XREnvironmentIntegrationProvider::CreatePlaneAnchorCallback CreateCallback(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder) {
    std::unique_ptr<XREnvironmentIntegrationProvider_CreatePlaneAnchor_ProxyToResponder> proxy(
        new XREnvironmentIntegrationProvider_CreatePlaneAnchor_ProxyToResponder(
            request_id, is_sync, responder));
    return base::BindOnce(&XREnvironmentIntegrationProvider_CreatePlaneAnchor_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~XREnvironmentIntegrationProvider_CreatePlaneAnchor_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
    // If the Callback was dropped then deleting the responder will close
    // the pipe so the calling application knows to stop waiting for a reply.
    responder_ = nullptr;
  }

 private:
  XREnvironmentIntegrationProvider_CreatePlaneAnchor_ProxyToResponder(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder)
      : request_id_(request_id),
        is_sync_(is_sync),
        responder_(std::move(*responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
//    DCHECK(!connected)
//        << "XREnvironmentIntegrationProvider::CreatePlaneAnchorCallback was destroyed without "
//        << "first either being run or its corresponding binding being closed. "
//        << "It is an error to drop response callbacks which still correspond "
//        << "to an open interface pipe.";
  }
#endif

  void Run(
      CreateAnchorResult in_result, uint64_t in_anchor_id);

  uint64_t request_id_;
  bool is_sync_;
  std::unique_ptr<mojo::MessageReceiverWithStatus> responder_;

  DISALLOW_COPY_AND_ASSIGN(XREnvironmentIntegrationProvider_CreatePlaneAnchor_ProxyToResponder);
};

bool XREnvironmentIntegrationProvider_CreatePlaneAnchor_ForwardToCallback::Accept(
    mojo::Message* message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1("mojom", "device::mojom::XREnvironmentIntegrationProvider::CreatePlaneAnchorCallback",
               "message", message->name());
#endif
  mojo::internal::MessageDispatchContext dispatch_context(message);

  DCHECK(message->is_serialized());
  internal::XREnvironmentIntegrationProvider_CreatePlaneAnchor_ResponseParams_Data* params =
      reinterpret_cast<
          internal::XREnvironmentIntegrationProvider_CreatePlaneAnchor_ResponseParams_Data*>(
              message->mutable_payload());
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  
  bool success = true;
  CreateAnchorResult p_result{};
  uint64_t p_anchor_id{};
  XREnvironmentIntegrationProvider_CreatePlaneAnchor_ResponseParamsDataView input_data_view(params, &serialization_context);
  
  if (success && !input_data_view.ReadResult(&p_result))
    success = false;
  if (success)
    p_anchor_id = input_data_view.anchor_id();
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        XREnvironmentIntegrationProvider::Name_, 4, true);
    return false;
  }
  if (!callback_.is_null())
    std::move(callback_).Run(
std::move(p_result), 
std::move(p_anchor_id));
  return true;
}

void XREnvironmentIntegrationProvider_CreatePlaneAnchor_ProxyToResponder::Run(
    CreateAnchorResult in_result, uint64_t in_anchor_id) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_BEGIN1(
    "mojom", "(Impl)device::mojom::XREnvironmentIntegrationProvider::CreatePlaneAnchorCallback", "async_response_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("result", base::trace_event::ValueToString(in_result));
      raw_value->SetString("anchor_id", base::NumberToString(in_anchor_id));
      return value;
    }());
#endif
  
  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXREnvironmentIntegrationProvider_CreatePlaneAnchor_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XREnvironmentIntegrationProvider_CreatePlaneAnchor_ResponseParams_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  mojo::internal::Serialize<::device::mojom::CreateAnchorResult>(
      in_result, &params->result);
  params->anchor_id = in_anchor_id;
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_END1("mojom", "(Impl)device::mojom::XREnvironmentIntegrationProvider::CreatePlaneAnchorCallback", "message",
                   message.name());
#endif

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XREnvironmentIntegrationProvider::Name_);
  message.set_method_name("CreatePlaneAnchor");
#endif

  message.set_request_id(request_id_);
  ignore_result(responder_->Accept(&message));
  // TODO(darin): Accept() returning false indicates a malformed message, and
  // that may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}

// static
bool XREnvironmentIntegrationProviderStubDispatch::Accept(
    XREnvironmentIntegrationProvider* impl,
    mojo::Message* message) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  switch (message->header()->name) {
    case internal::kXREnvironmentIntegrationProvider_SubscribeToHitTest_Name: {
      break;
    }
    case internal::kXREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_Name: {
      break;
    }
    case internal::kXREnvironmentIntegrationProvider_UnsubscribeFromHitTest_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XREnvironmentIntegrationProvider::UnsubscribeFromHitTest",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XREnvironmentIntegrationProvider::UnsubscribeFromHitTest");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XREnvironmentIntegrationProvider_UnsubscribeFromHitTest_Params_Data* params =
          reinterpret_cast<internal::XREnvironmentIntegrationProvider_UnsubscribeFromHitTest_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      uint64_t p_subscription_id{};
      XREnvironmentIntegrationProvider_UnsubscribeFromHitTest_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_subscription_id = input_data_view.subscription_id();
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XREnvironmentIntegrationProvider::Name_, 2, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->UnsubscribeFromHitTest(
std::move(p_subscription_id));
      return true;
    }
    case internal::kXREnvironmentIntegrationProvider_CreateAnchor_Name: {
      break;
    }
    case internal::kXREnvironmentIntegrationProvider_CreatePlaneAnchor_Name: {
      break;
    }
    case internal::kXREnvironmentIntegrationProvider_DetachAnchor_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XREnvironmentIntegrationProvider::DetachAnchor",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XREnvironmentIntegrationProvider::DetachAnchor");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XREnvironmentIntegrationProvider_DetachAnchor_Params_Data* params =
          reinterpret_cast<internal::XREnvironmentIntegrationProvider_DetachAnchor_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      uint64_t p_anchor_id{};
      XREnvironmentIntegrationProvider_DetachAnchor_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_anchor_id = input_data_view.anchor_id();
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XREnvironmentIntegrationProvider::Name_, 5, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->DetachAnchor(
std::move(p_anchor_id));
      return true;
    }
  }
  return false;
}

// static
bool XREnvironmentIntegrationProviderStubDispatch::AcceptWithResponder(
    XREnvironmentIntegrationProvider* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  const bool message_is_sync = message->has_flag(mojo::Message::kFlagIsSync);
  const uint64_t request_id = message->request_id();
  ALLOW_UNUSED_LOCAL(message_is_sync);
  ALLOW_UNUSED_LOCAL(request_id);
  switch (message->header()->name) {
    case internal::kXREnvironmentIntegrationProvider_SubscribeToHitTest_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XREnvironmentIntegrationProvider::SubscribeToHitTest",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XREnvironmentIntegrationProvider::SubscribeToHitTest");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      internal::XREnvironmentIntegrationProvider_SubscribeToHitTest_Params_Data* params =
          reinterpret_cast<
              internal::XREnvironmentIntegrationProvider_SubscribeToHitTest_Params_Data*>(
                  message->mutable_payload());
      
      bool success = true;
      XRNativeOriginInformationPtr p_native_origin_information{};
      WTF::Vector<EntityTypeForHitTest> p_entity_types{};
      XRRayPtr p_ray{};
      XREnvironmentIntegrationProvider_SubscribeToHitTest_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadNativeOriginInformation(&p_native_origin_information))
        success = false;
      if (success && !input_data_view.ReadEntityTypes(&p_entity_types))
        success = false;
      if (success && !input_data_view.ReadRay(&p_ray))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XREnvironmentIntegrationProvider::Name_, 0, false);
        return false;
      }
      XREnvironmentIntegrationProvider::SubscribeToHitTestCallback callback =
          XREnvironmentIntegrationProvider_SubscribeToHitTest_ProxyToResponder::CreateCallback(
              message->request_id(), message_is_sync, &responder);
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SubscribeToHitTest(
std::move(p_native_origin_information), 
std::move(p_entity_types), 
std::move(p_ray), std::move(callback));
      return true;
    }
    case internal::kXREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XREnvironmentIntegrationProvider::SubscribeToHitTestForTransientInput",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XREnvironmentIntegrationProvider::SubscribeToHitTestForTransientInput");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      internal::XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_Params_Data* params =
          reinterpret_cast<
              internal::XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_Params_Data*>(
                  message->mutable_payload());
      
      bool success = true;
      WTF::String p_profile_name{};
      WTF::Vector<EntityTypeForHitTest> p_entity_types{};
      XRRayPtr p_ray{};
      XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadProfileName(&p_profile_name))
        success = false;
      if (success && !input_data_view.ReadEntityTypes(&p_entity_types))
        success = false;
      if (success && !input_data_view.ReadRay(&p_ray))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XREnvironmentIntegrationProvider::Name_, 1, false);
        return false;
      }
      XREnvironmentIntegrationProvider::SubscribeToHitTestForTransientInputCallback callback =
          XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ProxyToResponder::CreateCallback(
              message->request_id(), message_is_sync, &responder);
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SubscribeToHitTestForTransientInput(
std::move(p_profile_name), 
std::move(p_entity_types), 
std::move(p_ray), std::move(callback));
      return true;
    }
    case internal::kXREnvironmentIntegrationProvider_UnsubscribeFromHitTest_Name: {
      break;
    }
    case internal::kXREnvironmentIntegrationProvider_CreateAnchor_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XREnvironmentIntegrationProvider::CreateAnchor",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XREnvironmentIntegrationProvider::CreateAnchor");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      internal::XREnvironmentIntegrationProvider_CreateAnchor_Params_Data* params =
          reinterpret_cast<
              internal::XREnvironmentIntegrationProvider_CreateAnchor_Params_Data*>(
                  message->mutable_payload());
      
      bool success = true;
      XRNativeOriginInformationPtr p_native_origin_information{};
      ::device::Pose p_native_origin_from_anchor{};
      XREnvironmentIntegrationProvider_CreateAnchor_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadNativeOriginInformation(&p_native_origin_information))
        success = false;
      if (success && !input_data_view.ReadNativeOriginFromAnchor(&p_native_origin_from_anchor))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XREnvironmentIntegrationProvider::Name_, 3, false);
        return false;
      }
      XREnvironmentIntegrationProvider::CreateAnchorCallback callback =
          XREnvironmentIntegrationProvider_CreateAnchor_ProxyToResponder::CreateCallback(
              message->request_id(), message_is_sync, &responder);
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->CreateAnchor(
std::move(p_native_origin_information), 
std::move(p_native_origin_from_anchor), std::move(callback));
      return true;
    }
    case internal::kXREnvironmentIntegrationProvider_CreatePlaneAnchor_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XREnvironmentIntegrationProvider::CreatePlaneAnchor",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XREnvironmentIntegrationProvider::CreatePlaneAnchor");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      internal::XREnvironmentIntegrationProvider_CreatePlaneAnchor_Params_Data* params =
          reinterpret_cast<
              internal::XREnvironmentIntegrationProvider_CreatePlaneAnchor_Params_Data*>(
                  message->mutable_payload());
      
      bool success = true;
      XRNativeOriginInformationPtr p_native_origin_information{};
      ::device::Pose p_native_origin_from_anchor{};
      uint64_t p_plane_id{};
      XREnvironmentIntegrationProvider_CreatePlaneAnchor_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadNativeOriginInformation(&p_native_origin_information))
        success = false;
      if (success && !input_data_view.ReadNativeOriginFromAnchor(&p_native_origin_from_anchor))
        success = false;
      if (success)
        p_plane_id = input_data_view.plane_id();
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XREnvironmentIntegrationProvider::Name_, 4, false);
        return false;
      }
      XREnvironmentIntegrationProvider::CreatePlaneAnchorCallback callback =
          XREnvironmentIntegrationProvider_CreatePlaneAnchor_ProxyToResponder::CreateCallback(
              message->request_id(), message_is_sync, &responder);
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->CreatePlaneAnchor(
std::move(p_native_origin_information), 
std::move(p_native_origin_from_anchor), 
std::move(p_plane_id), std::move(callback));
      return true;
    }
    case internal::kXREnvironmentIntegrationProvider_DetachAnchor_Name: {
      break;
    }
  }
  return false;
}


static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kXREnvironmentIntegrationProviderValidationInfo[] = {
    {internal::kXREnvironmentIntegrationProvider_SubscribeToHitTest_Name,
     {&internal::XREnvironmentIntegrationProvider_SubscribeToHitTest_Params_Data::Validate,
      &internal::XREnvironmentIntegrationProvider_SubscribeToHitTest_ResponseParams_Data::Validate}},
    {internal::kXREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_Name,
     {&internal::XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_Params_Data::Validate,
      &internal::XREnvironmentIntegrationProvider_SubscribeToHitTestForTransientInput_ResponseParams_Data::Validate}},
    {internal::kXREnvironmentIntegrationProvider_UnsubscribeFromHitTest_Name,
     {&internal::XREnvironmentIntegrationProvider_UnsubscribeFromHitTest_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kXREnvironmentIntegrationProvider_CreateAnchor_Name,
     {&internal::XREnvironmentIntegrationProvider_CreateAnchor_Params_Data::Validate,
      &internal::XREnvironmentIntegrationProvider_CreateAnchor_ResponseParams_Data::Validate}},
    {internal::kXREnvironmentIntegrationProvider_CreatePlaneAnchor_Name,
     {&internal::XREnvironmentIntegrationProvider_CreatePlaneAnchor_Params_Data::Validate,
      &internal::XREnvironmentIntegrationProvider_CreatePlaneAnchor_ResponseParams_Data::Validate}},
    {internal::kXREnvironmentIntegrationProvider_DetachAnchor_Name,
     {&internal::XREnvironmentIntegrationProvider_DetachAnchor_Params_Data::Validate,
      nullptr /* no response */}},
};

bool XREnvironmentIntegrationProviderRequestValidator::Accept(mojo::Message* message) {
  const char* name = ::device::mojom::blink::XREnvironmentIntegrationProvider::Name_;
  return mojo::internal::ValidateRequestGeneric(message, name, kXREnvironmentIntegrationProviderValidationInfo);
}

bool XREnvironmentIntegrationProviderResponseValidator::Accept(mojo::Message* message) {
  const char* name = ::device::mojom::blink::XREnvironmentIntegrationProvider::Name_;
  return mojo::internal::ValidateResponseGeneric(message, name, kXREnvironmentIntegrationProviderValidationInfo);

}
const char XRInputSourceButtonListener::Name_[] = "device.mojom.XRInputSourceButtonListener";

XRInputSourceButtonListenerProxy::XRInputSourceButtonListenerProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void XRInputSourceButtonListenerProxy::OnButtonEvent(
    XRInputSourceStatePtr in_input_source) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRInputSourceButtonListener::OnButtonEvent", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      if (in_input_source.is_null()) {
        raw_value->SetString("input_source", "nullptr");
      } else {
        raw_value->BeginDictionary("input_source");
        in_input_source->AsValueInto(raw_value);
        raw_value->EndDictionary();
      }
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRInputSourceButtonListener_OnButtonEvent_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRInputSourceButtonListener_OnButtonEvent_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->input_source)::BaseType::BufferWriter
      input_source_writer;
  mojo::internal::Serialize<::device::mojom::XRInputSourceStateDataView>(
      in_input_source, buffer, &input_source_writer, &serialization_context);
  params->input_source.Set(
      input_source_writer.is_null() ? nullptr : input_source_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->input_source.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null input_source in XRInputSourceButtonListener.OnButtonEvent request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRInputSourceButtonListener::Name_);
  message.set_method_name("OnButtonEvent");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

// static
bool XRInputSourceButtonListenerStubDispatch::Accept(
    XRInputSourceButtonListener* impl,
    mojo::Message* message) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  switch (message->header()->name) {
    case internal::kXRInputSourceButtonListener_OnButtonEvent_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRInputSourceButtonListener::OnButtonEvent",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRInputSourceButtonListener::OnButtonEvent");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRInputSourceButtonListener_OnButtonEvent_Params_Data* params =
          reinterpret_cast<internal::XRInputSourceButtonListener_OnButtonEvent_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      XRInputSourceStatePtr p_input_source{};
      XRInputSourceButtonListener_OnButtonEvent_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadInputSource(&p_input_source))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRInputSourceButtonListener::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnButtonEvent(
std::move(p_input_source));
      return true;
    }
  }
  return false;
}

// static
bool XRInputSourceButtonListenerStubDispatch::AcceptWithResponder(
    XRInputSourceButtonListener* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  const bool message_is_sync = message->has_flag(mojo::Message::kFlagIsSync);
  const uint64_t request_id = message->request_id();
  ALLOW_UNUSED_LOCAL(message_is_sync);
  ALLOW_UNUSED_LOCAL(request_id);
  switch (message->header()->name) {
    case internal::kXRInputSourceButtonListener_OnButtonEvent_Name: {
      break;
    }
  }
  return false;
}


static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kXRInputSourceButtonListenerValidationInfo[] = {
    {internal::kXRInputSourceButtonListener_OnButtonEvent_Name,
     {&internal::XRInputSourceButtonListener_OnButtonEvent_Params_Data::Validate,
      nullptr /* no response */}},
};

bool XRInputSourceButtonListenerRequestValidator::Accept(mojo::Message* message) {
  const char* name = ::device::mojom::blink::XRInputSourceButtonListener::Name_;
  return mojo::internal::ValidateRequestGeneric(message, name, kXRInputSourceButtonListenerValidationInfo);
}

const char XRFrameDataProvider::Name_[] = "device.mojom.XRFrameDataProvider";

class XRFrameDataProvider_GetFrameData_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  XRFrameDataProvider_GetFrameData_ForwardToCallback(
      XRFrameDataProvider::GetFrameDataCallback callback
      ) : callback_(std::move(callback)) {
  }
  bool Accept(mojo::Message* message) override;
 private:
  XRFrameDataProvider::GetFrameDataCallback callback_;
  DISALLOW_COPY_AND_ASSIGN(XRFrameDataProvider_GetFrameData_ForwardToCallback);
};

XRFrameDataProviderProxy::XRFrameDataProviderProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void XRFrameDataProviderProxy::GetFrameData(
    XRFrameDataRequestOptionsPtr in_options, GetFrameDataCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRFrameDataProvider::GetFrameData", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      if (in_options.is_null()) {
        raw_value->SetString("options", "nullptr");
      } else {
        raw_value->BeginDictionary("options");
        in_options->AsValueInto(raw_value);
        raw_value->EndDictionary();
      }
      return value;
    }());
#endif
  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRFrameDataProvider_GetFrameData_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRFrameDataProvider_GetFrameData_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->options)::BaseType::BufferWriter
      options_writer;
  mojo::internal::Serialize<::device::mojom::XRFrameDataRequestOptionsDataView>(
      in_options, buffer, &options_writer, &serialization_context);
  params->options.Set(
      options_writer.is_null() ? nullptr : options_writer.data());
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRFrameDataProvider::Name_);
  message.set_method_name("GetFrameData");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new XRFrameDataProvider_GetFrameData_ForwardToCallback(
          std::move(callback)));
  ignore_result(receiver_->AcceptWithResponder(&message, std::move(responder)));
}

void XRFrameDataProviderProxy::GetEnvironmentIntegrationProvider(
    ::mojo::PendingAssociatedReceiver<XREnvironmentIntegrationProvider> in_environment_provider) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRFrameDataProvider::GetEnvironmentIntegrationProvider", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetBoolean("environment_provider", in_environment_provider.is_valid());
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRFrameDataProvider_GetEnvironmentIntegrationProvider_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRFrameDataProvider_GetEnvironmentIntegrationProvider_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  mojo::internal::Serialize<::device::mojom::XREnvironmentIntegrationProviderAssociatedRequestDataView>(
      in_environment_provider, &params->environment_provider, &serialization_context);
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      !mojo::internal::IsHandleOrInterfaceValid(params->environment_provider),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_INTERFACE_ID,
      "invalid environment_provider in XRFrameDataProvider.GetEnvironmentIntegrationProvider request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRFrameDataProvider::Name_);
  message.set_method_name("GetEnvironmentIntegrationProvider");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void XRFrameDataProviderProxy::SetInputSourceButtonListener(
    ::mojo::PendingAssociatedRemote<XRInputSourceButtonListener> in_event_listener) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRFrameDataProvider::SetInputSourceButtonListener", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetBoolean("event_listener", in_event_listener.is_valid());
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRFrameDataProvider_SetInputSourceButtonListener_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRFrameDataProvider_SetInputSourceButtonListener_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  mojo::internal::Serialize<::device::mojom::XRInputSourceButtonListenerAssociatedPtrInfoDataView>(
      in_event_listener, &params->event_listener, &serialization_context);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRFrameDataProvider::Name_);
  message.set_method_name("SetInputSourceButtonListener");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}
class XRFrameDataProvider_GetFrameData_ProxyToResponder {
 public:
  static XRFrameDataProvider::GetFrameDataCallback CreateCallback(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder) {
    std::unique_ptr<XRFrameDataProvider_GetFrameData_ProxyToResponder> proxy(
        new XRFrameDataProvider_GetFrameData_ProxyToResponder(
            request_id, is_sync, responder));
    return base::BindOnce(&XRFrameDataProvider_GetFrameData_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~XRFrameDataProvider_GetFrameData_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
    // If the Callback was dropped then deleting the responder will close
    // the pipe so the calling application knows to stop waiting for a reply.
    responder_ = nullptr;
  }

 private:
  XRFrameDataProvider_GetFrameData_ProxyToResponder(
      uint64_t request_id,
      bool is_sync,
      std::unique_ptr<mojo::MessageReceiverWithStatus>* responder)
      : request_id_(request_id),
        is_sync_(is_sync),
        responder_(std::move(*responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
//    DCHECK(!connected)
//        << "XRFrameDataProvider::GetFrameDataCallback was destroyed without "
//        << "first either being run or its corresponding binding being closed. "
//        << "It is an error to drop response callbacks which still correspond "
//        << "to an open interface pipe.";
  }
#endif

  void Run(
      XRFrameDataPtr in_frame_data);

  uint64_t request_id_;
  bool is_sync_;
  std::unique_ptr<mojo::MessageReceiverWithStatus> responder_;

  DISALLOW_COPY_AND_ASSIGN(XRFrameDataProvider_GetFrameData_ProxyToResponder);
};

bool XRFrameDataProvider_GetFrameData_ForwardToCallback::Accept(
    mojo::Message* message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1("mojom", "device::mojom::XRFrameDataProvider::GetFrameDataCallback",
               "message", message->name());
#endif
  mojo::internal::MessageDispatchContext dispatch_context(message);

  DCHECK(message->is_serialized());
  internal::XRFrameDataProvider_GetFrameData_ResponseParams_Data* params =
      reinterpret_cast<
          internal::XRFrameDataProvider_GetFrameData_ResponseParams_Data*>(
              message->mutable_payload());
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  
  bool success = true;
  XRFrameDataPtr p_frame_data{};
  XRFrameDataProvider_GetFrameData_ResponseParamsDataView input_data_view(params, &serialization_context);
  
  if (success && !input_data_view.ReadFrameData(&p_frame_data))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        XRFrameDataProvider::Name_, 0, true);
    return false;
  }
  if (!callback_.is_null())
    std::move(callback_).Run(
std::move(p_frame_data));
  return true;
}

void XRFrameDataProvider_GetFrameData_ProxyToResponder::Run(
    XRFrameDataPtr in_frame_data) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_BEGIN1(
    "mojom", "(Impl)device::mojom::XRFrameDataProvider::GetFrameDataCallback", "async_response_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      if (in_frame_data.is_null()) {
        raw_value->SetString("frame_data", "nullptr");
      } else {
        raw_value->BeginDictionary("frame_data");
        in_frame_data->AsValueInto(raw_value);
        raw_value->EndDictionary();
      }
      return value;
    }());
#endif
  
  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRFrameDataProvider_GetFrameData_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRFrameDataProvider_GetFrameData_ResponseParams_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->frame_data)::BaseType::BufferWriter
      frame_data_writer;
  mojo::internal::Serialize<::device::mojom::XRFrameDataDataView>(
      in_frame_data, buffer, &frame_data_writer, &serialization_context);
  params->frame_data.Set(
      frame_data_writer.is_null() ? nullptr : frame_data_writer.data());
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT_END1("mojom", "(Impl)device::mojom::XRFrameDataProvider::GetFrameDataCallback", "message",
                   message.name());
#endif

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRFrameDataProvider::Name_);
  message.set_method_name("GetFrameData");
#endif

  message.set_request_id(request_id_);
  ignore_result(responder_->Accept(&message));
  // TODO(darin): Accept() returning false indicates a malformed message, and
  // that may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}

// static
bool XRFrameDataProviderStubDispatch::Accept(
    XRFrameDataProvider* impl,
    mojo::Message* message) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  switch (message->header()->name) {
    case internal::kXRFrameDataProvider_GetFrameData_Name: {
      break;
    }
    case internal::kXRFrameDataProvider_GetEnvironmentIntegrationProvider_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRFrameDataProvider::GetEnvironmentIntegrationProvider",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRFrameDataProvider::GetEnvironmentIntegrationProvider");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRFrameDataProvider_GetEnvironmentIntegrationProvider_Params_Data* params =
          reinterpret_cast<internal::XRFrameDataProvider_GetEnvironmentIntegrationProvider_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      ::mojo::PendingAssociatedReceiver<XREnvironmentIntegrationProvider> p_environment_provider{};
      XRFrameDataProvider_GetEnvironmentIntegrationProvider_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success) {
        p_environment_provider =
            input_data_view.TakeEnvironmentProvider<decltype(p_environment_provider)>();
      }
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRFrameDataProvider::Name_, 1, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->GetEnvironmentIntegrationProvider(
std::move(p_environment_provider));
      return true;
    }
    case internal::kXRFrameDataProvider_SetInputSourceButtonListener_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRFrameDataProvider::SetInputSourceButtonListener",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRFrameDataProvider::SetInputSourceButtonListener");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRFrameDataProvider_SetInputSourceButtonListener_Params_Data* params =
          reinterpret_cast<internal::XRFrameDataProvider_SetInputSourceButtonListener_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      ::mojo::PendingAssociatedRemote<XRInputSourceButtonListener> p_event_listener{};
      XRFrameDataProvider_SetInputSourceButtonListener_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success) {
        p_event_listener =
            input_data_view.TakeEventListener<decltype(p_event_listener)>();
      }
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRFrameDataProvider::Name_, 2, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SetInputSourceButtonListener(
std::move(p_event_listener));
      return true;
    }
  }
  return false;
}

// static
bool XRFrameDataProviderStubDispatch::AcceptWithResponder(
    XRFrameDataProvider* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  const bool message_is_sync = message->has_flag(mojo::Message::kFlagIsSync);
  const uint64_t request_id = message->request_id();
  ALLOW_UNUSED_LOCAL(message_is_sync);
  ALLOW_UNUSED_LOCAL(request_id);
  switch (message->header()->name) {
    case internal::kXRFrameDataProvider_GetFrameData_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRFrameDataProvider::GetFrameData",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRFrameDataProvider::GetFrameData");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      internal::XRFrameDataProvider_GetFrameData_Params_Data* params =
          reinterpret_cast<
              internal::XRFrameDataProvider_GetFrameData_Params_Data*>(
                  message->mutable_payload());
      
      bool success = true;
      XRFrameDataRequestOptionsPtr p_options{};
      XRFrameDataProvider_GetFrameData_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadOptions(&p_options))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRFrameDataProvider::Name_, 0, false);
        return false;
      }
      XRFrameDataProvider::GetFrameDataCallback callback =
          XRFrameDataProvider_GetFrameData_ProxyToResponder::CreateCallback(
              message->request_id(), message_is_sync, &responder);
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->GetFrameData(
std::move(p_options), std::move(callback));
      return true;
    }
    case internal::kXRFrameDataProvider_GetEnvironmentIntegrationProvider_Name: {
      break;
    }
    case internal::kXRFrameDataProvider_SetInputSourceButtonListener_Name: {
      break;
    }
  }
  return false;
}


static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kXRFrameDataProviderValidationInfo[] = {
    {internal::kXRFrameDataProvider_GetFrameData_Name,
     {&internal::XRFrameDataProvider_GetFrameData_Params_Data::Validate,
      &internal::XRFrameDataProvider_GetFrameData_ResponseParams_Data::Validate}},
    {internal::kXRFrameDataProvider_GetEnvironmentIntegrationProvider_Name,
     {&internal::XRFrameDataProvider_GetEnvironmentIntegrationProvider_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kXRFrameDataProvider_SetInputSourceButtonListener_Name,
     {&internal::XRFrameDataProvider_SetInputSourceButtonListener_Params_Data::Validate,
      nullptr /* no response */}},
};

bool XRFrameDataProviderRequestValidator::Accept(mojo::Message* message) {
  const char* name = ::device::mojom::blink::XRFrameDataProvider::Name_;
  return mojo::internal::ValidateRequestGeneric(message, name, kXRFrameDataProviderValidationInfo);
}

bool XRFrameDataProviderResponseValidator::Accept(mojo::Message* message) {
  const char* name = ::device::mojom::blink::XRFrameDataProvider::Name_;
  return mojo::internal::ValidateResponseGeneric(message, name, kXRFrameDataProviderValidationInfo);

}
const char XRPresentationProvider::Name_[] = "device.mojom.XRPresentationProvider";

XRPresentationProviderProxy::XRPresentationProviderProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void XRPresentationProviderProxy::UpdateLayerBounds(
    int16_t in_frame_id, const ::gfx::RectF& in_left_bounds, const ::gfx::RectF& in_right_bounds, const ::gfx::Size& in_source_size) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRPresentationProvider::UpdateLayerBounds", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetInteger("frame_id", in_frame_id);
      raw_value->SetString("left_bounds", base::trace_event::ValueToString(in_left_bounds, "<value of type const ::gfx::RectF&>"));
      raw_value->SetString("right_bounds", base::trace_event::ValueToString(in_right_bounds, "<value of type const ::gfx::RectF&>"));
      raw_value->SetString("source_size", base::trace_event::ValueToString(in_source_size, "<value of type const ::gfx::Size&>"));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRPresentationProvider_UpdateLayerBounds_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRPresentationProvider_UpdateLayerBounds_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->frame_id = in_frame_id;
  typename decltype(params->left_bounds)::BaseType::BufferWriter
      left_bounds_writer;
  mojo::internal::Serialize<::gfx::mojom::RectFDataView>(
      in_left_bounds, buffer, &left_bounds_writer, &serialization_context);
  params->left_bounds.Set(
      left_bounds_writer.is_null() ? nullptr : left_bounds_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->left_bounds.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null left_bounds in XRPresentationProvider.UpdateLayerBounds request");
  typename decltype(params->right_bounds)::BaseType::BufferWriter
      right_bounds_writer;
  mojo::internal::Serialize<::gfx::mojom::RectFDataView>(
      in_right_bounds, buffer, &right_bounds_writer, &serialization_context);
  params->right_bounds.Set(
      right_bounds_writer.is_null() ? nullptr : right_bounds_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->right_bounds.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null right_bounds in XRPresentationProvider.UpdateLayerBounds request");
  typename decltype(params->source_size)::BaseType::BufferWriter
      source_size_writer;
  mojo::internal::Serialize<::gfx::mojom::SizeDataView>(
      in_source_size, buffer, &source_size_writer, &serialization_context);
  params->source_size.Set(
      source_size_writer.is_null() ? nullptr : source_size_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->source_size.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null source_size in XRPresentationProvider.UpdateLayerBounds request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRPresentationProvider::Name_);
  message.set_method_name("UpdateLayerBounds");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void XRPresentationProviderProxy::SubmitFrameMissing(
    int16_t in_frame_id, const ::gpu::SyncToken& in_sync_token) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRPresentationProvider::SubmitFrameMissing", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetInteger("frame_id", in_frame_id);
      raw_value->SetString("sync_token", base::trace_event::ValueToString(in_sync_token, "<value of type const ::gpu::SyncToken&>"));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRPresentationProvider_SubmitFrameMissing_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRPresentationProvider_SubmitFrameMissing_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->frame_id = in_frame_id;
  typename decltype(params->sync_token)::BaseType::BufferWriter
      sync_token_writer;
  mojo::internal::Serialize<::gpu::mojom::SyncTokenDataView>(
      in_sync_token, buffer, &sync_token_writer, &serialization_context);
  params->sync_token.Set(
      sync_token_writer.is_null() ? nullptr : sync_token_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->sync_token.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null sync_token in XRPresentationProvider.SubmitFrameMissing request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRPresentationProvider::Name_);
  message.set_method_name("SubmitFrameMissing");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void XRPresentationProviderProxy::SubmitFrame(
    int16_t in_frame_id, const ::gpu::MailboxHolder& in_mailbox_holder, ::base::TimeDelta in_time_waited) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRPresentationProvider::SubmitFrame", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetInteger("frame_id", in_frame_id);
      raw_value->SetString("mailbox_holder", base::trace_event::ValueToString(in_mailbox_holder, "<value of type const ::gpu::MailboxHolder&>"));
      raw_value->SetString("time_waited", base::trace_event::ValueToString(in_time_waited, "<value of type ::base::TimeDelta>"));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRPresentationProvider_SubmitFrame_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRPresentationProvider_SubmitFrame_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->frame_id = in_frame_id;
  typename decltype(params->mailbox_holder)::BaseType::BufferWriter
      mailbox_holder_writer;
  mojo::internal::Serialize<::gpu::mojom::MailboxHolderDataView>(
      in_mailbox_holder, buffer, &mailbox_holder_writer, &serialization_context);
  params->mailbox_holder.Set(
      mailbox_holder_writer.is_null() ? nullptr : mailbox_holder_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->mailbox_holder.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null mailbox_holder in XRPresentationProvider.SubmitFrame request");
  typename decltype(params->time_waited)::BaseType::BufferWriter
      time_waited_writer;
  mojo::internal::Serialize<::mojo_base::mojom::TimeDeltaDataView>(
      in_time_waited, buffer, &time_waited_writer, &serialization_context);
  params->time_waited.Set(
      time_waited_writer.is_null() ? nullptr : time_waited_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->time_waited.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null time_waited in XRPresentationProvider.SubmitFrame request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRPresentationProvider::Name_);
  message.set_method_name("SubmitFrame");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void XRPresentationProviderProxy::SubmitFrameWithTextureHandle(
    int16_t in_frameId, ::mojo::PlatformHandle in_texture) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRPresentationProvider::SubmitFrameWithTextureHandle", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetInteger("frameId", in_frameId);
      raw_value->SetBoolean("texture", in_texture.is_valid());
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRPresentationProvider_SubmitFrameWithTextureHandle_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRPresentationProvider_SubmitFrameWithTextureHandle_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->frameId = in_frameId;
  mojo::internal::Serialize<mojo::PlatformHandle>(
      in_texture, &params->texture, &serialization_context);
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      !mojo::internal::IsHandleOrInterfaceValid(params->texture),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
      "invalid texture in XRPresentationProvider.SubmitFrameWithTextureHandle request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRPresentationProvider::Name_);
  message.set_method_name("SubmitFrameWithTextureHandle");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void XRPresentationProviderProxy::SubmitFrameDrawnIntoTexture(
    int16_t in_frameId, const ::gpu::SyncToken& in_sync_token, ::base::TimeDelta in_time_waited) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRPresentationProvider::SubmitFrameDrawnIntoTexture", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetInteger("frameId", in_frameId);
      raw_value->SetString("sync_token", base::trace_event::ValueToString(in_sync_token, "<value of type const ::gpu::SyncToken&>"));
      raw_value->SetString("time_waited", base::trace_event::ValueToString(in_time_waited, "<value of type ::base::TimeDelta>"));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRPresentationProvider_SubmitFrameDrawnIntoTexture_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRPresentationProvider_SubmitFrameDrawnIntoTexture_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->frameId = in_frameId;
  typename decltype(params->sync_token)::BaseType::BufferWriter
      sync_token_writer;
  mojo::internal::Serialize<::gpu::mojom::SyncTokenDataView>(
      in_sync_token, buffer, &sync_token_writer, &serialization_context);
  params->sync_token.Set(
      sync_token_writer.is_null() ? nullptr : sync_token_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->sync_token.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null sync_token in XRPresentationProvider.SubmitFrameDrawnIntoTexture request");
  typename decltype(params->time_waited)::BaseType::BufferWriter
      time_waited_writer;
  mojo::internal::Serialize<::mojo_base::mojom::TimeDeltaDataView>(
      in_time_waited, buffer, &time_waited_writer, &serialization_context);
  params->time_waited.Set(
      time_waited_writer.is_null() ? nullptr : time_waited_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->time_waited.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null time_waited in XRPresentationProvider.SubmitFrameDrawnIntoTexture request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRPresentationProvider::Name_);
  message.set_method_name("SubmitFrameDrawnIntoTexture");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

// static
bool XRPresentationProviderStubDispatch::Accept(
    XRPresentationProvider* impl,
    mojo::Message* message) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  switch (message->header()->name) {
    case internal::kXRPresentationProvider_UpdateLayerBounds_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRPresentationProvider::UpdateLayerBounds",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRPresentationProvider::UpdateLayerBounds");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRPresentationProvider_UpdateLayerBounds_Params_Data* params =
          reinterpret_cast<internal::XRPresentationProvider_UpdateLayerBounds_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      int16_t p_frame_id{};
      ::gfx::RectF p_left_bounds{};
      ::gfx::RectF p_right_bounds{};
      ::gfx::Size p_source_size{};
      XRPresentationProvider_UpdateLayerBounds_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_frame_id = input_data_view.frame_id();
      if (success && !input_data_view.ReadLeftBounds(&p_left_bounds))
        success = false;
      if (success && !input_data_view.ReadRightBounds(&p_right_bounds))
        success = false;
      if (success && !input_data_view.ReadSourceSize(&p_source_size))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRPresentationProvider::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->UpdateLayerBounds(
std::move(p_frame_id), 
std::move(p_left_bounds), 
std::move(p_right_bounds), 
std::move(p_source_size));
      return true;
    }
    case internal::kXRPresentationProvider_SubmitFrameMissing_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRPresentationProvider::SubmitFrameMissing",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRPresentationProvider::SubmitFrameMissing");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRPresentationProvider_SubmitFrameMissing_Params_Data* params =
          reinterpret_cast<internal::XRPresentationProvider_SubmitFrameMissing_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      int16_t p_frame_id{};
      ::gpu::SyncToken p_sync_token{};
      XRPresentationProvider_SubmitFrameMissing_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_frame_id = input_data_view.frame_id();
      if (success && !input_data_view.ReadSyncToken(&p_sync_token))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRPresentationProvider::Name_, 1, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SubmitFrameMissing(
std::move(p_frame_id), 
std::move(p_sync_token));
      return true;
    }
    case internal::kXRPresentationProvider_SubmitFrame_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRPresentationProvider::SubmitFrame",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRPresentationProvider::SubmitFrame");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRPresentationProvider_SubmitFrame_Params_Data* params =
          reinterpret_cast<internal::XRPresentationProvider_SubmitFrame_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      int16_t p_frame_id{};
      ::gpu::MailboxHolder p_mailbox_holder{};
      ::base::TimeDelta p_time_waited{};
      XRPresentationProvider_SubmitFrame_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_frame_id = input_data_view.frame_id();
      if (success && !input_data_view.ReadMailboxHolder(&p_mailbox_holder))
        success = false;
      if (success && !input_data_view.ReadTimeWaited(&p_time_waited))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRPresentationProvider::Name_, 2, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SubmitFrame(
std::move(p_frame_id), 
std::move(p_mailbox_holder), 
std::move(p_time_waited));
      return true;
    }
    case internal::kXRPresentationProvider_SubmitFrameWithTextureHandle_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRPresentationProvider::SubmitFrameWithTextureHandle",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRPresentationProvider::SubmitFrameWithTextureHandle");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRPresentationProvider_SubmitFrameWithTextureHandle_Params_Data* params =
          reinterpret_cast<internal::XRPresentationProvider_SubmitFrameWithTextureHandle_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      int16_t p_frameId{};
      ::mojo::PlatformHandle p_texture{};
      XRPresentationProvider_SubmitFrameWithTextureHandle_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_frameId = input_data_view.frameId();
      if (success)
        p_texture = input_data_view.TakeTexture();
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRPresentationProvider::Name_, 3, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SubmitFrameWithTextureHandle(
std::move(p_frameId), 
std::move(p_texture));
      return true;
    }
    case internal::kXRPresentationProvider_SubmitFrameDrawnIntoTexture_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRPresentationProvider::SubmitFrameDrawnIntoTexture",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRPresentationProvider::SubmitFrameDrawnIntoTexture");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRPresentationProvider_SubmitFrameDrawnIntoTexture_Params_Data* params =
          reinterpret_cast<internal::XRPresentationProvider_SubmitFrameDrawnIntoTexture_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      int16_t p_frameId{};
      ::gpu::SyncToken p_sync_token{};
      ::base::TimeDelta p_time_waited{};
      XRPresentationProvider_SubmitFrameDrawnIntoTexture_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_frameId = input_data_view.frameId();
      if (success && !input_data_view.ReadSyncToken(&p_sync_token))
        success = false;
      if (success && !input_data_view.ReadTimeWaited(&p_time_waited))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRPresentationProvider::Name_, 4, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SubmitFrameDrawnIntoTexture(
std::move(p_frameId), 
std::move(p_sync_token), 
std::move(p_time_waited));
      return true;
    }
  }
  return false;
}

// static
bool XRPresentationProviderStubDispatch::AcceptWithResponder(
    XRPresentationProvider* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  const bool message_is_sync = message->has_flag(mojo::Message::kFlagIsSync);
  const uint64_t request_id = message->request_id();
  ALLOW_UNUSED_LOCAL(message_is_sync);
  ALLOW_UNUSED_LOCAL(request_id);
  switch (message->header()->name) {
    case internal::kXRPresentationProvider_UpdateLayerBounds_Name: {
      break;
    }
    case internal::kXRPresentationProvider_SubmitFrameMissing_Name: {
      break;
    }
    case internal::kXRPresentationProvider_SubmitFrame_Name: {
      break;
    }
    case internal::kXRPresentationProvider_SubmitFrameWithTextureHandle_Name: {
      break;
    }
    case internal::kXRPresentationProvider_SubmitFrameDrawnIntoTexture_Name: {
      break;
    }
  }
  return false;
}


static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kXRPresentationProviderValidationInfo[] = {
    {internal::kXRPresentationProvider_UpdateLayerBounds_Name,
     {&internal::XRPresentationProvider_UpdateLayerBounds_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kXRPresentationProvider_SubmitFrameMissing_Name,
     {&internal::XRPresentationProvider_SubmitFrameMissing_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kXRPresentationProvider_SubmitFrame_Name,
     {&internal::XRPresentationProvider_SubmitFrame_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kXRPresentationProvider_SubmitFrameWithTextureHandle_Name,
     {&internal::XRPresentationProvider_SubmitFrameWithTextureHandle_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kXRPresentationProvider_SubmitFrameDrawnIntoTexture_Name,
     {&internal::XRPresentationProvider_SubmitFrameDrawnIntoTexture_Params_Data::Validate,
      nullptr /* no response */}},
};

bool XRPresentationProviderRequestValidator::Accept(mojo::Message* message) {
  const char* name = ::device::mojom::blink::XRPresentationProvider::Name_;
  return mojo::internal::ValidateRequestGeneric(message, name, kXRPresentationProviderValidationInfo);
}

const char XRPresentationClient::Name_[] = "device.mojom.XRPresentationClient";

XRPresentationClientProxy::XRPresentationClientProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void XRPresentationClientProxy::OnSubmitFrameTransferred(
    bool in_success) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRPresentationClient::OnSubmitFrameTransferred", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetBoolean("success", in_success);
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRPresentationClient_OnSubmitFrameTransferred_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRPresentationClient_OnSubmitFrameTransferred_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->success = in_success;
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRPresentationClient::Name_);
  message.set_method_name("OnSubmitFrameTransferred");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void XRPresentationClientProxy::OnSubmitFrameRendered(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "device::mojom::XRPresentationClient::OnSubmitFrameRendered");
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRPresentationClient_OnSubmitFrameRendered_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRPresentationClient_OnSubmitFrameRendered_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRPresentationClient::Name_);
  message.set_method_name("OnSubmitFrameRendered");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void XRPresentationClientProxy::OnSubmitFrameGpuFence(
    ::gfx::GpuFenceHandle in_gpu_fence_handle) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRPresentationClient::OnSubmitFrameGpuFence", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("gpu_fence_handle", base::trace_event::ValueToString(in_gpu_fence_handle, "<value of type ::gfx::GpuFenceHandle>"));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRPresentationClient_OnSubmitFrameGpuFence_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRPresentationClient_OnSubmitFrameGpuFence_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->gpu_fence_handle)::BaseType::BufferWriter
      gpu_fence_handle_writer;
  mojo::internal::Serialize<::gfx::mojom::GpuFenceHandleDataView>(
      in_gpu_fence_handle, buffer, &gpu_fence_handle_writer, &serialization_context);
  params->gpu_fence_handle.Set(
      gpu_fence_handle_writer.is_null() ? nullptr : gpu_fence_handle_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->gpu_fence_handle.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null gpu_fence_handle in XRPresentationClient.OnSubmitFrameGpuFence request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRPresentationClient::Name_);
  message.set_method_name("OnSubmitFrameGpuFence");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

// static
bool XRPresentationClientStubDispatch::Accept(
    XRPresentationClient* impl,
    mojo::Message* message) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  switch (message->header()->name) {
    case internal::kXRPresentationClient_OnSubmitFrameTransferred_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRPresentationClient::OnSubmitFrameTransferred",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRPresentationClient::OnSubmitFrameTransferred");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRPresentationClient_OnSubmitFrameTransferred_Params_Data* params =
          reinterpret_cast<internal::XRPresentationClient_OnSubmitFrameTransferred_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      bool p_success{};
      XRPresentationClient_OnSubmitFrameTransferred_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_success = input_data_view.success();
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRPresentationClient::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnSubmitFrameTransferred(
std::move(p_success));
      return true;
    }
    case internal::kXRPresentationClient_OnSubmitFrameRendered_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRPresentationClient::OnSubmitFrameRendered",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRPresentationClient::OnSubmitFrameRendered");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRPresentationClient_OnSubmitFrameRendered_Params_Data* params =
          reinterpret_cast<internal::XRPresentationClient_OnSubmitFrameRendered_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      XRPresentationClient_OnSubmitFrameRendered_ParamsDataView input_data_view(params, &serialization_context);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRPresentationClient::Name_, 1, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnSubmitFrameRendered();
      return true;
    }
    case internal::kXRPresentationClient_OnSubmitFrameGpuFence_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRPresentationClient::OnSubmitFrameGpuFence",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRPresentationClient::OnSubmitFrameGpuFence");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRPresentationClient_OnSubmitFrameGpuFence_Params_Data* params =
          reinterpret_cast<internal::XRPresentationClient_OnSubmitFrameGpuFence_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      ::gfx::GpuFenceHandle p_gpu_fence_handle{};
      XRPresentationClient_OnSubmitFrameGpuFence_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadGpuFenceHandle(&p_gpu_fence_handle))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRPresentationClient::Name_, 2, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnSubmitFrameGpuFence(
std::move(p_gpu_fence_handle));
      return true;
    }
  }
  return false;
}

// static
bool XRPresentationClientStubDispatch::AcceptWithResponder(
    XRPresentationClient* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  const bool message_is_sync = message->has_flag(mojo::Message::kFlagIsSync);
  const uint64_t request_id = message->request_id();
  ALLOW_UNUSED_LOCAL(message_is_sync);
  ALLOW_UNUSED_LOCAL(request_id);
  switch (message->header()->name) {
    case internal::kXRPresentationClient_OnSubmitFrameTransferred_Name: {
      break;
    }
    case internal::kXRPresentationClient_OnSubmitFrameRendered_Name: {
      break;
    }
    case internal::kXRPresentationClient_OnSubmitFrameGpuFence_Name: {
      break;
    }
  }
  return false;
}


static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kXRPresentationClientValidationInfo[] = {
    {internal::kXRPresentationClient_OnSubmitFrameTransferred_Name,
     {&internal::XRPresentationClient_OnSubmitFrameTransferred_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kXRPresentationClient_OnSubmitFrameRendered_Name,
     {&internal::XRPresentationClient_OnSubmitFrameRendered_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kXRPresentationClient_OnSubmitFrameGpuFence_Name,
     {&internal::XRPresentationClient_OnSubmitFrameGpuFence_Params_Data::Validate,
      nullptr /* no response */}},
};

bool XRPresentationClientRequestValidator::Accept(mojo::Message* message) {
  const char* name = ::device::mojom::blink::XRPresentationClient::Name_;
  return mojo::internal::ValidateRequestGeneric(message, name, kXRPresentationClientValidationInfo);
}

const char XRSessionClient::Name_[] = "device.mojom.XRSessionClient";

XRSessionClientProxy::XRSessionClientProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void XRSessionClientProxy::OnChanged(
    VRDisplayInfoPtr in_display) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRSessionClient::OnChanged", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      if (in_display.is_null()) {
        raw_value->SetString("display", "nullptr");
      } else {
        raw_value->BeginDictionary("display");
        in_display->AsValueInto(raw_value);
        raw_value->EndDictionary();
      }
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRSessionClient_OnChanged_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRSessionClient_OnChanged_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->display)::BaseType::BufferWriter
      display_writer;
  mojo::internal::Serialize<::device::mojom::VRDisplayInfoDataView>(
      in_display, buffer, &display_writer, &serialization_context);
  params->display.Set(
      display_writer.is_null() ? nullptr : display_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->display.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null display in XRSessionClient.OnChanged request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRSessionClient::Name_);
  message.set_method_name("OnChanged");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void XRSessionClientProxy::OnExitPresent(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "device::mojom::XRSessionClient::OnExitPresent");
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRSessionClient_OnExitPresent_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRSessionClient_OnExitPresent_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRSessionClient::Name_);
  message.set_method_name("OnExitPresent");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void XRSessionClientProxy::OnVisibilityStateChanged(
    XRVisibilityState in_visibility_state) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "device::mojom::XRSessionClient::OnVisibilityStateChanged", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("visibility_state", base::trace_event::ValueToString(in_visibility_state));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kXRSessionClient_OnVisibilityStateChanged_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::device::mojom::internal::XRSessionClient_OnVisibilityStateChanged_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  mojo::internal::Serialize<::device::mojom::XRVisibilityState>(
      in_visibility_state, &params->visibility_state);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRSessionClient::Name_);
  message.set_method_name("OnVisibilityStateChanged");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

// static
bool XRSessionClientStubDispatch::Accept(
    XRSessionClient* impl,
    mojo::Message* message) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  switch (message->header()->name) {
    case internal::kXRSessionClient_OnChanged_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRSessionClient::OnChanged",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRSessionClient::OnChanged");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRSessionClient_OnChanged_Params_Data* params =
          reinterpret_cast<internal::XRSessionClient_OnChanged_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      VRDisplayInfoPtr p_display{};
      XRSessionClient_OnChanged_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadDisplay(&p_display))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRSessionClient::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnChanged(
std::move(p_display));
      return true;
    }
    case internal::kXRSessionClient_OnExitPresent_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRSessionClient::OnExitPresent",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRSessionClient::OnExitPresent");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRSessionClient_OnExitPresent_Params_Data* params =
          reinterpret_cast<internal::XRSessionClient_OnExitPresent_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      XRSessionClient_OnExitPresent_ParamsDataView input_data_view(params, &serialization_context);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRSessionClient::Name_, 1, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnExitPresent();
      return true;
    }
    case internal::kXRSessionClient_OnVisibilityStateChanged_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)device::mojom::XRSessionClient::OnVisibilityStateChanged",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)device::mojom::XRSessionClient::OnVisibilityStateChanged");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::XRSessionClient_OnVisibilityStateChanged_Params_Data* params =
          reinterpret_cast<internal::XRSessionClient_OnVisibilityStateChanged_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      XRVisibilityState p_visibility_state{};
      XRSessionClient_OnVisibilityStateChanged_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadVisibilityState(&p_visibility_state))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRSessionClient::Name_, 2, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnVisibilityStateChanged(
std::move(p_visibility_state));
      return true;
    }
  }
  return false;
}

// static
bool XRSessionClientStubDispatch::AcceptWithResponder(
    XRSessionClient* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  const bool message_is_sync = message->has_flag(mojo::Message::kFlagIsSync);
  const uint64_t request_id = message->request_id();
  ALLOW_UNUSED_LOCAL(message_is_sync);
  ALLOW_UNUSED_LOCAL(request_id);
  switch (message->header()->name) {
    case internal::kXRSessionClient_OnChanged_Name: {
      break;
    }
    case internal::kXRSessionClient_OnExitPresent_Name: {
      break;
    }
    case internal::kXRSessionClient_OnVisibilityStateChanged_Name: {
      break;
    }
  }
  return false;
}


static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kXRSessionClientValidationInfo[] = {
    {internal::kXRSessionClient_OnChanged_Name,
     {&internal::XRSessionClient_OnChanged_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kXRSessionClient_OnExitPresent_Name,
     {&internal::XRSessionClient_OnExitPresent_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kXRSessionClient_OnVisibilityStateChanged_Name,
     {&internal::XRSessionClient_OnVisibilityStateChanged_Params_Data::Validate,
      nullptr /* no response */}},
};

bool XRSessionClientRequestValidator::Accept(mojo::Message* message) {
  const char* name = ::device::mojom::blink::XRSessionClient::Name_;
  return mojo::internal::ValidateRequestGeneric(message, name, kXRSessionClientValidationInfo);
}

}  // namespace blink
}  // namespace mojom
}  // namespace device

namespace mojo {


// static
bool StructTraits<::device::mojom::blink::XRSessionOptions::DataView, ::device::mojom::blink::XRSessionOptionsPtr>::Read(
    ::device::mojom::blink::XRSessionOptions::DataView input,
    ::device::mojom::blink::XRSessionOptionsPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRSessionOptionsPtr result(::device::mojom::blink::XRSessionOptions::New());
  
      if (success && !input.ReadMode(&result->mode))
        success = false;
      if (success && !input.ReadRequiredFeatures(&result->required_features))
        success = false;
      if (success && !input.ReadOptionalFeatures(&result->optional_features))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRSession::DataView, ::device::mojom::blink::XRSessionPtr>::Read(
    ::device::mojom::blink::XRSession::DataView input,
    ::device::mojom::blink::XRSessionPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRSessionPtr result(::device::mojom::blink::XRSession::New());
  
      if (success) {
        result->data_provider =
            input.TakeDataProvider<decltype(result->data_provider)>();
      }
      if (success) {
        result->client_receiver =
            input.TakeClientReceiver<decltype(result->client_receiver)>();
      }
      if (success && !input.ReadDisplayInfo(&result->display_info))
        success = false;
      if (success && !input.ReadSubmitFrameSink(&result->submit_frame_sink))
        success = false;
      if (success && !input.ReadEnabledFeatures(&result->enabled_features))
        success = false;
      if (success)
        result->uses_input_eventing = input.uses_input_eventing();
      if (success)
        result->default_framebuffer_scale = input.default_framebuffer_scale();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRPresentationConnection::DataView, ::device::mojom::blink::XRPresentationConnectionPtr>::Read(
    ::device::mojom::blink::XRPresentationConnection::DataView input,
    ::device::mojom::blink::XRPresentationConnectionPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRPresentationConnectionPtr result(::device::mojom::blink::XRPresentationConnection::New());
  
      if (success) {
        result->provider =
            input.TakeProvider<decltype(result->provider)>();
      }
      if (success) {
        result->client_receiver =
            input.TakeClientReceiver<decltype(result->client_receiver)>();
      }
      if (success && !input.ReadTransportOptions(&result->transport_options))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRInputSourceDescription::DataView, ::device::mojom::blink::XRInputSourceDescriptionPtr>::Read(
    ::device::mojom::blink::XRInputSourceDescription::DataView input,
    ::device::mojom::blink::XRInputSourceDescriptionPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRInputSourceDescriptionPtr result(::device::mojom::blink::XRInputSourceDescription::New());
  
      if (success && !input.ReadTargetRayMode(&result->target_ray_mode))
        success = false;
      if (success && !input.ReadHandedness(&result->handedness))
        success = false;
      if (success && !input.ReadInputFromPointer(&result->input_from_pointer))
        success = false;
      if (success && !input.ReadProfiles(&result->profiles))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRInputSourceState::DataView, ::device::mojom::blink::XRInputSourceStatePtr>::Read(
    ::device::mojom::blink::XRInputSourceState::DataView input,
    ::device::mojom::blink::XRInputSourceStatePtr* output) {
  bool success = true;
  ::device::mojom::blink::XRInputSourceStatePtr result(::device::mojom::blink::XRInputSourceState::New());
  
      if (success)
        result->source_id = input.source_id();
      if (success && !input.ReadDescription(&result->description))
        success = false;
      if (success && !input.ReadMojoFromInput(&result->mojo_from_input))
        success = false;
      if (success)
        result->emulated_position = input.emulated_position();
      if (success)
        result->is_auxiliary = input.is_auxiliary();
      if (success)
        result->primary_input_pressed = input.primary_input_pressed();
      if (success)
        result->primary_input_clicked = input.primary_input_clicked();
      if (success)
        result->primary_squeeze_pressed = input.primary_squeeze_pressed();
      if (success)
        result->primary_squeeze_clicked = input.primary_squeeze_clicked();
      if (success && !input.ReadGamepad(&result->gamepad))
        success = false;
      if (success && !input.ReadOverlayPointerPosition(&result->overlay_pointer_position))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::VRFieldOfView::DataView, ::device::mojom::blink::VRFieldOfViewPtr>::Read(
    ::device::mojom::blink::VRFieldOfView::DataView input,
    ::device::mojom::blink::VRFieldOfViewPtr* output) {
  bool success = true;
  ::device::mojom::blink::VRFieldOfViewPtr result(::device::mojom::blink::VRFieldOfView::New());
  
      if (success)
        result->up_degrees = input.up_degrees();
      if (success)
        result->down_degrees = input.down_degrees();
      if (success)
        result->left_degrees = input.left_degrees();
      if (success)
        result->right_degrees = input.right_degrees();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::VRPose::DataView, ::device::mojom::blink::VRPosePtr>::Read(
    ::device::mojom::blink::VRPose::DataView input,
    ::device::mojom::blink::VRPosePtr* output) {
  bool success = true;
  ::device::mojom::blink::VRPosePtr result(::device::mojom::blink::VRPose::New());
  
      if (success && !input.ReadOrientation(&result->orientation))
        success = false;
      if (success && !input.ReadPosition(&result->position))
        success = false;
      if (success)
        result->emulated_position = input.emulated_position();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::Pose::DataView, ::device::mojom::blink::PosePtr>::Read(
    ::device::mojom::blink::Pose::DataView input,
    ::device::mojom::blink::PosePtr* output) {
  bool success = true;
  ::device::mojom::blink::PosePtr result(::device::mojom::blink::Pose::New());
  
      if (success && !input.ReadOrientation(&result->orientation))
        success = false;
      if (success && !input.ReadPosition(&result->position))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRRay::DataView, ::device::mojom::blink::XRRayPtr>::Read(
    ::device::mojom::blink::XRRay::DataView input,
    ::device::mojom::blink::XRRayPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRRayPtr result(::device::mojom::blink::XRRay::New());
  
      if (success && !input.ReadOrigin(&result->origin))
        success = false;
      if (success && !input.ReadDirection(&result->direction))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRHitResult::DataView, ::device::mojom::blink::XRHitResultPtr>::Read(
    ::device::mojom::blink::XRHitResult::DataView input,
    ::device::mojom::blink::XRHitResultPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRHitResultPtr result(::device::mojom::blink::XRHitResult::New());
  
      if (success && !input.ReadMojoFromResult(&result->mojo_from_result))
        success = false;
      if (success)
        result->plane_id = input.plane_id();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::VREyeParameters::DataView, ::device::mojom::blink::VREyeParametersPtr>::Read(
    ::device::mojom::blink::VREyeParameters::DataView input,
    ::device::mojom::blink::VREyeParametersPtr* output) {
  bool success = true;
  ::device::mojom::blink::VREyeParametersPtr result(::device::mojom::blink::VREyeParameters::New());
  
      if (success && !input.ReadFieldOfView(&result->field_of_view))
        success = false;
      if (success && !input.ReadHeadFromEye(&result->head_from_eye))
        success = false;
      if (success)
        result->render_width = input.render_width();
      if (success)
        result->render_height = input.render_height();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::VRStageParameters::DataView, ::device::mojom::blink::VRStageParametersPtr>::Read(
    ::device::mojom::blink::VRStageParameters::DataView input,
    ::device::mojom::blink::VRStageParametersPtr* output) {
  bool success = true;
  ::device::mojom::blink::VRStageParametersPtr result(::device::mojom::blink::VRStageParameters::New());
  
      if (success && !input.ReadMojoFromFloor(&result->mojo_from_floor))
        success = false;
      if (success && !input.ReadBounds(&result->bounds))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::VRDisplayInfo::DataView, ::device::mojom::blink::VRDisplayInfoPtr>::Read(
    ::device::mojom::blink::VRDisplayInfo::DataView input,
    ::device::mojom::blink::VRDisplayInfoPtr* output) {
  bool success = true;
  ::device::mojom::blink::VRDisplayInfoPtr result(::device::mojom::blink::VRDisplayInfo::New());
  
      if (success && !input.ReadStageParameters(&result->stage_parameters))
        success = false;
      if (success && !input.ReadLeftEye(&result->left_eye))
        success = false;
      if (success && !input.ReadRightEye(&result->right_eye))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRPresentationTransportOptions::DataView, ::device::mojom::blink::XRPresentationTransportOptionsPtr>::Read(
    ::device::mojom::blink::XRPresentationTransportOptions::DataView input,
    ::device::mojom::blink::XRPresentationTransportOptionsPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRPresentationTransportOptionsPtr result(::device::mojom::blink::XRPresentationTransportOptions::New());
  
      if (success && !input.ReadTransportMethod(&result->transport_method))
        success = false;
      if (success)
        result->wait_for_transfer_notification = input.wait_for_transfer_notification();
      if (success)
        result->wait_for_render_notification = input.wait_for_render_notification();
      if (success)
        result->wait_for_gpu_fence = input.wait_for_gpu_fence();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRPlanePointData::DataView, ::device::mojom::blink::XRPlanePointDataPtr>::Read(
    ::device::mojom::blink::XRPlanePointData::DataView input,
    ::device::mojom::blink::XRPlanePointDataPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRPlanePointDataPtr result(::device::mojom::blink::XRPlanePointData::New());
  
      if (success)
        result->x = input.x();
      if (success)
        result->z = input.z();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRPlaneData::DataView, ::device::mojom::blink::XRPlaneDataPtr>::Read(
    ::device::mojom::blink::XRPlaneData::DataView input,
    ::device::mojom::blink::XRPlaneDataPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRPlaneDataPtr result(::device::mojom::blink::XRPlaneData::New());
  
      if (success)
        result->id = input.id();
      if (success && !input.ReadOrientation(&result->orientation))
        success = false;
      if (success && !input.ReadMojoFromPlane(&result->mojo_from_plane))
        success = false;
      if (success && !input.ReadPolygon(&result->polygon))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRPlaneDetectionData::DataView, ::device::mojom::blink::XRPlaneDetectionDataPtr>::Read(
    ::device::mojom::blink::XRPlaneDetectionData::DataView input,
    ::device::mojom::blink::XRPlaneDetectionDataPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRPlaneDetectionDataPtr result(::device::mojom::blink::XRPlaneDetectionData::New());
  
      if (success && !input.ReadAllPlanesIds(&result->all_planes_ids))
        success = false;
      if (success && !input.ReadUpdatedPlanesData(&result->updated_planes_data))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRAnchorData::DataView, ::device::mojom::blink::XRAnchorDataPtr>::Read(
    ::device::mojom::blink::XRAnchorData::DataView input,
    ::device::mojom::blink::XRAnchorDataPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRAnchorDataPtr result(::device::mojom::blink::XRAnchorData::New());
  
      if (success)
        result->id = input.id();
      if (success && !input.ReadMojoFromAnchor(&result->mojo_from_anchor))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRAnchorsData::DataView, ::device::mojom::blink::XRAnchorsDataPtr>::Read(
    ::device::mojom::blink::XRAnchorsData::DataView input,
    ::device::mojom::blink::XRAnchorsDataPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRAnchorsDataPtr result(::device::mojom::blink::XRAnchorsData::New());
  
      if (success && !input.ReadAllAnchorsIds(&result->all_anchors_ids))
        success = false;
      if (success && !input.ReadUpdatedAnchorsData(&result->updated_anchors_data))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRHitTestSubscriptionResultData::DataView, ::device::mojom::blink::XRHitTestSubscriptionResultDataPtr>::Read(
    ::device::mojom::blink::XRHitTestSubscriptionResultData::DataView input,
    ::device::mojom::blink::XRHitTestSubscriptionResultDataPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRHitTestSubscriptionResultDataPtr result(::device::mojom::blink::XRHitTestSubscriptionResultData::New());
  
      if (success)
        result->subscription_id = input.subscription_id();
      if (success && !input.ReadHitTestResults(&result->hit_test_results))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRHitTestTransientInputSubscriptionResultData::DataView, ::device::mojom::blink::XRHitTestTransientInputSubscriptionResultDataPtr>::Read(
    ::device::mojom::blink::XRHitTestTransientInputSubscriptionResultData::DataView input,
    ::device::mojom::blink::XRHitTestTransientInputSubscriptionResultDataPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRHitTestTransientInputSubscriptionResultDataPtr result(::device::mojom::blink::XRHitTestTransientInputSubscriptionResultData::New());
  
      if (success)
        result->subscription_id = input.subscription_id();
      if (success && !input.ReadInputSourceIdToHitTestResults(&result->input_source_id_to_hit_test_results))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRHitTestSubscriptionResultsData::DataView, ::device::mojom::blink::XRHitTestSubscriptionResultsDataPtr>::Read(
    ::device::mojom::blink::XRHitTestSubscriptionResultsData::DataView input,
    ::device::mojom::blink::XRHitTestSubscriptionResultsDataPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRHitTestSubscriptionResultsDataPtr result(::device::mojom::blink::XRHitTestSubscriptionResultsData::New());
  
      if (success && !input.ReadResults(&result->results))
        success = false;
      if (success && !input.ReadTransientInputResults(&result->transient_input_results))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::RgbTupleF32::DataView, ::device::mojom::blink::RgbTupleF32Ptr>::Read(
    ::device::mojom::blink::RgbTupleF32::DataView input,
    ::device::mojom::blink::RgbTupleF32Ptr* output) {
  bool success = true;
  ::device::mojom::blink::RgbTupleF32Ptr result(::device::mojom::blink::RgbTupleF32::New());
  
      if (success)
        result->red = input.red();
      if (success)
        result->green = input.green();
      if (success)
        result->blue = input.blue();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRSphericalHarmonics::DataView, ::device::mojom::blink::XRSphericalHarmonicsPtr>::Read(
    ::device::mojom::blink::XRSphericalHarmonics::DataView input,
    ::device::mojom::blink::XRSphericalHarmonicsPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRSphericalHarmonicsPtr result(::device::mojom::blink::XRSphericalHarmonics::New());
  
      if (success && !input.ReadCoefficients(&result->coefficients))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::RgbaTupleF16::DataView, ::device::mojom::blink::RgbaTupleF16Ptr>::Read(
    ::device::mojom::blink::RgbaTupleF16::DataView input,
    ::device::mojom::blink::RgbaTupleF16Ptr* output) {
  bool success = true;
  ::device::mojom::blink::RgbaTupleF16Ptr result(::device::mojom::blink::RgbaTupleF16::New());
  
      if (success)
        result->red = input.red();
      if (success)
        result->green = input.green();
      if (success)
        result->blue = input.blue();
      if (success)
        result->alpha = input.alpha();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRCubeMap::DataView, ::device::mojom::blink::XRCubeMapPtr>::Read(
    ::device::mojom::blink::XRCubeMap::DataView input,
    ::device::mojom::blink::XRCubeMapPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRCubeMapPtr result(::device::mojom::blink::XRCubeMap::New());
  
      if (success)
        result->width_and_height = input.width_and_height();
      if (success && !input.ReadPositiveX(&result->positive_x))
        success = false;
      if (success && !input.ReadNegativeX(&result->negative_x))
        success = false;
      if (success && !input.ReadPositiveY(&result->positive_y))
        success = false;
      if (success && !input.ReadNegativeY(&result->negative_y))
        success = false;
      if (success && !input.ReadPositiveZ(&result->positive_z))
        success = false;
      if (success && !input.ReadNegativeZ(&result->negative_z))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRLightProbe::DataView, ::device::mojom::blink::XRLightProbePtr>::Read(
    ::device::mojom::blink::XRLightProbe::DataView input,
    ::device::mojom::blink::XRLightProbePtr* output) {
  bool success = true;
  ::device::mojom::blink::XRLightProbePtr result(::device::mojom::blink::XRLightProbe::New());
  
      if (success && !input.ReadSphericalHarmonics(&result->spherical_harmonics))
        success = false;
      if (success && !input.ReadMainLightDirection(&result->main_light_direction))
        success = false;
      if (success && !input.ReadMainLightIntensity(&result->main_light_intensity))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRReflectionProbe::DataView, ::device::mojom::blink::XRReflectionProbePtr>::Read(
    ::device::mojom::blink::XRReflectionProbe::DataView input,
    ::device::mojom::blink::XRReflectionProbePtr* output) {
  bool success = true;
  ::device::mojom::blink::XRReflectionProbePtr result(::device::mojom::blink::XRReflectionProbe::New());
  
      if (success && !input.ReadCubeMap(&result->cube_map))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRLightEstimationData::DataView, ::device::mojom::blink::XRLightEstimationDataPtr>::Read(
    ::device::mojom::blink::XRLightEstimationData::DataView input,
    ::device::mojom::blink::XRLightEstimationDataPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRLightEstimationDataPtr result(::device::mojom::blink::XRLightEstimationData::New());
  
      if (success && !input.ReadLightProbe(&result->light_probe))
        success = false;
      if (success && !input.ReadReflectionProbe(&result->reflection_probe))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRDepthDataStillValid::DataView, ::device::mojom::blink::XRDepthDataStillValidPtr>::Read(
    ::device::mojom::blink::XRDepthDataStillValid::DataView input,
    ::device::mojom::blink::XRDepthDataStillValidPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRDepthDataStillValidPtr result(::device::mojom::blink::XRDepthDataStillValid::New());
  
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRDepthDataUpdated::DataView, ::device::mojom::blink::XRDepthDataUpdatedPtr>::Read(
    ::device::mojom::blink::XRDepthDataUpdated::DataView input,
    ::device::mojom::blink::XRDepthDataUpdatedPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRDepthDataUpdatedPtr result(::device::mojom::blink::XRDepthDataUpdated::New());
  
      if (success && !input.ReadTimeDelta(&result->time_delta))
        success = false;
      if (success && !input.ReadPixelData(&result->pixel_data))
        success = false;
      if (success && !input.ReadNormTextureFromNormView(&result->norm_texture_from_norm_view))
        success = false;
      if (success && !input.ReadSize(&result->size))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRFrameData::DataView, ::device::mojom::blink::XRFrameDataPtr>::Read(
    ::device::mojom::blink::XRFrameData::DataView input,
    ::device::mojom::blink::XRFrameDataPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRFrameDataPtr result(::device::mojom::blink::XRFrameData::New());
  
      if (success && !input.ReadPose(&result->pose))
        success = false;
      if (success && !input.ReadTimeDelta(&result->time_delta))
        success = false;
      if (success && !input.ReadBufferHolder(&result->buffer_holder))
        success = false;
      if (success && !input.ReadCameraImageBufferHolder(&result->camera_image_buffer_holder))
        success = false;
      if (success && !input.ReadDepthData(&result->depth_data))
        success = false;
      if (success)
        result->mojo_space_reset = input.mojo_space_reset();
      if (success)
        result->frame_id = input.frame_id();
      if (success && !input.ReadLeftEye(&result->left_eye))
        success = false;
      if (success && !input.ReadRightEye(&result->right_eye))
        success = false;
      if (success && !input.ReadInputState(&result->input_state))
        success = false;
      if (success)
        result->stage_parameters_updated = input.stage_parameters_updated();
      if (success && !input.ReadStageParameters(&result->stage_parameters))
        success = false;
      if (success && !input.ReadDetectedPlanesData(&result->detected_planes_data))
        success = false;
      if (success && !input.ReadAnchorsData(&result->anchors_data))
        success = false;
      if (success && !input.ReadLightEstimationData(&result->light_estimation_data))
        success = false;
      if (success && !input.ReadHitTestSubscriptionResults(&result->hit_test_subscription_results))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::RequestSessionSuccess::DataView, ::device::mojom::blink::RequestSessionSuccessPtr>::Read(
    ::device::mojom::blink::RequestSessionSuccess::DataView input,
    ::device::mojom::blink::RequestSessionSuccessPtr* output) {
  bool success = true;
  ::device::mojom::blink::RequestSessionSuccessPtr result(::device::mojom::blink::RequestSessionSuccess::New());
  
      if (success && !input.ReadSession(&result->session))
        success = false;
      if (success) {
        result->metrics_recorder =
            input.TakeMetricsRecorder<decltype(result->metrics_recorder)>();
      }
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::device::mojom::blink::XRFrameDataRequestOptions::DataView, ::device::mojom::blink::XRFrameDataRequestOptionsPtr>::Read(
    ::device::mojom::blink::XRFrameDataRequestOptions::DataView input,
    ::device::mojom::blink::XRFrameDataRequestOptionsPtr* output) {
  bool success = true;
  ::device::mojom::blink::XRFrameDataRequestOptionsPtr result(::device::mojom::blink::XRFrameDataRequestOptions::New());
  
      if (success)
        result->include_lighting_estimation_data = input.include_lighting_estimation_data();
  *output = std::move(result);
  return success;
}

// static
bool UnionTraits<::device::mojom::blink::XRNativeOriginInformation::DataView, ::device::mojom::blink::XRNativeOriginInformationPtr>::Read(
    ::device::mojom::blink::XRNativeOriginInformation::DataView input,
    ::device::mojom::blink::XRNativeOriginInformationPtr* output) {
  using UnionType = ::device::mojom::blink::XRNativeOriginInformation;
  using Tag = UnionType::Tag;

  switch (input.tag()) {
    case Tag::INPUT_SOURCE_ID: {
      *output = UnionType::NewInputSourceId(input.input_source_id());
      break;
    }
    case Tag::PLANE_ID: {
      *output = UnionType::NewPlaneId(input.plane_id());
      break;
    }
    case Tag::ANCHOR_ID: {
      *output = UnionType::NewAnchorId(input.anchor_id());
      break;
    }
    case Tag::REFERENCE_SPACE_TYPE: {
      ::device::mojom::blink::XRReferenceSpaceType result_reference_space_type;
      if (!input.ReadReferenceSpaceType(&result_reference_space_type))
        return false;

      *output = UnionType::NewReferenceSpaceType(result_reference_space_type);
      break;
    }
    default:
      return false;
  }
  return true;
}

// static
bool UnionTraits<::device::mojom::blink::XRDepthData::DataView, ::device::mojom::blink::XRDepthDataPtr>::Read(
    ::device::mojom::blink::XRDepthData::DataView input,
    ::device::mojom::blink::XRDepthDataPtr* output) {
  using UnionType = ::device::mojom::blink::XRDepthData;
  using Tag = UnionType::Tag;

  switch (input.tag()) {
    case Tag::DATA_STILL_VALID: {
      ::device::mojom::blink::XRDepthDataStillValidPtr result_data_still_valid;
      if (!input.ReadDataStillValid(&result_data_still_valid))
        return false;

      *output = UnionType::NewDataStillValid(
          std::move(result_data_still_valid));
      break;
    }
    case Tag::UPDATED_DEPTH_DATA: {
      ::device::mojom::blink::XRDepthDataUpdatedPtr result_updated_depth_data;
      if (!input.ReadUpdatedDepthData(&result_updated_depth_data))
        return false;

      *output = UnionType::NewUpdatedDepthData(
          std::move(result_updated_depth_data));
      break;
    }
    default:
      return false;
  }
  return true;
}

// static
bool UnionTraits<::device::mojom::blink::RequestSessionResult::DataView, ::device::mojom::blink::RequestSessionResultPtr>::Read(
    ::device::mojom::blink::RequestSessionResult::DataView input,
    ::device::mojom::blink::RequestSessionResultPtr* output) {
  using UnionType = ::device::mojom::blink::RequestSessionResult;
  using Tag = UnionType::Tag;

  switch (input.tag()) {
    case Tag::SUCCESS: {
      ::device::mojom::blink::RequestSessionSuccessPtr result_success;
      if (!input.ReadSuccess(&result_success))
        return false;

      *output = UnionType::NewSuccess(
          std::move(result_success));
      break;
    }
    case Tag::FAILURE_REASON: {
      ::device::mojom::blink::RequestSessionError result_failure_reason;
      if (!input.ReadFailureReason(&result_failure_reason))
        return false;

      *output = UnionType::NewFailureReason(result_failure_reason);
      break;
    }
    default:
      return false;
  }
  return true;
}

}  // namespace mojo

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