// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/PProcessHangMonitorParent.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/dom/TabMessageUtils.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 { auto PProcessHangMonitorParent::ProcessingError( Result aCode, const char* aReason) -> void { } auto PProcessHangMonitorParent::ShouldContinueFromReplyTimeout() -> bool { return true; } MOZ_IMPLICIT PProcessHangMonitorParent::PProcessHangMonitorParent() : mozilla::ipc::IToplevelProtocol("PProcessHangMonitorParent", kProtocolId, mozilla::ipc::ParentSide) { MOZ_COUNT_CTOR(PProcessHangMonitorParent); } PProcessHangMonitorParent::~PProcessHangMonitorParent() { MOZ_COUNT_DTOR(PProcessHangMonitorParent); } auto PProcessHangMonitorParent::ActorAlloc() -> void { MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PProcessHangMonitorParent'"); AddRef(); } auto PProcessHangMonitorParent::ActorDealloc() -> void { Release(); } auto PProcessHangMonitorParent::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PProcessHangMonitorParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PProcessHangMonitorParent::SendTerminateScript() -> bool { UniquePtr msg__ = PProcessHangMonitor::Msg_TerminateScript(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PProcessHangMonitorParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_TerminateScript", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PProcessHangMonitorParent::SendRequestContentJSInterrupt() -> bool { UniquePtr msg__ = PProcessHangMonitor::Msg_RequestContentJSInterrupt(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PProcessHangMonitorParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_RequestContentJSInterrupt", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PProcessHangMonitorParent::SendBeginStartingDebugger() -> bool { UniquePtr msg__ = PProcessHangMonitor::Msg_BeginStartingDebugger(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PProcessHangMonitorParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_BeginStartingDebugger", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PProcessHangMonitorParent::SendEndStartingDebugger() -> bool { UniquePtr msg__ = PProcessHangMonitor::Msg_EndStartingDebugger(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PProcessHangMonitorParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_EndStartingDebugger", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PProcessHangMonitorParent::SendPaintWhileInterruptingJS(const TabId& tabId) -> bool { UniquePtr msg__ = PProcessHangMonitor::Msg_PaintWhileInterruptingJS(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), tabId); // Sentinel = 'tabId' ((&(writer__)))->WriteSentinel(99156453); if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PProcessHangMonitorParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_PaintWhileInterruptingJS", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PProcessHangMonitorParent::SendUnloadLayersWhileInterruptingJS(const TabId& tabId) -> bool { UniquePtr msg__ = PProcessHangMonitor::Msg_UnloadLayersWhileInterruptingJS(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), tabId); // Sentinel = 'tabId' ((&(writer__)))->WriteSentinel(99156453); if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PProcessHangMonitorParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_UnloadLayersWhileInterruptingJS", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PProcessHangMonitorParent::SendCancelContentJSExecutionIfRunning( const TabId& tabId, const NavigationType& aNavigationType, const int32_t& aNavigationIndex, const mozilla::Maybe& aNavigationURI, const int32_t& aEpoch) -> bool { UniquePtr msg__ = PProcessHangMonitor::Msg_CancelContentJSExecutionIfRunning(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), tabId); // Sentinel = 'tabId' ((&(writer__)))->WriteSentinel(99156453); IPC::WriteParam((&(writer__)), aNavigationType); // Sentinel = 'aNavigationType' ((&(writer__)))->WriteSentinel(799540756); IPC::WriteParam((&(writer__)), aNavigationIndex); // Sentinel = 'aNavigationIndex' ((&(writer__)))->WriteSentinel(900531818); IPC::WriteParam((&(writer__)), aNavigationURI); // Sentinel = 'aNavigationURI' ((&(writer__)))->WriteSentinel(690095458); IPC::WriteParam((&(writer__)), aEpoch); // Sentinel = 'aEpoch' ((&(writer__)))->WriteSentinel(132121169); if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PProcessHangMonitorParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_CancelContentJSExecutionIfRunning", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PProcessHangMonitorParent::SendSetMainThreadQoSPriority(const QoSPriority& qosPriority) -> bool { UniquePtr msg__ = PProcessHangMonitor::Msg_SetMainThreadQoSPriority(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), qosPriority); // Sentinel = 'qosPriority' ((&(writer__)))->WriteSentinel(468321462); if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PProcessHangMonitorParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_SetMainThreadQoSPriority", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PProcessHangMonitorParent::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PProcessHangMonitorParent::OnMessageReceived(const Message& msg__) -> PProcessHangMonitorParent::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PProcessHangMonitorParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } switch (msg__.type()) { case PProcessHangMonitor::Msg_HangEvidence__ID: { if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PProcessHangMonitorParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_HangEvidence", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__data = IPC::ReadParam((&(reader__))); if (!maybe__data) { FatalError("Error deserializing 'SlowScriptData'"); return MsgValueError; } auto& data = *maybe__data; // Sentinel = 'data' if ((!(((&(reader__)))->ReadSentinel(67109275)))) { mozilla::ipc::SentinelReadError("Error deserializing 'SlowScriptData'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (this)->RecvHangEvidence(std::move(data)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PProcessHangMonitor::Msg_ClearHang__ID: { if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PProcessHangMonitorParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_ClearHang", OTHER); mozilla::ipc::IPCResult __ok = (this)->RecvClearHang(); 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 PProcessHangMonitorParent::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PProcessHangMonitorParent::Result { if (!CanSend()) { return MsgDropped; } MOZ_ASSERT_UNREACHABLE("message protocol not supported"); return MsgNotKnown; } } // namespace mozilla