// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/dom/PDigitalCredentialChild.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/dom/DigitalCredentialChild.h" #include "mozilla/dom/PWindowGlobalChild.h" #include "ipc/IPCMessageUtils.h" #include "ipc/IPCMessageUtilsSpecializations.h" #include "nsIFile.h" #include "mozilla/ipc/Endpoint.h" #include "mozilla/ipc/ProtocolMessageUtils.h" #include "mozilla/ipc/ProtocolUtils.h" #include "mozilla/ipc/ShmemMessageUtils.h" #include "mozilla/ipc/TaintingIPCUtils.h" namespace mozilla { namespace dom { auto PDigitalCredentialChild::Recv__delete__() -> mozilla::ipc::IPCResult { return IPC_OK(); } MOZ_IMPLICIT PDigitalCredentialChild::PDigitalCredentialChild() : mozilla::ipc::IRefCountedProtocol(kProtocolId, mozilla::ipc::ChildSide) { MOZ_COUNT_CTOR(PDigitalCredentialChild); } PDigitalCredentialChild::~PDigitalCredentialChild() { MOZ_COUNT_DTOR(PDigitalCredentialChild); } auto PDigitalCredentialChild::ActorAlloc() -> void { AddRef(); } auto PDigitalCredentialChild::ActorDealloc() -> void { Release(); } auto PDigitalCredentialChild::Manager() const -> PWindowGlobalChild* { return static_cast(IProtocol::Manager()); } auto PDigitalCredentialChild::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PDigitalCredentialChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PDigitalCredentialChild::RejectPendingResponses(ResponseRejectReason aReason) -> void { mAsyncCallbacks.RejectPendingResponses(aReason); } auto PDigitalCredentialChild::SendGetDigitalCredential( mozilla::Span aRequests, mozilla::ipc::ResolveCallback&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PDigitalCredential::Msg_GetDigitalCredential(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aRequests); // Sentinel = 'aRequests' ((&(writer__)))->WriteSentinel(301728702); if (mozilla::ipc::LoggingEnabledFor("PDigitalCredential", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PDigitalCredentialChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PDigitalCredential::Msg_GetDigitalCredential", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PDigitalCredential::Reply_GetDigitalCredential__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__response = IPC::ReadParam(aReader); if (!maybe__response) { (aReader)->FatalError("Error deserializing 'IPCDigitalCredentialResponse'"); return MsgValueError; } auto& response = *maybe__response; // Sentinel = 'response' if ((!((aReader)->ReadSentinel(260965232)))) { mozilla::ipc::SentinelReadError("Error deserializing 'IPCDigitalCredentialResponse'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(response)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PDigitalCredentialChild::SendGetDigitalCredential(mozilla::Span aRequests) -> RefPtr { RefPtr::Private> promise__ = new MozPromise::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendGetDigitalCredential(std::forward>(aRequests), [promise__](IPCDigitalCredentialResponse&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PDigitalCredentialChild::SendCreateDigitalCredential( mozilla::Span aRequests, mozilla::ipc::ResolveCallback&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PDigitalCredential::Msg_CreateDigitalCredential(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aRequests); // Sentinel = 'aRequests' ((&(writer__)))->WriteSentinel(301728702); if (mozilla::ipc::LoggingEnabledFor("PDigitalCredential", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PDigitalCredentialChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PDigitalCredential::Msg_CreateDigitalCredential", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PDigitalCredential::Reply_CreateDigitalCredential__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__response = IPC::ReadParam(aReader); if (!maybe__response) { (aReader)->FatalError("Error deserializing 'IPCDigitalCredentialResponse'"); return MsgValueError; } auto& response = *maybe__response; // Sentinel = 'response' if ((!((aReader)->ReadSentinel(260965232)))) { mozilla::ipc::SentinelReadError("Error deserializing 'IPCDigitalCredentialResponse'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(response)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PDigitalCredentialChild::SendCreateDigitalCredential(mozilla::Span aRequests) -> RefPtr { RefPtr::Private> promise__ = new MozPromise::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendCreateDigitalCredential(std::forward>(aRequests), [promise__](IPCDigitalCredentialResponse&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PDigitalCredentialChild::SendCancelOperationInParent() -> bool { UniquePtr msg__ = PDigitalCredential::Msg_CancelOperationInParent(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PDigitalCredential", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PDigitalCredentialChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PDigitalCredential::Msg_CancelOperationInParent", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PDigitalCredentialChild::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PDigitalCredentialChild::OnMessageReceived(const Message& msg__) -> PDigitalCredentialChild::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PDigitalCredential", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PDigitalCredentialChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } switch (msg__.type()) { case MANAGED_ENDPOINT_BOUND_MESSAGE_TYPE: { if (!mAwaitingManagedEndpointBind) { NS_WARNING("Unexpected managed endpoint lifecycle message after actor bound!"); return MsgNotAllowed; } mAwaitingManagedEndpointBind = false; return MsgProcessed; } case MANAGED_ENDPOINT_DROPPED_MESSAGE_TYPE: { if (!mAwaitingManagedEndpointBind) { NS_WARNING("Unexpected managed endpoint lifecycle message after actor bound!"); return MsgNotAllowed; } mAwaitingManagedEndpointBind = false; this->ActorDisconnected(ManagedEndpointDropped); return MsgProcessed; } case PDigitalCredential::Reply_GetDigitalCredential__ID: { if (mozilla::ipc::LoggingEnabledFor("PDigitalCredential", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PDigitalCredentialChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PDigitalCredential::Msg_GetDigitalCredential", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PDigitalCredential::Reply_CreateDigitalCredential__ID: { if (mozilla::ipc::LoggingEnabledFor("PDigitalCredential", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PDigitalCredentialChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PDigitalCredential::Msg_CreateDigitalCredential", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PDigitalCredential::Msg___delete____ID: { if (mozilla::ipc::LoggingEnabledFor("PDigitalCredential", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PDigitalCredentialChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PDigitalCredential::Msg___delete__", OTHER); DoomSubtree(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::DigitalCredentialChild*>(this))->Recv__delete__(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } this->ActorDisconnected(Deletion); return MsgProcessed; } default: return MsgNotKnown; } } auto PDigitalCredentialChild::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PDigitalCredentialChild::Result { if (!CanSend()) { return MsgDropped; } return MsgNotKnown; } } // namespace dom } // namespace mozilla