Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PRemoteDecoderManagerParent.h"
#include "gfxipc/ShadowLayerUtils.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/RemoteDecoderManagerParent.h"
#include "mozilla/dom/MediaIPCUtils.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/layers/CompositorTypes.h"
#include "mozilla/layers/LayersMessageUtils.h"
#include "mozilla/layers/WebRenderMessageUtils.h"
#include "mozilla/PMFMediaEngineParent.h"
#include "mozilla/PMFCDMParent.h"
#include "mozilla/layers/PTextureParent.h"
#include "mozilla/PRemoteDecoderParent.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 PRemoteDecoderManagerParent::RecvPMFMediaEngineConstructor(PMFMediaEngineParent* actor) -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
auto PRemoteDecoderManagerParent::RecvPMFCDMConstructor(
PMFCDMParent* actor,
const nsAString& keySystem) -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
auto PRemoteDecoderManagerParent::RecvPRemoteDecoderConstructor(
PRemoteDecoderParent* actor,
const RemoteDecoderInfoIPDL& info,
const OptionSet& options,
const mozilla::Maybe<TextureFactoryIdentifier>& identifier,
const mozilla::Maybe<uint64_t>& mediaEngineId,
const mozilla::Maybe<TrackingId>& trackingId) -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
auto PRemoteDecoderManagerParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PRemoteDecoderManagerParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PRemoteDecoderManagerParent::PRemoteDecoderManagerParent() :
mozilla::ipc::IToplevelProtocol("PRemoteDecoderManagerParent", kProtocolId, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PRemoteDecoderManagerParent);
}
PRemoteDecoderManagerParent::~PRemoteDecoderManagerParent()
{
MOZ_COUNT_DTOR(PRemoteDecoderManagerParent);
}
auto PRemoteDecoderManagerParent::ActorAlloc() -> void
{
AddRef();
}
auto PRemoteDecoderManagerParent::ActorDealloc() -> void
{
Release();
}
auto PRemoteDecoderManagerParent::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PRemoteDecoderManagerParent::OtherChildID() const -> ::GeckoChildID
{
::GeckoChildID childID =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid();
MOZ_RELEASE_ASSERT(childID != -1);
return childID;
}
auto PRemoteDecoderManagerParent::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo
{
return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()};
}
auto PRemoteDecoderManagerParent::ManagedPRemoteDecoderParent(nsTArray<PRemoteDecoderParent*>& aArr) const -> void
{
mManagedPRemoteDecoderParent.ToArray(aArr);
}
auto PRemoteDecoderManagerParent::ManagedPRemoteDecoderParent() const -> const ManagedContainer<PRemoteDecoderParent>&
{
return mManagedPRemoteDecoderParent;
}
auto PRemoteDecoderManagerParent::ManagedPMFMediaEngineParent(nsTArray<PMFMediaEngineParent*>& aArr) const -> void
{
mManagedPMFMediaEngineParent.ToArray(aArr);
}
auto PRemoteDecoderManagerParent::ManagedPMFMediaEngineParent() const -> const ManagedContainer<PMFMediaEngineParent>&
{
return mManagedPMFMediaEngineParent;
}
auto PRemoteDecoderManagerParent::ManagedPMFCDMParent(nsTArray<PMFCDMParent*>& aArr) const -> void
{
mManagedPMFCDMParent.ToArray(aArr);
}
auto PRemoteDecoderManagerParent::ManagedPMFCDMParent() const -> const ManagedContainer<PMFCDMParent>&
{
return mManagedPMFCDMParent;
}
auto PRemoteDecoderManagerParent::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
static constexpr ::mozilla::ipc::ProtocolId sIds[] = {
PRemoteDecoderMsgStart,
PMFMediaEngineMsgStart,
PMFCDMMsgStart
};
return sIds;
}
auto PRemoteDecoderManagerParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
case PRemoteDecoderMsgStart:
return (&(mManagedPRemoteDecoderParent));
case PMFMediaEngineMsgStart:
return (&(mManagedPMFMediaEngineParent));
case PMFCDMMsgStart:
return (&(mManagedPMFCDMParent));
default:
return nullptr;
}
}
auto PRemoteDecoderManagerParent::OpenPRemoteDecoderEndpoint(PRemoteDecoderParent* aActor) -> ManagedEndpoint<PRemoteDecoderChild>
{
if (!aActor) {
NS_WARNING("Cannot bind null PRemoteDecoderParent actor");
return ManagedEndpoint<PRemoteDecoderChild>();
}
if (!aActor->SetManagerAndRegister(this)) {
NS_WARNING("Failed to bind PRemoteDecoderParent actor");
return ManagedEndpoint<PRemoteDecoderChild>();
}
// Mark our actor as awaiting the other side to be bound. This will
// be cleared when a `MANAGED_ENDPOINT_{DROPPED,BOUND}` message is
// received.
aActor->mAwaitingManagedEndpointBind = true;
return ManagedEndpoint<PRemoteDecoderChild>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}
auto PRemoteDecoderManagerParent::BindPRemoteDecoderEndpoint(
ManagedEndpoint<PRemoteDecoderParent> aEndpoint,
PRemoteDecoderParent* aActor) -> bool
{
return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this);
}
auto PRemoteDecoderManagerParent::OpenPMFMediaEngineEndpoint(PMFMediaEngineParent* aActor) -> ManagedEndpoint<PMFMediaEngineChild>
{
if (!aActor) {
NS_WARNING("Cannot bind null PMFMediaEngineParent actor");
return ManagedEndpoint<PMFMediaEngineChild>();
}
if (!aActor->SetManagerAndRegister(this)) {
NS_WARNING("Failed to bind PMFMediaEngineParent actor");
return ManagedEndpoint<PMFMediaEngineChild>();
}
// Mark our actor as awaiting the other side to be bound. This will
// be cleared when a `MANAGED_ENDPOINT_{DROPPED,BOUND}` message is
// received.
aActor->mAwaitingManagedEndpointBind = true;
return ManagedEndpoint<PMFMediaEngineChild>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}
auto PRemoteDecoderManagerParent::BindPMFMediaEngineEndpoint(
ManagedEndpoint<PMFMediaEngineParent> aEndpoint,
PMFMediaEngineParent* aActor) -> bool
{
return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this);
}
auto PRemoteDecoderManagerParent::OpenPMFCDMEndpoint(PMFCDMParent* aActor) -> ManagedEndpoint<PMFCDMChild>
{
if (!aActor) {
NS_WARNING("Cannot bind null PMFCDMParent actor");
return ManagedEndpoint<PMFCDMChild>();
}
if (!aActor->SetManagerAndRegister(this)) {
NS_WARNING("Failed to bind PMFCDMParent actor");
return ManagedEndpoint<PMFCDMChild>();
}
// Mark our actor as awaiting the other side to be bound. This will
// be cleared when a `MANAGED_ENDPOINT_{DROPPED,BOUND}` message is
// received.
aActor->mAwaitingManagedEndpointBind = true;
return ManagedEndpoint<PMFCDMChild>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}
auto PRemoteDecoderManagerParent::BindPMFCDMEndpoint(
ManagedEndpoint<PMFCDMParent> aEndpoint,
PMFCDMParent* aActor) -> bool
{
return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this);
}
auto PRemoteDecoderManagerParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
switch (aProtocolId) {
case PRemoteDecoderMsgStart:
static_cast<RemoteDecoderManagerParent*>(this)->DeallocPRemoteDecoderParent(static_cast<PRemoteDecoderParent*>(aListener));
return;
case PMFMediaEngineMsgStart:
static_cast<RemoteDecoderManagerParent*>(this)->DeallocPMFMediaEngineParent(static_cast<PMFMediaEngineParent*>(aListener));
return;
case PMFCDMMsgStart:
static_cast<RemoteDecoderManagerParent*>(this)->DeallocPMFCDMParent(static_cast<PMFCDMParent*>(aListener));
return;
default:
FatalError("unreached");
return;
}
}
auto PRemoteDecoderManagerParent::OnMessageReceived(const Message& msg__) -> PRemoteDecoderManagerParent::Result
{
int32_t route__ = msg__.routing_id();
if (MSG_ROUTING_CONTROL != route__) {
IProtocol* routed__ = Lookup(route__);
if (!routed__ || !routed__->GetLifecycleProxy()) {
if (mozilla::ipc::LoggingEnabledFor("PRemoteDecoderManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteDecoderManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Ignored message for dead actor",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
RefPtr<mozilla::ipc::ActorLifecycleProxy> proxy__ =
routed__->GetLifecycleProxy();
return proxy__->Get()->OnMessageReceived(msg__);
}
switch (msg__.type()) {
case PRemoteDecoderManager::Msg_PMFMediaEngineConstructor__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteDecoderManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteDecoderManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteDecoderManager::Msg_PMFMediaEngineConstructor", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__handle__ = IPC::ReadParam<ActorHandle>((&(reader__)));
if (!maybe__handle__) {
FatalError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
auto& handle__ = *maybe__handle__;
// Sentinel = 'actor'
if ((!(((&(reader__)))->ReadSentinel(102892058)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
reader__.EndRead();
PMFMediaEngineParent* actor = (static_cast<RemoteDecoderManagerParent*>(this))->AllocPMFMediaEngineParent();
if (!actor) {
NS_WARNING("Cannot bind null PMFMediaEngineParent actor");
return MsgValueError;
}
if (!actor->SetManagerAndRegister(this, (handle__).mId)) {
NS_WARNING("Failed to bind PMFMediaEngineParent actor");
return MsgValueError;
}
mozilla::ipc::IPCResult __ok = (static_cast<RemoteDecoderManagerParent*>(this))->RecvPMFMediaEngineConstructor(std::move(actor));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PRemoteDecoderManager::Msg_PMFCDMConstructor__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteDecoderManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteDecoderManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteDecoderManager::Msg_PMFCDMConstructor", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__handle__ = IPC::ReadParam<ActorHandle>((&(reader__)));
if (!maybe__handle__) {
FatalError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
auto& handle__ = *maybe__handle__;
// Sentinel = 'actor'
if ((!(((&(reader__)))->ReadSentinel(102892058)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
auto maybe__keySystem = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__keySystem) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& keySystem = *maybe__keySystem;
// Sentinel = 'keySystem'
if ((!(((&(reader__)))->ReadSentinel(317785039)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
reader__.EndRead();
PMFCDMParent* actor = (static_cast<RemoteDecoderManagerParent*>(this))->AllocPMFCDMParent(keySystem);
if (!actor) {
NS_WARNING("Cannot bind null PMFCDMParent actor");
return MsgValueError;
}
if (!actor->SetManagerAndRegister(this, (handle__).mId)) {
NS_WARNING("Failed to bind PMFCDMParent actor");
return MsgValueError;
}
mozilla::ipc::IPCResult __ok = (static_cast<RemoteDecoderManagerParent*>(this))->RecvPMFCDMConstructor(std::move(actor), std::move(keySystem));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PRemoteDecoderManager::Msg_PRemoteDecoderConstructor__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteDecoderManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteDecoderManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteDecoderManager::Msg_PRemoteDecoderConstructor", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__handle__ = IPC::ReadParam<ActorHandle>((&(reader__)));
if (!maybe__handle__) {
FatalError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
auto& handle__ = *maybe__handle__;
// Sentinel = 'actor'
if ((!(((&(reader__)))->ReadSentinel(102892058)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
auto maybe__info = IPC::ReadParam<RemoteDecoderInfoIPDL>((&(reader__)));
if (!maybe__info) {
FatalError("Error deserializing 'RemoteDecoderInfoIPDL'");
return MsgValueError;
}
auto& info = *maybe__info;
// Sentinel = 'info'
if ((!(((&(reader__)))->ReadSentinel(70058413)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'RemoteDecoderInfoIPDL'");
return MsgValueError;
}
auto maybe__options = IPC::ReadParam<OptionSet>((&(reader__)));
if (!maybe__options) {
FatalError("Error deserializing 'OptionSet'");
return MsgValueError;
}
auto& options = *maybe__options;
// Sentinel = 'options'
if ((!(((&(reader__)))->ReadSentinel(204735245)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'OptionSet'");
return MsgValueError;
}
auto maybe__identifier = IPC::ReadParam<mozilla::Maybe<TextureFactoryIdentifier>>((&(reader__)));
if (!maybe__identifier) {
FatalError("Error deserializing 'TextureFactoryIdentifier?'");
return MsgValueError;
}
auto& identifier = *maybe__identifier;
// Sentinel = 'identifier'
if ((!(((&(reader__)))->ReadSentinel(379978788)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'TextureFactoryIdentifier?'");
return MsgValueError;
}
auto maybe__mediaEngineId = IPC::ReadParam<mozilla::Maybe<uint64_t>>((&(reader__)));
if (!maybe__mediaEngineId) {
FatalError("Error deserializing 'uint64_t?'");
return MsgValueError;
}
auto& mediaEngineId = *maybe__mediaEngineId;
// Sentinel = 'mediaEngineId'
if ((!(((&(reader__)))->ReadSentinel(597624068)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t?'");
return MsgValueError;
}
auto maybe__trackingId = IPC::ReadParam<mozilla::Maybe<TrackingId>>((&(reader__)));
if (!maybe__trackingId) {
FatalError("Error deserializing 'TrackingId?'");
return MsgValueError;
}
auto& trackingId = *maybe__trackingId;
// Sentinel = 'trackingId'
if ((!(((&(reader__)))->ReadSentinel(381879297)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'TrackingId?'");
return MsgValueError;
}
reader__.EndRead();
PRemoteDecoderParent* actor = (static_cast<RemoteDecoderManagerParent*>(this))->AllocPRemoteDecoderParent(info, options, identifier, mediaEngineId, trackingId);
if (!actor) {
NS_WARNING("Cannot bind null PRemoteDecoderParent actor");
return MsgValueError;
}
if (!actor->SetManagerAndRegister(this, (handle__).mId)) {
NS_WARNING("Failed to bind PRemoteDecoderParent actor");
return MsgValueError;
}
mozilla::ipc::IPCResult __ok = (static_cast<RemoteDecoderManagerParent*>(this))->RecvPRemoteDecoderConstructor(std::move(actor), std::move(info), std::move(options), std::move(identifier), std::move(mediaEngineId), std::move(trackingId));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PRemoteDecoderManager::Msg_DeallocateSurfaceDescriptorGPUVideo__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteDecoderManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteDecoderManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteDecoderManager::Msg_DeallocateSurfaceDescriptorGPUVideo", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__sd = IPC::ReadParam<SurfaceDescriptorGPUVideo>((&(reader__)));
if (!maybe__sd) {
FatalError("Error deserializing 'SurfaceDescriptorGPUVideo'");
return MsgValueError;
}
auto& sd = *maybe__sd;
// Sentinel = 'sd'
if ((!(((&(reader__)))->ReadSentinel(21758168)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'SurfaceDescriptorGPUVideo'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<RemoteDecoderManagerParent*>(this))->RecvDeallocateSurfaceDescriptorGPUVideo(std::move(sd));
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 PRemoteDecoderManagerParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PRemoteDecoderManagerParent::Result
{
int32_t route__ = msg__.routing_id();
if (MSG_ROUTING_CONTROL != route__) {
IProtocol* routed__ = Lookup(route__);
if (!routed__ || !routed__->GetLifecycleProxy()) {
return MsgRouteError;
}
RefPtr<mozilla::ipc::ActorLifecycleProxy> proxy__ =
routed__->GetLifecycleProxy();
return proxy__->Get()->OnMessageReceived(msg__, reply__);
}
switch (msg__.type()) {
case PRemoteDecoderManager::Msg_Readback__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteDecoderManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteDecoderManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteDecoderManager::Msg_Readback", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__sd = IPC::ReadParam<SurfaceDescriptorGPUVideo>((&(reader__)));
if (!maybe__sd) {
FatalError("Error deserializing 'SurfaceDescriptorGPUVideo'");
return MsgValueError;
}
auto& sd = *maybe__sd;
// Sentinel = 'sd'
if ((!(((&(reader__)))->ReadSentinel(21758168)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'SurfaceDescriptorGPUVideo'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = MSG_ROUTING_CONTROL;
SurfaceDescriptor aResult{};
mozilla::ipc::IPCResult __ok = (static_cast<RemoteDecoderManagerParent*>(this))->RecvReadback(std::move(sd), (&(aResult)));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
reply__ = PRemoteDecoderManager::Reply_Readback(id__);
IPC::MessageWriter writer__{
(*(reply__)),
this};
IPC::WriteParam((&(writer__)), aResult);
// Sentinel = 'aResult'
((&(writer__)))->WriteSentinel(185205473);
if (mozilla::ipc::LoggingEnabledFor("PRemoteDecoderManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteDecoderManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PRemoteDecoderManagerParent*>::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::PRemoteDecoderManagerParent*>::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, "PRemoteDecoderManager", PRemoteDecoderManagerMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::PRemoteDecoderManagerParent*>(actor.ref());
}
return {};
}
} // namespace IPC