// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/dom/PSerialPortParent.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/dom/SerialPortIPCTypes.h" #include "mozilla/dom/SerialPortParent.h" #include "mozilla/ipc/DataPipe.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 PSerialPortParent::Recv__delete__() -> mozilla::ipc::IPCResult { return IPC_OK(); } auto PSerialPortParent::ProcessingError( Result aCode, const char* aReason) -> void { } auto PSerialPortParent::ShouldContinueFromReplyTimeout() -> bool { return true; } MOZ_IMPLICIT PSerialPortParent::PSerialPortParent() : mozilla::ipc::IToplevelProtocol("PSerialPortParent", kProtocolId, mozilla::ipc::ParentSide) { MOZ_COUNT_CTOR(PSerialPortParent); } PSerialPortParent::~PSerialPortParent() { MOZ_COUNT_DTOR(PSerialPortParent); } auto PSerialPortParent::ActorAlloc() -> void { MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PSerialPortParent'"); AddRef(); } auto PSerialPortParent::ActorDealloc() -> void { Release(); } auto PSerialPortParent::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PSerialPortParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PSerialPortParent::RejectPendingResponses(ResponseRejectReason aReason) -> void { mAsyncCallbacks.RejectPendingResponses(aReason); } auto PSerialPortParent::SendConnected() -> bool { UniquePtr msg__ = PSerialPort::Msg_Connected(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PSerialPort::Msg_Connected", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PSerialPortParent::SendDisconnected() -> bool { UniquePtr msg__ = PSerialPort::Msg_Disconnected(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PSerialPort::Msg_Disconnected", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PSerialPortParent::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PSerialPortParent::OnMessageReceived(const Message& msg__) -> PSerialPortParent::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } switch (msg__.type()) { case PSerialPort::Msg_Open__ID: { if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSerialPort::Msg_Open", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__options = IPC::ReadParam((&(reader__))); if (!maybe__options) { FatalError("Error deserializing 'IPCSerialOptions'"); return MsgValueError; } auto& options = *maybe__options; // Sentinel = 'options' if ((!(((&(reader__)))->ReadSentinel(204735245)))) { mozilla::ipc::SentinelReadError("Error deserializing 'IPCSerialOptions'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL; UniquePtr reply__(PSerialPort::Reply_Open(id__)); reply__->set_seqno(msg__.seqno()); RefPtr resolver__ = new mozilla::ipc::IPDLResolverInner(std::move(reply__), this); OpenResolver resolver = [resolver__ = std::move(resolver__)](const nsresult& aParam) { resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) { IPC::MessageWriter writer__(*reply__, self__); IPC::WriteParam((&(writer__)), aParam); // Sentinel = 'result' ((&(writer__)))->WriteSentinel(153223840); if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", self__->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending reply ", reply__->type(), mozilla::ipc::MessageDirection::eSending); } }); }; mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SerialPortParent*>(this))->RecvOpen(std::move(options), std::move(resolver)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSerialPort::Msg_Close__ID: { if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSerialPort::Msg_Close", OTHER); mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL; UniquePtr reply__(PSerialPort::Reply_Close(id__)); reply__->set_seqno(msg__.seqno()); RefPtr resolver__ = new mozilla::ipc::IPDLResolverInner(std::move(reply__), this); CloseResolver resolver = [resolver__ = std::move(resolver__)](const nsresult& aParam) { resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) { IPC::MessageWriter writer__(*reply__, self__); IPC::WriteParam((&(writer__)), aParam); // Sentinel = 'result' ((&(writer__)))->WriteSentinel(153223840); if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", self__->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending reply ", reply__->type(), mozilla::ipc::MessageDirection::eSending); } }); }; mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SerialPortParent*>(this))->RecvClose(std::move(resolver)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSerialPort::Msg_SetSignals__ID: { if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSerialPort::Msg_SetSignals", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__signals = IPC::ReadParam((&(reader__))); if (!maybe__signals) { FatalError("Error deserializing 'IPCSerialOutputSignals'"); return MsgValueError; } auto& signals = *maybe__signals; // Sentinel = 'signals' if ((!(((&(reader__)))->ReadSentinel(197853938)))) { mozilla::ipc::SentinelReadError("Error deserializing 'IPCSerialOutputSignals'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL; UniquePtr reply__(PSerialPort::Reply_SetSignals(id__)); reply__->set_seqno(msg__.seqno()); RefPtr resolver__ = new mozilla::ipc::IPDLResolverInner(std::move(reply__), this); SetSignalsResolver resolver = [resolver__ = std::move(resolver__)](const nsresult& aParam) { resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) { IPC::MessageWriter writer__(*reply__, self__); IPC::WriteParam((&(writer__)), aParam); // Sentinel = 'result' ((&(writer__)))->WriteSentinel(153223840); if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", self__->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending reply ", reply__->type(), mozilla::ipc::MessageDirection::eSending); } }); }; mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SerialPortParent*>(this))->RecvSetSignals(std::move(signals), std::move(resolver)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSerialPort::Msg_GetSignals__ID: { if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSerialPort::Msg_GetSignals", OTHER); mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL; UniquePtr reply__(PSerialPort::Reply_GetSignals(id__)); reply__->set_seqno(msg__.seqno()); RefPtr resolver__ = new mozilla::ipc::IPDLResolverInner(std::move(reply__), this); GetSignalsResolver resolver = [resolver__ = std::move(resolver__)](std::tuple aParam) { resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) { IPC::MessageWriter writer__(*reply__, self__); IPC::WriteParam((&(writer__)), std::get<0>(aParam)); // Sentinel = 'result' ((&(writer__)))->WriteSentinel(153223840); IPC::WriteParam((&(writer__)), std::get<1>(aParam)); // Sentinel = 'signals' ((&(writer__)))->WriteSentinel(197853938); if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", self__->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending reply ", reply__->type(), mozilla::ipc::MessageDirection::eSending); } }); }; mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SerialPortParent*>(this))->RecvGetSignals(std::move(resolver)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSerialPort::Msg_Drain__ID: { if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSerialPort::Msg_Drain", OTHER); mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL; UniquePtr reply__(PSerialPort::Reply_Drain(id__)); reply__->set_seqno(msg__.seqno()); RefPtr resolver__ = new mozilla::ipc::IPDLResolverInner(std::move(reply__), this); DrainResolver resolver = [resolver__ = std::move(resolver__)](const nsresult& aParam) { resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) { IPC::MessageWriter writer__(*reply__, self__); IPC::WriteParam((&(writer__)), aParam); // Sentinel = 'result' ((&(writer__)))->WriteSentinel(153223840); if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", self__->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending reply ", reply__->type(), mozilla::ipc::MessageDirection::eSending); } }); }; mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SerialPortParent*>(this))->RecvDrain(std::move(resolver)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSerialPort::Msg_Flush__ID: { if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSerialPort::Msg_Flush", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__receive = IPC::ReadParam((&(reader__))); if (!maybe__receive) { FatalError("Error deserializing 'bool'"); return MsgValueError; } auto& receive = *maybe__receive; // Sentinel = 'receive' if ((!(((&(reader__)))->ReadSentinel(194118372)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL; UniquePtr reply__(PSerialPort::Reply_Flush(id__)); reply__->set_seqno(msg__.seqno()); RefPtr resolver__ = new mozilla::ipc::IPDLResolverInner(std::move(reply__), this); FlushResolver resolver = [resolver__ = std::move(resolver__)](const nsresult& aParam) { resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) { IPC::MessageWriter writer__(*reply__, self__); IPC::WriteParam((&(writer__)), aParam); // Sentinel = 'result' ((&(writer__)))->WriteSentinel(153223840); if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", self__->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending reply ", reply__->type(), mozilla::ipc::MessageDirection::eSending); } }); }; mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SerialPortParent*>(this))->RecvFlush(std::move(receive), std::move(resolver)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSerialPort::Msg_AttachReadPipe__ID: { if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSerialPort::Msg_AttachReadPipe", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__readPipeSender = IPC::ReadParam>((&(reader__))); if (!maybe__readPipeSender) { FatalError("Error deserializing 'DataPipeSender'"); return MsgValueError; } auto& readPipeSender = *maybe__readPipeSender; // Sentinel = 'readPipeSender' if ((!(((&(reader__)))->ReadSentinel(694289804)))) { mozilla::ipc::SentinelReadError("Error deserializing 'DataPipeSender'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SerialPortParent*>(this))->RecvAttachReadPipe(readPipeSender); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSerialPort::Msg_AttachWritePipe__ID: { if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSerialPort::Msg_AttachWritePipe", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__writePipeReceiver = IPC::ReadParam>((&(reader__))); if (!maybe__writePipeReceiver) { FatalError("Error deserializing 'DataPipeReceiver'"); return MsgValueError; } auto& writePipeReceiver = *maybe__writePipeReceiver; // Sentinel = 'writePipeReceiver' if ((!(((&(reader__)))->ReadSentinel(1053296367)))) { mozilla::ipc::SentinelReadError("Error deserializing 'DataPipeReceiver'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SerialPortParent*>(this))->RecvAttachWritePipe(writePipeReceiver); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSerialPort::Msg_Clone__ID: { if (mozilla::ipc::LoggingEnabledFor("PSerialPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSerialPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSerialPort::Msg_Clone", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aEndpoint = IPC::ReadParam>((&(reader__))); if (!maybe__aEndpoint) { FatalError("Error deserializing 'Endpoint<::mozilla::dom::PSerialPortParent>'"); return MsgValueError; } auto& aEndpoint = *maybe__aEndpoint; // Sentinel = 'aEndpoint' if ((!(((&(reader__)))->ReadSentinel(292225955)))) { mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::dom::PSerialPortParent>'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SerialPortParent*>(this))->RecvClone(std::move(aEndpoint)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } default: return MsgNotKnown; case SHMEM_CREATED_MESSAGE_TYPE: { if (!ShmemCreated(msg__)) { return MsgPayloadError; } return MsgProcessed; } case SHMEM_DESTROYED_MESSAGE_TYPE: { if (!ShmemDestroyed(msg__)) { return MsgPayloadError; } return MsgProcessed; } } } auto PSerialPortParent::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PSerialPortParent::Result { if (!CanSend()) { return MsgDropped; } MOZ_ASSERT_UNREACHABLE("message protocol not supported"); return MsgNotKnown; } } // namespace dom } // namespace mozilla