Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PProcessHangMonitorChild.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 PProcessHangMonitorChild::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PProcessHangMonitorChild::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PProcessHangMonitorChild::PProcessHangMonitorChild() :
mozilla::ipc::IToplevelProtocol("PProcessHangMonitorChild", kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PProcessHangMonitorChild);
}
PProcessHangMonitorChild::~PProcessHangMonitorChild()
{
MOZ_COUNT_DTOR(PProcessHangMonitorChild);
}
auto PProcessHangMonitorChild::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsContentProcess(), "Invalid process for `PProcessHangMonitorChild'");
AddRef();
}
auto PProcessHangMonitorChild::ActorDealloc() -> void
{
Release();
}
auto PProcessHangMonitorChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PProcessHangMonitorChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PProcessHangMonitorChild::SendHangEvidence(const SlowScriptData& data) -> bool
{
UniquePtr<IPC::Message> msg__ = PProcessHangMonitor::Msg_HangEvidence(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), data);
// Sentinel = 'data'
((&(writer__)))->WriteSentinel(67109275);
if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProcessHangMonitorChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_HangEvidence", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PProcessHangMonitorChild::SendClearHang() -> bool
{
UniquePtr<IPC::Message> msg__ = PProcessHangMonitor::Msg_ClearHang(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProcessHangMonitorChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_ClearHang", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PProcessHangMonitorChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PProcessHangMonitorChild::OnMessageReceived(const Message& msg__) -> PProcessHangMonitorChild::Result
{
switch (msg__.type()) {
case PProcessHangMonitor::Msg_TerminateScript__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProcessHangMonitorChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_TerminateScript", OTHER);
mozilla::ipc::IPCResult __ok = (this)->RecvTerminateScript();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProcessHangMonitor::Msg_RequestContentJSInterrupt__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProcessHangMonitorChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_RequestContentJSInterrupt", OTHER);
mozilla::ipc::IPCResult __ok = (this)->RecvRequestContentJSInterrupt();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProcessHangMonitor::Msg_BeginStartingDebugger__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProcessHangMonitorChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_BeginStartingDebugger", OTHER);
mozilla::ipc::IPCResult __ok = (this)->RecvBeginStartingDebugger();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProcessHangMonitor::Msg_EndStartingDebugger__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProcessHangMonitorChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_EndStartingDebugger", OTHER);
mozilla::ipc::IPCResult __ok = (this)->RecvEndStartingDebugger();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProcessHangMonitor::Msg_PaintWhileInterruptingJS__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProcessHangMonitorChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_PaintWhileInterruptingJS", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__tabId = IPC::ReadParam<TabId>((&(reader__)));
if (!maybe__tabId) {
FatalError("Error deserializing 'TabId'");
return MsgValueError;
}
auto& tabId = *maybe__tabId;
// Sentinel = 'tabId'
if ((!(((&(reader__)))->ReadSentinel(99156453)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'TabId'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvPaintWhileInterruptingJS(std::move(tabId));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProcessHangMonitor::Msg_UnloadLayersWhileInterruptingJS__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProcessHangMonitorChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_UnloadLayersWhileInterruptingJS", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__tabId = IPC::ReadParam<TabId>((&(reader__)));
if (!maybe__tabId) {
FatalError("Error deserializing 'TabId'");
return MsgValueError;
}
auto& tabId = *maybe__tabId;
// Sentinel = 'tabId'
if ((!(((&(reader__)))->ReadSentinel(99156453)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'TabId'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvUnloadLayersWhileInterruptingJS(std::move(tabId));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProcessHangMonitor::Msg_CancelContentJSExecutionIfRunning__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProcessHangMonitorChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_CancelContentJSExecutionIfRunning", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__tabId = IPC::ReadParam<TabId>((&(reader__)));
if (!maybe__tabId) {
FatalError("Error deserializing 'TabId'");
return MsgValueError;
}
auto& tabId = *maybe__tabId;
// Sentinel = 'tabId'
if ((!(((&(reader__)))->ReadSentinel(99156453)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'TabId'");
return MsgValueError;
}
auto maybe__aNavigationType = IPC::ReadParam<NavigationType>((&(reader__)));
if (!maybe__aNavigationType) {
FatalError("Error deserializing 'NavigationType'");
return MsgValueError;
}
auto& aNavigationType = *maybe__aNavigationType;
// Sentinel = 'aNavigationType'
if ((!(((&(reader__)))->ReadSentinel(799540756)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'NavigationType'");
return MsgValueError;
}
auto maybe__aNavigationIndex = IPC::ReadParam<int32_t>((&(reader__)));
if (!maybe__aNavigationIndex) {
FatalError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto& aNavigationIndex = *maybe__aNavigationIndex;
// Sentinel = 'aNavigationIndex'
if ((!(((&(reader__)))->ReadSentinel(900531818)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto maybe__aNavigationURI = IPC::ReadParam<mozilla::Maybe<nsCString>>((&(reader__)));
if (!maybe__aNavigationURI) {
FatalError("Error deserializing 'nsCString?'");
return MsgValueError;
}
auto& aNavigationURI = *maybe__aNavigationURI;
// Sentinel = 'aNavigationURI'
if ((!(((&(reader__)))->ReadSentinel(690095458)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString?'");
return MsgValueError;
}
auto maybe__aEpoch = IPC::ReadParam<int32_t>((&(reader__)));
if (!maybe__aEpoch) {
FatalError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto& aEpoch = *maybe__aEpoch;
// Sentinel = 'aEpoch'
if ((!(((&(reader__)))->ReadSentinel(132121169)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvCancelContentJSExecutionIfRunning(std::move(tabId), std::move(aNavigationType), std::move(aNavigationIndex), std::move(aNavigationURI), std::move(aEpoch));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProcessHangMonitor::Msg_SetMainThreadQoSPriority__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitor", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProcessHangMonitorChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_SetMainThreadQoSPriority", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__qosPriority = IPC::ReadParam<QoSPriority>((&(reader__)));
if (!maybe__qosPriority) {
FatalError("Error deserializing 'QoSPriority'");
return MsgValueError;
}
auto& qosPriority = *maybe__qosPriority;
// Sentinel = 'qosPriority'
if ((!(((&(reader__)))->ReadSentinel(468321462)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'QoSPriority'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvSetMainThreadQoSPriority(std::move(qosPriority));
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 PProcessHangMonitorChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PProcessHangMonitorChild::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PProcessHangMonitorChild*>::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::PProcessHangMonitorChild*>::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::PProcessHangMonitorChild*>(actor.ref());
}
return {};
}
} // namespace IPC