//
// Automatically generated by ipdlc.
// Edit at your own risk
//


#include "mozilla/dom/PCookieStoreChild.h"
#include "ipc/IPCMessageUtils.h"
#include "mozilla/AntiTrackingIPCUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/dom/CookieStoreChild.h"
#include "mozilla/dom/DomSecurityIPCUtils.h"
#include "mozilla/dom/FeaturePolicyUtils.h"
#include "mozilla/dom/FetchIPCTypes.h"
#include "mozilla/dom/NavigationAPIIPCUtils.h"
#include "mozilla/dom/PropertyBagUtils.h"
#include "mozilla/dom/ReferrerInfoUtils.h"
#include "mozilla/dom/SessionHistoryEntry.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/ipc/URIUtils.h"
#include "mozilla/net/CacheInfoIPCTypes.h"
#include "mozilla/net/ClassOfService.h"
#include "nsDOMNavigationTiming.h"
#include "nsDocShellLoadState.h"
#include "nsHttp.h"
#include "nsHttpResponseHead.h"
#include "nsID.h"
#include "nsIPropertyBag2.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(
        mozilla::NotNull<nsIURI*> cookieURI,
        const OriginAttributes& attrs,
        const mozilla::Maybe<OriginAttributes>& partitionedAttrs,
        const bool& thirdPartyContext,
        const bool& partitionForeign,
        const bool& usingStorageAccess,
        const bool& isOn3PCBExceptionList,
        const bool& matchName,
        const nsAString& name,
        const nsACString& path,
        const bool& onlyFirstMatch,
        mozilla::ipc::ResolveCallback<nsTArray<CookieStruct>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PCookieStore::Msg_GetRequest(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), cookieURI);
    // Sentinel = 'cookieURI'
    ((&(writer__)))->WriteSentinel(303301483);
    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__)), isOn3PCBExceptionList);
    // Sentinel = 'isOn3PCBExceptionList'
    ((&(writer__)))->WriteSentinel(1400571885);
    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);

    IPC::Message::seqno_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<CookieStruct>>(aReader);
            if (!maybe__data) {
                (aReader)->FatalError("Error deserializing 'CookieStruct[]'");
                return MsgValueError;

            }
            auto& data = *maybe__data;
            // Sentinel = 'data'
            if ((!((aReader)->ReadSentinel(67109275)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'CookieStruct[]'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(data));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PCookieStoreChild::SendGetRequest(
        mozilla::NotNull<nsIURI*> cookieURI,
        const OriginAttributes& attrs,
        const mozilla::Maybe<OriginAttributes>& partitionedAttrs,
        const bool& thirdPartyContext,
        const bool& partitionForeign,
        const bool& usingStorageAccess,
        const bool& isOn3PCBExceptionList,
        const bool& matchName,
        const nsAString& name,
        const nsACString& path,
        const bool& onlyFirstMatch) -> RefPtr<GetRequestPromise>
{
    RefPtr<MozPromise<nsTArray<CookieStruct>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsTArray<CookieStruct>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendGetRequest(std::move(cookieURI), std::move(attrs), std::move(partitionedAttrs), std::move(thirdPartyContext), std::move(partitionForeign), std::move(usingStorageAccess), std::move(isOn3PCBExceptionList), std::move(matchName), std::move(name), std::move(path), std::move(onlyFirstMatch), [promise__](nsTArray<CookieStruct>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PCookieStoreChild::SendSetRequest(
        mozilla::NotNull<nsIURI*> cookieURI,
        const OriginAttributes& attrs,
        const bool& thirdPartyContext,
        const bool& partitionForeign,
        const bool& usingStorageAccess,
        const bool& isOn3PCBExceptionList,
        const nsAString& name,
        const nsAString& value,
        const bool& session,
        const int64_t& expires,
        const nsAString& domain,
        const nsAString& path,
        const int32_t& sameSite,
        const bool& partitioned,
        const nsID& operationId,
        mozilla::ipc::ResolveCallback<CookieStoreResult>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PCookieStore::Msg_SetRequest(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), cookieURI);
    // Sentinel = 'cookieURI'
    ((&(writer__)))->WriteSentinel(303301483);
    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__)), isOn3PCBExceptionList);
    // Sentinel = 'isOn3PCBExceptionList'
    ((&(writer__)))->WriteSentinel(1400571885);
    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__)), domain);
    // Sentinel = 'domain'
    ((&(writer__)))->WriteSentinel(144704121);
    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);

    IPC::Message::seqno_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__result = IPC::ReadParam<CookieStoreResult>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'CookieStoreResult'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'CookieStoreResult'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PCookieStoreChild::SendSetRequest(
        mozilla::NotNull<nsIURI*> cookieURI,
        const OriginAttributes& attrs,
        const bool& thirdPartyContext,
        const bool& partitionForeign,
        const bool& usingStorageAccess,
        const bool& isOn3PCBExceptionList,
        const nsAString& name,
        const nsAString& value,
        const bool& session,
        const int64_t& expires,
        const nsAString& domain,
        const nsAString& path,
        const int32_t& sameSite,
        const bool& partitioned,
        const nsID& operationId) -> RefPtr<SetRequestPromise>
{
    RefPtr<MozPromise<CookieStoreResult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<CookieStoreResult, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendSetRequest(std::move(cookieURI), std::move(attrs), std::move(thirdPartyContext), std::move(partitionForeign), std::move(usingStorageAccess), std::move(isOn3PCBExceptionList), std::move(name), std::move(value), std::move(session), std::move(expires), std::move(domain), std::move(path), std::move(sameSite), std::move(partitioned), std::move(operationId), [promise__](CookieStoreResult&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PCookieStoreChild::SendDeleteRequest(
        mozilla::NotNull<nsIURI*> cookieURI,
        const OriginAttributes& attrs,
        const bool& thirdPartyContext,
        const bool& partitionForeign,
        const bool& usingStorageAccess,
        const bool& isOn3PCBExceptionList,
        const nsAString& name,
        const nsAString& domain,
        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__)), cookieURI);
    // Sentinel = 'cookieURI'
    ((&(writer__)))->WriteSentinel(303301483);
    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__)), isOn3PCBExceptionList);
    // Sentinel = 'isOn3PCBExceptionList'
    ((&(writer__)))->WriteSentinel(1400571885);
    IPC::WriteParam((&(writer__)), name);
    // Sentinel = 'name'
    ((&(writer__)))->WriteSentinel(69075362);
    IPC::WriteParam((&(writer__)), domain);
    // Sentinel = 'domain'
    ((&(writer__)))->WriteSentinel(144704121);
    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);

    IPC::Message::seqno_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(
        mozilla::NotNull<nsIURI*> cookieURI,
        const OriginAttributes& attrs,
        const bool& thirdPartyContext,
        const bool& partitionForeign,
        const bool& usingStorageAccess,
        const bool& isOn3PCBExceptionList,
        const nsAString& name,
        const nsAString& domain,
        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(cookieURI), std::move(attrs), std::move(thirdPartyContext), std::move(partitionForeign), std::move(usingStorageAccess), std::move(isOn3PCBExceptionList), std::move(name), std::move(domain), 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::SendGetSubscriptionsRequest(
        const PrincipalInfo& principalInfo,
        const nsACString& scopeURL,
        mozilla::ipc::ResolveCallback<nsTArray<CookieSubscription>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PCookieStore::Msg_GetSubscriptionsRequest(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), principalInfo);
    // Sentinel = 'principalInfo'
    ((&(writer__)))->WriteSentinel(633472335);
    IPC::WriteParam((&(writer__)), scopeURL);
    // Sentinel = 'scopeURL'
    ((&(writer__)))->WriteSentinel(245498638);


    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_GetSubscriptionsRequest", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PCookieStore::Reply_GetSubscriptionsRequest__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__subscriptions = IPC::ReadParam<nsTArray<CookieSubscription>>(aReader);
            if (!maybe__subscriptions) {
                (aReader)->FatalError("Error deserializing 'CookieSubscription[]'");
                return MsgValueError;

            }
            auto& subscriptions = *maybe__subscriptions;
            // Sentinel = 'subscriptions'
            if ((!((aReader)->ReadSentinel(656541081)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'CookieSubscription[]'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(subscriptions));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PCookieStoreChild::SendGetSubscriptionsRequest(
        const PrincipalInfo& principalInfo,
        const nsACString& scopeURL) -> RefPtr<GetSubscriptionsRequestPromise>
{
    RefPtr<MozPromise<nsTArray<CookieSubscription>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsTArray<CookieSubscription>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendGetSubscriptionsRequest(std::move(principalInfo), std::move(scopeURL), [promise__](nsTArray<CookieSubscription>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PCookieStoreChild::SendSubscribeOrUnsubscribeRequest(
        const PrincipalInfo& principalInfo,
        const nsACString& scopeURL,
        mozilla::Span<CookieSubscription const> subscriptions,
        const bool& subscribe,
        mozilla::ipc::ResolveCallback<bool>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PCookieStore::Msg_SubscribeOrUnsubscribeRequest(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), principalInfo);
    // Sentinel = 'principalInfo'
    ((&(writer__)))->WriteSentinel(633472335);
    IPC::WriteParam((&(writer__)), scopeURL);
    // Sentinel = 'scopeURL'
    ((&(writer__)))->WriteSentinel(245498638);
    IPC::WriteParam((&(writer__)), subscriptions);
    // Sentinel = 'subscriptions'
    ((&(writer__)))->WriteSentinel(656541081);
    IPC::WriteParam((&(writer__)), subscribe);
    // Sentinel = 'subscribe'
    ((&(writer__)))->WriteSentinel(322372547);


    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_SubscribeOrUnsubscribeRequest", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PCookieStore::Reply_SubscribeOrUnsubscribeRequest__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<bool>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PCookieStoreChild::SendSubscribeOrUnsubscribeRequest(
        const PrincipalInfo& principalInfo,
        const nsACString& scopeURL,
        mozilla::Span<CookieSubscription const> subscriptions,
        const bool& subscribe) -> RefPtr<SubscribeOrUnsubscribeRequestPromise>
{
    RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendSubscribeOrUnsubscribeRequest(std::move(principalInfo), std::move(scopeURL), std::move(subscriptions), std::move(subscribe), [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(
        mozilla::ipc::ProtocolId 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::Reply_GetSubscriptionsRequest__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_GetSubscriptionsRequest", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PCookieStore::Reply_SubscribeOrUnsubscribeRequest__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_SubscribeOrUnsubscribeRequest", 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
{
    IPC::WriteParam(aWriter, static_cast<mozilla::ipc::IProtocol*>(aVar));
    // Sentinel = 'PCookieStore'
    (aWriter)->WriteSentinel(495191224);
}

auto ParamTraits<::mozilla::dom::PCookieStoreChild*>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe__actor = IPC::ReadParam<mozilla::ipc::IProtocol*>(aReader);
    if (!maybe__actor) {
        aReader->FatalError("Error deserializing managed PCookieStore actor");
        return {};

    }
    auto& actor = *maybe__actor;
    // Sentinel = 'PCookieStore'
    if ((!((aReader)->ReadSentinel(495191224)))) {
        mozilla::ipc::SentinelReadError("Error deserializing managed PCookieStore actor");
        return {};
    }

    if (actor && actor->GetProtocolId() != PCookieStoreMsgStart) {
        aReader->FatalError("Unexpected actor type (expected PCookieStore)");

        return {};
    }
    return static_cast<::mozilla::dom::PCookieStoreChild*>(actor);
}

} // namespace IPC
