// content/browser/xr/webxr_internals/mojom/webxr_internals.mojom.cc is auto generated by mojom_bindings_generator.py, do not edit

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

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

#include "content/browser/xr/webxr_internals/mojom/webxr_internals.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/notreached.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.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/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization.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_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "content/browser/xr/webxr_internals/mojom/webxr_internals.mojom-params-data.h"
#include "content/browser/xr/webxr_internals/mojom/webxr_internals.mojom-shared-message-ids.h"

#include "content/browser/xr/webxr_internals/mojom/webxr_internals.mojom-import-headers.h"
#include "content/browser/xr/webxr_internals/mojom/webxr_internals.mojom-test-utils.h"


namespace webxr::mojom {
DeviceInfo::DeviceInfo()
    : operating_system_name(),
      operating_system_version(),
      gpu_gl_vendor(),
      gpu_gl_renderer() {}

DeviceInfo::DeviceInfo(
    const std::string& operating_system_name_in,
    const std::string& operating_system_version_in,
    const std::string& gpu_gl_vendor_in,
    const std::string& gpu_gl_renderer_in)
    : operating_system_name(std::move(operating_system_name_in)),
      operating_system_version(std::move(operating_system_version_in)),
      gpu_gl_vendor(std::move(gpu_gl_vendor_in)),
      gpu_gl_renderer(std::move(gpu_gl_renderer_in)) {}

DeviceInfo::~DeviceInfo() = default;
size_t DeviceInfo::Hash(size_t seed) const {
  seed = mojo::internal::Hash(seed, this->operating_system_name);
  seed = mojo::internal::Hash(seed, this->operating_system_version);
  seed = mojo::internal::Hash(seed, this->gpu_gl_vendor);
  seed = mojo::internal::Hash(seed, this->gpu_gl_renderer);
  return seed;
}

void DeviceInfo::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "operating_system_name"), this->operating_system_name,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "operating_system_version"), this->operating_system_version,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "gpu_gl_vendor"), this->gpu_gl_vendor,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "gpu_gl_renderer"), this->gpu_gl_renderer,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool DeviceInfo::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
SessionRequestedRecord::SessionRequestedRecord()
    : options(),
      requested_time() {}

SessionRequestedRecord::SessionRequestedRecord(
    ::device::mojom::XRSessionOptionsPtr options_in,
    ::base::Time requested_time_in)
    : options(std::move(options_in)),
      requested_time(std::move(requested_time_in)) {}

SessionRequestedRecord::~SessionRequestedRecord() = default;

void SessionRequestedRecord::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "options"), this->options,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ::device::mojom::XRSessionOptionsPtr>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "requested_time"), this->requested_time,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ::base::Time>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool SessionRequestedRecord::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
SessionRejectedRecord::SessionRejectedRecord()
    : trace_id(),
      failure_reason(),
      rejected_time(),
      failure_reason_description(),
      rejected_features() {}

SessionRejectedRecord::SessionRejectedRecord(
    uint64_t trace_id_in,
    ::device::mojom::RequestSessionError failure_reason_in,
    ::base::Time rejected_time_in,
    const std::string& failure_reason_description_in,
    std::vector<::device::mojom::XRSessionFeature> rejected_features_in)
    : trace_id(std::move(trace_id_in)),
      failure_reason(std::move(failure_reason_in)),
      rejected_time(std::move(rejected_time_in)),
      failure_reason_description(std::move(failure_reason_description_in)),
      rejected_features(std::move(rejected_features_in)) {}

SessionRejectedRecord::~SessionRejectedRecord() = default;

void SessionRejectedRecord::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "trace_id"), this->trace_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type uint64_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "failure_reason"), this->failure_reason,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ::device::mojom::RequestSessionError>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "rejected_time"), this->rejected_time,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ::base::Time>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "failure_reason_description"), this->failure_reason_description,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "rejected_features"), this->rejected_features,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::vector<::device::mojom::XRSessionFeature>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool SessionRejectedRecord::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
SessionStartedRecord::SessionStartedRecord()
    : trace_id(),
      device_id(),
      started_time() {}

SessionStartedRecord::SessionStartedRecord(
    uint64_t trace_id_in,
    ::device::mojom::XRDeviceId device_id_in,
    ::base::Time started_time_in)
    : trace_id(std::move(trace_id_in)),
      device_id(std::move(device_id_in)),
      started_time(std::move(started_time_in)) {}

SessionStartedRecord::~SessionStartedRecord() = default;

void SessionStartedRecord::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "trace_id"), this->trace_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type uint64_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "device_id"), this->device_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ::device::mojom::XRDeviceId>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "started_time"), this->started_time,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ::base::Time>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool SessionStartedRecord::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
SessionStoppedRecord::SessionStoppedRecord()
    : trace_id(),
      stopped_time() {}

SessionStoppedRecord::SessionStoppedRecord(
    uint64_t trace_id_in,
    ::base::Time stopped_time_in)
    : trace_id(std::move(trace_id_in)),
      stopped_time(std::move(stopped_time_in)) {}

SessionStoppedRecord::~SessionStoppedRecord() = default;

void SessionStoppedRecord::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "trace_id"), this->trace_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type uint64_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "stopped_time"), this->stopped_time,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ::base::Time>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool SessionStoppedRecord::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
RuntimeInfo::RuntimeInfo()
    : device_id(),
      supported_features(),
      is_ar_blend_mode_supported() {}

RuntimeInfo::RuntimeInfo(
    ::device::mojom::XRDeviceId device_id_in,
    std::vector<::device::mojom::XRSessionFeature> supported_features_in,
    bool is_ar_blend_mode_supported_in)
    : device_id(std::move(device_id_in)),
      supported_features(std::move(supported_features_in)),
      is_ar_blend_mode_supported(std::move(is_ar_blend_mode_supported_in)) {}

RuntimeInfo::~RuntimeInfo() = default;

void RuntimeInfo::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "device_id"), this->device_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ::device::mojom::XRDeviceId>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "supported_features"), this->supported_features,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::vector<::device::mojom::XRSessionFeature>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "is_ar_blend_mode_supported"), this->is_ar_blend_mode_supported,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool RuntimeInfo::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
// The declaration includes the definition on other builds.

WebXrInternalsHandler::IPCStableHashFunction WebXrInternalsHandler::MessageToMethodInfo_(mojo::Message& message) {
#if !BUILDFLAG(IS_FUCHSIA)
  switch (static_cast<messages::WebXrInternalsHandler>(message.name())) {
    case messages::WebXrInternalsHandler::kGetDeviceInfo: {
      return &WebXrInternalsHandler::GetDeviceInfo_Sym::IPCStableHash;
    }
    case messages::WebXrInternalsHandler::kGetActiveRuntimes: {
      return &WebXrInternalsHandler::GetActiveRuntimes_Sym::IPCStableHash;
    }
    case messages::WebXrInternalsHandler::kSubscribeToEvents: {
      return &WebXrInternalsHandler::SubscribeToEvents_Sym::IPCStableHash;
    }
  }
#endif  // !BUILDFLAG(IS_FUCHSIA)
  return nullptr;
}


const char* WebXrInternalsHandler::MessageToMethodName_(mojo::Message& message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (!is_response) {
    switch (static_cast<messages::WebXrInternalsHandler>(message.name())) {
      case messages::WebXrInternalsHandler::kGetDeviceInfo:
            return "Receive webxr::mojom::WebXrInternalsHandler::GetDeviceInfo";
      case messages::WebXrInternalsHandler::kGetActiveRuntimes:
            return "Receive webxr::mojom::WebXrInternalsHandler::GetActiveRuntimes";
      case messages::WebXrInternalsHandler::kSubscribeToEvents:
            return "Receive webxr::mojom::WebXrInternalsHandler::SubscribeToEvents";
    }
  } else {
    switch (static_cast<messages::WebXrInternalsHandler>(message.name())) {
      case messages::WebXrInternalsHandler::kGetDeviceInfo:
            return "Receive reply webxr::mojom::WebXrInternalsHandler::GetDeviceInfo";
      case messages::WebXrInternalsHandler::kGetActiveRuntimes:
            return "Receive reply webxr::mojom::WebXrInternalsHandler::GetActiveRuntimes";
      case messages::WebXrInternalsHandler::kSubscribeToEvents:
            return "Receive reply webxr::mojom::WebXrInternalsHandler::SubscribeToEvents";
    }
  }
  return "Receive unknown mojo message";
#else
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (is_response) {
    return "Receive mojo reply";
  } else {
    return "Receive mojo message";
  }
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
}

#if !BUILDFLAG(IS_FUCHSIA)
uint32_t WebXrInternalsHandler::GetDeviceInfo_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x20c0879e;  // IPCStableHash for webxr::mojom::WebXrInternalsHandler::GetDeviceInfo
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t WebXrInternalsHandler::GetActiveRuntimes_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x586d83c4;  // IPCStableHash for webxr::mojom::WebXrInternalsHandler::GetActiveRuntimes
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t WebXrInternalsHandler::SubscribeToEvents_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x7df06dd4;  // IPCStableHash for webxr::mojom::WebXrInternalsHandler::SubscribeToEvents
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
# endif // !BUILDFLAG(IS_FUCHSIA)

class WebXrInternalsHandler_GetDeviceInfo_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  WebXrInternalsHandler_GetDeviceInfo_ForwardToCallback(
      WebXrInternalsHandler::GetDeviceInfoCallback callback
      ) : callback_(std::move(callback)) {
  }

  WebXrInternalsHandler_GetDeviceInfo_ForwardToCallback(const WebXrInternalsHandler_GetDeviceInfo_ForwardToCallback&) = delete;
  WebXrInternalsHandler_GetDeviceInfo_ForwardToCallback& operator=(const WebXrInternalsHandler_GetDeviceInfo_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  WebXrInternalsHandler::GetDeviceInfoCallback callback_;
};

class WebXrInternalsHandler_GetActiveRuntimes_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  WebXrInternalsHandler_GetActiveRuntimes_ForwardToCallback(
      WebXrInternalsHandler::GetActiveRuntimesCallback callback
      ) : callback_(std::move(callback)) {
  }

  WebXrInternalsHandler_GetActiveRuntimes_ForwardToCallback(const WebXrInternalsHandler_GetActiveRuntimes_ForwardToCallback&) = delete;
  WebXrInternalsHandler_GetActiveRuntimes_ForwardToCallback& operator=(const WebXrInternalsHandler_GetActiveRuntimes_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  WebXrInternalsHandler::GetActiveRuntimesCallback callback_;
};

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

void WebXrInternalsHandlerProxy::GetDeviceInfo(
    GetDeviceInfoCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "Send webxr::mojom::WebXrInternalsHandler::GetDeviceInfo");
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::WebXrInternalsHandler::kGetDeviceInfo), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::WebXrInternalsHandler_GetDeviceInfo_Params_Data> params(
          message);
  params.Allocate();

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(WebXrInternalsHandler::Name_);
  message.set_method_name("GetDeviceInfo");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new WebXrInternalsHandler_GetDeviceInfo_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}

void WebXrInternalsHandlerProxy::GetActiveRuntimes(
    GetActiveRuntimesCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "Send webxr::mojom::WebXrInternalsHandler::GetActiveRuntimes");
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::WebXrInternalsHandler::kGetActiveRuntimes), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::WebXrInternalsHandler_GetActiveRuntimes_Params_Data> params(
          message);
  params.Allocate();

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(WebXrInternalsHandler::Name_);
  message.set_method_name("GetActiveRuntimes");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new WebXrInternalsHandler_GetActiveRuntimes_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}

void WebXrInternalsHandlerProxy::SubscribeToEvents(
    ::mojo::PendingRemote<XRInternalsSessionListener> in_listener) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send webxr::mojom::WebXrInternalsHandler::SubscribeToEvents", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("listener"), in_listener,
                        "<value of type ::mojo::PendingRemote<XRInternalsSessionListener>>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::WebXrInternalsHandler::kSubscribeToEvents), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::WebXrInternalsHandler_SubscribeToEvents_Params_Data> params(
          message);
  params.Allocate();

  
  mojo::internal::Serialize<mojo::InterfacePtrDataView<::webxr::mojom::XRInternalsSessionListenerInterfaceBase>>(
    in_listener,
    &params->listener,
    &params.message());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(!mojo::internal::IsHandleOrInterfaceValid(params->listener)),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
    "invalid listener in WebXrInternalsHandler.SubscribeToEvents request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(WebXrInternalsHandler::Name_);
  message.set_method_name("SubscribeToEvents");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}
class WebXrInternalsHandler_GetDeviceInfo_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static WebXrInternalsHandler::GetDeviceInfoCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<WebXrInternalsHandler_GetDeviceInfo_ProxyToResponder> proxy(
        new WebXrInternalsHandler_GetDeviceInfo_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&WebXrInternalsHandler_GetDeviceInfo_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~WebXrInternalsHandler_GetDeviceInfo_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.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  WebXrInternalsHandler_GetDeviceInfo_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "WebXrInternalsHandler::GetDeviceInfoCallback 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(
      DeviceInfoPtr in_device_info);
};

bool WebXrInternalsHandler_GetDeviceInfo_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::WebXrInternalsHandler_GetDeviceInfo_ResponseParams_Data* params =
      reinterpret_cast<
          internal::WebXrInternalsHandler_GetDeviceInfo_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for WebXrInternalsHandler.0
  bool success = true;
  DeviceInfoPtr p_device_info{};
  WebXrInternalsHandler_GetDeviceInfo_ResponseParamsDataView input_data_view(params, message);
  
  if (success && !input_data_view.ReadDeviceInfo(&p_device_info))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        WebXrInternalsHandler::Name_, 0, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run(
std::move(p_device_info));
  }
  return true;
}

void WebXrInternalsHandler_GetDeviceInfo_ProxyToResponder::Run(
    DeviceInfoPtr in_device_info) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply webxr::mojom::WebXrInternalsHandler::GetDeviceInfo", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("device_info"), in_device_info,
                        "<value of type DeviceInfoPtr>");
   });
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::WebXrInternalsHandler::kGetDeviceInfo), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::WebXrInternalsHandler_GetDeviceInfo_ResponseParams_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->device_info)::BaseType> device_info_fragment(
          params.message());
  
  mojo::internal::Serialize<::webxr::mojom::DeviceInfoDataView>(
    in_device_info,
    device_info_fragment);

  params->device_info.Set(
      device_info_fragment.is_null() ? nullptr : device_info_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->device_info.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null device_info in ");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(WebXrInternalsHandler::Name_);
  message.set_method_name("GetDeviceInfo");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, 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 WebXrInternalsHandler_GetActiveRuntimes_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static WebXrInternalsHandler::GetActiveRuntimesCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<WebXrInternalsHandler_GetActiveRuntimes_ProxyToResponder> proxy(
        new WebXrInternalsHandler_GetActiveRuntimes_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&WebXrInternalsHandler_GetActiveRuntimes_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~WebXrInternalsHandler_GetActiveRuntimes_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.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  WebXrInternalsHandler_GetActiveRuntimes_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "WebXrInternalsHandler::GetActiveRuntimesCallback 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(
      std::vector<RuntimeInfoPtr> in_active_runtimes);
};

bool WebXrInternalsHandler_GetActiveRuntimes_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::WebXrInternalsHandler_GetActiveRuntimes_ResponseParams_Data* params =
      reinterpret_cast<
          internal::WebXrInternalsHandler_GetActiveRuntimes_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for WebXrInternalsHandler.1
  bool success = true;
  std::vector<RuntimeInfoPtr> p_active_runtimes{};
  WebXrInternalsHandler_GetActiveRuntimes_ResponseParamsDataView input_data_view(params, message);
  
  if (success && !input_data_view.ReadActiveRuntimes(&p_active_runtimes))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        WebXrInternalsHandler::Name_, 1, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run(
std::move(p_active_runtimes));
  }
  return true;
}

void WebXrInternalsHandler_GetActiveRuntimes_ProxyToResponder::Run(
    std::vector<RuntimeInfoPtr> in_active_runtimes) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply webxr::mojom::WebXrInternalsHandler::GetActiveRuntimes", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("active_runtimes"), in_active_runtimes,
                        "<value of type std::vector<RuntimeInfoPtr>>");
   });
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::WebXrInternalsHandler::kGetActiveRuntimes), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::WebXrInternalsHandler_GetActiveRuntimes_ResponseParams_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->active_runtimes)::BaseType>
      active_runtimes_fragment(params.message());
  constexpr const mojo::internal::ContainerValidateParams& active_runtimes_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  
  mojo::internal::Serialize<mojo::ArrayDataView<::webxr::mojom::RuntimeInfoDataView>>(
    in_active_runtimes,
    active_runtimes_fragment,
    &active_runtimes_validate_params);

  params->active_runtimes.Set(
      active_runtimes_fragment.is_null() ? nullptr : active_runtimes_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->active_runtimes.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null active_runtimes in ");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(WebXrInternalsHandler::Name_);
  message.set_method_name("GetActiveRuntimes");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, 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 WebXrInternalsHandlerStubDispatch::Accept(
    WebXrInternalsHandler* impl,
    mojo::Message* message) {
  switch (static_cast<messages::WebXrInternalsHandler>(message->header()->name)) {
    case messages::WebXrInternalsHandler::kGetDeviceInfo: {
      break;
    }
    case messages::WebXrInternalsHandler::kGetActiveRuntimes: {
      break;
    }
    case messages::WebXrInternalsHandler::kSubscribeToEvents: {
      DCHECK(message->is_serialized());
      internal::WebXrInternalsHandler_SubscribeToEvents_Params_Data* params =
          reinterpret_cast<internal::WebXrInternalsHandler_SubscribeToEvents_Params_Data*>(
              message->mutable_payload());
      

      // Validation for WebXrInternalsHandler.2
      bool success = true;
      ::mojo::PendingRemote<XRInternalsSessionListener> p_listener{};
      WebXrInternalsHandler_SubscribeToEvents_ParamsDataView input_data_view(params, message);
      
      if (success) {
        p_listener =
            input_data_view.TakeListener<decltype(p_listener)>();
      }
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            WebXrInternalsHandler::Name_, 2, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SubscribeToEvents(        
        std::move(p_listener));
      return true;
    }
  }
  return false;
}

// static
bool WebXrInternalsHandlerStubDispatch::AcceptWithResponder(
    WebXrInternalsHandler* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  [[maybe_unused]] const bool message_is_sync =
      message->has_flag(mojo::Message::kFlagIsSync);
  [[maybe_unused]] const uint64_t request_id = message->request_id();
  switch (static_cast<messages::WebXrInternalsHandler>(message->header()->name)) {
    case messages::WebXrInternalsHandler::kGetDeviceInfo: {
      internal::WebXrInternalsHandler_GetDeviceInfo_Params_Data* params =
          reinterpret_cast<
              internal::WebXrInternalsHandler_GetDeviceInfo_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for WebXrInternalsHandler.0
      bool success = true;
      WebXrInternalsHandler_GetDeviceInfo_ParamsDataView input_data_view(params, message);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            WebXrInternalsHandler::Name_, 0, false);
        return false;
      }
      auto callback =
          WebXrInternalsHandler_GetDeviceInfo_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->GetDeviceInfo(std::move(callback));
      return true;
    }
    case messages::WebXrInternalsHandler::kGetActiveRuntimes: {
      internal::WebXrInternalsHandler_GetActiveRuntimes_Params_Data* params =
          reinterpret_cast<
              internal::WebXrInternalsHandler_GetActiveRuntimes_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for WebXrInternalsHandler.1
      bool success = true;
      WebXrInternalsHandler_GetActiveRuntimes_ParamsDataView input_data_view(params, message);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            WebXrInternalsHandler::Name_, 1, false);
        return false;
      }
      auto callback =
          WebXrInternalsHandler_GetActiveRuntimes_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->GetActiveRuntimes(std::move(callback));
      return true;
    }
    case messages::WebXrInternalsHandler::kSubscribeToEvents: {
      break;
    }
  }
  return false;
}
namespace {
}  // namespace
static const mojo::internal::GenericValidationInfo kWebXrInternalsHandlerValidationInfo[] = {
    { &internal::WebXrInternalsHandler_GetDeviceInfo_Params_Data::Validate,
     &internal::WebXrInternalsHandler_GetDeviceInfo_ResponseParams_Data::Validate},
    { &internal::WebXrInternalsHandler_GetActiveRuntimes_Params_Data::Validate,
     &internal::WebXrInternalsHandler_GetActiveRuntimes_ResponseParams_Data::Validate},
    { &internal::WebXrInternalsHandler_SubscribeToEvents_Params_Data::Validate,
     nullptr /* no response */},
};

bool WebXrInternalsHandlerRequestValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateRequestGenericPacked(
    message,
    ::webxr::mojom::WebXrInternalsHandler::Name_,
    kWebXrInternalsHandlerValidationInfo);
}

bool WebXrInternalsHandlerResponseValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateResponseGenericPacked(
    message,
    ::webxr::mojom::WebXrInternalsHandler::Name_,
    kWebXrInternalsHandlerValidationInfo);
}
// The declaration includes the definition on other builds.

XRInternalsSessionListener::IPCStableHashFunction XRInternalsSessionListener::MessageToMethodInfo_(mojo::Message& message) {
#if !BUILDFLAG(IS_FUCHSIA)
  switch (static_cast<messages::XRInternalsSessionListener>(message.name())) {
    case messages::XRInternalsSessionListener::kLogXrSessionRequested: {
      return &XRInternalsSessionListener::LogXrSessionRequested_Sym::IPCStableHash;
    }
    case messages::XRInternalsSessionListener::kLogXrSessionRejected: {
      return &XRInternalsSessionListener::LogXrSessionRejected_Sym::IPCStableHash;
    }
    case messages::XRInternalsSessionListener::kLogXrSessionStarted: {
      return &XRInternalsSessionListener::LogXrSessionStarted_Sym::IPCStableHash;
    }
    case messages::XRInternalsSessionListener::kLogXrSessionStopped: {
      return &XRInternalsSessionListener::LogXrSessionStopped_Sym::IPCStableHash;
    }
    case messages::XRInternalsSessionListener::kLogXrRuntimeAdded: {
      return &XRInternalsSessionListener::LogXrRuntimeAdded_Sym::IPCStableHash;
    }
    case messages::XRInternalsSessionListener::kLogXrRuntimeRemoved: {
      return &XRInternalsSessionListener::LogXrRuntimeRemoved_Sym::IPCStableHash;
    }
    case messages::XRInternalsSessionListener::kLogFrameData: {
      return &XRInternalsSessionListener::LogFrameData_Sym::IPCStableHash;
    }
    case messages::XRInternalsSessionListener::kLogConsoleMessages: {
      return &XRInternalsSessionListener::LogConsoleMessages_Sym::IPCStableHash;
    }
  }
#endif  // !BUILDFLAG(IS_FUCHSIA)
  return nullptr;
}


const char* XRInternalsSessionListener::MessageToMethodName_(mojo::Message& message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (!is_response) {
    switch (static_cast<messages::XRInternalsSessionListener>(message.name())) {
      case messages::XRInternalsSessionListener::kLogXrSessionRequested:
            return "Receive webxr::mojom::XRInternalsSessionListener::LogXrSessionRequested";
      case messages::XRInternalsSessionListener::kLogXrSessionRejected:
            return "Receive webxr::mojom::XRInternalsSessionListener::LogXrSessionRejected";
      case messages::XRInternalsSessionListener::kLogXrSessionStarted:
            return "Receive webxr::mojom::XRInternalsSessionListener::LogXrSessionStarted";
      case messages::XRInternalsSessionListener::kLogXrSessionStopped:
            return "Receive webxr::mojom::XRInternalsSessionListener::LogXrSessionStopped";
      case messages::XRInternalsSessionListener::kLogXrRuntimeAdded:
            return "Receive webxr::mojom::XRInternalsSessionListener::LogXrRuntimeAdded";
      case messages::XRInternalsSessionListener::kLogXrRuntimeRemoved:
            return "Receive webxr::mojom::XRInternalsSessionListener::LogXrRuntimeRemoved";
      case messages::XRInternalsSessionListener::kLogFrameData:
            return "Receive webxr::mojom::XRInternalsSessionListener::LogFrameData";
      case messages::XRInternalsSessionListener::kLogConsoleMessages:
            return "Receive webxr::mojom::XRInternalsSessionListener::LogConsoleMessages";
    }
  } else {
    switch (static_cast<messages::XRInternalsSessionListener>(message.name())) {
      case messages::XRInternalsSessionListener::kLogXrSessionRequested:
            return "Receive reply webxr::mojom::XRInternalsSessionListener::LogXrSessionRequested";
      case messages::XRInternalsSessionListener::kLogXrSessionRejected:
            return "Receive reply webxr::mojom::XRInternalsSessionListener::LogXrSessionRejected";
      case messages::XRInternalsSessionListener::kLogXrSessionStarted:
            return "Receive reply webxr::mojom::XRInternalsSessionListener::LogXrSessionStarted";
      case messages::XRInternalsSessionListener::kLogXrSessionStopped:
            return "Receive reply webxr::mojom::XRInternalsSessionListener::LogXrSessionStopped";
      case messages::XRInternalsSessionListener::kLogXrRuntimeAdded:
            return "Receive reply webxr::mojom::XRInternalsSessionListener::LogXrRuntimeAdded";
      case messages::XRInternalsSessionListener::kLogXrRuntimeRemoved:
            return "Receive reply webxr::mojom::XRInternalsSessionListener::LogXrRuntimeRemoved";
      case messages::XRInternalsSessionListener::kLogFrameData:
            return "Receive reply webxr::mojom::XRInternalsSessionListener::LogFrameData";
      case messages::XRInternalsSessionListener::kLogConsoleMessages:
            return "Receive reply webxr::mojom::XRInternalsSessionListener::LogConsoleMessages";
    }
  }
  return "Receive unknown mojo message";
#else
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (is_response) {
    return "Receive mojo reply";
  } else {
    return "Receive mojo message";
  }
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
}

#if !BUILDFLAG(IS_FUCHSIA)
uint32_t XRInternalsSessionListener::LogXrSessionRequested_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x660a1be3;  // IPCStableHash for webxr::mojom::XRInternalsSessionListener::LogXrSessionRequested
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t XRInternalsSessionListener::LogXrSessionRejected_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x6e9cab9e;  // IPCStableHash for webxr::mojom::XRInternalsSessionListener::LogXrSessionRejected
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t XRInternalsSessionListener::LogXrSessionStarted_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0xcdc5f923;  // IPCStableHash for webxr::mojom::XRInternalsSessionListener::LogXrSessionStarted
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t XRInternalsSessionListener::LogXrSessionStopped_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x6726c91e;  // IPCStableHash for webxr::mojom::XRInternalsSessionListener::LogXrSessionStopped
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t XRInternalsSessionListener::LogXrRuntimeAdded_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x397efe9b;  // IPCStableHash for webxr::mojom::XRInternalsSessionListener::LogXrRuntimeAdded
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t XRInternalsSessionListener::LogXrRuntimeRemoved_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x9ef52e69;  // IPCStableHash for webxr::mojom::XRInternalsSessionListener::LogXrRuntimeRemoved
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t XRInternalsSessionListener::LogFrameData_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0xc4696319;  // IPCStableHash for webxr::mojom::XRInternalsSessionListener::LogFrameData
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t XRInternalsSessionListener::LogConsoleMessages_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x068b14c8;  // IPCStableHash for webxr::mojom::XRInternalsSessionListener::LogConsoleMessages
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
# endif // !BUILDFLAG(IS_FUCHSIA)

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

void XRInternalsSessionListenerProxy::LogXrSessionRequested(
    SessionRequestedRecordPtr in_session_requested_record) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send webxr::mojom::XRInternalsSessionListener::LogXrSessionRequested", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("session_requested_record"), in_session_requested_record,
                        "<value of type SessionRequestedRecordPtr>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::XRInternalsSessionListener::kLogXrSessionRequested), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::XRInternalsSessionListener_LogXrSessionRequested_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->session_requested_record)::BaseType> session_requested_record_fragment(
          params.message());
  
  mojo::internal::Serialize<::webxr::mojom::SessionRequestedRecordDataView>(
    in_session_requested_record,
    session_requested_record_fragment);

  params->session_requested_record.Set(
      session_requested_record_fragment.is_null() ? nullptr : session_requested_record_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->session_requested_record.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null session_requested_record in XRInternalsSessionListener.LogXrSessionRequested request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRInternalsSessionListener::Name_);
  message.set_method_name("LogXrSessionRequested");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

void XRInternalsSessionListenerProxy::LogXrSessionRejected(
    SessionRejectedRecordPtr in_session_rejected_record) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send webxr::mojom::XRInternalsSessionListener::LogXrSessionRejected", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("session_rejected_record"), in_session_rejected_record,
                        "<value of type SessionRejectedRecordPtr>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::XRInternalsSessionListener::kLogXrSessionRejected), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::XRInternalsSessionListener_LogXrSessionRejected_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->session_rejected_record)::BaseType> session_rejected_record_fragment(
          params.message());
  
  mojo::internal::Serialize<::webxr::mojom::SessionRejectedRecordDataView>(
    in_session_rejected_record,
    session_rejected_record_fragment);

  params->session_rejected_record.Set(
      session_rejected_record_fragment.is_null() ? nullptr : session_rejected_record_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->session_rejected_record.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null session_rejected_record in XRInternalsSessionListener.LogXrSessionRejected request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRInternalsSessionListener::Name_);
  message.set_method_name("LogXrSessionRejected");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

void XRInternalsSessionListenerProxy::LogXrSessionStarted(
    SessionStartedRecordPtr in_session_started_record) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send webxr::mojom::XRInternalsSessionListener::LogXrSessionStarted", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("session_started_record"), in_session_started_record,
                        "<value of type SessionStartedRecordPtr>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::XRInternalsSessionListener::kLogXrSessionStarted), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::XRInternalsSessionListener_LogXrSessionStarted_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->session_started_record)::BaseType> session_started_record_fragment(
          params.message());
  
  mojo::internal::Serialize<::webxr::mojom::SessionStartedRecordDataView>(
    in_session_started_record,
    session_started_record_fragment);

  params->session_started_record.Set(
      session_started_record_fragment.is_null() ? nullptr : session_started_record_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->session_started_record.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null session_started_record in XRInternalsSessionListener.LogXrSessionStarted request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRInternalsSessionListener::Name_);
  message.set_method_name("LogXrSessionStarted");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

void XRInternalsSessionListenerProxy::LogXrSessionStopped(
    SessionStoppedRecordPtr in_session_stopped_record) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send webxr::mojom::XRInternalsSessionListener::LogXrSessionStopped", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("session_stopped_record"), in_session_stopped_record,
                        "<value of type SessionStoppedRecordPtr>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::XRInternalsSessionListener::kLogXrSessionStopped), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::XRInternalsSessionListener_LogXrSessionStopped_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->session_stopped_record)::BaseType> session_stopped_record_fragment(
          params.message());
  
  mojo::internal::Serialize<::webxr::mojom::SessionStoppedRecordDataView>(
    in_session_stopped_record,
    session_stopped_record_fragment);

  params->session_stopped_record.Set(
      session_stopped_record_fragment.is_null() ? nullptr : session_stopped_record_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->session_stopped_record.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null session_stopped_record in XRInternalsSessionListener.LogXrSessionStopped request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRInternalsSessionListener::Name_);
  message.set_method_name("LogXrSessionStopped");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

void XRInternalsSessionListenerProxy::LogXrRuntimeAdded(
    RuntimeInfoPtr in_runtime_added_record) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send webxr::mojom::XRInternalsSessionListener::LogXrRuntimeAdded", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("runtime_added_record"), in_runtime_added_record,
                        "<value of type RuntimeInfoPtr>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::XRInternalsSessionListener::kLogXrRuntimeAdded), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::XRInternalsSessionListener_LogXrRuntimeAdded_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->runtime_added_record)::BaseType> runtime_added_record_fragment(
          params.message());
  
  mojo::internal::Serialize<::webxr::mojom::RuntimeInfoDataView>(
    in_runtime_added_record,
    runtime_added_record_fragment);

  params->runtime_added_record.Set(
      runtime_added_record_fragment.is_null() ? nullptr : runtime_added_record_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->runtime_added_record.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null runtime_added_record in XRInternalsSessionListener.LogXrRuntimeAdded request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRInternalsSessionListener::Name_);
  message.set_method_name("LogXrRuntimeAdded");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

void XRInternalsSessionListenerProxy::LogXrRuntimeRemoved(
    ::device::mojom::XRDeviceId in_device_id) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send webxr::mojom::XRInternalsSessionListener::LogXrRuntimeRemoved", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("device_id"), in_device_id,
                        "<value of type ::device::mojom::XRDeviceId>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::XRInternalsSessionListener::kLogXrRuntimeRemoved), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::XRInternalsSessionListener_LogXrRuntimeRemoved_Params_Data> params(
          message);
  params.Allocate();

  
  mojo::internal::Serialize<::device::mojom::XRDeviceId>(
    in_device_id,
    &params->device_id);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRInternalsSessionListener::Name_);
  message.set_method_name("LogXrRuntimeRemoved");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

void XRInternalsSessionListenerProxy::LogFrameData(
    ::device::mojom::XrFrameStatisticsPtr in_xrframe_statistics) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send webxr::mojom::XRInternalsSessionListener::LogFrameData", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("xrframe_statistics"), in_xrframe_statistics,
                        "<value of type ::device::mojom::XrFrameStatisticsPtr>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::XRInternalsSessionListener::kLogFrameData), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::XRInternalsSessionListener_LogFrameData_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->xrframe_statistics)::BaseType> xrframe_statistics_fragment(
          params.message());
  
  mojo::internal::Serialize<::device::mojom::XrFrameStatisticsDataView>(
    in_xrframe_statistics,
    xrframe_statistics_fragment);

  params->xrframe_statistics.Set(
      xrframe_statistics_fragment.is_null() ? nullptr : xrframe_statistics_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->xrframe_statistics.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null xrframe_statistics in XRInternalsSessionListener.LogFrameData request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRInternalsSessionListener::Name_);
  message.set_method_name("LogFrameData");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

void XRInternalsSessionListenerProxy::LogConsoleMessages(
    ::device::mojom::XrLogMessagePtr in_xrlogging_statistics) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send webxr::mojom::XRInternalsSessionListener::LogConsoleMessages", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("xrlogging_statistics"), in_xrlogging_statistics,
                        "<value of type ::device::mojom::XrLogMessagePtr>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::XRInternalsSessionListener::kLogConsoleMessages), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::webxr::mojom::internal::XRInternalsSessionListener_LogConsoleMessages_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->xrlogging_statistics)::BaseType> xrlogging_statistics_fragment(
          params.message());
  
  mojo::internal::Serialize<::device::mojom::XrLogMessageDataView>(
    in_xrlogging_statistics,
    xrlogging_statistics_fragment);

  params->xrlogging_statistics.Set(
      xrlogging_statistics_fragment.is_null() ? nullptr : xrlogging_statistics_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->xrlogging_statistics.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null xrlogging_statistics in XRInternalsSessionListener.LogConsoleMessages request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(XRInternalsSessionListener::Name_);
  message.set_method_name("LogConsoleMessages");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

// static
bool XRInternalsSessionListenerStubDispatch::Accept(
    XRInternalsSessionListener* impl,
    mojo::Message* message) {
  switch (static_cast<messages::XRInternalsSessionListener>(message->header()->name)) {
    case messages::XRInternalsSessionListener::kLogXrSessionRequested: {
      DCHECK(message->is_serialized());
      internal::XRInternalsSessionListener_LogXrSessionRequested_Params_Data* params =
          reinterpret_cast<internal::XRInternalsSessionListener_LogXrSessionRequested_Params_Data*>(
              message->mutable_payload());
      

      // Validation for XRInternalsSessionListener.0
      bool success = true;
      SessionRequestedRecordPtr p_session_requested_record{};
      XRInternalsSessionListener_LogXrSessionRequested_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadSessionRequestedRecord(&p_session_requested_record))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRInternalsSessionListener::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->LogXrSessionRequested(        
        std::move(p_session_requested_record));
      return true;
    }
    case messages::XRInternalsSessionListener::kLogXrSessionRejected: {
      DCHECK(message->is_serialized());
      internal::XRInternalsSessionListener_LogXrSessionRejected_Params_Data* params =
          reinterpret_cast<internal::XRInternalsSessionListener_LogXrSessionRejected_Params_Data*>(
              message->mutable_payload());
      

      // Validation for XRInternalsSessionListener.1
      bool success = true;
      SessionRejectedRecordPtr p_session_rejected_record{};
      XRInternalsSessionListener_LogXrSessionRejected_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadSessionRejectedRecord(&p_session_rejected_record))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRInternalsSessionListener::Name_, 1, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->LogXrSessionRejected(        
        std::move(p_session_rejected_record));
      return true;
    }
    case messages::XRInternalsSessionListener::kLogXrSessionStarted: {
      DCHECK(message->is_serialized());
      internal::XRInternalsSessionListener_LogXrSessionStarted_Params_Data* params =
          reinterpret_cast<internal::XRInternalsSessionListener_LogXrSessionStarted_Params_Data*>(
              message->mutable_payload());
      

      // Validation for XRInternalsSessionListener.2
      bool success = true;
      SessionStartedRecordPtr p_session_started_record{};
      XRInternalsSessionListener_LogXrSessionStarted_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadSessionStartedRecord(&p_session_started_record))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRInternalsSessionListener::Name_, 2, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->LogXrSessionStarted(        
        std::move(p_session_started_record));
      return true;
    }
    case messages::XRInternalsSessionListener::kLogXrSessionStopped: {
      DCHECK(message->is_serialized());
      internal::XRInternalsSessionListener_LogXrSessionStopped_Params_Data* params =
          reinterpret_cast<internal::XRInternalsSessionListener_LogXrSessionStopped_Params_Data*>(
              message->mutable_payload());
      

      // Validation for XRInternalsSessionListener.3
      bool success = true;
      SessionStoppedRecordPtr p_session_stopped_record{};
      XRInternalsSessionListener_LogXrSessionStopped_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadSessionStoppedRecord(&p_session_stopped_record))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRInternalsSessionListener::Name_, 3, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->LogXrSessionStopped(        
        std::move(p_session_stopped_record));
      return true;
    }
    case messages::XRInternalsSessionListener::kLogXrRuntimeAdded: {
      DCHECK(message->is_serialized());
      internal::XRInternalsSessionListener_LogXrRuntimeAdded_Params_Data* params =
          reinterpret_cast<internal::XRInternalsSessionListener_LogXrRuntimeAdded_Params_Data*>(
              message->mutable_payload());
      

      // Validation for XRInternalsSessionListener.4
      bool success = true;
      RuntimeInfoPtr p_runtime_added_record{};
      XRInternalsSessionListener_LogXrRuntimeAdded_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadRuntimeAddedRecord(&p_runtime_added_record))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRInternalsSessionListener::Name_, 4, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->LogXrRuntimeAdded(        
        std::move(p_runtime_added_record));
      return true;
    }
    case messages::XRInternalsSessionListener::kLogXrRuntimeRemoved: {
      DCHECK(message->is_serialized());
      internal::XRInternalsSessionListener_LogXrRuntimeRemoved_Params_Data* params =
          reinterpret_cast<internal::XRInternalsSessionListener_LogXrRuntimeRemoved_Params_Data*>(
              message->mutable_payload());
      

      // Validation for XRInternalsSessionListener.5
      bool success = true;
      ::device::mojom::XRDeviceId p_device_id{};
      XRInternalsSessionListener_LogXrRuntimeRemoved_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadDeviceId(&p_device_id))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRInternalsSessionListener::Name_, 5, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->LogXrRuntimeRemoved(        
        std::move(p_device_id));
      return true;
    }
    case messages::XRInternalsSessionListener::kLogFrameData: {
      DCHECK(message->is_serialized());
      internal::XRInternalsSessionListener_LogFrameData_Params_Data* params =
          reinterpret_cast<internal::XRInternalsSessionListener_LogFrameData_Params_Data*>(
              message->mutable_payload());
      

      // Validation for XRInternalsSessionListener.6
      bool success = true;
      ::device::mojom::XrFrameStatisticsPtr p_xrframe_statistics{};
      XRInternalsSessionListener_LogFrameData_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadXrframeStatistics(&p_xrframe_statistics))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRInternalsSessionListener::Name_, 6, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->LogFrameData(        
        std::move(p_xrframe_statistics));
      return true;
    }
    case messages::XRInternalsSessionListener::kLogConsoleMessages: {
      DCHECK(message->is_serialized());
      internal::XRInternalsSessionListener_LogConsoleMessages_Params_Data* params =
          reinterpret_cast<internal::XRInternalsSessionListener_LogConsoleMessages_Params_Data*>(
              message->mutable_payload());
      

      // Validation for XRInternalsSessionListener.7
      bool success = true;
      ::device::mojom::XrLogMessagePtr p_xrlogging_statistics{};
      XRInternalsSessionListener_LogConsoleMessages_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadXrloggingStatistics(&p_xrlogging_statistics))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            XRInternalsSessionListener::Name_, 7, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->LogConsoleMessages(        
        std::move(p_xrlogging_statistics));
      return true;
    }
  }
  return false;
}

// static
bool XRInternalsSessionListenerStubDispatch::AcceptWithResponder(
    XRInternalsSessionListener* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  [[maybe_unused]] const bool message_is_sync =
      message->has_flag(mojo::Message::kFlagIsSync);
  [[maybe_unused]] const uint64_t request_id = message->request_id();
  switch (static_cast<messages::XRInternalsSessionListener>(message->header()->name)) {
    case messages::XRInternalsSessionListener::kLogXrSessionRequested: {
      break;
    }
    case messages::XRInternalsSessionListener::kLogXrSessionRejected: {
      break;
    }
    case messages::XRInternalsSessionListener::kLogXrSessionStarted: {
      break;
    }
    case messages::XRInternalsSessionListener::kLogXrSessionStopped: {
      break;
    }
    case messages::XRInternalsSessionListener::kLogXrRuntimeAdded: {
      break;
    }
    case messages::XRInternalsSessionListener::kLogXrRuntimeRemoved: {
      break;
    }
    case messages::XRInternalsSessionListener::kLogFrameData: {
      break;
    }
    case messages::XRInternalsSessionListener::kLogConsoleMessages: {
      break;
    }
  }
  return false;
}
namespace {
}  // namespace
static const mojo::internal::GenericValidationInfo kXRInternalsSessionListenerValidationInfo[] = {
    { &internal::XRInternalsSessionListener_LogXrSessionRequested_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::XRInternalsSessionListener_LogXrSessionRejected_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::XRInternalsSessionListener_LogXrSessionStarted_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::XRInternalsSessionListener_LogXrSessionStopped_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::XRInternalsSessionListener_LogXrRuntimeAdded_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::XRInternalsSessionListener_LogXrRuntimeRemoved_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::XRInternalsSessionListener_LogFrameData_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::XRInternalsSessionListener_LogConsoleMessages_Params_Data::Validate,
     nullptr /* no response */},
};

bool XRInternalsSessionListenerRequestValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateRequestGenericPacked(
    message,
    ::webxr::mojom::XRInternalsSessionListener::Name_,
    kXRInternalsSessionListenerValidationInfo);
}



}  // webxr::mojom


namespace mojo {


// static
bool StructTraits<::webxr::mojom::DeviceInfo::DataView, ::webxr::mojom::DeviceInfoPtr>::Read(
    ::webxr::mojom::DeviceInfo::DataView input,
    ::webxr::mojom::DeviceInfoPtr* output) {
  bool success = true;
  ::webxr::mojom::DeviceInfoPtr result(::webxr::mojom::DeviceInfo::New());
  
      if (success && !input.ReadOperatingSystemName(&result->operating_system_name))
        success = false;
      if (success && !input.ReadOperatingSystemVersion(&result->operating_system_version))
        success = false;
      if (success && !input.ReadGpuGlVendor(&result->gpu_gl_vendor))
        success = false;
      if (success && !input.ReadGpuGlRenderer(&result->gpu_gl_renderer))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::webxr::mojom::SessionRequestedRecord::DataView, ::webxr::mojom::SessionRequestedRecordPtr>::Read(
    ::webxr::mojom::SessionRequestedRecord::DataView input,
    ::webxr::mojom::SessionRequestedRecordPtr* output) {
  bool success = true;
  ::webxr::mojom::SessionRequestedRecordPtr result(::webxr::mojom::SessionRequestedRecord::New());
  
      if (success && !input.ReadOptions(&result->options))
        success = false;
      if (success && !input.ReadRequestedTime(&result->requested_time))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::webxr::mojom::SessionRejectedRecord::DataView, ::webxr::mojom::SessionRejectedRecordPtr>::Read(
    ::webxr::mojom::SessionRejectedRecord::DataView input,
    ::webxr::mojom::SessionRejectedRecordPtr* output) {
  bool success = true;
  ::webxr::mojom::SessionRejectedRecordPtr result(::webxr::mojom::SessionRejectedRecord::New());
  
      if (success)
        result->trace_id = input.trace_id();
      if (success && !input.ReadFailureReason(&result->failure_reason))
        success = false;
      if (success && !input.ReadRejectedTime(&result->rejected_time))
        success = false;
      if (success && !input.ReadFailureReasonDescription(&result->failure_reason_description))
        success = false;
      if (success && !input.ReadRejectedFeatures(&result->rejected_features))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::webxr::mojom::SessionStartedRecord::DataView, ::webxr::mojom::SessionStartedRecordPtr>::Read(
    ::webxr::mojom::SessionStartedRecord::DataView input,
    ::webxr::mojom::SessionStartedRecordPtr* output) {
  bool success = true;
  ::webxr::mojom::SessionStartedRecordPtr result(::webxr::mojom::SessionStartedRecord::New());
  
      if (success)
        result->trace_id = input.trace_id();
      if (success && !input.ReadDeviceId(&result->device_id))
        success = false;
      if (success && !input.ReadStartedTime(&result->started_time))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::webxr::mojom::SessionStoppedRecord::DataView, ::webxr::mojom::SessionStoppedRecordPtr>::Read(
    ::webxr::mojom::SessionStoppedRecord::DataView input,
    ::webxr::mojom::SessionStoppedRecordPtr* output) {
  bool success = true;
  ::webxr::mojom::SessionStoppedRecordPtr result(::webxr::mojom::SessionStoppedRecord::New());
  
      if (success)
        result->trace_id = input.trace_id();
      if (success && !input.ReadStoppedTime(&result->stopped_time))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::webxr::mojom::RuntimeInfo::DataView, ::webxr::mojom::RuntimeInfoPtr>::Read(
    ::webxr::mojom::RuntimeInfo::DataView input,
    ::webxr::mojom::RuntimeInfoPtr* output) {
  bool success = true;
  ::webxr::mojom::RuntimeInfoPtr result(::webxr::mojom::RuntimeInfo::New());
  
      if (success && !input.ReadDeviceId(&result->device_id))
        success = false;
      if (success && !input.ReadSupportedFeatures(&result->supported_features))
        success = false;
      if (success)
        result->is_ar_blend_mode_supported = input.is_ar_blend_mode_supported();
  *output = std::move(result);
  return success;
}

}  // namespace mojo


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


namespace webxr::mojom {


void WebXrInternalsHandlerInterceptorForTesting::GetDeviceInfo(GetDeviceInfoCallback callback) {
  GetForwardingInterface()->GetDeviceInfo(std::move(callback));
}
void WebXrInternalsHandlerInterceptorForTesting::GetActiveRuntimes(GetActiveRuntimesCallback callback) {
  GetForwardingInterface()->GetActiveRuntimes(std::move(callback));
}
void WebXrInternalsHandlerInterceptorForTesting::SubscribeToEvents(::mojo::PendingRemote<XRInternalsSessionListener> listener) {
  GetForwardingInterface()->SubscribeToEvents(
    std::move(listener)
    );
}
WebXrInternalsHandlerAsyncWaiter::WebXrInternalsHandlerAsyncWaiter(
    WebXrInternalsHandler* proxy) : proxy_(proxy) {}

WebXrInternalsHandlerAsyncWaiter::~WebXrInternalsHandlerAsyncWaiter() = default;


void WebXrInternalsHandlerAsyncWaiter::GetDeviceInfo(
    DeviceInfoPtr* out_device_info) {
  base::RunLoop loop;
  proxy_->GetDeviceInfo(
      base::BindOnce(
          [](base::RunLoop* loop,
             DeviceInfoPtr* out_device_info
,
             DeviceInfoPtr device_info) {*out_device_info = std::move(device_info);
            loop->Quit();
          },
          &loop,
          out_device_info));
  loop.Run();
}

DeviceInfoPtr WebXrInternalsHandlerAsyncWaiter::GetDeviceInfo(
    ) {
  DeviceInfoPtr async_wait_result;
  GetDeviceInfo(&async_wait_result);
  return async_wait_result;
}

void WebXrInternalsHandlerAsyncWaiter::GetActiveRuntimes(
    std::vector<RuntimeInfoPtr>* out_active_runtimes) {
  base::RunLoop loop;
  proxy_->GetActiveRuntimes(
      base::BindOnce(
          [](base::RunLoop* loop,
             std::vector<RuntimeInfoPtr>* out_active_runtimes
,
             std::vector<RuntimeInfoPtr> active_runtimes) {*out_active_runtimes = std::move(active_runtimes);
            loop->Quit();
          },
          &loop,
          out_active_runtimes));
  loop.Run();
}

std::vector<RuntimeInfoPtr> WebXrInternalsHandlerAsyncWaiter::GetActiveRuntimes(
    ) {
  std::vector<RuntimeInfoPtr> async_wait_result;
  GetActiveRuntimes(&async_wait_result);
  return async_wait_result;
}




void XRInternalsSessionListenerInterceptorForTesting::LogXrSessionRequested(SessionRequestedRecordPtr session_requested_record) {
  GetForwardingInterface()->LogXrSessionRequested(
    std::move(session_requested_record)
    );
}
void XRInternalsSessionListenerInterceptorForTesting::LogXrSessionRejected(SessionRejectedRecordPtr session_rejected_record) {
  GetForwardingInterface()->LogXrSessionRejected(
    std::move(session_rejected_record)
    );
}
void XRInternalsSessionListenerInterceptorForTesting::LogXrSessionStarted(SessionStartedRecordPtr session_started_record) {
  GetForwardingInterface()->LogXrSessionStarted(
    std::move(session_started_record)
    );
}
void XRInternalsSessionListenerInterceptorForTesting::LogXrSessionStopped(SessionStoppedRecordPtr session_stopped_record) {
  GetForwardingInterface()->LogXrSessionStopped(
    std::move(session_stopped_record)
    );
}
void XRInternalsSessionListenerInterceptorForTesting::LogXrRuntimeAdded(RuntimeInfoPtr runtime_added_record) {
  GetForwardingInterface()->LogXrRuntimeAdded(
    std::move(runtime_added_record)
    );
}
void XRInternalsSessionListenerInterceptorForTesting::LogXrRuntimeRemoved(::device::mojom::XRDeviceId device_id) {
  GetForwardingInterface()->LogXrRuntimeRemoved(
    std::move(device_id)
    );
}
void XRInternalsSessionListenerInterceptorForTesting::LogFrameData(::device::mojom::XrFrameStatisticsPtr xrframe_statistics) {
  GetForwardingInterface()->LogFrameData(
    std::move(xrframe_statistics)
    );
}
void XRInternalsSessionListenerInterceptorForTesting::LogConsoleMessages(::device::mojom::XrLogMessagePtr xrlogging_statistics) {
  GetForwardingInterface()->LogConsoleMessages(
    std::move(xrlogging_statistics)
    );
}
XRInternalsSessionListenerAsyncWaiter::XRInternalsSessionListenerAsyncWaiter(
    XRInternalsSessionListener* proxy) : proxy_(proxy) {}

XRInternalsSessionListenerAsyncWaiter::~XRInternalsSessionListenerAsyncWaiter() = default;







}  // webxr::mojom


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