Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PMFCDMChild.h"
#include "MFCDMSerializers.h"
#include "mozilla/MFCDMChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/PRemoteDecoderManagerChild.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 {
MOZ_IMPLICIT PMFCDMChild::PMFCDMChild() :
mozilla::ipc::IProtocol(kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PMFCDMChild);
}
PMFCDMChild::~PMFCDMChild()
{
MOZ_COUNT_DTOR(PMFCDMChild);
}
auto PMFCDMChild::ActorAlloc() -> void
{
}
auto PMFCDMChild::ActorDealloc() -> void
{
if (Manager()) {
Manager()->DeallocManagee(kProtocolId, this);
}
}
auto PMFCDMChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PMFCDMChild::OtherChildID() const -> ::GeckoChildID
{
::GeckoChildID childID =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid();
MOZ_RELEASE_ASSERT(childID != -1);
return childID;
}
auto PMFCDMChild::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo
{
return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()};
}
auto PMFCDMChild::Manager() const -> PRemoteDecoderManagerChild*
{
return static_cast<PRemoteDecoderManagerChild*>(IProtocol::Manager());
}
auto PMFCDMChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PMFCDMChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PMFCDMChild::RejectPendingResponses(ResponseRejectReason aReason) -> void
{
mAsyncCallbacks.RejectPendingResponses(aReason);
}
auto PMFCDMChild::SendGetCapabilities(
const MFCDMCapabilitiesRequest& request,
mozilla::ipc::ResolveCallback<MFCDMCapabilitiesResult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PMFCDM::Msg_GetCapabilities(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), request);
// Sentinel = 'request'
((&(writer__)))->WriteSentinel(202703626);
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_GetCapabilities", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PMFCDM::Reply_GetCapabilities__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__result = IPC::ReadParam<MFCDMCapabilitiesResult>(aReader);
if (!maybe__result) {
(aReader)->FatalError("Error deserializing 'MFCDMCapabilitiesResult'");
return MsgValueError;
}
auto& result = *maybe__result;
// Sentinel = 'result'
if ((!((aReader)->ReadSentinel(153223840)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'MFCDMCapabilitiesResult'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(result));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PMFCDMChild::SendGetCapabilities(const MFCDMCapabilitiesRequest& request) -> RefPtr<GetCapabilitiesPromise>
{
RefPtr<MozPromise<MFCDMCapabilitiesResult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<MFCDMCapabilitiesResult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendGetCapabilities(std::move(request), [promise__](MFCDMCapabilitiesResult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PMFCDMChild::SendInit(
const MFCDMInitParamsIPDL& params,
mozilla::ipc::ResolveCallback<MFCDMInitResult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PMFCDM::Msg_Init(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), params);
// Sentinel = 'params'
((&(writer__)))->WriteSentinel(146997893);
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_Init", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PMFCDM::Reply_Init__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__result = IPC::ReadParam<MFCDMInitResult>(aReader);
if (!maybe__result) {
(aReader)->FatalError("Error deserializing 'MFCDMInitResult'");
return MsgValueError;
}
auto& result = *maybe__result;
// Sentinel = 'result'
if ((!((aReader)->ReadSentinel(153223840)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'MFCDMInitResult'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(result));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PMFCDMChild::SendInit(const MFCDMInitParamsIPDL& params) -> RefPtr<InitPromise>
{
RefPtr<MozPromise<MFCDMInitResult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<MFCDMInitResult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendInit(std::move(params), [promise__](MFCDMInitResult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PMFCDMChild::SendCreateSessionAndGenerateRequest(
const MFCDMCreateSessionParamsIPDL& type,
mozilla::ipc::ResolveCallback<MFCDMSessionResult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PMFCDM::Msg_CreateSessionAndGenerateRequest(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), type);
// Sentinel = 'type'
((&(writer__)))->WriteSentinel(75760067);
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_CreateSessionAndGenerateRequest", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PMFCDM::Reply_CreateSessionAndGenerateRequest__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__result = IPC::ReadParam<MFCDMSessionResult>(aReader);
if (!maybe__result) {
(aReader)->FatalError("Error deserializing 'MFCDMSessionResult'");
return MsgValueError;
}
auto& result = *maybe__result;
// Sentinel = 'result'
if ((!((aReader)->ReadSentinel(153223840)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'MFCDMSessionResult'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(result));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PMFCDMChild::SendCreateSessionAndGenerateRequest(const MFCDMCreateSessionParamsIPDL& type) -> RefPtr<CreateSessionAndGenerateRequestPromise>
{
RefPtr<MozPromise<MFCDMSessionResult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<MFCDMSessionResult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendCreateSessionAndGenerateRequest(std::move(type), [promise__](MFCDMSessionResult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PMFCDMChild::SendLoadSession(
const SessionType& sessionType,
const nsAString& sessionId,
mozilla::ipc::ResolveCallback<nsresult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PMFCDM::Msg_LoadSession(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), sessionType);
// Sentinel = 'sessionType'
((&(writer__)))->WriteSentinel(472908967);
IPC::WriteParam((&(writer__)), sessionId);
// Sentinel = 'sessionId'
((&(writer__)))->WriteSentinel(320603058);
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_LoadSession", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PMFCDM::Reply_LoadSession__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__result = IPC::ReadParam<nsresult>(aReader);
if (!maybe__result) {
(aReader)->FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& result = *maybe__result;
// Sentinel = 'result'
if ((!((aReader)->ReadSentinel(153223840)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(result));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PMFCDMChild::SendLoadSession(
const SessionType& sessionType,
const nsAString& sessionId) -> RefPtr<LoadSessionPromise>
{
RefPtr<MozPromise<nsresult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsresult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendLoadSession(std::move(sessionType), std::move(sessionId), [promise__](nsresult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PMFCDMChild::SendUpdateSession(
const nsAString& sessionId,
mozilla::Span<uint8_t const> response,
mozilla::ipc::ResolveCallback<nsresult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PMFCDM::Msg_UpdateSession(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), sessionId);
// Sentinel = 'sessionId'
((&(writer__)))->WriteSentinel(320603058);
IPC::WriteParam((&(writer__)), response);
// Sentinel = 'response'
((&(writer__)))->WriteSentinel(260965232);
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_UpdateSession", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PMFCDM::Reply_UpdateSession__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__result = IPC::ReadParam<nsresult>(aReader);
if (!maybe__result) {
(aReader)->FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& result = *maybe__result;
// Sentinel = 'result'
if ((!((aReader)->ReadSentinel(153223840)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(result));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PMFCDMChild::SendUpdateSession(
const nsAString& sessionId,
mozilla::Span<uint8_t const> response) -> RefPtr<UpdateSessionPromise>
{
RefPtr<MozPromise<nsresult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsresult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendUpdateSession(std::move(sessionId), std::move(response), [promise__](nsresult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PMFCDMChild::SendCloseSession(
const nsAString& sessionId,
mozilla::ipc::ResolveCallback<nsresult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PMFCDM::Msg_CloseSession(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), sessionId);
// Sentinel = 'sessionId'
((&(writer__)))->WriteSentinel(320603058);
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_CloseSession", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PMFCDM::Reply_CloseSession__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__result = IPC::ReadParam<nsresult>(aReader);
if (!maybe__result) {
(aReader)->FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& result = *maybe__result;
// Sentinel = 'result'
if ((!((aReader)->ReadSentinel(153223840)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(result));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PMFCDMChild::SendCloseSession(const nsAString& sessionId) -> RefPtr<CloseSessionPromise>
{
RefPtr<MozPromise<nsresult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsresult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendCloseSession(std::move(sessionId), [promise__](nsresult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PMFCDMChild::SendRemoveSession(
const nsAString& sessionId,
mozilla::ipc::ResolveCallback<nsresult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PMFCDM::Msg_RemoveSession(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), sessionId);
// Sentinel = 'sessionId'
((&(writer__)))->WriteSentinel(320603058);
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_RemoveSession", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PMFCDM::Reply_RemoveSession__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__result = IPC::ReadParam<nsresult>(aReader);
if (!maybe__result) {
(aReader)->FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& result = *maybe__result;
// Sentinel = 'result'
if ((!((aReader)->ReadSentinel(153223840)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(result));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PMFCDMChild::SendRemoveSession(const nsAString& sessionId) -> RefPtr<RemoveSessionPromise>
{
RefPtr<MozPromise<nsresult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsresult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendRemoveSession(std::move(sessionId), [promise__](nsresult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PMFCDMChild::SendSetServerCertificate(
mozilla::Span<uint8_t const> certificate,
mozilla::ipc::ResolveCallback<nsresult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PMFCDM::Msg_SetServerCertificate(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), certificate);
// Sentinel = 'certificate'
((&(writer__)))->WriteSentinel(455869572);
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_SetServerCertificate", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PMFCDM::Reply_SetServerCertificate__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__result = IPC::ReadParam<nsresult>(aReader);
if (!maybe__result) {
(aReader)->FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& result = *maybe__result;
// Sentinel = 'result'
if ((!((aReader)->ReadSentinel(153223840)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(result));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PMFCDMChild::SendSetServerCertificate(mozilla::Span<uint8_t const> certificate) -> RefPtr<SetServerCertificatePromise>
{
RefPtr<MozPromise<nsresult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsresult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendSetServerCertificate(std::move(certificate), [promise__](nsresult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PMFCDMChild::SendGetStatusForPolicy(
const HDCPVersion& minHdcpVersion,
mozilla::ipc::ResolveCallback<nsresult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PMFCDM::Msg_GetStatusForPolicy(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), minHdcpVersion);
// Sentinel = 'minHdcpVersion'
((&(writer__)))->WriteSentinel(700515754);
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_GetStatusForPolicy", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PMFCDM::Reply_GetStatusForPolicy__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__result = IPC::ReadParam<nsresult>(aReader);
if (!maybe__result) {
(aReader)->FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& result = *maybe__result;
// Sentinel = 'result'
if ((!((aReader)->ReadSentinel(153223840)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(result));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PMFCDMChild::SendGetStatusForPolicy(const HDCPVersion& minHdcpVersion) -> RefPtr<GetStatusForPolicyPromise>
{
RefPtr<MozPromise<nsresult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsresult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendGetStatusForPolicy(std::move(minHdcpVersion), [promise__](nsresult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PMFCDMChild::Send__delete__(PMFCDMChild* actor) -> bool
{
if (!actor || !actor->CanSend()) {
NS_WARNING("Attempt to __delete__ missing or closed actor");
return false;
}
UniquePtr<IPC::Message> msg__ = PMFCDM::Msg___delete__((actor)->Id());
IPC::MessageWriter writer__{
(*(msg__)),
actor};
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
actor->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg___delete__", OTHER);
bool sendok__ = (actor)->ChannelSend(std::move(msg__));
actor->ActorDisconnected(Deletion);
return sendok__;
}
auto PMFCDMChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PMFCDMChild::OnMessageReceived(const Message& msg__) -> PMFCDMChild::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 PMFCDM::Reply_GetCapabilities__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_GetCapabilities", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PMFCDM::Reply_Init__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_Init", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PMFCDM::Reply_CreateSessionAndGenerateRequest__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_CreateSessionAndGenerateRequest", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PMFCDM::Reply_LoadSession__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_LoadSession", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PMFCDM::Reply_UpdateSession__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_UpdateSession", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PMFCDM::Reply_CloseSession__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_CloseSession", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PMFCDM::Reply_RemoveSession__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_RemoveSession", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PMFCDM::Reply_SetServerCertificate__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_SetServerCertificate", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PMFCDM::Reply_GetStatusForPolicy__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_GetStatusForPolicy", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PMFCDM::Reply___delete____ID:
{
return MsgProcessed;
}
case PMFCDM::Msg_OnSessionKeyMessage__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_OnSessionKeyMessage", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__message = IPC::ReadParam<MFCDMKeyMessage>((&(reader__)));
if (!maybe__message) {
FatalError("Error deserializing 'MFCDMKeyMessage'");
return MsgValueError;
}
auto& message = *maybe__message;
// Sentinel = 'message'
if ((!(((&(reader__)))->ReadSentinel(197198566)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'MFCDMKeyMessage'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<MFCDMChild*>(this))->RecvOnSessionKeyMessage(std::move(message));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PMFCDM::Msg_OnSessionKeyStatusesChanged__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_OnSessionKeyStatusesChanged", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__keystatuses = IPC::ReadParam<MFCDMKeyStatusChange>((&(reader__)));
if (!maybe__keystatuses) {
FatalError("Error deserializing 'MFCDMKeyStatusChange'");
return MsgValueError;
}
auto& keystatuses = *maybe__keystatuses;
// Sentinel = 'keystatuses'
if ((!(((&(reader__)))->ReadSentinel(479134918)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'MFCDMKeyStatusChange'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<MFCDMChild*>(this))->RecvOnSessionKeyStatusesChanged(std::move(keystatuses));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PMFCDM::Msg_OnSessionKeyExpiration__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFCDM", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFCDMChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFCDM::Msg_OnSessionKeyExpiration", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__expiration = IPC::ReadParam<MFCDMKeyExpiration>((&(reader__)));
if (!maybe__expiration) {
FatalError("Error deserializing 'MFCDMKeyExpiration'");
return MsgValueError;
}
auto& expiration = *maybe__expiration;
// Sentinel = 'expiration'
if ((!(((&(reader__)))->ReadSentinel(393937988)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'MFCDMKeyExpiration'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<MFCDMChild*>(this))->RecvOnSessionKeyExpiration(std::move(expiration));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PMFCDMChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PMFCDMChild::Result
{
return MsgNotKnown;
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PMFCDMChild*>::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::PMFCDMChild*>::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, "PMFCDM", PMFCDMMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::PMFCDMChild*>(actor.ref());
}
return {};
}
} // namespace IPC