// components/browser_apis/tab_drag/tab_drag_api.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 "components/browser_apis/tab_drag/tab_drag_api.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 "components/browser_apis/tab_drag/tab_drag_api.mojom-params-data.h"
#include "components/browser_apis/tab_drag/tab_drag_api.mojom-shared-message-ids.h"

#include "components/browser_apis/tab_drag/tab_drag_api.mojom-import-headers.h"
#include "components/browser_apis/tab_drag/tab_drag_api.mojom-test-utils.h"


namespace tabs_api::mojom {
TabDragService_StartDrag_ResponseParam_ResultPtr
TabDragService_StartDrag_ResponseParam_Result::NewSuccess(
    const ::std::monostate& value) {
  return TabDragService_StartDrag_ResponseParam_ResultPtr(
      std::in_place,
      std::in_place_index<static_cast<size_t>(Tag::kSuccess)>,
      std::move(value));
}

TabDragService_StartDrag_ResponseParam_ResultPtr
TabDragService_StartDrag_ResponseParam_Result::NewFailure(
    ::mojo_base::mojom::ErrorPtr value) {
  return TabDragService_StartDrag_ResponseParam_ResultPtr(
      std::in_place,
      std::in_place_index<static_cast<size_t>(Tag::kFailure)>,
      std::move(value));
}

TabDragService_StartDrag_ResponseParam_Result::TabDragService_StartDrag_ResponseParam_Result(
    std::in_place_index_t<static_cast<size_t>(Tag::kSuccess)>,
    const ::std::monostate& value)
    : tag_(Tag::kSuccess),
      data_(std::in_place_index<static_cast<size_t>(Tag::kSuccess)>,
            std::move(value)) {}

TabDragService_StartDrag_ResponseParam_Result::TabDragService_StartDrag_ResponseParam_Result(
    std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
    ::mojo_base::mojom::ErrorPtr value)
    : tag_(Tag::kFailure),
      data_(std::in_place_index<static_cast<size_t>(Tag::kFailure)>,
            std::move(value)) {}
TabDragService_StartDrag_ResponseParam_Result::~TabDragService_StartDrag_ResponseParam_Result() {
  DestroyActive();
}

void TabDragService_StartDrag_ResponseParam_Result::set_success(const ::std::monostate& success) {
  if (tag_ == Tag::kSuccess) {
    data_.success = std::move(success);
  } else {
    DestroyActive();
    tag_ = Tag::kSuccess;
    new (&data_.success) ::std::monostate(
        std::move(success));
  }
}

void TabDragService_StartDrag_ResponseParam_Result::set_failure(::mojo_base::mojom::ErrorPtr failure) {
  if (tag_ == Tag::kFailure) {
    data_.failure = std::move(failure);
  } else {
    DestroyActive();
    tag_ = Tag::kFailure;
    new (&data_.failure) ::mojo_base::mojom::ErrorPtr(
        std::move(failure));
  }
}


TabDragService_StartDrag_ResponseParam_Result::Union_::Union_(
    std::in_place_index_t<static_cast<size_t>(Tag::kSuccess)>,
    const ::std::monostate& value)
    : success(std::move(value)) {}

TabDragService_StartDrag_ResponseParam_Result::Union_::Union_(
    std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
    ::mojo_base::mojom::ErrorPtr value)
    : failure(std::move(value)) {}

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

    case Tag::kSuccess:
      std::destroy_at(&data_.success);
      break;
    case Tag::kFailure:
      std::destroy_at(&data_.failure);
      break;
  }
}

bool TabDragService_StartDrag_ResponseParam_Result::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context, false);
}
TabDragService_RegisterDropTarget_ResponseParam_ResultPtr
TabDragService_RegisterDropTarget_ResponseParam_Result::NewSuccess(
    const ::std::monostate& value) {
  return TabDragService_RegisterDropTarget_ResponseParam_ResultPtr(
      std::in_place,
      std::in_place_index<static_cast<size_t>(Tag::kSuccess)>,
      std::move(value));
}

TabDragService_RegisterDropTarget_ResponseParam_ResultPtr
TabDragService_RegisterDropTarget_ResponseParam_Result::NewFailure(
    ::mojo_base::mojom::ErrorPtr value) {
  return TabDragService_RegisterDropTarget_ResponseParam_ResultPtr(
      std::in_place,
      std::in_place_index<static_cast<size_t>(Tag::kFailure)>,
      std::move(value));
}

TabDragService_RegisterDropTarget_ResponseParam_Result::TabDragService_RegisterDropTarget_ResponseParam_Result(
    std::in_place_index_t<static_cast<size_t>(Tag::kSuccess)>,
    const ::std::monostate& value)
    : tag_(Tag::kSuccess),
      data_(std::in_place_index<static_cast<size_t>(Tag::kSuccess)>,
            std::move(value)) {}

TabDragService_RegisterDropTarget_ResponseParam_Result::TabDragService_RegisterDropTarget_ResponseParam_Result(
    std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
    ::mojo_base::mojom::ErrorPtr value)
    : tag_(Tag::kFailure),
      data_(std::in_place_index<static_cast<size_t>(Tag::kFailure)>,
            std::move(value)) {}
TabDragService_RegisterDropTarget_ResponseParam_Result::~TabDragService_RegisterDropTarget_ResponseParam_Result() {
  DestroyActive();
}

void TabDragService_RegisterDropTarget_ResponseParam_Result::set_success(const ::std::monostate& success) {
  if (tag_ == Tag::kSuccess) {
    data_.success = std::move(success);
  } else {
    DestroyActive();
    tag_ = Tag::kSuccess;
    new (&data_.success) ::std::monostate(
        std::move(success));
  }
}

void TabDragService_RegisterDropTarget_ResponseParam_Result::set_failure(::mojo_base::mojom::ErrorPtr failure) {
  if (tag_ == Tag::kFailure) {
    data_.failure = std::move(failure);
  } else {
    DestroyActive();
    tag_ = Tag::kFailure;
    new (&data_.failure) ::mojo_base::mojom::ErrorPtr(
        std::move(failure));
  }
}


TabDragService_RegisterDropTarget_ResponseParam_Result::Union_::Union_(
    std::in_place_index_t<static_cast<size_t>(Tag::kSuccess)>,
    const ::std::monostate& value)
    : success(std::move(value)) {}

TabDragService_RegisterDropTarget_ResponseParam_Result::Union_::Union_(
    std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
    ::mojo_base::mojom::ErrorPtr value)
    : failure(std::move(value)) {}

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

    case Tag::kSuccess:
      std::destroy_at(&data_.success);
      break;
    case Tag::kFailure:
      std::destroy_at(&data_.failure);
      break;
  }
}

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

TabDragService::IPCStableHashFunction TabDragService::MessageToMethodInfo_(mojo::Message& message) {
#if !BUILDFLAG(IS_FUCHSIA)
  switch (static_cast<messages::TabDragService>(message.name())) {
    case messages::TabDragService::kStartDrag: {
      return &TabDragService::StartDrag_Sym::IPCStableHash;
    }
    case messages::TabDragService::kRegisterDropTarget: {
      return &TabDragService::RegisterDropTarget_Sym::IPCStableHash;
    }
  }
#endif  // !BUILDFLAG(IS_FUCHSIA)
  return nullptr;
}


const char* TabDragService::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::TabDragService>(message.name())) {
      case messages::TabDragService::kStartDrag:
            return "Receive tabs_api::mojom::TabDragService::StartDrag";
      case messages::TabDragService::kRegisterDropTarget:
            return "Receive tabs_api::mojom::TabDragService::RegisterDropTarget";
    }
  } else {
    switch (static_cast<messages::TabDragService>(message.name())) {
      case messages::TabDragService::kStartDrag:
            return "Receive reply tabs_api::mojom::TabDragService::StartDrag";
      case messages::TabDragService::kRegisterDropTarget:
            return "Receive reply tabs_api::mojom::TabDragService::RegisterDropTarget";
    }
  }
  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 TabDragService::StartDrag_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 = 0x3d13e1c6;  // IPCStableHash for tabs_api::mojom::TabDragService::StartDrag
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t TabDragService::RegisterDropTarget_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 = 0x92fed06b;  // IPCStableHash for tabs_api::mojom::TabDragService::RegisterDropTarget
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
# endif // !BUILDFLAG(IS_FUCHSIA)

class TabDragService_StartDrag_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  TabDragService_StartDrag_ForwardToCallback(
      TabDragService::StartDragCallback callback
      ) : callback_(std::move(callback)) {
  }

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

  bool Accept(mojo::Message* message) override;
 private:
  TabDragService::StartDragCallback callback_;
};

class TabDragService_RegisterDropTarget_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  TabDragService_RegisterDropTarget_ForwardToCallback(
      TabDragService::RegisterDropTargetCallback callback
      ) : callback_(std::move(callback)) {
  }

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

  bool Accept(mojo::Message* message) override;
 private:
  TabDragService::RegisterDropTargetCallback callback_;
};

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

void TabDragServiceProxy::StartDrag(
    const std::vector<::tabs_api::NodeId>& in_node_ids, const ::gfx::Point& in_start_point, int32_t in_tab_original_offset_x, float in_mouse_to_tab_x_ratio, StartDragCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send tabs_api::mojom::TabDragService::StartDrag", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("node_ids"), in_node_ids,
                        "<value of type const std::vector<::tabs_api::NodeId>&>");
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("start_point"), in_start_point,
                        "<value of type const ::gfx::Point&>");
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("tab_original_offset_x"), in_tab_original_offset_x,
                        "<value of type int32_t>");
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("mouse_to_tab_x_ratio"), in_mouse_to_tab_x_ratio,
                        "<value of type float>");
   });
#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::TabDragService::kStartDrag), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::tabs_api::mojom::internal::TabDragService_StartDrag_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->node_ids)::BaseType>
      node_ids_fragment(params.message());
  constexpr const mojo::internal::ContainerValidateParams& node_ids_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  
  mojo::internal::Serialize<mojo::ArrayDataView<::tabs_api::mojom::NodeIdDataView>>(
    in_node_ids,
    node_ids_fragment,
    &node_ids_validate_params);

  params->node_ids.Set(
      node_ids_fragment.is_null() ? nullptr : node_ids_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->node_ids.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null node_ids in TabDragService.StartDrag request");
  mojo::internal::MessageFragment<
      typename decltype(params->start_point)::BaseType> start_point_fragment(
          params.message());
  
  mojo::internal::Serialize<::gfx::mojom::PointDataView>(
    in_start_point,
    start_point_fragment);

  params->start_point.Set(
      start_point_fragment.is_null() ? nullptr : start_point_fragment.data());

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

  params->tab_original_offset_x = in_tab_original_offset_x;

  params->mouse_to_tab_x_ratio = in_mouse_to_tab_x_ratio;

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

void TabDragServiceProxy::RegisterDropTarget(
    ::mojo::PendingAssociatedRemote<DropTarget> in_target, ::mojo::PendingAssociatedReceiver<DropTargetRegistration> in_registration, RegisterDropTargetCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send tabs_api::mojom::TabDragService::RegisterDropTarget", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("target"), in_target,
                        "<value of type ::mojo::PendingAssociatedRemote<DropTarget>>");
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("registration"), in_registration,
                        "<value of type ::mojo::PendingAssociatedReceiver<DropTargetRegistration>>");
   });
#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::TabDragService::kRegisterDropTarget), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::tabs_api::mojom::internal::TabDragService_RegisterDropTarget_Params_Data> params(
          message);
  params.Allocate();

  
  mojo::internal::Serialize<::tabs_api::mojom::DropTargetAssociatedPtrInfoDataView>(
    in_target,
    &params->target,
    &params.message());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(!mojo::internal::IsHandleOrInterfaceValid(params->target)),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_INTERFACE_ID,
    "invalid target in TabDragService.RegisterDropTarget request");

  
  mojo::internal::Serialize<::tabs_api::mojom::DropTargetRegistrationAssociatedRequestDataView>(
    in_registration,
    &params->registration,
    &params.message());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(!mojo::internal::IsHandleOrInterfaceValid(params->registration)),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_INTERFACE_ID,
    "invalid registration in TabDragService.RegisterDropTarget request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(TabDragService::Name_);
  message.set_method_name("RegisterDropTarget");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new TabDragService_RegisterDropTarget_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}
class TabDragService_StartDrag_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static TabDragService::StartDragCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<TabDragService_StartDrag_ProxyToResponder> proxy(
        new TabDragService_StartDrag_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&Transform)
      .Then(base::BindOnce(&TabDragService_StartDrag_ProxyToResponder::Run,
                          std::move(proxy)));
  }

  static TabDragService_StartDrag_ResponseParam_ResultPtr Transform(base::expected<
  ::std::monostate,
  ::mojo_base::mojom::ErrorPtr> in) {
    return in.has_value() ? ::tabs_api::mojom::TabDragService_StartDrag_ResponseParam_Result::NewSuccess(std::move(in.value())) :
                            ::tabs_api::mojom::TabDragService_StartDrag_ResponseParam_Result::NewFailure(std::move(in.error()));
  }



  ~TabDragService_StartDrag_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:
  TabDragService_StartDrag_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)
        << "TabDragService::StartDragCallback 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(
      TabDragService_StartDrag_ResponseParam_ResultPtr in_result);
};

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

  // Validation for TabDragService.0
  bool success = true;
  TabDragService_StartDrag_ResponseParam_ResultPtr p_result{};
  TabDragService_StartDrag_ResponseParamsDataView input_data_view(params, message);
  
  if (success && !input_data_view.ReadResult(&p_result))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        TabDragService::Name_, 0, true);
    return false;
  }
  if (!callback_.is_null()) {
    if (p_result->is_success()) {
      std::move(callback_).Run(base::ok(std::move(p_result->get_success())));
    } else {
      std::move(callback_).Run(base::unexpected(std::move(p_result->get_failure())));
    }
  }
  return true;
}

void TabDragService_StartDrag_ProxyToResponder::Run(
    TabDragService_StartDrag_ResponseParam_ResultPtr in_result) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply tabs_api::mojom::TabDragService::StartDrag", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("result"), in_result,
                        "<value of type TabDragService_StartDrag_ResponseParam_ResultPtr>");
   });
#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::TabDragService::kStartDrag), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::tabs_api::mojom::internal::TabDragService_StartDrag_ResponseParams_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<decltype(params->result)>
      result_fragment(params.message());
  result_fragment.Claim(&params->result);
  
  mojo::internal::Serialize<::tabs_api::mojom::TabDragService_StartDrag_ResponseParam_ResultDataView>(
    in_result,
    result_fragment,
    true);

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

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(TabDragService::Name_);
  message.set_method_name("StartDrag");
#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 TabDragService_RegisterDropTarget_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static TabDragService::RegisterDropTargetCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<TabDragService_RegisterDropTarget_ProxyToResponder> proxy(
        new TabDragService_RegisterDropTarget_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&Transform)
      .Then(base::BindOnce(&TabDragService_RegisterDropTarget_ProxyToResponder::Run,
                          std::move(proxy)));
  }

  static TabDragService_RegisterDropTarget_ResponseParam_ResultPtr Transform(base::expected<
  ::std::monostate,
  ::mojo_base::mojom::ErrorPtr> in) {
    return in.has_value() ? ::tabs_api::mojom::TabDragService_RegisterDropTarget_ResponseParam_Result::NewSuccess(std::move(in.value())) :
                            ::tabs_api::mojom::TabDragService_RegisterDropTarget_ResponseParam_Result::NewFailure(std::move(in.error()));
  }



  ~TabDragService_RegisterDropTarget_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:
  TabDragService_RegisterDropTarget_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)
        << "TabDragService::RegisterDropTargetCallback 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(
      TabDragService_RegisterDropTarget_ResponseParam_ResultPtr in_result);
};

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

  // Validation for TabDragService.1
  bool success = true;
  TabDragService_RegisterDropTarget_ResponseParam_ResultPtr p_result{};
  TabDragService_RegisterDropTarget_ResponseParamsDataView input_data_view(params, message);
  
  if (success && !input_data_view.ReadResult(&p_result))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        TabDragService::Name_, 1, true);
    return false;
  }
  if (!callback_.is_null()) {
    if (p_result->is_success()) {
      std::move(callback_).Run(base::ok(std::move(p_result->get_success())));
    } else {
      std::move(callback_).Run(base::unexpected(std::move(p_result->get_failure())));
    }
  }
  return true;
}

void TabDragService_RegisterDropTarget_ProxyToResponder::Run(
    TabDragService_RegisterDropTarget_ResponseParam_ResultPtr in_result) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply tabs_api::mojom::TabDragService::RegisterDropTarget", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("result"), in_result,
                        "<value of type TabDragService_RegisterDropTarget_ResponseParam_ResultPtr>");
   });
#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::TabDragService::kRegisterDropTarget), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::tabs_api::mojom::internal::TabDragService_RegisterDropTarget_ResponseParams_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<decltype(params->result)>
      result_fragment(params.message());
  result_fragment.Claim(&params->result);
  
  mojo::internal::Serialize<::tabs_api::mojom::TabDragService_RegisterDropTarget_ResponseParam_ResultDataView>(
    in_result,
    result_fragment,
    true);

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

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(TabDragService::Name_);
  message.set_method_name("RegisterDropTarget");
#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 TabDragServiceStubDispatch::Accept(
    TabDragService* impl,
    mojo::Message* message) {
  switch (static_cast<messages::TabDragService>(message->header()->name)) {
    case messages::TabDragService::kStartDrag: {
      break;
    }
    case messages::TabDragService::kRegisterDropTarget: {
      break;
    }
  }
  return false;
}

// static
bool TabDragServiceStubDispatch::AcceptWithResponder(
    TabDragService* 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::TabDragService>(message->header()->name)) {
    case messages::TabDragService::kStartDrag: {
      internal::TabDragService_StartDrag_Params_Data* params =
          reinterpret_cast<
              internal::TabDragService_StartDrag_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for TabDragService.0
      bool success = true;
      std::vector<::tabs_api::NodeId> p_node_ids{};
      ::gfx::Point p_start_point{};
      int32_t p_tab_original_offset_x{};
      float p_mouse_to_tab_x_ratio{};
      TabDragService_StartDrag_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadNodeIds(&p_node_ids))
        success = false;
      if (success && !input_data_view.ReadStartPoint(&p_start_point))
        success = false;
      if (success)
        p_tab_original_offset_x = input_data_view.tab_original_offset_x();
      if (success)
        p_mouse_to_tab_x_ratio = input_data_view.mouse_to_tab_x_ratio();
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            TabDragService::Name_, 0, false);
        return false;
      }
      auto callback =
          TabDragService_StartDrag_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->StartDrag(        
        std::move(p_node_ids), 
        std::move(p_start_point), 
        std::move(p_tab_original_offset_x), 
        std::move(p_mouse_to_tab_x_ratio), std::move(callback));
      return true;
    }
    case messages::TabDragService::kRegisterDropTarget: {
      internal::TabDragService_RegisterDropTarget_Params_Data* params =
          reinterpret_cast<
              internal::TabDragService_RegisterDropTarget_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for TabDragService.1
      bool success = true;
      ::mojo::PendingAssociatedRemote<DropTarget> p_target{};
      ::mojo::PendingAssociatedReceiver<DropTargetRegistration> p_registration{};
      TabDragService_RegisterDropTarget_ParamsDataView input_data_view(params, message);
      
      if (success) {
        p_target =
            input_data_view.TakeTarget<decltype(p_target)>();
      }
      if (success) {
        p_registration =
            input_data_view.TakeRegistration<decltype(p_registration)>();
      }
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            TabDragService::Name_, 1, false);
        return false;
      }
      auto callback =
          TabDragService_RegisterDropTarget_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->RegisterDropTarget(        
        std::move(p_target), 
        std::move(p_registration), std::move(callback));
      return true;
    }
  }
  return false;
}
namespace {
}  // namespace
static const mojo::internal::GenericValidationInfo kTabDragServiceValidationInfo[] = {
    { &internal::TabDragService_StartDrag_Params_Data::Validate,
     &internal::TabDragService_StartDrag_ResponseParams_Data::Validate},
    { &internal::TabDragService_RegisterDropTarget_Params_Data::Validate,
     &internal::TabDragService_RegisterDropTarget_ResponseParams_Data::Validate},
};

bool TabDragServiceRequestValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateRequestGenericPacked(
    message,
    ::tabs_api::mojom::TabDragService::Name_,
    kTabDragServiceValidationInfo);
}

bool TabDragServiceResponseValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateResponseGenericPacked(
    message,
    ::tabs_api::mojom::TabDragService::Name_,
    kTabDragServiceValidationInfo);
}



TabDragServiceBridge::TabDragServiceBridge(TabDragServiceDirectReturnStub* stub)
        : stub_(stub) {
    CHECK(stub_);
}

TabDragServiceBridge::~TabDragServiceBridge() = default;


void TabDragServiceBridge::StartDrag(const std::vector<::tabs_api::NodeId>& node_ids, const ::gfx::Point& start_point, int32_t tab_original_offset_x, float mouse_to_tab_x_ratio, StartDragCallback callback) {

    std::move(callback).Run(stub_->StartDrag(
      std::move(node_ids)
, 
      std::move(start_point)
, 
      std::move(tab_original_offset_x)
, 
      std::move(mouse_to_tab_x_ratio)

    ));
}

void TabDragServiceBridge::RegisterDropTarget(::mojo::PendingAssociatedRemote<DropTarget> target, ::mojo::PendingAssociatedReceiver<DropTargetRegistration> registration, RegisterDropTargetCallback callback) {

    std::move(callback).Run(stub_->RegisterDropTarget(
      std::move(target)
, 
      std::move(registration)

    ));
}

// The declaration includes the definition on other builds.

DropTargetRegistration::IPCStableHashFunction DropTargetRegistration::MessageToMethodInfo_(mojo::Message& message) {
#if !BUILDFLAG(IS_FUCHSIA)
  switch (static_cast<messages::DropTargetRegistration>(message.name())) {
    case messages::DropTargetRegistration::kOnBoundsChanged: {
      return &DropTargetRegistration::OnBoundsChanged_Sym::IPCStableHash;
    }
  }
#endif  // !BUILDFLAG(IS_FUCHSIA)
  return nullptr;
}


const char* DropTargetRegistration::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::DropTargetRegistration>(message.name())) {
      case messages::DropTargetRegistration::kOnBoundsChanged:
            return "Receive tabs_api::mojom::DropTargetRegistration::OnBoundsChanged";
    }
  } else {
    switch (static_cast<messages::DropTargetRegistration>(message.name())) {
      case messages::DropTargetRegistration::kOnBoundsChanged:
            return "Receive reply tabs_api::mojom::DropTargetRegistration::OnBoundsChanged";
    }
  }
  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 DropTargetRegistration::OnBoundsChanged_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 = 0x2af828c2;  // IPCStableHash for tabs_api::mojom::DropTargetRegistration::OnBoundsChanged
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
# endif // !BUILDFLAG(IS_FUCHSIA)

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

void DropTargetRegistrationProxy::OnBoundsChanged(
    const ::gfx::Rect& in_bounds) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send tabs_api::mojom::DropTargetRegistration::OnBoundsChanged", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("bounds"), in_bounds,
                        "<value of type const ::gfx::Rect&>");
   });
#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::DropTargetRegistration::kOnBoundsChanged), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::tabs_api::mojom::internal::DropTargetRegistration_OnBoundsChanged_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->bounds)::BaseType> bounds_fragment(
          params.message());
  
  mojo::internal::Serialize<::gfx::mojom::RectDataView>(
    in_bounds,
    bounds_fragment);

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

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

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(DropTargetRegistration::Name_);
  message.set_method_name("OnBoundsChanged");
#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 DropTargetRegistrationStubDispatch::Accept(
    DropTargetRegistration* impl,
    mojo::Message* message) {
  switch (static_cast<messages::DropTargetRegistration>(message->header()->name)) {
    case messages::DropTargetRegistration::kOnBoundsChanged: {
      DCHECK(message->is_serialized());
      internal::DropTargetRegistration_OnBoundsChanged_Params_Data* params =
          reinterpret_cast<internal::DropTargetRegistration_OnBoundsChanged_Params_Data*>(
              message->mutable_payload());
      

      // Validation for DropTargetRegistration.0
      bool success = true;
      ::gfx::Rect p_bounds{};
      DropTargetRegistration_OnBoundsChanged_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadBounds(&p_bounds))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            DropTargetRegistration::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnBoundsChanged(        
        std::move(p_bounds));
      return true;
    }
  }
  return false;
}

// static
bool DropTargetRegistrationStubDispatch::AcceptWithResponder(
    DropTargetRegistration* 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::DropTargetRegistration>(message->header()->name)) {
    case messages::DropTargetRegistration::kOnBoundsChanged: {
      break;
    }
  }
  return false;
}
namespace {
}  // namespace
static const mojo::internal::GenericValidationInfo kDropTargetRegistrationValidationInfo[] = {
    { &internal::DropTargetRegistration_OnBoundsChanged_Params_Data::Validate,
     nullptr /* no response */},
};

bool DropTargetRegistrationRequestValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateRequestGenericPacked(
    message,
    ::tabs_api::mojom::DropTargetRegistration::Name_,
    kDropTargetRegistrationValidationInfo);
}

// The declaration includes the definition on other builds.

DropTarget::IPCStableHashFunction DropTarget::MessageToMethodInfo_(mojo::Message& message) {
#if !BUILDFLAG(IS_FUCHSIA)
  switch (static_cast<messages::DropTarget>(message.name())) {
    case messages::DropTarget::kOnDragEntered: {
      return &DropTarget::OnDragEntered_Sym::IPCStableHash;
    }
    case messages::DropTarget::kOnDrag: {
      return &DropTarget::OnDrag_Sym::IPCStableHash;
    }
    case messages::DropTarget::kOnDragLeave: {
      return &DropTarget::OnDragLeave_Sym::IPCStableHash;
    }
    case messages::DropTarget::kOnDrop: {
      return &DropTarget::OnDrop_Sym::IPCStableHash;
    }
    case messages::DropTarget::kOnDragCancelled: {
      return &DropTarget::OnDragCancelled_Sym::IPCStableHash;
    }
  }
#endif  // !BUILDFLAG(IS_FUCHSIA)
  return nullptr;
}


const char* DropTarget::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::DropTarget>(message.name())) {
      case messages::DropTarget::kOnDragEntered:
            return "Receive tabs_api::mojom::DropTarget::OnDragEntered";
      case messages::DropTarget::kOnDrag:
            return "Receive tabs_api::mojom::DropTarget::OnDrag";
      case messages::DropTarget::kOnDragLeave:
            return "Receive tabs_api::mojom::DropTarget::OnDragLeave";
      case messages::DropTarget::kOnDrop:
            return "Receive tabs_api::mojom::DropTarget::OnDrop";
      case messages::DropTarget::kOnDragCancelled:
            return "Receive tabs_api::mojom::DropTarget::OnDragCancelled";
    }
  } else {
    switch (static_cast<messages::DropTarget>(message.name())) {
      case messages::DropTarget::kOnDragEntered:
            return "Receive reply tabs_api::mojom::DropTarget::OnDragEntered";
      case messages::DropTarget::kOnDrag:
            return "Receive reply tabs_api::mojom::DropTarget::OnDrag";
      case messages::DropTarget::kOnDragLeave:
            return "Receive reply tabs_api::mojom::DropTarget::OnDragLeave";
      case messages::DropTarget::kOnDrop:
            return "Receive reply tabs_api::mojom::DropTarget::OnDrop";
      case messages::DropTarget::kOnDragCancelled:
            return "Receive reply tabs_api::mojom::DropTarget::OnDragCancelled";
    }
  }
  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 DropTarget::OnDragEntered_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 = 0xc551938a;  // IPCStableHash for tabs_api::mojom::DropTarget::OnDragEntered
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t DropTarget::OnDrag_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 = 0x380f6b29;  // IPCStableHash for tabs_api::mojom::DropTarget::OnDrag
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t DropTarget::OnDragLeave_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 = 0x20c5e6a0;  // IPCStableHash for tabs_api::mojom::DropTarget::OnDragLeave
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t DropTarget::OnDrop_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 = 0x5178eeba;  // IPCStableHash for tabs_api::mojom::DropTarget::OnDrop
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t DropTarget::OnDragCancelled_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 = 0x86874763;  // IPCStableHash for tabs_api::mojom::DropTarget::OnDragCancelled
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
# endif // !BUILDFLAG(IS_FUCHSIA)

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

void DropTargetProxy::OnDragEntered(
    const std::vector<::tabs_api::NodeId>& in_source_tab_ids, const ::gfx::Point& in_local_point, float in_mouse_to_tab_x_ratio) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send tabs_api::mojom::DropTarget::OnDragEntered", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("source_tab_ids"), in_source_tab_ids,
                        "<value of type const std::vector<::tabs_api::NodeId>&>");
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("local_point"), in_local_point,
                        "<value of type const ::gfx::Point&>");
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("mouse_to_tab_x_ratio"), in_mouse_to_tab_x_ratio,
                        "<value of type float>");
   });
#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::DropTarget::kOnDragEntered), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::tabs_api::mojom::internal::DropTarget_OnDragEntered_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->source_tab_ids)::BaseType>
      source_tab_ids_fragment(params.message());
  constexpr const mojo::internal::ContainerValidateParams& source_tab_ids_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  
  mojo::internal::Serialize<mojo::ArrayDataView<::tabs_api::mojom::NodeIdDataView>>(
    in_source_tab_ids,
    source_tab_ids_fragment,
    &source_tab_ids_validate_params);

  params->source_tab_ids.Set(
      source_tab_ids_fragment.is_null() ? nullptr : source_tab_ids_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->source_tab_ids.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null source_tab_ids in DropTarget.OnDragEntered request");
  mojo::internal::MessageFragment<
      typename decltype(params->local_point)::BaseType> local_point_fragment(
          params.message());
  
  mojo::internal::Serialize<::gfx::mojom::PointDataView>(
    in_local_point,
    local_point_fragment);

  params->local_point.Set(
      local_point_fragment.is_null() ? nullptr : local_point_fragment.data());

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

  params->mouse_to_tab_x_ratio = in_mouse_to_tab_x_ratio;

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(DropTarget::Name_);
  message.set_method_name("OnDragEntered");
#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 DropTargetProxy::OnDrag(
    const ::gfx::Point& in_local_point) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send tabs_api::mojom::DropTarget::OnDrag", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("local_point"), in_local_point,
                        "<value of type const ::gfx::Point&>");
   });
#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::DropTarget::kOnDrag), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::tabs_api::mojom::internal::DropTarget_OnDrag_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->local_point)::BaseType> local_point_fragment(
          params.message());
  
  mojo::internal::Serialize<::gfx::mojom::PointDataView>(
    in_local_point,
    local_point_fragment);

  params->local_point.Set(
      local_point_fragment.is_null() ? nullptr : local_point_fragment.data());

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

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(DropTarget::Name_);
  message.set_method_name("OnDrag");
#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 DropTargetProxy::OnDragLeave(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "Send tabs_api::mojom::DropTarget::OnDragLeave");
#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::DropTarget::kOnDragLeave), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::tabs_api::mojom::internal::DropTarget_OnDragLeave_Params_Data> params(
          message);
  params.Allocate();

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(DropTarget::Name_);
  message.set_method_name("OnDragLeave");
#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 DropTargetProxy::OnDrop(
    const std::vector<::tabs_api::NodeId>& in_source_tab_ids, const ::gfx::Point& in_local_point) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send tabs_api::mojom::DropTarget::OnDrop", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("source_tab_ids"), in_source_tab_ids,
                        "<value of type const std::vector<::tabs_api::NodeId>&>");
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("local_point"), in_local_point,
                        "<value of type const ::gfx::Point&>");
   });
#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::DropTarget::kOnDrop), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::tabs_api::mojom::internal::DropTarget_OnDrop_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->source_tab_ids)::BaseType>
      source_tab_ids_fragment(params.message());
  constexpr const mojo::internal::ContainerValidateParams& source_tab_ids_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  
  mojo::internal::Serialize<mojo::ArrayDataView<::tabs_api::mojom::NodeIdDataView>>(
    in_source_tab_ids,
    source_tab_ids_fragment,
    &source_tab_ids_validate_params);

  params->source_tab_ids.Set(
      source_tab_ids_fragment.is_null() ? nullptr : source_tab_ids_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->source_tab_ids.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null source_tab_ids in DropTarget.OnDrop request");
  mojo::internal::MessageFragment<
      typename decltype(params->local_point)::BaseType> local_point_fragment(
          params.message());
  
  mojo::internal::Serialize<::gfx::mojom::PointDataView>(
    in_local_point,
    local_point_fragment);

  params->local_point.Set(
      local_point_fragment.is_null() ? nullptr : local_point_fragment.data());

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

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(DropTarget::Name_);
  message.set_method_name("OnDrop");
#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 DropTargetProxy::OnDragCancelled(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "Send tabs_api::mojom::DropTarget::OnDragCancelled");
#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::DropTarget::kOnDragCancelled), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::tabs_api::mojom::internal::DropTarget_OnDragCancelled_Params_Data> params(
          message);
  params.Allocate();

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(DropTarget::Name_);
  message.set_method_name("OnDragCancelled");
#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 DropTargetStubDispatch::Accept(
    DropTarget* impl,
    mojo::Message* message) {
  switch (static_cast<messages::DropTarget>(message->header()->name)) {
    case messages::DropTarget::kOnDragEntered: {
      DCHECK(message->is_serialized());
      internal::DropTarget_OnDragEntered_Params_Data* params =
          reinterpret_cast<internal::DropTarget_OnDragEntered_Params_Data*>(
              message->mutable_payload());
      

      // Validation for DropTarget.0
      bool success = true;
      std::vector<::tabs_api::NodeId> p_source_tab_ids{};
      ::gfx::Point p_local_point{};
      float p_mouse_to_tab_x_ratio{};
      DropTarget_OnDragEntered_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadSourceTabIds(&p_source_tab_ids))
        success = false;
      if (success && !input_data_view.ReadLocalPoint(&p_local_point))
        success = false;
      if (success)
        p_mouse_to_tab_x_ratio = input_data_view.mouse_to_tab_x_ratio();
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            DropTarget::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnDragEntered(        
        std::move(p_source_tab_ids), 
        std::move(p_local_point), 
        std::move(p_mouse_to_tab_x_ratio));
      return true;
    }
    case messages::DropTarget::kOnDrag: {
      DCHECK(message->is_serialized());
      internal::DropTarget_OnDrag_Params_Data* params =
          reinterpret_cast<internal::DropTarget_OnDrag_Params_Data*>(
              message->mutable_payload());
      

      // Validation for DropTarget.1
      bool success = true;
      ::gfx::Point p_local_point{};
      DropTarget_OnDrag_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadLocalPoint(&p_local_point))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            DropTarget::Name_, 1, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnDrag(        
        std::move(p_local_point));
      return true;
    }
    case messages::DropTarget::kOnDragLeave: {
      DCHECK(message->is_serialized());
      internal::DropTarget_OnDragLeave_Params_Data* params =
          reinterpret_cast<internal::DropTarget_OnDragLeave_Params_Data*>(
              message->mutable_payload());
      

      // Validation for DropTarget.2
      bool success = true;
      DropTarget_OnDragLeave_ParamsDataView input_data_view(params, message);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            DropTarget::Name_, 2, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnDragLeave(        );
      return true;
    }
    case messages::DropTarget::kOnDrop: {
      DCHECK(message->is_serialized());
      internal::DropTarget_OnDrop_Params_Data* params =
          reinterpret_cast<internal::DropTarget_OnDrop_Params_Data*>(
              message->mutable_payload());
      

      // Validation for DropTarget.3
      bool success = true;
      std::vector<::tabs_api::NodeId> p_source_tab_ids{};
      ::gfx::Point p_local_point{};
      DropTarget_OnDrop_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadSourceTabIds(&p_source_tab_ids))
        success = false;
      if (success && !input_data_view.ReadLocalPoint(&p_local_point))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            DropTarget::Name_, 3, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnDrop(        
        std::move(p_source_tab_ids), 
        std::move(p_local_point));
      return true;
    }
    case messages::DropTarget::kOnDragCancelled: {
      DCHECK(message->is_serialized());
      internal::DropTarget_OnDragCancelled_Params_Data* params =
          reinterpret_cast<internal::DropTarget_OnDragCancelled_Params_Data*>(
              message->mutable_payload());
      

      // Validation for DropTarget.4
      bool success = true;
      DropTarget_OnDragCancelled_ParamsDataView input_data_view(params, message);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            DropTarget::Name_, 4, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->OnDragCancelled(        );
      return true;
    }
  }
  return false;
}

// static
bool DropTargetStubDispatch::AcceptWithResponder(
    DropTarget* 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::DropTarget>(message->header()->name)) {
    case messages::DropTarget::kOnDragEntered: {
      break;
    }
    case messages::DropTarget::kOnDrag: {
      break;
    }
    case messages::DropTarget::kOnDragLeave: {
      break;
    }
    case messages::DropTarget::kOnDrop: {
      break;
    }
    case messages::DropTarget::kOnDragCancelled: {
      break;
    }
  }
  return false;
}
namespace {
}  // namespace
static const mojo::internal::GenericValidationInfo kDropTargetValidationInfo[] = {
    { &internal::DropTarget_OnDragEntered_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::DropTarget_OnDrag_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::DropTarget_OnDragLeave_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::DropTarget_OnDrop_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::DropTarget_OnDragCancelled_Params_Data::Validate,
     nullptr /* no response */},
};

bool DropTargetRequestValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateRequestGenericPacked(
    message,
    ::tabs_api::mojom::DropTarget::Name_,
    kDropTargetValidationInfo);
}



}  // tabs_api::mojom


namespace mojo {

// static
bool UnionTraits<::tabs_api::mojom::TabDragService_StartDrag_ResponseParam_Result::DataView, ::tabs_api::mojom::TabDragService_StartDrag_ResponseParam_ResultPtr>::Read(
    ::tabs_api::mojom::TabDragService_StartDrag_ResponseParam_Result::DataView input,
    ::tabs_api::mojom::TabDragService_StartDrag_ResponseParam_ResultPtr* output) {
  using UnionType = ::tabs_api::mojom::TabDragService_StartDrag_ResponseParam_Result;
  using Tag = UnionType::Tag;

  switch (input.tag()) {
    case Tag::kSuccess: {
      ::std::monostate result_success{};
      if (!input.ReadSuccess(&result_success))
        return false;

      *output = UnionType::NewSuccess(
          std::move(result_success));
      break;
    }
    case Tag::kFailure: {
      ::mojo_base::mojom::ErrorPtr result_failure{};
      if (!input.ReadFailure(&result_failure))
        return false;

      *output = UnionType::NewFailure(
          std::move(result_failure));
      break;
    }
    default:

      return false;
  }
  return true;
}

// static
bool UnionTraits<::tabs_api::mojom::TabDragService_RegisterDropTarget_ResponseParam_Result::DataView, ::tabs_api::mojom::TabDragService_RegisterDropTarget_ResponseParam_ResultPtr>::Read(
    ::tabs_api::mojom::TabDragService_RegisterDropTarget_ResponseParam_Result::DataView input,
    ::tabs_api::mojom::TabDragService_RegisterDropTarget_ResponseParam_ResultPtr* output) {
  using UnionType = ::tabs_api::mojom::TabDragService_RegisterDropTarget_ResponseParam_Result;
  using Tag = UnionType::Tag;

  switch (input.tag()) {
    case Tag::kSuccess: {
      ::std::monostate result_success{};
      if (!input.ReadSuccess(&result_success))
        return false;

      *output = UnionType::NewSuccess(
          std::move(result_success));
      break;
    }
    case Tag::kFailure: {
      ::mojo_base::mojom::ErrorPtr result_failure{};
      if (!input.ReadFailure(&result_failure))
        return false;

      *output = UnionType::NewFailure(
          std::move(result_failure));
      break;
    }
    default:

      return false;
  }
  return true;
}

}  // namespace mojo


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


namespace tabs_api::mojom {


void TabDragServiceInterceptorForTesting::StartDrag(const std::vector<::tabs_api::NodeId>& node_ids, const ::gfx::Point& start_point, int32_t tab_original_offset_x, float mouse_to_tab_x_ratio, StartDragCallback callback) {
  GetForwardingInterface()->StartDrag(
    std::move(node_ids)
    , 
    std::move(start_point)
    , 
    std::move(tab_original_offset_x)
    , 
    std::move(mouse_to_tab_x_ratio)
    , std::move(callback));
}
void TabDragServiceInterceptorForTesting::RegisterDropTarget(::mojo::PendingAssociatedRemote<DropTarget> target, ::mojo::PendingAssociatedReceiver<DropTargetRegistration> registration, RegisterDropTargetCallback callback) {
  GetForwardingInterface()->RegisterDropTarget(
    std::move(target)
    , 
    std::move(registration)
    , std::move(callback));
}
TabDragServiceAsyncWaiter::TabDragServiceAsyncWaiter(
    TabDragService* proxy) : proxy_(proxy) {}

TabDragServiceAsyncWaiter::~TabDragServiceAsyncWaiter() = default;





void DropTargetRegistrationInterceptorForTesting::OnBoundsChanged(const ::gfx::Rect& bounds) {
  GetForwardingInterface()->OnBoundsChanged(
    std::move(bounds)
    );
}
DropTargetRegistrationAsyncWaiter::DropTargetRegistrationAsyncWaiter(
    DropTargetRegistration* proxy) : proxy_(proxy) {}

DropTargetRegistrationAsyncWaiter::~DropTargetRegistrationAsyncWaiter() = default;





void DropTargetInterceptorForTesting::OnDragEntered(const std::vector<::tabs_api::NodeId>& source_tab_ids, const ::gfx::Point& local_point, float mouse_to_tab_x_ratio) {
  GetForwardingInterface()->OnDragEntered(
    std::move(source_tab_ids)
    , 
    std::move(local_point)
    , 
    std::move(mouse_to_tab_x_ratio)
    );
}
void DropTargetInterceptorForTesting::OnDrag(const ::gfx::Point& local_point) {
  GetForwardingInterface()->OnDrag(
    std::move(local_point)
    );
}
void DropTargetInterceptorForTesting::OnDragLeave() {
  GetForwardingInterface()->OnDragLeave();
}
void DropTargetInterceptorForTesting::OnDrop(const std::vector<::tabs_api::NodeId>& source_tab_ids, const ::gfx::Point& local_point) {
  GetForwardingInterface()->OnDrop(
    std::move(source_tab_ids)
    , 
    std::move(local_point)
    );
}
void DropTargetInterceptorForTesting::OnDragCancelled() {
  GetForwardingInterface()->OnDragCancelled();
}
DropTargetAsyncWaiter::DropTargetAsyncWaiter(
    DropTarget* proxy) : proxy_(proxy) {}

DropTargetAsyncWaiter::~DropTargetAsyncWaiter() = default;







}  // tabs_api::mojom


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