Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/ipc/PUtilityAudioDecoderParent.h"
#include "mozilla/D3DMessageUtils.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/ipc/UtilityAudioDecoderParent.h"
#include "mozilla/PRemoteDecoderManagerParent.h"
#include "mozilla/layers/PVideoBridgeParent.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 PUtilityAudioDecoderParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PUtilityAudioDecoderParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PUtilityAudioDecoderParent::PUtilityAudioDecoderParent() :
mozilla::ipc::IToplevelProtocol("PUtilityAudioDecoderParent", kProtocolId, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PUtilityAudioDecoderParent);
}
PUtilityAudioDecoderParent::~PUtilityAudioDecoderParent()
{
MOZ_COUNT_DTOR(PUtilityAudioDecoderParent);
}
auto PUtilityAudioDecoderParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsUtilityProcess(), "Invalid process for `PUtilityAudioDecoderParent'");
AddRef();
}
auto PUtilityAudioDecoderParent::ActorDealloc() -> void
{
Release();
}
auto PUtilityAudioDecoderParent::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PUtilityAudioDecoderParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PUtilityAudioDecoderParent::SendUpdateMediaCodecsSupported(
const RemoteDecodeIn& aLocation,
const MediaCodecsSupported& aSupported) -> bool
{
UniquePtr<IPC::Message> msg__ = PUtilityAudioDecoder::Msg_UpdateMediaCodecsSupported(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aLocation);
// Sentinel = 'aLocation'
((&(writer__)))->WriteSentinel(292094875);
IPC::WriteParam((&(writer__)), aSupported);
// Sentinel = 'aSupported'
((&(writer__)))->WriteSentinel(378799144);
if (mozilla::ipc::LoggingEnabledFor("PUtilityAudioDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityAudioDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityAudioDecoder::Msg_UpdateMediaCodecsSupported", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUtilityAudioDecoderParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PUtilityAudioDecoderParent::OnMessageReceived(const Message& msg__) -> PUtilityAudioDecoderParent::Result
{
switch (msg__.type()) {
case PUtilityAudioDecoder::Msg_NewContentRemoteDecoderManager__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityAudioDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityAudioDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityAudioDecoder::Msg_NewContentRemoteDecoderManager", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__endpoint = IPC::ReadParam<Endpoint<::mozilla::PRemoteDecoderManagerParent>>((&(reader__)));
if (!maybe__endpoint) {
FatalError("Error deserializing 'Endpoint<::mozilla::PRemoteDecoderManagerParent>'");
return MsgValueError;
}
auto& endpoint = *maybe__endpoint;
// Sentinel = 'endpoint'
if ((!(((&(reader__)))->ReadSentinel(251724642)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::PRemoteDecoderManagerParent>'");
return MsgValueError;
}
auto maybe__parentId = IPC::ReadParam<ContentParentId>((&(reader__)));
if (!maybe__parentId) {
FatalError("Error deserializing 'ContentParentId'");
return MsgValueError;
}
auto& parentId = *maybe__parentId;
// Sentinel = 'parentId'
if ((!(((&(reader__)))->ReadSentinel(249430840)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ContentParentId'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityAudioDecoderParent*>(this))->RecvNewContentRemoteDecoderManager(std::move(endpoint), std::move(parentId));
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 PUtilityAudioDecoderParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PUtilityAudioDecoderParent::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
} // namespace ipc
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::ipc::PUtilityAudioDecoderParent*>::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::PUtilityAudioDecoderParent*>::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, "PUtilityAudioDecoder", PUtilityAudioDecoderMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::ipc::PUtilityAudioDecoderParent*>(actor.ref());
}
return {};
}
} // namespace IPC