Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PCookieStoreChild.h"
#include "ipc/IPCMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/CookieStoreChild.h"
#include "nsID.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 PCookieStoreChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PCookieStoreChild::PCookieStoreChild() :
mozilla::ipc::IProtocol(kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PCookieStoreChild);
}
PCookieStoreChild::~PCookieStoreChild()
{
MOZ_COUNT_DTOR(PCookieStoreChild);
}
auto PCookieStoreChild::ActorAlloc() -> void
{
}
auto PCookieStoreChild::ActorDealloc() -> void
{
if (Manager()) {
Manager()->DeallocManagee(kProtocolId, this);
}
}
auto PCookieStoreChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PCookieStoreChild::OtherChildID() const -> ::GeckoChildID
{
::GeckoChildID childID =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid();
MOZ_RELEASE_ASSERT(childID != -1);
return childID;
}
auto PCookieStoreChild::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo
{
return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()};
}
auto PCookieStoreChild::Manager() const -> PBackgroundChild*
{
return static_cast<PBackgroundChild*>(IProtocol::Manager());
}
auto PCookieStoreChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PCookieStoreChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PCookieStoreChild::RejectPendingResponses(ResponseRejectReason aReason) -> void
{
mAsyncCallbacks.RejectPendingResponses(aReason);
}
auto PCookieStoreChild::SendGetRequest(
const nsAString& domain,
const OriginAttributes& attrs,
const mozilla::Maybe<OriginAttributes>& partitionedAttrs,
const bool& thirdPartyContext,
const bool& partitionForeign,
const bool& usingStorageAccess,
const bool& matchName,
const nsAString& name,
const nsACString& path,
const bool& onlyFirstMatch,
mozilla::ipc::ResolveCallback<nsTArray<CookieData>>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PCookieStore::Msg_GetRequest(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), domain);
// Sentinel = 'domain'
((&(writer__)))->WriteSentinel(144704121);
IPC::WriteParam((&(writer__)), attrs);
// Sentinel = 'attrs'
((&(writer__)))->WriteSentinel(107807279);
IPC::WriteParam((&(writer__)), partitionedAttrs);
// Sentinel = 'partitionedAttrs'
((&(writer__)))->WriteSentinel(958072498);
IPC::WriteParam((&(writer__)), thirdPartyContext);
// Sentinel = 'thirdPartyContext'
((&(writer__)))->WriteSentinel(1055852305);
IPC::WriteParam((&(writer__)), partitionForeign);
// Sentinel = 'partitionForeign'
((&(writer__)))->WriteSentinel(956368549);
IPC::WriteParam((&(writer__)), usingStorageAccess);
// Sentinel = 'usingStorageAccess'
((&(writer__)))->WriteSentinel(1180698446);
IPC::WriteParam((&(writer__)), matchName);
// Sentinel = 'matchName'
((&(writer__)))->WriteSentinel(302384015);
IPC::WriteParam((&(writer__)), name);
// Sentinel = 'name'
((&(writer__)))->WriteSentinel(69075362);
IPC::WriteParam((&(writer__)), path);
// Sentinel = 'path'
((&(writer__)))->WriteSentinel(70713774);
IPC::WriteParam((&(writer__)), onlyFirstMatch);
// Sentinel = 'onlyFirstMatch'
((&(writer__)))->WriteSentinel(727844280);
if (mozilla::ipc::LoggingEnabledFor("PCookieStore", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieStoreChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PCookieStore::Msg_GetRequest", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PCookieStore::Reply_GetRequest__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__data = IPC::ReadParam<nsTArray<CookieData>>(aReader);
if (!maybe__data) {
(aReader)->FatalError("Error deserializing 'CookieData[]'");
return MsgValueError;
}
auto& data = *maybe__data;
// Sentinel = 'data'
if ((!((aReader)->ReadSentinel(67109275)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'CookieData[]'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(data));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PCookieStoreChild::SendGetRequest(
const nsAString& domain,
const OriginAttributes& attrs,
const mozilla::Maybe<OriginAttributes>& partitionedAttrs,
const bool& thirdPartyContext,
const bool& partitionForeign,
const bool& usingStorageAccess,
const bool& matchName,
const nsAString& name,
const nsACString& path,
const bool& onlyFirstMatch) -> RefPtr<GetRequestPromise>
{
RefPtr<MozPromise<nsTArray<CookieData>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsTArray<CookieData>, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendGetRequest(std::move(domain), std::move(attrs), std::move(partitionedAttrs), std::move(thirdPartyContext), std::move(partitionForeign), std::move(usingStorageAccess), std::move(matchName), std::move(name), std::move(path), std::move(onlyFirstMatch), [promise__](nsTArray<CookieData>&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PCookieStoreChild::SendSetRequest(
const nsAString& domain,
const OriginAttributes& attrs,
const bool& thirdPartyContext,
const bool& partitionForeign,
const bool& usingStorageAccess,
const nsAString& name,
const nsAString& value,
const bool& session,
const int64_t& expires,
const nsAString& path,
const int32_t& sameSite,
const bool& partitioned,
const nsID& operationId,
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PCookieStore::Msg_SetRequest(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), domain);
// Sentinel = 'domain'
((&(writer__)))->WriteSentinel(144704121);
IPC::WriteParam((&(writer__)), attrs);
// Sentinel = 'attrs'
((&(writer__)))->WriteSentinel(107807279);
IPC::WriteParam((&(writer__)), thirdPartyContext);
// Sentinel = 'thirdPartyContext'
((&(writer__)))->WriteSentinel(1055852305);
IPC::WriteParam((&(writer__)), partitionForeign);
// Sentinel = 'partitionForeign'
((&(writer__)))->WriteSentinel(956368549);
IPC::WriteParam((&(writer__)), usingStorageAccess);
// Sentinel = 'usingStorageAccess'
((&(writer__)))->WriteSentinel(1180698446);
IPC::WriteParam((&(writer__)), name);
// Sentinel = 'name'
((&(writer__)))->WriteSentinel(69075362);
IPC::WriteParam((&(writer__)), value);
// Sentinel = 'value'
((&(writer__)))->WriteSentinel(107610654);
IPC::WriteParam((&(writer__)), session);
// Sentinel = 'session'
((&(writer__)))->WriteSentinel(203162373);
IPC::WriteParam((&(writer__)), expires);
// Sentinel = 'expires'
((&(writer__)))->WriteSentinel(201392897);
IPC::WriteParam((&(writer__)), path);
// Sentinel = 'path'
((&(writer__)))->WriteSentinel(70713774);
IPC::WriteParam((&(writer__)), sameSite);
// Sentinel = 'sameSite'
((&(writer__)))->WriteSentinel(245498684);
IPC::WriteParam((&(writer__)), partitioned);
// Sentinel = 'partitioned'
((&(writer__)))->WriteSentinel(471794852);
IPC::WriteParam((&(writer__)), operationId);
// Sentinel = 'operationId'
((&(writer__)))->WriteSentinel(464847999);
if (mozilla::ipc::LoggingEnabledFor("PCookieStore", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieStoreChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PCookieStore::Msg_SetRequest", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PCookieStore::Reply_SetRequest__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__waitForNotification = IPC::ReadParam<bool>(aReader);
if (!maybe__waitForNotification) {
(aReader)->FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& waitForNotification = *maybe__waitForNotification;
// Sentinel = 'waitForNotification'
if ((!((aReader)->ReadSentinel(1294731204)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(waitForNotification));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PCookieStoreChild::SendSetRequest(
const nsAString& domain,
const OriginAttributes& attrs,
const bool& thirdPartyContext,
const bool& partitionForeign,
const bool& usingStorageAccess,
const nsAString& name,
const nsAString& value,
const bool& session,
const int64_t& expires,
const nsAString& path,
const int32_t& sameSite,
const bool& partitioned,
const nsID& operationId) -> RefPtr<SetRequestPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendSetRequest(std::move(domain), std::move(attrs), std::move(thirdPartyContext), std::move(partitionForeign), std::move(usingStorageAccess), std::move(name), std::move(value), std::move(session), std::move(expires), std::move(path), std::move(sameSite), std::move(partitioned), std::move(operationId), [promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PCookieStoreChild::SendDeleteRequest(
const nsAString& domain,
const OriginAttributes& attrs,
const bool& thirdPartyContext,
const bool& partitionForeign,
const bool& usingStorageAccess,
const nsAString& name,
const nsAString& path,
const bool& partitioned,
const nsID& operationID,
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PCookieStore::Msg_DeleteRequest(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), domain);
// Sentinel = 'domain'
((&(writer__)))->WriteSentinel(144704121);
IPC::WriteParam((&(writer__)), attrs);
// Sentinel = 'attrs'
((&(writer__)))->WriteSentinel(107807279);
IPC::WriteParam((&(writer__)), thirdPartyContext);
// Sentinel = 'thirdPartyContext'
((&(writer__)))->WriteSentinel(1055852305);
IPC::WriteParam((&(writer__)), partitionForeign);
// Sentinel = 'partitionForeign'
((&(writer__)))->WriteSentinel(956368549);
IPC::WriteParam((&(writer__)), usingStorageAccess);
// Sentinel = 'usingStorageAccess'
((&(writer__)))->WriteSentinel(1180698446);
IPC::WriteParam((&(writer__)), name);
// Sentinel = 'name'
((&(writer__)))->WriteSentinel(69075362);
IPC::WriteParam((&(writer__)), path);
// Sentinel = 'path'
((&(writer__)))->WriteSentinel(70713774);
IPC::WriteParam((&(writer__)), partitioned);
// Sentinel = 'partitioned'
((&(writer__)))->WriteSentinel(471794852);
IPC::WriteParam((&(writer__)), operationID);
// Sentinel = 'operationID'
((&(writer__)))->WriteSentinel(462750815);
if (mozilla::ipc::LoggingEnabledFor("PCookieStore", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieStoreChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PCookieStore::Msg_DeleteRequest", OTHER);
int32_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PCookieStore::Reply_DeleteRequest__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__waitForNotification = IPC::ReadParam<bool>(aReader);
if (!maybe__waitForNotification) {
(aReader)->FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& waitForNotification = *maybe__waitForNotification;
// Sentinel = 'waitForNotification'
if ((!((aReader)->ReadSentinel(1294731204)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(waitForNotification));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PCookieStoreChild::SendDeleteRequest(
const nsAString& domain,
const OriginAttributes& attrs,
const bool& thirdPartyContext,
const bool& partitionForeign,
const bool& usingStorageAccess,
const nsAString& name,
const nsAString& path,
const bool& partitioned,
const nsID& operationID) -> RefPtr<DeleteRequestPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendDeleteRequest(std::move(domain), std::move(attrs), std::move(thirdPartyContext), std::move(partitionForeign), std::move(usingStorageAccess), std::move(name), std::move(path), std::move(partitioned), std::move(operationID), [promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PCookieStoreChild::SendClose() -> bool
{
UniquePtr<IPC::Message> msg__ = PCookieStore::Msg_Close(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PCookieStore", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieStoreChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PCookieStore::Msg_Close", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PCookieStoreChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PCookieStoreChild::OnMessageReceived(const Message& msg__) -> PCookieStoreChild::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 PCookieStore::Reply_GetRequest__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PCookieStore", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieStoreChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PCookieStore::Msg_GetRequest", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PCookieStore::Reply_SetRequest__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PCookieStore", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieStoreChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PCookieStore::Msg_SetRequest", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PCookieStore::Reply_DeleteRequest__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PCookieStore", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieStoreChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PCookieStore::Msg_DeleteRequest", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PCookieStore::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PCookieStore", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieStoreChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PCookieStore::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<CookieStoreChild*>(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 PCookieStoreChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PCookieStoreChild::Result
{
return MsgNotKnown;
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PCookieStoreChild*>::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::PCookieStoreChild*>::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, "PCookieStore", PCookieStoreMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::PCookieStoreChild*>(actor.ref());
}
return {};
}
} // namespace IPC