Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PProfilerChild.h"
#include "ProfileAdditionalInformation.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/TimeStamp.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 PProfilerChild::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PProfilerChild::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PProfilerChild::PProfilerChild() :
mozilla::ipc::IToplevelProtocol("PProfilerChild", kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PProfilerChild);
}
PProfilerChild::~PProfilerChild()
{
MOZ_COUNT_DTOR(PProfilerChild);
}
auto PProfilerChild::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(!XRE_IsParentProcess(), "Invalid process for `PProfilerChild'");
AddRef();
}
auto PProfilerChild::ActorDealloc() -> void
{
Release();
}
auto PProfilerChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PProfilerChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PProfilerChild::RejectPendingResponses(ResponseRejectReason aReason) -> void
{
mAsyncCallbacks.RejectPendingResponses(aReason);
}
auto PProfilerChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PProfilerChild::OnMessageReceived(const Message& msg__) -> PProfilerChild::Result
{
switch (msg__.type()) {
case PProfiler::Msg_Start__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_Start", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__params = IPC::ReadParam<ProfilerInitParams>((&(reader__)));
if (!maybe__params) {
FatalError("Error deserializing 'ProfilerInitParams'");
return MsgValueError;
}
auto& params = *maybe__params;
// Sentinel = 'params'
if ((!(((&(reader__)))->ReadSentinel(146997893)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ProfilerInitParams'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PProfiler::Reply_Start(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
StartResolver resolver = [resolver__ = std::move(resolver__)](const bool& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'unused'
((&(writer__)))->WriteSentinel(155517589);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvStart(std::move(params), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProfiler::Msg_EnsureStarted__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_EnsureStarted", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__params = IPC::ReadParam<ProfilerInitParams>((&(reader__)));
if (!maybe__params) {
FatalError("Error deserializing 'ProfilerInitParams'");
return MsgValueError;
}
auto& params = *maybe__params;
// Sentinel = 'params'
if ((!(((&(reader__)))->ReadSentinel(146997893)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ProfilerInitParams'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PProfiler::Reply_EnsureStarted(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
EnsureStartedResolver resolver = [resolver__ = std::move(resolver__)](const bool& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'unused'
((&(writer__)))->WriteSentinel(155517589);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvEnsureStarted(std::move(params), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProfiler::Msg_Stop__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_Stop", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PProfiler::Reply_Stop(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
StopResolver resolver = [resolver__ = std::move(resolver__)](const bool& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'unused'
((&(writer__)))->WriteSentinel(155517589);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvStop(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProfiler::Msg_Pause__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_Pause", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PProfiler::Reply_Pause(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
PauseResolver resolver = [resolver__ = std::move(resolver__)](const bool& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'unused'
((&(writer__)))->WriteSentinel(155517589);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvPause(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProfiler::Msg_Resume__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_Resume", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PProfiler::Reply_Resume(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
ResumeResolver resolver = [resolver__ = std::move(resolver__)](const bool& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'unused'
((&(writer__)))->WriteSentinel(155517589);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvResume(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProfiler::Msg_PauseSampling__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_PauseSampling", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PProfiler::Reply_PauseSampling(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
PauseSamplingResolver resolver = [resolver__ = std::move(resolver__)](const bool& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'unused'
((&(writer__)))->WriteSentinel(155517589);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvPauseSampling(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProfiler::Msg_ResumeSampling__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_ResumeSampling", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PProfiler::Reply_ResumeSampling(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
ResumeSamplingResolver resolver = [resolver__ = std::move(resolver__)](const bool& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'unused'
((&(writer__)))->WriteSentinel(155517589);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvResumeSampling(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProfiler::Msg_WaitOnePeriodicSampling__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_WaitOnePeriodicSampling", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PProfiler::Reply_WaitOnePeriodicSampling(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
WaitOnePeriodicSamplingResolver resolver = [resolver__ = std::move(resolver__)](const bool& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'sampled'
((&(writer__)))->WriteSentinel(197460711);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvWaitOnePeriodicSampling(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProfiler::Msg_AwaitNextChunkManagerUpdate__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_AwaitNextChunkManagerUpdate", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PProfiler::Reply_AwaitNextChunkManagerUpdate(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
AwaitNextChunkManagerUpdateResolver resolver = [resolver__ = std::move(resolver__)](const ProfileBufferChunkManagerUpdate& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'update'
((&(writer__)))->WriteSentinel(150209156);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvAwaitNextChunkManagerUpdate(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProfiler::Msg_DestroyReleasedChunksAtOrBefore__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_DestroyReleasedChunksAtOrBefore", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__timeStamp = IPC::ReadParam<TimeStamp>((&(reader__)));
if (!maybe__timeStamp) {
FatalError("Error deserializing 'TimeStamp'");
return MsgValueError;
}
auto& timeStamp = *maybe__timeStamp;
// Sentinel = 'timeStamp'
if ((!(((&(reader__)))->ReadSentinel(312083381)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'TimeStamp'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvDestroyReleasedChunksAtOrBefore(std::move(timeStamp));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProfiler::Msg_GatherProfile__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_GatherProfile", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PProfiler::Reply_GatherProfile(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
GatherProfileResolver resolver = [resolver__ = std::move(resolver__)](const IPCProfileAndAdditionalInformation& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'profileAndAdditionalInformation'
((&(writer__)))->WriteSentinel(3328052356);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvGatherProfile(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProfiler::Msg_GetGatherProfileProgress__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_GetGatherProfileProgress", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PProfiler::Reply_GetGatherProfileProgress(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
GetGatherProfileProgressResolver resolver = [resolver__ = std::move(resolver__)](const GatherProfileProgress& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'progress'
((&(writer__)))->WriteSentinel(261292918);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvGetGatherProfileProgress(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PProfiler::Msg_ClearAllPages__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_ClearAllPages", OTHER);
mozilla::ipc::IPCResult __ok = (this)->RecvClearAllPages();
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 PProfilerChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PProfilerChild::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PProfilerChild*>::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::PProfilerChild*>::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, "PProfiler", PProfilerMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::PProfilerChild*>(actor.ref());
}
return {};
}
} // namespace IPC