// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/dom/PMIDIPortChild.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/dom/MIDIIPCUtils.h" #include "mozilla/dom/MIDIPortChild.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 PMIDIPortChild::ProcessingError( Result aCode, const char* aReason) -> void { } auto PMIDIPortChild::ShouldContinueFromReplyTimeout() -> bool { return true; } MOZ_IMPLICIT PMIDIPortChild::PMIDIPortChild() : mozilla::ipc::IToplevelProtocol("PMIDIPortChild", kProtocolId, mozilla::ipc::ChildSide) { MOZ_COUNT_CTOR(PMIDIPortChild); } PMIDIPortChild::~PMIDIPortChild() { MOZ_COUNT_DTOR(PMIDIPortChild); } auto PMIDIPortChild::ActorAlloc() -> void { MOZ_RELEASE_ASSERT(XRE_IsParentProcess() || XRE_IsContentProcess(), "Invalid process for `PMIDIPortChild'"); AddRef(); } auto PMIDIPortChild::ActorDealloc() -> void { Release(); } auto PMIDIPortChild::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PMIDIPortChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PMIDIPortChild::SendShutdown() -> bool { UniquePtr msg__ = PMIDIPort::Msg_Shutdown(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_Shutdown", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PMIDIPortChild::SendSend(mozilla::Span msg) -> bool { UniquePtr msg__ = PMIDIPort::Msg_Send(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), msg); // Sentinel = 'msg' ((&(writer__)))->WriteSentinel(43450696); if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_Send", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PMIDIPortChild::SendOpen() -> bool { UniquePtr msg__ = PMIDIPort::Msg_Open(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_Open", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PMIDIPortChild::SendClose() -> bool { UniquePtr msg__ = PMIDIPort::Msg_Close(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_Close", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PMIDIPortChild::SendClear() -> bool { UniquePtr msg__ = PMIDIPort::Msg_Clear(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_Clear", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PMIDIPortChild::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PMIDIPortChild::OnMessageReceived(const Message& msg__) -> PMIDIPortChild::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } switch (msg__.type()) { case PMIDIPort::Msg_Receive__ID: { if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_Receive", 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::MIDIPortChild*>(this))->RecvReceive(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_UpdateStatus__ID: { if (mozilla::ipc::LoggingEnabledFor("PMIDIPort", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMIDIPortChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PMIDIPort::Msg_UpdateStatus", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__deviceState = IPC::ReadParam((&(reader__))); if (!maybe__deviceState) { FatalError("Error deserializing 'MIDIPortDeviceState'"); return MsgValueError; } auto& deviceState = *maybe__deviceState; // Sentinel = 'deviceState' if ((!(((&(reader__)))->ReadSentinel(447284338)))) { mozilla::ipc::SentinelReadError("Error deserializing 'MIDIPortDeviceState'"); return MsgValueError; } auto maybe__connectionState = IPC::ReadParam((&(reader__))); if (!maybe__connectionState) { FatalError("Error deserializing 'MIDIPortConnectionState'"); return MsgValueError; } auto& connectionState = *maybe__connectionState; // Sentinel = 'connectionState' if ((!(((&(reader__)))->ReadSentinel(834209330)))) { mozilla::ipc::SentinelReadError("Error deserializing 'MIDIPortConnectionState'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::MIDIPortChild*>(this))->RecvUpdateStatus(std::move(deviceState), std::move(connectionState)); 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 PMIDIPortChild::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PMIDIPortChild::Result { if (!CanSend()) { return MsgDropped; } MOZ_ASSERT_UNREACHABLE("message protocol not supported"); return MsgNotKnown; } } // namespace dom } // namespace mozilla