Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/gmp/PGMPVideoDecoderChild.h"
#include "GMPMessageUtils.h"
#include "GMPVideoDecoderChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/gmp/PGMPContentChild.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 gmp {
auto PGMPVideoDecoderChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PGMPVideoDecoderChild::PGMPVideoDecoderChild() :
mozilla::ipc::IRefCountedProtocol(kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PGMPVideoDecoderChild);
}
PGMPVideoDecoderChild::~PGMPVideoDecoderChild()
{
MOZ_COUNT_DTOR(PGMPVideoDecoderChild);
}
auto PGMPVideoDecoderChild::ActorAlloc() -> void
{
AddRef();
}
auto PGMPVideoDecoderChild::ActorDealloc() -> void
{
Release();
}
auto PGMPVideoDecoderChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PGMPVideoDecoderChild::OtherChildID() const -> ::GeckoChildID
{
::GeckoChildID childID =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid();
MOZ_RELEASE_ASSERT(childID != -1);
return childID;
}
auto PGMPVideoDecoderChild::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo
{
return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()};
}
auto PGMPVideoDecoderChild::Manager() const -> PGMPContentChild*
{
return static_cast<PGMPContentChild*>(IProtocol::Manager());
}
auto PGMPVideoDecoderChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PGMPVideoDecoderChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PGMPVideoDecoderChild::SendReturnShmem(Shmem&& aInputShmem) -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_ReturnShmem(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), std::move(aInputShmem));
// Sentinel = 'aInputShmem'
((&(writer__)))->WriteSentinel(437650540);
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ReturnShmem", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderChild::SendDecodedData(
const GMPVideoi420FrameData& aDecodedFrame,
mozilla::Span<uint8_t const> aDecodedData) -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_DecodedData(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aDecodedFrame);
// Sentinel = 'aDecodedFrame'
((&(writer__)))->WriteSentinel(571016437);
IPC::WriteParam((&(writer__)), aDecodedData);
// Sentinel = 'aDecodedData'
((&(writer__)))->WriteSentinel(485688452);
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_DecodedData", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderChild::SendDecodedShmem(
const GMPVideoi420FrameData& aDecodedFrame,
Shmem&& aDecodedShmem) -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_DecodedShmem(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aDecodedFrame);
// Sentinel = 'aDecodedFrame'
((&(writer__)))->WriteSentinel(571016437);
IPC::WriteParam((&(writer__)), std::move(aDecodedShmem));
// Sentinel = 'aDecodedShmem'
((&(writer__)))->WriteSentinel(574489860);
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_DecodedShmem", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderChild::SendReceivedDecodedReferenceFrame(const uint64_t& aPictureId) -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_ReceivedDecodedReferenceFrame(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aPictureId);
// Sentinel = 'aPictureId'
((&(writer__)))->WriteSentinel(361694187);
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ReceivedDecodedReferenceFrame", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderChild::SendReceivedDecodedFrame(const uint64_t& aPictureId) -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_ReceivedDecodedFrame(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aPictureId);
// Sentinel = 'aPictureId'
((&(writer__)))->WriteSentinel(361694187);
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ReceivedDecodedFrame", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderChild::SendInputDataExhausted() -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_InputDataExhausted(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_InputDataExhausted", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderChild::SendDrainComplete() -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_DrainComplete(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_DrainComplete", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderChild::SendResetComplete() -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_ResetComplete(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ResetComplete", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderChild::SendError(const GMPErr& aErr) -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_Error(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aErr);
// Sentinel = 'aErr'
((&(writer__)))->WriteSentinel(61669771);
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Error", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderChild::SendShutdown() -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_Shutdown(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Shutdown", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PGMPVideoDecoderChild::OnMessageReceived(const Message& msg__) -> PGMPVideoDecoderChild::Result
{
switch (msg__.type()) {
case MANAGED_ENDPOINT_BOUND_MESSAGE_TYPE:
{
if (!mAwaitingManagedEndpointBind) {
NS_WARNING("Unexpected managed endpoint lifecycle message after actor bound!");
return MsgNotAllowed;
}
mAwaitingManagedEndpointBind = false;
return MsgProcessed;
}
case MANAGED_ENDPOINT_DROPPED_MESSAGE_TYPE:
{
if (!mAwaitingManagedEndpointBind) {
NS_WARNING("Unexpected managed endpoint lifecycle message after actor bound!");
return MsgNotAllowed;
}
mAwaitingManagedEndpointBind = false;
this->ActorDisconnected(ManagedEndpointDropped);
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_InitDecode__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_InitDecode", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aCodecSettings = IPC::ReadParam<GMPVideoCodec>((&(reader__)));
if (!maybe__aCodecSettings) {
FatalError("Error deserializing 'GMPVideoCodec'");
return MsgValueError;
}
auto& aCodecSettings = *maybe__aCodecSettings;
// Sentinel = 'aCodecSettings'
if ((!(((&(reader__)))->ReadSentinel(674629009)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'GMPVideoCodec'");
return MsgValueError;
}
auto maybe__aCodecSpecific = IPC::ReadParam<nsTArray<uint8_t>>((&(reader__)));
if (!maybe__aCodecSpecific) {
FatalError("Error deserializing 'uint8_t[]'");
return MsgValueError;
}
auto& aCodecSpecific = *maybe__aCodecSpecific;
// Sentinel = 'aCodecSpecific'
if ((!(((&(reader__)))->ReadSentinel(665847142)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint8_t[]'");
return MsgValueError;
}
auto maybe__aCoreCount = IPC::ReadParam<int32_t>((&(reader__)));
if (!maybe__aCoreCount) {
FatalError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto& aCoreCount = *maybe__aCoreCount;
// Sentinel = 'aCoreCount'
if ((!(((&(reader__)))->ReadSentinel(350028788)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<GMPVideoDecoderChild*>(this))->RecvInitDecode(std::move(aCodecSettings), std::move(aCodecSpecific), std::move(aCoreCount));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_GiveShmem__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_GiveShmem", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aOutputShmem = IPC::ReadParam<Shmem>((&(reader__)));
if (!maybe__aOutputShmem) {
FatalError("Error deserializing 'Shmem'");
return MsgValueError;
}
auto& aOutputShmem = *maybe__aOutputShmem;
// Sentinel = 'aOutputShmem'
if ((!(((&(reader__)))->ReadSentinel(533398765)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Shmem'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<GMPVideoDecoderChild*>(this))->RecvGiveShmem(std::move(aOutputShmem));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_Decode__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Decode", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aInputFrame = IPC::ReadParam<GMPVideoEncodedFrameData>((&(reader__)));
if (!maybe__aInputFrame) {
FatalError("Error deserializing 'GMPVideoEncodedFrameData'");
return MsgValueError;
}
auto& aInputFrame = *maybe__aInputFrame;
// Sentinel = 'aInputFrame'
if ((!(((&(reader__)))->ReadSentinel(434177117)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'GMPVideoEncodedFrameData'");
return MsgValueError;
}
auto maybe__aInputShmem = IPC::ReadParam<Shmem>((&(reader__)));
if (!maybe__aInputShmem) {
FatalError("Error deserializing 'Shmem'");
return MsgValueError;
}
auto& aInputShmem = *maybe__aInputShmem;
// Sentinel = 'aInputShmem'
if ((!(((&(reader__)))->ReadSentinel(437650540)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Shmem'");
return MsgValueError;
}
auto maybe__aMissingFrames = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__aMissingFrames) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& aMissingFrames = *maybe__aMissingFrames;
// Sentinel = 'aMissingFrames'
if ((!(((&(reader__)))->ReadSentinel(695731610)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__aCodecSpecificInfo = IPC::ReadParam<nsTArray<uint8_t>>((&(reader__)));
if (!maybe__aCodecSpecificInfo) {
FatalError("Error deserializing 'uint8_t[]'");
return MsgValueError;
}
auto& aCodecSpecificInfo = *maybe__aCodecSpecificInfo;
// Sentinel = 'aCodecSpecificInfo'
if ((!(((&(reader__)))->ReadSentinel(1089537778)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint8_t[]'");
return MsgValueError;
}
auto maybe__aRenderTimeMs = IPC::ReadParam<int64_t>((&(reader__)));
if (!maybe__aRenderTimeMs) {
FatalError("Error deserializing 'int64_t'");
return MsgValueError;
}
auto& aRenderTimeMs = *maybe__aRenderTimeMs;
// Sentinel = 'aRenderTimeMs'
if ((!(((&(reader__)))->ReadSentinel(590611729)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int64_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<GMPVideoDecoderChild*>(this))->RecvDecode(std::move(aInputFrame), std::move(aInputShmem), std::move(aMissingFrames), std::move(aCodecSpecificInfo), std::move(aRenderTimeMs));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_Reset__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Reset", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<GMPVideoDecoderChild*>(this))->RecvReset();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_Drain__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Drain", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<GMPVideoDecoderChild*>(this))->RecvDrain();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<GMPVideoDecoderChild*>(this))->Recv__delete__();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
this->ActorDisconnected(Deletion);
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PGMPVideoDecoderChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PGMPVideoDecoderChild::Result
{
return MsgNotKnown;
}
} // namespace gmp
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::gmp::PGMPVideoDecoderChild*>::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::gmp::PGMPVideoDecoderChild*>::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, "PGMPVideoDecoder", PGMPVideoDecoderMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::gmp::PGMPVideoDecoderChild*>(actor.ref());
}
return {};
}
} // namespace IPC