Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/ipc/PUtilityProcessParent.h"
#include "mozilla/D3DMessageUtils.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/ipc/ByteBufUtils.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/ipc/UtilityProcessParent.h"
#include "mozilla/PProfilerParent.h"
#include "mozilla/ipc/PUtilityAudioDecoderParent.h"
#include "mozilla/dom/PJSOracleParent.h"
#include "mozilla/PSandboxTestingParent.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 {
namespace ipc {
auto PUtilityProcessParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PUtilityProcessParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PUtilityProcessParent::PUtilityProcessParent() :
mozilla::ipc::IToplevelProtocol("PUtilityProcessParent", PUtilityProcessMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PUtilityProcessParent);
}
PUtilityProcessParent::~PUtilityProcessParent()
{
MOZ_COUNT_DTOR(PUtilityProcessParent);
}
auto PUtilityProcessParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PUtilityProcessParent'");
AddRef();
}
auto PUtilityProcessParent::ActorDealloc() -> void
{
Release();
}
auto PUtilityProcessParent::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PUtilityProcessParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PUtilityProcessParent::SendInit(
const mozilla::Maybe<FileDescriptor>& sandboxBroker,
const bool& canRecordReleaseTelemetry,
const bool& aIsReadyForBackgroundProcessing) -> bool
{
UniquePtr<IPC::Message> msg__ = PUtilityProcess::Msg_Init(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), sandboxBroker);
// Sentinel = 'sandboxBroker'
((&(writer__)))->WriteSentinel(625149269);
IPC::WriteParam((&(writer__)), canRecordReleaseTelemetry);
// Sentinel = 'canRecordReleaseTelemetry'
((&(writer__)))->WriteSentinel(2148731406);
IPC::WriteParam((&(writer__)), aIsReadyForBackgroundProcessing);
// Sentinel = 'aIsReadyForBackgroundProcessing'
((&(writer__)))->WriteSentinel(3228372055);
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_Init", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUtilityProcessParent::SendInitProfiler(Endpoint<::mozilla::PProfilerChild>&& endpoint) -> bool
{
UniquePtr<IPC::Message> msg__ = PUtilityProcess::Msg_InitProfiler(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), std::move(endpoint));
// Sentinel = 'endpoint'
((&(writer__)))->WriteSentinel(251724642);
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_InitProfiler", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUtilityProcessParent::SendRequestMemoryReport(
const uint32_t& generation,
const bool& anonymize,
const bool& minimizeMemoryUsage,
const mozilla::Maybe<FileDescriptor>& DMDFile,
mozilla::ipc::ResolveCallback<uint32_t>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PUtilityProcess::Msg_RequestMemoryReport(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), generation);
// Sentinel = 'generation'
((&(writer__)))->WriteSentinel(381158445);
IPC::WriteParam((&(writer__)), anonymize);
// Sentinel = 'anonymize'
((&(writer__)))->WriteSentinel(321127387);
IPC::WriteParam((&(writer__)), minimizeMemoryUsage);
// Sentinel = 'minimizeMemoryUsage'
((&(writer__)))->WriteSentinel(1321600977);
IPC::WriteParam((&(writer__)), DMDFile);
// Sentinel = 'DMDFile'
((&(writer__)))->WriteSentinel(143983190);
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_RequestMemoryReport", OTHER);
ChannelSend(std::move(msg__), PUtilityProcess::Reply_RequestMemoryReport__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PUtilityProcessParent::SendRequestMemoryReport(
const uint32_t& generation,
const bool& anonymize,
const bool& minimizeMemoryUsage,
const mozilla::Maybe<FileDescriptor>& DMDFile) -> RefPtr<RequestMemoryReportPromise>
{
RefPtr<MozPromise<uint32_t, ResponseRejectReason, true>::Private> promise__ = new MozPromise<uint32_t, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendRequestMemoryReport(std::move(generation), std::move(anonymize), std::move(minimizeMemoryUsage), std::move(DMDFile), [promise__](uint32_t&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PUtilityProcessParent::SendPreferenceUpdate(const Pref& pref) -> bool
{
UniquePtr<IPC::Message> msg__ = PUtilityProcess::Msg_PreferenceUpdate(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), pref);
// Sentinel = 'pref'
((&(writer__)))->WriteSentinel(71958958);
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_PreferenceUpdate", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUtilityProcessParent::SendFlushFOGData(
mozilla::ipc::ResolveCallback<ByteBuf>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PUtilityProcess::Msg_FlushFOGData(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_FlushFOGData", OTHER);
ChannelSend(std::move(msg__), PUtilityProcess::Reply_FlushFOGData__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PUtilityProcessParent::SendFlushFOGData() -> RefPtr<FlushFOGDataPromise>
{
RefPtr<MozPromise<ByteBuf, ResponseRejectReason, true>::Private> promise__ = new MozPromise<ByteBuf, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendFlushFOGData([promise__](ByteBuf&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PUtilityProcessParent::SendTestTriggerMetrics(
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PUtilityProcess::Msg_TestTriggerMetrics(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_TestTriggerMetrics", OTHER);
ChannelSend(std::move(msg__), PUtilityProcess::Reply_TestTriggerMetrics__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PUtilityProcessParent::SendTestTriggerMetrics() -> RefPtr<TestTriggerMetricsPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendTestTriggerMetrics([promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PUtilityProcessParent::SendTestTelemetryProbes() -> bool
{
UniquePtr<IPC::Message> msg__ = PUtilityProcess::Msg_TestTelemetryProbes(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_TestTelemetryProbes", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUtilityProcessParent::SendStartUtilityAudioDecoderService(
Endpoint<::mozilla::ipc::PUtilityAudioDecoderParent>&& aEndpoint,
mozilla::Span<GfxVarUpdate const> updates) -> bool
{
UniquePtr<IPC::Message> msg__ = PUtilityProcess::Msg_StartUtilityAudioDecoderService(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), std::move(aEndpoint));
// Sentinel = 'aEndpoint'
((&(writer__)))->WriteSentinel(292225955);
IPC::WriteParam((&(writer__)), updates);
// Sentinel = 'updates'
((&(writer__)))->WriteSentinel(199951095);
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_StartUtilityAudioDecoderService", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUtilityProcessParent::SendStartJSOracleService(Endpoint<::mozilla::dom::PJSOracleChild>&& aEndpoint) -> bool
{
UniquePtr<IPC::Message> msg__ = PUtilityProcess::Msg_StartJSOracleService(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), std::move(aEndpoint));
// Sentinel = 'aEndpoint'
((&(writer__)))->WriteSentinel(292225955);
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_StartJSOracleService", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUtilityProcessParent::SendInitSandboxTesting(Endpoint<::mozilla::PSandboxTestingChild>&& aEndpoint) -> bool
{
UniquePtr<IPC::Message> msg__ = PUtilityProcess::Msg_InitSandboxTesting(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), std::move(aEndpoint));
// Sentinel = 'aEndpoint'
((&(writer__)))->WriteSentinel(292225955);
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_InitSandboxTesting", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUtilityProcessParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PUtilityProcessParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PUtilityProcessParent::OnMessageReceived(const Message& msg__) -> PUtilityProcessParent::Result
{
switch (msg__.type()) {
case PUtilityProcess::Msg_InitCrashReporter__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_InitCrashReporter", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__threadId = IPC::ReadParam<NativeThreadId>((&(reader__)));
if (!maybe__threadId) {
FatalError("Error deserializing 'NativeThreadId'");
return MsgValueError;
}
auto& threadId = *maybe__threadId;
// Sentinel = 'threadId'
if ((!(((&(reader__)))->ReadSentinel(248185638)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'NativeThreadId'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityProcessParent*>(this))->RecvInitCrashReporter(std::move(threadId));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityProcess::Msg_AddMemoryReport__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_AddMemoryReport", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aReport = IPC::ReadParam<MemoryReport>((&(reader__)));
if (!maybe__aReport) {
FatalError("Error deserializing 'MemoryReport'");
return MsgValueError;
}
auto& aReport = *maybe__aReport;
// Sentinel = 'aReport'
if ((!(((&(reader__)))->ReadSentinel(184025822)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'MemoryReport'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityProcessParent*>(this))->RecvAddMemoryReport(std::move(aReport));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityProcess::Msg_FOGData__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_FOGData", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__buf = IPC::ReadParam<ByteBuf>((&(reader__)));
if (!maybe__buf) {
FatalError("Error deserializing 'ByteBuf'");
return MsgValueError;
}
auto& buf = *maybe__buf;
// Sentinel = 'buf'
if ((!(((&(reader__)))->ReadSentinel(41484606)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ByteBuf'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityProcessParent*>(this))->RecvFOGData(std::move(buf));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityProcess::Msg_AccumulateChildHistograms__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_AccumulateChildHistograms", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__accumulations = IPC::ReadParam<nsTArray<HistogramAccumulation>>((&(reader__)));
if (!maybe__accumulations) {
FatalError("Error deserializing 'HistogramAccumulation[]'");
return MsgValueError;
}
auto& accumulations = *maybe__accumulations;
// Sentinel = 'accumulations'
if ((!(((&(reader__)))->ReadSentinel(632030585)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'HistogramAccumulation[]'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityProcessParent*>(this))->RecvAccumulateChildHistograms(std::move(accumulations));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityProcess::Msg_AccumulateChildKeyedHistograms__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_AccumulateChildKeyedHistograms", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__accumulations = IPC::ReadParam<nsTArray<KeyedHistogramAccumulation>>((&(reader__)));
if (!maybe__accumulations) {
FatalError("Error deserializing 'KeyedHistogramAccumulation[]'");
return MsgValueError;
}
auto& accumulations = *maybe__accumulations;
// Sentinel = 'accumulations'
if ((!(((&(reader__)))->ReadSentinel(632030585)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'KeyedHistogramAccumulation[]'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityProcessParent*>(this))->RecvAccumulateChildKeyedHistograms(std::move(accumulations));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityProcess::Msg_UpdateChildScalars__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_UpdateChildScalars", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__actions = IPC::ReadParam<nsTArray<ScalarAction>>((&(reader__)));
if (!maybe__actions) {
FatalError("Error deserializing 'ScalarAction[]'");
return MsgValueError;
}
auto& actions = *maybe__actions;
// Sentinel = 'actions'
if ((!(((&(reader__)))->ReadSentinel(193200882)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ScalarAction[]'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityProcessParent*>(this))->RecvUpdateChildScalars(std::move(actions));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityProcess::Msg_UpdateChildKeyedScalars__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_UpdateChildKeyedScalars", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__actions = IPC::ReadParam<nsTArray<KeyedScalarAction>>((&(reader__)));
if (!maybe__actions) {
FatalError("Error deserializing 'KeyedScalarAction[]'");
return MsgValueError;
}
auto& actions = *maybe__actions;
// Sentinel = 'actions'
if ((!(((&(reader__)))->ReadSentinel(193200882)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'KeyedScalarAction[]'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityProcessParent*>(this))->RecvUpdateChildKeyedScalars(std::move(actions));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityProcess::Msg_RecordChildEvents__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_RecordChildEvents", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__events = IPC::ReadParam<nsTArray<ChildEventData>>((&(reader__)));
if (!maybe__events) {
FatalError("Error deserializing 'ChildEventData[]'");
return MsgValueError;
}
auto& events = *maybe__events;
// Sentinel = 'events'
if ((!(((&(reader__)))->ReadSentinel(149619350)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ChildEventData[]'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityProcessParent*>(this))->RecvRecordChildEvents(std::move(events));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityProcess::Msg_RecordDiscardedData__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_RecordDiscardedData", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__data = IPC::ReadParam<DiscardedData>((&(reader__)));
if (!maybe__data) {
FatalError("Error deserializing 'DiscardedData'");
return MsgValueError;
}
auto& data = *maybe__data;
// Sentinel = 'data'
if ((!(((&(reader__)))->ReadSentinel(67109275)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'DiscardedData'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityProcessParent*>(this))->RecvRecordDiscardedData(std::move(data));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityProcess::Msg_InitCompleted__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_InitCompleted", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<UtilityProcessParent*>(this))->RecvInitCompleted();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityProcess::Reply_RequestMemoryReport__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_RequestMemoryReport", 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<uint32_t> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__aGeneration = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aGeneration) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aGeneration = *maybe__aGeneration;
// Sentinel = 'aGeneration'
if ((!(((&(reader__)))->ReadSentinel(430179438)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(aGeneration));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PUtilityProcess::Reply_FlushFOGData__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_FlushFOGData", 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<ByteBuf> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__buf = IPC::ReadParam<ByteBuf>((&(reader__)));
if (!maybe__buf) {
FatalError("Error deserializing 'ByteBuf'");
return MsgValueError;
}
auto& buf = *maybe__buf;
// Sentinel = 'buf'
if ((!(((&(reader__)))->ReadSentinel(41484606)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ByteBuf'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(buf));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PUtilityProcess::Reply_TestTriggerMetrics__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityProcess", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityProcessParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityProcess::Msg_TestTriggerMetrics", 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;
}
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 PUtilityProcessParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PUtilityProcessParent::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
auto PUtilityProcessParent::DoomSubtree() -> void
{
SetDoomed();
}
auto PUtilityProcessParent::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace ipc
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::ipc::PUtilityProcessParent*>::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::ipc::PUtilityProcessParent*>::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, "PUtilityProcess", PUtilityProcessMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::ipc::PUtilityProcessParent*>(actor.ref());
}
return {};
}
} // namespace IPC