Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PWebAuthnTransactionChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/WebAuthnTransactionChild.h"
#include "mozilla/ipc/PBackgroundChild.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 dom {
auto PWebAuthnTransactionChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PWebAuthnTransactionChild::PWebAuthnTransactionChild() :
mozilla::ipc::IProtocol(kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PWebAuthnTransactionChild);
}
PWebAuthnTransactionChild::~PWebAuthnTransactionChild()
{
MOZ_COUNT_DTOR(PWebAuthnTransactionChild);
}
auto PWebAuthnTransactionChild::ActorAlloc() -> void
{
}
auto PWebAuthnTransactionChild::ActorDealloc() -> void
{
if (Manager()) {
Manager()->DeallocManagee(kProtocolId, this);
}
}
auto PWebAuthnTransactionChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PWebAuthnTransactionChild::OtherChildID() const -> ::GeckoChildID
{
::GeckoChildID childID =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid();
MOZ_RELEASE_ASSERT(childID != -1);
return childID;
}
auto PWebAuthnTransactionChild::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo
{
return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()};
}
auto PWebAuthnTransactionChild::Manager() const -> PBackgroundChild*
{
return static_cast<PBackgroundChild*>(IProtocol::Manager());
}
auto PWebAuthnTransactionChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PWebAuthnTransactionChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PWebAuthnTransactionChild::RejectPendingResponses(ResponseRejectReason aReason) -> void
{
mAsyncCallbacks.RejectPendingResponses(aReason);
}
auto PWebAuthnTransactionChild::SendRequestRegister(
const uint64_t& aTransactionId,
const WebAuthnMakeCredentialInfo& aTransactionInfo) -> bool
{
UniquePtr<IPC::Message> msg__ = PWebAuthnTransaction::Msg_RequestRegister(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aTransactionId);
// Sentinel = 'aTransactionId'
((&(writer__)))->WriteSentinel(704120213);
IPC::WriteParam((&(writer__)), aTransactionInfo);
// Sentinel = 'aTransactionInfo'
((&(writer__)))->WriteSentinel(914032244);
if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransaction", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebAuthnTransactionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_RequestRegister", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebAuthnTransactionChild::SendRequestSign(
const uint64_t& aTransactionId,
const WebAuthnGetAssertionInfo& aTransactionInfo) -> bool
{
UniquePtr<IPC::Message> msg__ = PWebAuthnTransaction::Msg_RequestSign(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aTransactionId);
// Sentinel = 'aTransactionId'
((&(writer__)))->WriteSentinel(704120213);
IPC::WriteParam((&(writer__)), aTransactionInfo);
// Sentinel = 'aTransactionInfo'
((&(writer__)))->WriteSentinel(914032244);
if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransaction", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebAuthnTransactionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_RequestSign", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebAuthnTransactionChild::SendRequestIsUVPAA(
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PWebAuthnTransaction::Msg_RequestIsUVPAA(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransaction", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebAuthnTransactionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_RequestIsUVPAA", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PWebAuthnTransaction::Reply_RequestIsUVPAA__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__available = IPC::ReadParam<bool>(aReader);
if (!maybe__available) {
(aReader)->FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& available = *maybe__available;
// Sentinel = 'available'
if ((!((aReader)->ReadSentinel(306316194)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(available));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PWebAuthnTransactionChild::SendRequestIsUVPAA() -> RefPtr<RequestIsUVPAAPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendRequestIsUVPAA([promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PWebAuthnTransactionChild::SendRequestCancel(const uint64_t& aTransactionId) -> bool
{
UniquePtr<IPC::Message> msg__ = PWebAuthnTransaction::Msg_RequestCancel(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aTransactionId);
// Sentinel = 'aTransactionId'
((&(writer__)))->WriteSentinel(704120213);
if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransaction", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebAuthnTransactionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_RequestCancel", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebAuthnTransactionChild::SendDestroyMe() -> bool
{
UniquePtr<IPC::Message> msg__ = PWebAuthnTransaction::Msg_DestroyMe(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransaction", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebAuthnTransactionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_DestroyMe", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebAuthnTransactionChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PWebAuthnTransactionChild::OnMessageReceived(const Message& msg__) -> PWebAuthnTransactionChild::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 PWebAuthnTransaction::Reply_RequestIsUVPAA__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransaction", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebAuthnTransactionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_RequestIsUVPAA", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PWebAuthnTransaction::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransaction", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebAuthnTransactionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<WebAuthnTransactionChild*>(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;
}
case PWebAuthnTransaction::Msg_ConfirmRegister__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransaction", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebAuthnTransactionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_ConfirmRegister", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aTransactionId = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__aTransactionId) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& aTransactionId = *maybe__aTransactionId;
// Sentinel = 'aTransactionId'
if ((!(((&(reader__)))->ReadSentinel(704120213)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto maybe__aResult = IPC::ReadParam<WebAuthnMakeCredentialResult>((&(reader__)));
if (!maybe__aResult) {
FatalError("Error deserializing 'WebAuthnMakeCredentialResult'");
return MsgValueError;
}
auto& aResult = *maybe__aResult;
// Sentinel = 'aResult'
if ((!(((&(reader__)))->ReadSentinel(185205473)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'WebAuthnMakeCredentialResult'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebAuthnTransactionChild*>(this))->RecvConfirmRegister(std::move(aTransactionId), std::move(aResult));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebAuthnTransaction::Msg_ConfirmSign__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransaction", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebAuthnTransactionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_ConfirmSign", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aTransactionId = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__aTransactionId) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& aTransactionId = *maybe__aTransactionId;
// Sentinel = 'aTransactionId'
if ((!(((&(reader__)))->ReadSentinel(704120213)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto maybe__aResult = IPC::ReadParam<WebAuthnGetAssertionResult>((&(reader__)));
if (!maybe__aResult) {
FatalError("Error deserializing 'WebAuthnGetAssertionResult'");
return MsgValueError;
}
auto& aResult = *maybe__aResult;
// Sentinel = 'aResult'
if ((!(((&(reader__)))->ReadSentinel(185205473)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'WebAuthnGetAssertionResult'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebAuthnTransactionChild*>(this))->RecvConfirmSign(std::move(aTransactionId), std::move(aResult));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebAuthnTransaction::Msg_Abort__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransaction", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebAuthnTransactionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_Abort", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aTransactionId = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__aTransactionId) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& aTransactionId = *maybe__aTransactionId;
// Sentinel = 'aTransactionId'
if ((!(((&(reader__)))->ReadSentinel(704120213)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto maybe__Error = IPC::ReadParam<nsresult>((&(reader__)));
if (!maybe__Error) {
FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& Error = *maybe__Error;
// Sentinel = 'Error'
if ((!(((&(reader__)))->ReadSentinel(97255947)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebAuthnTransactionChild*>(this))->RecvAbort(std::move(aTransactionId), std::move(Error));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PWebAuthnTransactionChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PWebAuthnTransactionChild::Result
{
return MsgNotKnown;
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PWebAuthnTransactionChild*>::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::dom::PWebAuthnTransactionChild*>::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, "PWebAuthnTransaction", PWebAuthnTransactionMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::PWebAuthnTransactionChild*>(actor.ref());
}
return {};
}
} // namespace IPC