Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/layers/PNativeLayerRemoteChild.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/layers/NativeLayerRemoteChild.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 PNativeLayerRemoteChild::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PNativeLayerRemoteChild::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PNativeLayerRemoteChild::PNativeLayerRemoteChild() :
mozilla::ipc::IToplevelProtocol("PNativeLayerRemoteChild", kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PNativeLayerRemoteChild);
}
PNativeLayerRemoteChild::~PNativeLayerRemoteChild()
{
MOZ_COUNT_DTOR(PNativeLayerRemoteChild);
}
auto PNativeLayerRemoteChild::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsGPUProcess(), "Invalid process for `PNativeLayerRemoteChild'");
AddRef();
}
auto PNativeLayerRemoteChild::ActorDealloc() -> void
{
Release();
}
auto PNativeLayerRemoteChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PNativeLayerRemoteChild::OtherChildID() const -> ::GeckoChildID
{
::GeckoChildID childID =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid();
MOZ_RELEASE_ASSERT(childID != -1);
return childID;
}
auto PNativeLayerRemoteChild::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo
{
return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()};
}
auto PNativeLayerRemoteChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PNativeLayerRemoteChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PNativeLayerRemoteChild::SendCommitNativeLayerCommands(mozilla::Span<NativeLayerCommand const> commands) -> bool
{
UniquePtr<IPC::Message> msg__ = PNativeLayerRemote::Msg_CommitNativeLayerCommands(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), commands);
// Sentinel = 'commands'
((&(writer__)))->WriteSentinel(249627475);
if (mozilla::ipc::LoggingEnabledFor("PNativeLayerRemote", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PNativeLayerRemoteChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PNativeLayerRemote::Msg_CommitNativeLayerCommands", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PNativeLayerRemoteChild::DeallocManagee(
mozilla::ipc::ProtocolId aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PNativeLayerRemoteChild::OnMessageReceived(const Message& msg__) -> PNativeLayerRemoteChild::Result
{
switch (msg__.type()) {
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 PNativeLayerRemoteChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PNativeLayerRemoteChild::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
} // namespace layers
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::layers::PNativeLayerRemoteChild*>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, static_cast<mozilla::ipc::IProtocol*>(aVar));
// Sentinel = 'PNativeLayerRemote'
(aWriter)->WriteSentinel(1107035937);
}
auto ParamTraits<::mozilla::layers::PNativeLayerRemoteChild*>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe__actor = IPC::ReadParam<mozilla::ipc::IProtocol*>(aReader);
if (!maybe__actor) {
aReader->FatalError("Error deserializing managed PNativeLayerRemote actor");
return {};
}
auto& actor = *maybe__actor;
// Sentinel = 'PNativeLayerRemote'
if ((!((aReader)->ReadSentinel(1107035937)))) {
mozilla::ipc::SentinelReadError("Error deserializing managed PNativeLayerRemote actor");
return {};
}
if (actor && actor->GetProtocolId() != PNativeLayerRemoteMsgStart) {
aReader->FatalError("Unexpected actor type (expected PNativeLayerRemote)");
return {};
}
return static_cast<::mozilla::layers::PNativeLayerRemoteChild*>(actor);
}
} // namespace IPC