Copy as Markdown

Other Tools

//
// 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", PProcessHangMonitorMsgStart, 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::AllManagedActors(nsTArray<RefPtr<mozilla::ipc::ActorLifecycleProxy>>& arr__) const -> void
{
uint32_t total = 0;
arr__.SetCapacity(total);
}
auto PProcessHangMonitorParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PProcessHangMonitorParent::SendTerminateScript() -> bool
{
UniquePtr<IPC::Message> 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<IPC::Message> 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<IPC::Message> 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<IPC::Message> 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<IPC::Message> 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<IPC::Message> 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<nsCString>& aNavigationURI,
const int32_t& aEpoch) -> bool
{
UniquePtr<IPC::Message> 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<IPC::Message> 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::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PProcessHangMonitorParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PProcessHangMonitorParent::OnMessageReceived(const Message& msg__) -> PProcessHangMonitorParent::Result
{
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<SlowScriptData>((&(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<Message>& reply__) -> PProcessHangMonitorParent::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
auto PProcessHangMonitorParent::OnChannelClose() -> void
{
DestroySubtree(NormalShutdown);
ClearSubtree();
DeallocShmems();
if (GetLifecycleProxy()) {
GetLifecycleProxy()->Release();
}
}
auto PProcessHangMonitorParent::OnChannelError() -> void
{
DestroySubtree(AbnormalShutdown);
ClearSubtree();
DeallocShmems();
if (GetLifecycleProxy()) {
GetLifecycleProxy()->Release();
}
}
auto PProcessHangMonitorParent::ClearSubtree() -> void
{
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PProcessHangMonitorParent*>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
MOZ_RELEASE_ASSERT(
aWriter->GetActor(),
"Cannot serialize managed actors without an actor");
int32_t id;
if (!aVar) {
id = 0; // kNullActorId
} else {
id = aVar->Id();
if (id == 1) { // kFreedActorId
aVar->FatalError("Actor has been |delete|d");
}
MOZ_RELEASE_ASSERT(
aWriter->GetActor()->GetIPCChannel() == aVar->GetIPCChannel(),
"Actor must be from the same channel as the"
" actor it's being sent over");
MOZ_RELEASE_ASSERT(
aVar->CanSend(),
"Actor must still be open when sending");
}
IPC::WriteParam(aWriter, id);
}
auto ParamTraits<::mozilla::PProcessHangMonitorParent*>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
MOZ_RELEASE_ASSERT(
aReader->GetActor(),
"Cannot deserialize managed actors without an actor");
mozilla::Maybe<mozilla::ipc::IProtocol*> actor = aReader->GetActor()
->ReadActor(aReader, true, "PProcessHangMonitor", PProcessHangMonitorMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::PProcessHangMonitorParent*>(actor.ref());
}
return {};
}
} // namespace IPC