// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/dom/PMIDIPortParent.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/dom/MIDIIPCUtils.h" #include "mozilla/dom/MIDIPortParent.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 PMIDIPortParent::ProcessingError( Result aCode, const char* aReason) -> void { } auto PMIDIPortParent::ShouldContinueFromReplyTimeout() -> bool { return true; } MOZ_IMPLICIT PMIDIPortParent::PMIDIPortParent() : mozilla::ipc::IToplevelProtocol("PMIDIPortParent", kProtocolId, mozilla::ipc::ParentSide) { MOZ_COUNT_CTOR(PMIDIPortParent); } PMIDIPortParent::~PMIDIPortParent() { MOZ_COUNT_DTOR(PMIDIPortParent); } auto PMIDIPortParent::ActorAlloc() -> void { MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PMIDIPortParent'"); AddRef(); } auto PMIDIPortParent::ActorDealloc() -> void { Release(); } auto PMIDIPortParent::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PMIDIPortParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PMIDIPortParent::SendReceive(mozilla::Span msg) -> bool { UniquePtr msg__ = PMIDIPort::Msg_Receive(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), msg); // Sentinel = 'msg' ((&(writer__)))->WriteSentinel(43450696); if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_Receive", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PMIDIPortParent::SendUpdateStatus( const MIDIPortDeviceState& deviceState, const MIDIPortConnectionState& connectionState) -> bool { UniquePtr msg__ = PMIDIPort::Msg_UpdateStatus(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), deviceState); // Sentinel = 'deviceState' ((&(writer__)))->WriteSentinel(447284338); IPC::WriteParam((&(writer__)), connectionState); // Sentinel = 'connectionState' ((&(writer__)))->WriteSentinel(834209330); if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_UpdateStatus", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PMIDIPortParent::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PMIDIPortParent::OnMessageReceived(const Message& msg__) -> PMIDIPortParent::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } switch (msg__.type()) { case PMIDIPort::Msg_Shutdown__ID: { if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_Shutdown", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::MIDIPortParent*>(this))->RecvShutdown(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PMIDIPort::Msg_Send__ID: { if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_Send", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__msg = IPC::ReadParam>((&(reader__))); if (!maybe__msg) { FatalError("Error deserializing 'MIDIMessage[]'"); return MsgValueError; } auto& msg = *maybe__msg; // Sentinel = 'msg' if ((!(((&(reader__)))->ReadSentinel(43450696)))) { mozilla::ipc::SentinelReadError("Error deserializing 'MIDIMessage[]'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::MIDIPortParent*>(this))->RecvSend(std::move(msg)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PMIDIPort::Msg_Open__ID: { if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_Open", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::MIDIPortParent*>(this))->RecvOpen(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PMIDIPort::Msg_Close__ID: { if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_Close", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::MIDIPortParent*>(this))->RecvClose(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PMIDIPort::Msg_Clear__ID: { if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_Clear", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::MIDIPortParent*>(this))->RecvClear(); 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 PMIDIPortParent::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PMIDIPortParent::Result { if (!CanSend()) { return MsgDropped; } MOZ_ASSERT_UNREACHABLE("message protocol not supported"); return MsgNotKnown; } } // namespace dom } // namespace mozilla