Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PWebIdentityChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/IdentityCredentialSerializationHelpers.h"
#include "mozilla/dom/WebIdentityChild.h"
#include "mozilla/dom/PWindowGlobalChild.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 PWebIdentityChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PWebIdentityChild::PWebIdentityChild() :
mozilla::ipc::IRefCountedProtocol(kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PWebIdentityChild);
}
PWebIdentityChild::~PWebIdentityChild()
{
MOZ_COUNT_DTOR(PWebIdentityChild);
}
auto PWebIdentityChild::ActorAlloc() -> void
{
AddRef();
}
auto PWebIdentityChild::ActorDealloc() -> void
{
Release();
}
auto PWebIdentityChild::Manager() const -> PWindowGlobalChild*
{
return static_cast<PWindowGlobalChild*>(IProtocol::Manager());
}
auto PWebIdentityChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PWebIdentityChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PWebIdentityChild::RejectPendingResponses(ResponseRejectReason aReason) -> void
{
mAsyncCallbacks.RejectPendingResponses(aReason);
}
auto PWebIdentityChild::SendRequestCancel() -> bool
{
UniquePtr<IPC::Message> msg__ = PWebIdentity::Msg_RequestCancel(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PWebIdentity", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebIdentityChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebIdentity::Msg_RequestCancel", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebIdentityChild::SendGetIdentityCredential(
const IdentityCredentialRequestOptions& aOptions,
const CredentialMediationRequirement& aMediationRequirement,
const bool& aHasUserActivation,
mozilla::ipc::ResolveCallback<WebIdentityGetCredentialResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PWebIdentity::Msg_GetIdentityCredential(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aOptions);
// Sentinel = 'aOptions'
((&(writer__)))->WriteSentinel(240976718);
IPC::WriteParam((&(writer__)), aMediationRequirement);
// Sentinel = 'aMediationRequirement'
((&(writer__)))->WriteSentinel(1539508365);
IPC::WriteParam((&(writer__)), aHasUserActivation);
// Sentinel = 'aHasUserActivation'
((&(writer__)))->WriteSentinel(1109133103);
if (mozilla::ipc::LoggingEnabledFor("PWebIdentity", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebIdentityChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebIdentity::Msg_GetIdentityCredential", OTHER);
IPC::Message::seqno_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PWebIdentity::Reply_GetIdentityCredential__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__response = IPC::ReadParam<WebIdentityGetCredentialResponse>(aReader);
if (!maybe__response) {
(aReader)->FatalError("Error deserializing 'WebIdentityGetCredentialResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!((aReader)->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'WebIdentityGetCredentialResponse'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(response));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PWebIdentityChild::SendGetIdentityCredential(
const IdentityCredentialRequestOptions& aOptions,
const CredentialMediationRequirement& aMediationRequirement,
const bool& aHasUserActivation) -> RefPtr<GetIdentityCredentialPromise>
{
RefPtr<MozPromise<WebIdentityGetCredentialResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<WebIdentityGetCredentialResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendGetIdentityCredential(std::move(aOptions), std::move(aMediationRequirement), std::move(aHasUserActivation), [promise__](WebIdentityGetCredentialResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PWebIdentityChild::SendDisconnectIdentityCredential(
const IdentityCredentialDisconnectOptions& aOptions,
mozilla::ipc::ResolveCallback<nsresult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PWebIdentity::Msg_DisconnectIdentityCredential(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aOptions);
// Sentinel = 'aOptions'
((&(writer__)))->WriteSentinel(240976718);
if (mozilla::ipc::LoggingEnabledFor("PWebIdentity", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebIdentityChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebIdentity::Msg_DisconnectIdentityCredential", OTHER);
IPC::Message::seqno_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PWebIdentity::Reply_DisconnectIdentityCredential__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__rv = IPC::ReadParam<nsresult>(aReader);
if (!maybe__rv) {
(aReader)->FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& rv = *maybe__rv;
// Sentinel = 'rv'
if ((!((aReader)->ReadSentinel(22806761)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(rv));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PWebIdentityChild::SendDisconnectIdentityCredential(const IdentityCredentialDisconnectOptions& aOptions) -> RefPtr<DisconnectIdentityCredentialPromise>
{
RefPtr<MozPromise<nsresult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsresult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendDisconnectIdentityCredential(std::move(aOptions), [promise__](nsresult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PWebIdentityChild::SendPreventSilentAccess(
mozilla::ipc::ResolveCallback<nsresult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PWebIdentity::Msg_PreventSilentAccess(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PWebIdentity", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebIdentityChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebIdentity::Msg_PreventSilentAccess", OTHER);
IPC::Message::seqno_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PWebIdentity::Reply_PreventSilentAccess__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__rv = IPC::ReadParam<nsresult>(aReader);
if (!maybe__rv) {
(aReader)->FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& rv = *maybe__rv;
// Sentinel = 'rv'
if ((!((aReader)->ReadSentinel(22806761)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(rv));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PWebIdentityChild::SendPreventSilentAccess() -> RefPtr<PreventSilentAccessPromise>
{
RefPtr<MozPromise<nsresult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsresult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendPreventSilentAccess([promise__](nsresult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PWebIdentityChild::SendSetLoginStatus(
const LoginStatus& foo,
mozilla::ipc::ResolveCallback<nsresult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PWebIdentity::Msg_SetLoginStatus(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), foo);
// Sentinel = 'foo'
((&(writer__)))->WriteSentinel(42074437);
if (mozilla::ipc::LoggingEnabledFor("PWebIdentity", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebIdentityChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebIdentity::Msg_SetLoginStatus", OTHER);
IPC::Message::seqno_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PWebIdentity::Reply_SetLoginStatus__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__rv = IPC::ReadParam<nsresult>(aReader);
if (!maybe__rv) {
(aReader)->FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& rv = *maybe__rv;
// Sentinel = 'rv'
if ((!((aReader)->ReadSentinel(22806761)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(rv));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PWebIdentityChild::SendSetLoginStatus(const LoginStatus& foo) -> RefPtr<SetLoginStatusPromise>
{
RefPtr<MozPromise<nsresult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsresult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendSetLoginStatus(std::move(foo), [promise__](nsresult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PWebIdentityChild::DeallocManagee(
mozilla::ipc::ProtocolId aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PWebIdentityChild::OnMessageReceived(const Message& msg__) -> PWebIdentityChild::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 PWebIdentity::Reply_GetIdentityCredential__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebIdentity", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebIdentityChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebIdentity::Msg_GetIdentityCredential", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PWebIdentity::Reply_DisconnectIdentityCredential__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebIdentity", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebIdentityChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebIdentity::Msg_DisconnectIdentityCredential", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PWebIdentity::Reply_PreventSilentAccess__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebIdentity", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebIdentityChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebIdentity::Msg_PreventSilentAccess", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PWebIdentity::Reply_SetLoginStatus__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebIdentity", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebIdentityChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebIdentity::Msg_SetLoginStatus", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PWebIdentity::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebIdentity", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebIdentityChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebIdentity::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<WebIdentityChild*>(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 PWebIdentityChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PWebIdentityChild::Result
{
return MsgNotKnown;
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PWebIdentityChild*>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, static_cast<mozilla::ipc::IProtocol*>(aVar));
// Sentinel = 'PWebIdentity'
(aWriter)->WriteSentinel(484508857);
}
auto ParamTraits<::mozilla::dom::PWebIdentityChild*>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe__actor = IPC::ReadParam<mozilla::ipc::IProtocol*>(aReader);
if (!maybe__actor) {
aReader->FatalError("Error deserializing managed PWebIdentity actor");
return {};
}
auto& actor = *maybe__actor;
// Sentinel = 'PWebIdentity'
if ((!((aReader)->ReadSentinel(484508857)))) {
mozilla::ipc::SentinelReadError("Error deserializing managed PWebIdentity actor");
return {};
}
if (actor && actor->GetProtocolId() != PWebIdentityMsgStart) {
aReader->FatalError("Unexpected actor type (expected PWebIdentity)");
return {};
}
return static_cast<::mozilla::dom::PWebIdentityChild*>(actor);
}
} // namespace IPC