Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/net/PCookieServiceParent.h"
#include "ipc/IPCMessageUtils.h"
#include "mozilla/AntiTrackingIPCUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/dom/DomSecurityIPCUtils.h"
#include "mozilla/dom/FeaturePolicyUtils.h"
#include "mozilla/dom/FetchIPCTypes.h"
#include "mozilla/dom/PropertyBagUtils.h"
#include "mozilla/dom/ReferrerInfoUtils.h"
#include "mozilla/dom/SessionHistoryEntry.h"
#include "mozilla/ipc/URIUtils.h"
#include "mozilla/net/CacheInfoIPCTypes.h"
#include "mozilla/net/ClassOfService.h"
#include "mozilla/net/CookieServiceParent.h"
#include "nsDOMNavigationTiming.h"
#include "nsDocShellLoadState.h"
#include "nsHttp.h"
#include "nsHttpResponseHead.h"
#include "nsID.h"
#include "nsIPropertyBag2.h"
#include "mozilla/net/PNeckoParent.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 net {
auto PCookieServiceParent::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PCookieServiceParent::PCookieServiceParent() :
mozilla::ipc::IProtocol(kProtocolId, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PCookieServiceParent);
}
PCookieServiceParent::~PCookieServiceParent()
{
MOZ_COUNT_DTOR(PCookieServiceParent);
}
auto PCookieServiceParent::ActorAlloc() -> void
{
}
auto PCookieServiceParent::ActorDealloc() -> void
{
if (Manager()) {
Manager()->DeallocManagee(kProtocolId, this);
}
}
auto PCookieServiceParent::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PCookieServiceParent::OtherChildID() const -> ::GeckoChildID
{
::GeckoChildID childID =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid();
MOZ_RELEASE_ASSERT(childID != -1);
return childID;
}
auto PCookieServiceParent::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo
{
return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()};
}
auto PCookieServiceParent::Manager() const -> PNeckoParent*
{
return static_cast<PNeckoParent*>(IProtocol::Manager());
}
auto PCookieServiceParent::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PCookieServiceParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PCookieServiceParent::RejectPendingResponses(ResponseRejectReason aReason) -> void
{
mAsyncCallbacks.RejectPendingResponses(aReason);
}
auto PCookieServiceParent::SendTrackCookiesLoad(mozilla::Span<CookieStructTable const> cookiesListTable) -> bool
{
UniquePtr<IPC::Message> msg__ = PCookieService::Msg_TrackCookiesLoad(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), cookiesListTable);
// Sentinel = 'cookiesListTable'
((&(writer__)))->WriteSentinel(928974450);
if (mozilla::ipc::LoggingEnabledFor("PCookieService", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieServiceParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PCookieService::Msg_TrackCookiesLoad", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PCookieServiceParent::SendRemoveCookie(
const CookieStruct& cookie,
const OriginAttributes& attrs,
const mozilla::Maybe<nsID>& operationId) -> bool
{
UniquePtr<IPC::Message> msg__ = PCookieService::Msg_RemoveCookie(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), cookie);
// Sentinel = 'cookie'
((&(writer__)))->WriteSentinel(146211451);
IPC::WriteParam((&(writer__)), attrs);
// Sentinel = 'attrs'
((&(writer__)))->WriteSentinel(107807279);
IPC::WriteParam((&(writer__)), operationId);
// Sentinel = 'operationId'
((&(writer__)))->WriteSentinel(464847999);
if (mozilla::ipc::LoggingEnabledFor("PCookieService", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieServiceParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PCookieService::Msg_RemoveCookie", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PCookieServiceParent::SendRemoveBatchDeletedCookies(
mozilla::Span<CookieStruct const> cookiesList,
mozilla::Span<OriginAttributes const> attrsList) -> bool
{
UniquePtr<IPC::Message> msg__ = PCookieService::Msg_RemoveBatchDeletedCookies(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), cookiesList);
// Sentinel = 'cookiesList'
((&(writer__)))->WriteSentinel(455214218);
IPC::WriteParam((&(writer__)), attrsList);
// Sentinel = 'attrsList'
((&(writer__)))->WriteSentinel(317588427);
if (mozilla::ipc::LoggingEnabledFor("PCookieService", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieServiceParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PCookieService::Msg_RemoveBatchDeletedCookies", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PCookieServiceParent::SendRemoveAll() -> bool
{
UniquePtr<IPC::Message> msg__ = PCookieService::Msg_RemoveAll(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PCookieService", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieServiceParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PCookieService::Msg_RemoveAll", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PCookieServiceParent::SendAddCookie(
const CookieStruct& cookie,
const OriginAttributes& attrs,
const mozilla::Maybe<nsID>& operationId) -> bool
{
UniquePtr<IPC::Message> msg__ = PCookieService::Msg_AddCookie(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), cookie);
// Sentinel = 'cookie'
((&(writer__)))->WriteSentinel(146211451);
IPC::WriteParam((&(writer__)), attrs);
// Sentinel = 'attrs'
((&(writer__)))->WriteSentinel(107807279);
IPC::WriteParam((&(writer__)), operationId);
// Sentinel = 'operationId'
((&(writer__)))->WriteSentinel(464847999);
if (mozilla::ipc::LoggingEnabledFor("PCookieService", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieServiceParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PCookieService::Msg_AddCookie", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PCookieServiceParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PCookieServiceParent::OnMessageReceived(const Message& msg__) -> PCookieServiceParent::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 PCookieService::Msg_SetCookies__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PCookieService", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieServiceParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PCookieService::Msg_SetCookies", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__baseDomain = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__baseDomain) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& baseDomain = *maybe__baseDomain;
// Sentinel = 'baseDomain'
if ((!(((&(reader__)))->ReadSentinel(360449012)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto maybe__attrs = IPC::ReadParam<OriginAttributes>((&(reader__)));
if (!maybe__attrs) {
FatalError("Error deserializing 'OriginAttributes'");
return MsgValueError;
}
auto& attrs = *maybe__attrs;
// Sentinel = 'attrs'
if ((!(((&(reader__)))->ReadSentinel(107807279)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'OriginAttributes'");
return MsgValueError;
}
auto maybe__host = IPC::ReadParam<RefPtr<nsIURI>>((&(reader__)));
if (!maybe__host) {
FatalError("Error deserializing 'nsIURI'");
return MsgValueError;
}
auto& host = *maybe__host;
// Sentinel = 'host'
if ((!(((&(reader__)))->ReadSentinel(72024511)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsIURI'");
return MsgValueError;
}
auto maybe__fromHttp = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__fromHttp) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& fromHttp = *maybe__fromHttp;
// Sentinel = 'fromHttp'
if ((!(((&(reader__)))->ReadSentinel(249889621)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__isThirdParty = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__isThirdParty) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& isThirdParty = *maybe__isThirdParty;
// Sentinel = 'isThirdParty'
if ((!(((&(reader__)))->ReadSentinel(526517480)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__cookies = IPC::ReadParam<nsTArray<CookieStruct>>((&(reader__)));
if (!maybe__cookies) {
FatalError("Error deserializing 'CookieStruct[]'");
return MsgValueError;
}
auto& cookies = *maybe__cookies;
// Sentinel = 'cookies'
if ((!(((&(reader__)))->ReadSentinel(195363566)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'CookieStruct[]'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<CookieServiceParent*>(this))->RecvSetCookies(std::move(baseDomain), std::move(attrs), host, std::move(fromHttp), std::move(isThirdParty), std::move(cookies));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PCookieService::Msg_GetCookieList__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PCookieService", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieServiceParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PCookieService::Msg_GetCookieList", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__host = IPC::ReadParam<RefPtr<nsIURI>>((&(reader__)));
if (!maybe__host) {
FatalError("Error deserializing 'nsIURI'");
return MsgValueError;
}
auto& host = *maybe__host;
// Sentinel = 'host'
if ((!(((&(reader__)))->ReadSentinel(72024511)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsIURI'");
return MsgValueError;
}
auto maybe__isForeign = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__isForeign) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& isForeign = *maybe__isForeign;
// Sentinel = 'isForeign'
if ((!(((&(reader__)))->ReadSentinel(303760295)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__isThirdPartyTrackingResource = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__isThirdPartyTrackingResource) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& isThirdPartyTrackingResource = *maybe__isThirdPartyTrackingResource;
// Sentinel = 'isThirdPartyTrackingResource'
if ((!(((&(reader__)))->ReadSentinel(2753301347)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__isThirdPartySocialTrackingResource = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__isThirdPartySocialTrackingResource) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& isThirdPartySocialTrackingResource = *maybe__isThirdPartySocialTrackingResource;
// Sentinel = 'isThirdPartySocialTrackingResource'
if ((!(((&(reader__)))->ReadSentinel(4014869950)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__firstPartyStorageAccessPermissionGranted = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__firstPartyStorageAccessPermissionGranted) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& firstPartyStorageAccessPermissionGranted = *maybe__firstPartyStorageAccessPermissionGranted;
// Sentinel = 'firstPartyStorageAccessPermissionGranted'
if ((!(((&(reader__)))->ReadSentinel(1328746574)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__rejectedReason = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__rejectedReason) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& rejectedReason = *maybe__rejectedReason;
// Sentinel = 'rejectedReason'
if ((!(((&(reader__)))->ReadSentinel(714999215)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto maybe__isSafeTopLevelNav = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__isSafeTopLevelNav) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& isSafeTopLevelNav = *maybe__isSafeTopLevelNav;
// Sentinel = 'isSafeTopLevelNav'
if ((!(((&(reader__)))->ReadSentinel(1004734124)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__isSameSiteForeign = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__isSameSiteForeign) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& isSameSiteForeign = *maybe__isSameSiteForeign;
// Sentinel = 'isSameSiteForeign'
if ((!(((&(reader__)))->ReadSentinel(1012532930)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__hadCrossSiteRedirects = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__hadCrossSiteRedirects) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& hadCrossSiteRedirects = *maybe__hadCrossSiteRedirects;
// Sentinel = 'hadCrossSiteRedirects'
if ((!(((&(reader__)))->ReadSentinel(1534789746)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__attrsList = IPC::ReadParam<nsTArray<OriginAttributes>>((&(reader__)));
if (!maybe__attrsList) {
FatalError("Error deserializing 'OriginAttributes[]'");
return MsgValueError;
}
auto& attrsList = *maybe__attrsList;
// Sentinel = 'attrsList'
if ((!(((&(reader__)))->ReadSentinel(317588427)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'OriginAttributes[]'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PCookieService::Reply_GetCookieList(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
GetCookieListResolver resolver = [resolver__ = std::move(resolver__)](mozilla::Span<CookieStructTable const> aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'cookies'
((&(writer__)))->WriteSentinel(195363566);
if (mozilla::ipc::LoggingEnabledFor("PCookieService", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieServiceParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<CookieServiceParent*>(this))->RecvGetCookieList(host, std::move(isForeign), std::move(isThirdPartyTrackingResource), std::move(isThirdPartySocialTrackingResource), std::move(firstPartyStorageAccessPermissionGranted), std::move(rejectedReason), std::move(isSafeTopLevelNav), std::move(isSameSiteForeign), std::move(hadCrossSiteRedirects), std::move(attrsList), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PCookieService::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PCookieService", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PCookieServiceParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PCookieService::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<CookieServiceParent*>(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 PCookieServiceParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PCookieServiceParent::Result
{
return MsgNotKnown;
}
} // namespace net
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::net::PCookieServiceParent*>::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::net::PCookieServiceParent*>::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, "PCookieService", PCookieServiceMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::net::PCookieServiceParent*>(actor.ref());
}
return {};
}
} // namespace IPC