Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PProfilerParent.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 PProfilerParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PProfilerParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PProfilerParent::PProfilerParent() :
mozilla::ipc::IToplevelProtocol("PProfilerParent", PProfilerMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PProfilerParent);
}
PProfilerParent::~PProfilerParent()
{
MOZ_COUNT_DTOR(PProfilerParent);
}
auto PProfilerParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PProfilerParent'");
AddRef();
}
auto PProfilerParent::ActorDealloc() -> void
{
Release();
}
auto PProfilerParent::AllManagedActors(nsTArray<RefPtr<mozilla::ipc::ActorLifecycleProxy>>& arr__) const -> void
{
uint32_t total = 0;
arr__.SetCapacity(total);
}
auto PProfilerParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PProfilerParent::SendStart(
const ProfilerInitParams& params,
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_Start(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), params);
// Sentinel = 'params'
((&(writer__)))->WriteSentinel(146997893);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_Start", OTHER);
ChannelSend(std::move(msg__), PProfiler::Reply_Start__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PProfilerParent::SendStart(const ProfilerInitParams& params) -> RefPtr<StartPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendStart(std::move(params), [promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PProfilerParent::SendEnsureStarted(
const ProfilerInitParams& params,
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_EnsureStarted(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), params);
// Sentinel = 'params'
((&(writer__)))->WriteSentinel(146997893);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_EnsureStarted", OTHER);
ChannelSend(std::move(msg__), PProfiler::Reply_EnsureStarted__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PProfilerParent::SendEnsureStarted(const ProfilerInitParams& params) -> RefPtr<EnsureStartedPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendEnsureStarted(std::move(params), [promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PProfilerParent::SendStop(
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_Stop(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_Stop", OTHER);
ChannelSend(std::move(msg__), PProfiler::Reply_Stop__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PProfilerParent::SendStop() -> RefPtr<StopPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendStop([promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PProfilerParent::SendPause(
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_Pause(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_Pause", OTHER);
ChannelSend(std::move(msg__), PProfiler::Reply_Pause__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PProfilerParent::SendPause() -> RefPtr<PausePromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendPause([promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PProfilerParent::SendResume(
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_Resume(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_Resume", OTHER);
ChannelSend(std::move(msg__), PProfiler::Reply_Resume__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PProfilerParent::SendResume() -> RefPtr<ResumePromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendResume([promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PProfilerParent::SendPauseSampling(
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_PauseSampling(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_PauseSampling", OTHER);
ChannelSend(std::move(msg__), PProfiler::Reply_PauseSampling__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PProfilerParent::SendPauseSampling() -> RefPtr<PauseSamplingPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendPauseSampling([promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PProfilerParent::SendResumeSampling(
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_ResumeSampling(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_ResumeSampling", OTHER);
ChannelSend(std::move(msg__), PProfiler::Reply_ResumeSampling__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PProfilerParent::SendResumeSampling() -> RefPtr<ResumeSamplingPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendResumeSampling([promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PProfilerParent::SendWaitOnePeriodicSampling(
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_WaitOnePeriodicSampling(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_WaitOnePeriodicSampling", OTHER);
ChannelSend(std::move(msg__), PProfiler::Reply_WaitOnePeriodicSampling__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PProfilerParent::SendWaitOnePeriodicSampling() -> RefPtr<WaitOnePeriodicSamplingPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendWaitOnePeriodicSampling([promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PProfilerParent::SendAwaitNextChunkManagerUpdate(
mozilla::ipc::ResolveCallback<ProfileBufferChunkManagerUpdate>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_AwaitNextChunkManagerUpdate(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_AwaitNextChunkManagerUpdate", OTHER);
ChannelSend(std::move(msg__), PProfiler::Reply_AwaitNextChunkManagerUpdate__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PProfilerParent::SendAwaitNextChunkManagerUpdate() -> RefPtr<AwaitNextChunkManagerUpdatePromise>
{
RefPtr<MozPromise<ProfileBufferChunkManagerUpdate, ResponseRejectReason, true>::Private> promise__ = new MozPromise<ProfileBufferChunkManagerUpdate, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendAwaitNextChunkManagerUpdate([promise__](ProfileBufferChunkManagerUpdate&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PProfilerParent::SendDestroyReleasedChunksAtOrBefore(const TimeStamp& timeStamp) -> bool
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_DestroyReleasedChunksAtOrBefore(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), timeStamp);
// Sentinel = 'timeStamp'
((&(writer__)))->WriteSentinel(312083381);
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_DestroyReleasedChunksAtOrBefore", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PProfilerParent::SendGatherProfile(
mozilla::ipc::ResolveCallback<IPCProfileAndAdditionalInformation>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_GatherProfile(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_GatherProfile", OTHER);
ChannelSend(std::move(msg__), PProfiler::Reply_GatherProfile__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PProfilerParent::SendGatherProfile() -> RefPtr<GatherProfilePromise>
{
RefPtr<MozPromise<IPCProfileAndAdditionalInformation, ResponseRejectReason, true>::Private> promise__ = new MozPromise<IPCProfileAndAdditionalInformation, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendGatherProfile([promise__](IPCProfileAndAdditionalInformation&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PProfilerParent::SendGetGatherProfileProgress(
mozilla::ipc::ResolveCallback<GatherProfileProgress>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_GetGatherProfileProgress(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_GetGatherProfileProgress", OTHER);
ChannelSend(std::move(msg__), PProfiler::Reply_GetGatherProfileProgress__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PProfilerParent::SendGetGatherProfileProgress() -> RefPtr<GetGatherProfileProgressPromise>
{
RefPtr<MozPromise<GatherProfileProgress, ResponseRejectReason, true>::Private> promise__ = new MozPromise<GatherProfileProgress, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendGetGatherProfileProgress([promise__](GatherProfileProgress&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PProfilerParent::SendClearAllPages() -> bool
{
UniquePtr<IPC::Message> msg__ = PProfiler::Msg_ClearAllPages(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_ClearAllPages", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PProfilerParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PProfilerParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PProfilerParent::OnMessageReceived(const Message& msg__) -> PProfilerParent::Result
{
switch (msg__.type()) {
case PProfiler::Reply_Start__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_Start", OTHER);
IPC::MessageReader reader__{
msg__,
this};
bool resolve__ = false;
if (!IPC::ReadParam(&reader__, &resolve__)) {
FatalError("Error deserializing bool");
return MsgValueError;
}
UniquePtr<MessageChannel::UntypedCallbackHolder> untypedCallback =
GetIPCChannel()->PopCallback(msg__, Id());
typedef MessageChannel::CallbackHolder<bool> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__unused = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__unused) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& unused = *maybe__unused;
// Sentinel = 'unused'
if ((!(((&(reader__)))->ReadSentinel(155517589)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(unused));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PProfiler::Reply_EnsureStarted__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_EnsureStarted", OTHER);
IPC::MessageReader reader__{
msg__,
this};
bool resolve__ = false;
if (!IPC::ReadParam(&reader__, &resolve__)) {
FatalError("Error deserializing bool");
return MsgValueError;
}
UniquePtr<MessageChannel::UntypedCallbackHolder> untypedCallback =
GetIPCChannel()->PopCallback(msg__, Id());
typedef MessageChannel::CallbackHolder<bool> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__unused = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__unused) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& unused = *maybe__unused;
// Sentinel = 'unused'
if ((!(((&(reader__)))->ReadSentinel(155517589)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(unused));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PProfiler::Reply_Stop__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_Stop", OTHER);
IPC::MessageReader reader__{
msg__,
this};
bool resolve__ = false;
if (!IPC::ReadParam(&reader__, &resolve__)) {
FatalError("Error deserializing bool");
return MsgValueError;
}
UniquePtr<MessageChannel::UntypedCallbackHolder> untypedCallback =
GetIPCChannel()->PopCallback(msg__, Id());
typedef MessageChannel::CallbackHolder<bool> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__unused = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__unused) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& unused = *maybe__unused;
// Sentinel = 'unused'
if ((!(((&(reader__)))->ReadSentinel(155517589)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(unused));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PProfiler::Reply_Pause__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_Pause", OTHER);
IPC::MessageReader reader__{
msg__,
this};
bool resolve__ = false;
if (!IPC::ReadParam(&reader__, &resolve__)) {
FatalError("Error deserializing bool");
return MsgValueError;
}
UniquePtr<MessageChannel::UntypedCallbackHolder> untypedCallback =
GetIPCChannel()->PopCallback(msg__, Id());
typedef MessageChannel::CallbackHolder<bool> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__unused = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__unused) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& unused = *maybe__unused;
// Sentinel = 'unused'
if ((!(((&(reader__)))->ReadSentinel(155517589)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(unused));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PProfiler::Reply_Resume__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_Resume", OTHER);
IPC::MessageReader reader__{
msg__,
this};
bool resolve__ = false;
if (!IPC::ReadParam(&reader__, &resolve__)) {
FatalError("Error deserializing bool");
return MsgValueError;
}
UniquePtr<MessageChannel::UntypedCallbackHolder> untypedCallback =
GetIPCChannel()->PopCallback(msg__, Id());
typedef MessageChannel::CallbackHolder<bool> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__unused = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__unused) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& unused = *maybe__unused;
// Sentinel = 'unused'
if ((!(((&(reader__)))->ReadSentinel(155517589)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(unused));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PProfiler::Reply_PauseSampling__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_PauseSampling", OTHER);
IPC::MessageReader reader__{
msg__,
this};
bool resolve__ = false;
if (!IPC::ReadParam(&reader__, &resolve__)) {
FatalError("Error deserializing bool");
return MsgValueError;
}
UniquePtr<MessageChannel::UntypedCallbackHolder> untypedCallback =
GetIPCChannel()->PopCallback(msg__, Id());
typedef MessageChannel::CallbackHolder<bool> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__unused = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__unused) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& unused = *maybe__unused;
// Sentinel = 'unused'
if ((!(((&(reader__)))->ReadSentinel(155517589)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(unused));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PProfiler::Reply_ResumeSampling__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_ResumeSampling", OTHER);
IPC::MessageReader reader__{
msg__,
this};
bool resolve__ = false;
if (!IPC::ReadParam(&reader__, &resolve__)) {
FatalError("Error deserializing bool");
return MsgValueError;
}
UniquePtr<MessageChannel::UntypedCallbackHolder> untypedCallback =
GetIPCChannel()->PopCallback(msg__, Id());
typedef MessageChannel::CallbackHolder<bool> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__unused = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__unused) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& unused = *maybe__unused;
// Sentinel = 'unused'
if ((!(((&(reader__)))->ReadSentinel(155517589)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(unused));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PProfiler::Reply_WaitOnePeriodicSampling__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_WaitOnePeriodicSampling", OTHER);
IPC::MessageReader reader__{
msg__,
this};
bool resolve__ = false;
if (!IPC::ReadParam(&reader__, &resolve__)) {
FatalError("Error deserializing bool");
return MsgValueError;
}
UniquePtr<MessageChannel::UntypedCallbackHolder> untypedCallback =
GetIPCChannel()->PopCallback(msg__, Id());
typedef MessageChannel::CallbackHolder<bool> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__sampled = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__sampled) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& sampled = *maybe__sampled;
// Sentinel = 'sampled'
if ((!(((&(reader__)))->ReadSentinel(197460711)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(sampled));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PProfiler::Reply_AwaitNextChunkManagerUpdate__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_AwaitNextChunkManagerUpdate", OTHER);
IPC::MessageReader reader__{
msg__,
this};
bool resolve__ = false;
if (!IPC::ReadParam(&reader__, &resolve__)) {
FatalError("Error deserializing bool");
return MsgValueError;
}
UniquePtr<MessageChannel::UntypedCallbackHolder> untypedCallback =
GetIPCChannel()->PopCallback(msg__, Id());
typedef MessageChannel::CallbackHolder<ProfileBufferChunkManagerUpdate> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__update = IPC::ReadParam<ProfileBufferChunkManagerUpdate>((&(reader__)));
if (!maybe__update) {
FatalError("Error deserializing 'ProfileBufferChunkManagerUpdate'");
return MsgValueError;
}
auto& update = *maybe__update;
// Sentinel = 'update'
if ((!(((&(reader__)))->ReadSentinel(150209156)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ProfileBufferChunkManagerUpdate'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(update));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PProfiler::Reply_GatherProfile__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_GatherProfile", OTHER);
IPC::MessageReader reader__{
msg__,
this};
bool resolve__ = false;
if (!IPC::ReadParam(&reader__, &resolve__)) {
FatalError("Error deserializing bool");
return MsgValueError;
}
UniquePtr<MessageChannel::UntypedCallbackHolder> untypedCallback =
GetIPCChannel()->PopCallback(msg__, Id());
typedef MessageChannel::CallbackHolder<IPCProfileAndAdditionalInformation> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__profileAndAdditionalInformation = IPC::ReadParam<IPCProfileAndAdditionalInformation>((&(reader__)));
if (!maybe__profileAndAdditionalInformation) {
FatalError("Error deserializing 'IPCProfileAndAdditionalInformation'");
return MsgValueError;
}
auto& profileAndAdditionalInformation = *maybe__profileAndAdditionalInformation;
// Sentinel = 'profileAndAdditionalInformation'
if ((!(((&(reader__)))->ReadSentinel(3328052356)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'IPCProfileAndAdditionalInformation'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(profileAndAdditionalInformation));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PProfiler::Reply_GetGatherProfileProgress__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProfiler", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProfilerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProfiler::Msg_GetGatherProfileProgress", OTHER);
IPC::MessageReader reader__{
msg__,
this};
bool resolve__ = false;
if (!IPC::ReadParam(&reader__, &resolve__)) {
FatalError("Error deserializing bool");
return MsgValueError;
}
UniquePtr<MessageChannel::UntypedCallbackHolder> untypedCallback =
GetIPCChannel()->PopCallback(msg__, Id());
typedef MessageChannel::CallbackHolder<GatherProfileProgress> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__progress = IPC::ReadParam<GatherProfileProgress>((&(reader__)));
if (!maybe__progress) {
FatalError("Error deserializing 'GatherProfileProgress'");
return MsgValueError;
}
auto& progress = *maybe__progress;
// Sentinel = 'progress'
if ((!(((&(reader__)))->ReadSentinel(261292918)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'GatherProfileProgress'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(progress));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
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 PProfilerParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PProfilerParent::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
auto PProfilerParent::OnChannelClose() -> void
{
DestroySubtree(NormalShutdown);
ClearSubtree();
DeallocShmems();
if (GetLifecycleProxy()) {
GetLifecycleProxy()->Release();
}
}
auto PProfilerParent::OnChannelError() -> void
{
DestroySubtree(AbnormalShutdown);
ClearSubtree();
DeallocShmems();
if (GetLifecycleProxy()) {
GetLifecycleProxy()->Release();
}
}
auto PProfilerParent::ClearSubtree() -> void
{
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PProfilerParent*>::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::PProfilerParent*>::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::PProfilerParent*>(actor.ref());
}
return {};
}
} // namespace IPC