Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/layers/PUiCompositorControllerParent.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/layers/UiCompositorControllerParent.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 layers {
auto PUiCompositorControllerParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PUiCompositorControllerParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PUiCompositorControllerParent::PUiCompositorControllerParent() :
mozilla::ipc::IToplevelProtocol("PUiCompositorControllerParent", kProtocolId, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PUiCompositorControllerParent);
}
PUiCompositorControllerParent::~PUiCompositorControllerParent()
{
MOZ_COUNT_DTOR(PUiCompositorControllerParent);
}
auto PUiCompositorControllerParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess() || XRE_IsGPUProcess(), "Invalid process for `PUiCompositorControllerParent'");
AddRef();
}
auto PUiCompositorControllerParent::ActorDealloc() -> void
{
Release();
}
auto PUiCompositorControllerParent::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PUiCompositorControllerParent::OtherChildID() const -> ::GeckoChildID
{
::GeckoChildID childID =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid();
MOZ_RELEASE_ASSERT(childID != -1);
return childID;
}
auto PUiCompositorControllerParent::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo
{
return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()};
}
auto PUiCompositorControllerParent::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PUiCompositorControllerParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PUiCompositorControllerParent::SendToolbarAnimatorMessageFromCompositor(const int32_t& aMessage) -> bool
{
UniquePtr<IPC::Message> msg__ = PUiCompositorController::Msg_ToolbarAnimatorMessageFromCompositor(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aMessage);
// Sentinel = 'aMessage'
((&(writer__)))->WriteSentinel(233440039);
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUiCompositorController::Msg_ToolbarAnimatorMessageFromCompositor", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUiCompositorControllerParent::SendRootFrameMetrics(
const ScreenPoint& aScrollOffset,
const CSSToScreenScale& aZoom) -> bool
{
UniquePtr<IPC::Message> msg__ = PUiCompositorController::Msg_RootFrameMetrics(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aScrollOffset);
// Sentinel = 'aScrollOffset'
((&(writer__)))->WriteSentinel(601163064);
IPC::WriteParam((&(writer__)), aZoom);
// Sentinel = 'aZoom'
((&(writer__)))->WriteSentinel(99222023);
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUiCompositorController::Msg_RootFrameMetrics", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUiCompositorControllerParent::SendScreenPixels(
Shmem&& aMem,
const ScreenIntSize& aSize,
const bool& aNeedsYFlip) -> bool
{
UniquePtr<IPC::Message> msg__ = PUiCompositorController::Msg_ScreenPixels(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), std::move(aMem));
// Sentinel = 'aMem'
((&(writer__)))->WriteSentinel(61211009);
IPC::WriteParam((&(writer__)), aSize);
// Sentinel = 'aSize'
((&(writer__)))->WriteSentinel(97124861);
IPC::WriteParam((&(writer__)), aNeedsYFlip);
// Sentinel = 'aNeedsYFlip'
((&(writer__)))->WriteSentinel(415237173);
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUiCompositorController::Msg_ScreenPixels", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUiCompositorControllerParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PUiCompositorControllerParent::OnMessageReceived(const Message& msg__) -> PUiCompositorControllerParent::Result
{
switch (msg__.type()) {
case PUiCompositorController::Msg_InvalidateAndRender__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUiCompositorController::Msg_InvalidateAndRender", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<UiCompositorControllerParent*>(this))->RecvInvalidateAndRender();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUiCompositorController::Msg_MaxToolbarHeight__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUiCompositorController::Msg_MaxToolbarHeight", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aHeight = IPC::ReadParam<int32_t>((&(reader__)));
if (!maybe__aHeight) {
FatalError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto& aHeight = *maybe__aHeight;
// Sentinel = 'aHeight'
if ((!(((&(reader__)))->ReadSentinel(175375035)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UiCompositorControllerParent*>(this))->RecvMaxToolbarHeight(std::move(aHeight));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUiCompositorController::Msg_FixedBottomOffset__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUiCompositorController::Msg_FixedBottomOffset", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aOffset = IPC::ReadParam<int32_t>((&(reader__)));
if (!maybe__aOffset) {
FatalError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto& aOffset = *maybe__aOffset;
// Sentinel = 'aOffset'
if ((!(((&(reader__)))->ReadSentinel(179634889)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UiCompositorControllerParent*>(this))->RecvFixedBottomOffset(std::move(aOffset));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUiCompositorController::Msg_DefaultClearColor__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUiCompositorController::Msg_DefaultClearColor", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aColor = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aColor) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aColor = *maybe__aColor;
// Sentinel = 'aColor'
if ((!(((&(reader__)))->ReadSentinel(132842081)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UiCompositorControllerParent*>(this))->RecvDefaultClearColor(std::move(aColor));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUiCompositorController::Msg_RequestScreenPixels__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUiCompositorController::Msg_RequestScreenPixels", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<UiCompositorControllerParent*>(this))->RecvRequestScreenPixels();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUiCompositorController::Msg_EnableLayerUpdateNotifications__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUiCompositorController::Msg_EnableLayerUpdateNotifications", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aEnable = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__aEnable) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& aEnable = *maybe__aEnable;
// Sentinel = 'aEnable'
if ((!(((&(reader__)))->ReadSentinel(173605545)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UiCompositorControllerParent*>(this))->RecvEnableLayerUpdateNotifications(std::move(aEnable));
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 PUiCompositorControllerParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PUiCompositorControllerParent::Result
{
switch (msg__.type()) {
case PUiCompositorController::Msg_Pause__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUiCompositorController::Msg_Pause", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
mozilla::ipc::IPCResult __ok = (static_cast<UiCompositorControllerParent*>(this))->RecvPause();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
reply__ = PUiCompositorController::Reply_Pause(id__);
IPC::MessageWriter writer__{
(*(reply__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
case PUiCompositorController::Msg_Resume__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUiCompositorController::Msg_Resume", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
bool aOutResumed{};
mozilla::ipc::IPCResult __ok = (static_cast<UiCompositorControllerParent*>(this))->RecvResume((&(aOutResumed)));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
reply__ = PUiCompositorController::Reply_Resume(id__);
IPC::MessageWriter writer__{
(*(reply__)),
this};
IPC::WriteParam((&(writer__)), aOutResumed);
// Sentinel = 'aOutResumed'
((&(writer__)))->WriteSentinel(439157871);
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
case PUiCompositorController::Msg_ResumeAndResize__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUiCompositorController::Msg_ResumeAndResize", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aX = IPC::ReadParam<int32_t>((&(reader__)));
if (!maybe__aX) {
FatalError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto& aX = *maybe__aX;
// Sentinel = 'aX'
if ((!(((&(reader__)))->ReadSentinel(18612410)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto maybe__aY = IPC::ReadParam<int32_t>((&(reader__)));
if (!maybe__aY) {
FatalError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto& aY = *maybe__aY;
// Sentinel = 'aY'
if ((!(((&(reader__)))->ReadSentinel(18677947)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto maybe__aWidth = IPC::ReadParam<int32_t>((&(reader__)));
if (!maybe__aWidth) {
FatalError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto& aWidth = *maybe__aWidth;
// Sentinel = 'aWidth'
if ((!(((&(reader__)))->ReadSentinel(136249954)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto maybe__aHeight = IPC::ReadParam<int32_t>((&(reader__)));
if (!maybe__aHeight) {
FatalError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto& aHeight = *maybe__aHeight;
// Sentinel = 'aHeight'
if ((!(((&(reader__)))->ReadSentinel(175375035)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = MSG_ROUTING_CONTROL;
bool aOutResumed{};
mozilla::ipc::IPCResult __ok = (static_cast<UiCompositorControllerParent*>(this))->RecvResumeAndResize(std::move(aX), std::move(aY), std::move(aWidth), std::move(aHeight), (&(aOutResumed)));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
reply__ = PUiCompositorController::Reply_ResumeAndResize(id__);
IPC::MessageWriter writer__{
(*(reply__)),
this};
IPC::WriteParam((&(writer__)), aOutResumed);
// Sentinel = 'aOutResumed'
((&(writer__)))->WriteSentinel(439157871);
if (mozilla::ipc::LoggingEnabledFor("PUiCompositorController", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUiCompositorControllerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
} // namespace layers
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::layers::PUiCompositorControllerParent*>::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::layers::PUiCompositorControllerParent*>::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, "PUiCompositorController", PUiCompositorControllerMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::layers::PUiCompositorControllerParent*>(actor.ref());
}
return {};
}
} // namespace IPC