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


#include "mozilla/ipc/PBackgroundParent.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/dom/BindingIPCUtils.h"
#include "mozilla/dom/ClientIPCUtils.h"
#include "ipc/ErrorIPCUtils.h"
#include "mozilla/dom/FetchIPCTypes.h"
#include "mozilla/ipc/TransportSecurityInfoUtils.h"
#include "mozilla/dom/ServiceWorkerIPCUtils.h"
#include "mozilla/dom/WorkerIPCUtils.h"
#include "mozilla/dom/DomSecurityIPCUtils.h"
#include "mozilla/dom/FetchIPCTypes.h"
#include "mozilla/dom/FeaturePolicyUtils.h"
#include "mozilla/dom/NavigationAPIIPCUtils.h"
#include "mozilla/dom/PropertyBagUtils.h"
#include "mozilla/dom/ReferrerInfoUtils.h"
#include "mozilla/ipc/URIUtils.h"
#include "mozilla/net/CacheInfoIPCTypes.h"
#include "mozilla/AntiTrackingIPCUtils.h"
#include "mozilla/net/ClassOfService.h"
#include "mozilla/dom/DomSecurityIPCUtils.h"
#include "mozilla/dom/PFetch.h"
#include "mozilla/dom/PFetchParent.h"
#include "mozilla/dom/PFetchChild.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 {
namespace PFetch {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::dom::PFetchParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::dom::PFetchChild>* aChild)
{
    return mozilla::ipc::CreateEndpoints(
        mozilla::ipc::PrivateIPDLInterface(),
        aParentDestInfo, aChildDestInfo, aParent, aChild);
}
mozilla::UniquePtr<IPC::Message>
Msg_FetchOp(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_FetchOp__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_AbortFetchOp(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_AbortFetchOp__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_OnResponseAvailableInternal(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_OnResponseAvailableInternal__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_OnResponseEnd(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_OnResponseEnd__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_OnDataAvailable(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_OnDataAvailable__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_OnFlushConsoleReport(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_OnFlushConsoleReport__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_OnCSPViolationEvent(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_OnCSPViolationEvent__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_OnReportPerformanceTiming(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_OnReportPerformanceTiming__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_OnNotifyNetworkMonitorAlternateStack(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_OnNotifyNetworkMonitorAlternateStack__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg___delete__(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg___delete____ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply___delete__(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply___delete____ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::REPLY));
}

} // namespace PFetch
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct FetchOpArgs|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::dom::FetchOpArgs>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).request());
    // Sentinel = 'request'
    (aWriter)->WriteSentinel(202703626);
    IPC::WriteParam(aWriter, (aVar).principalInfo());
    // Sentinel = 'principalInfo'
    (aWriter)->WriteSentinel(633472335);
    IPC::WriteParam(aWriter, (aVar).workerScript());
    // Sentinel = 'workerScript'
    (aWriter)->WriteSentinel(555353360);
    IPC::WriteParam(aWriter, (aVar).clientInfo());
    // Sentinel = 'clientInfo'
    (aWriter)->WriteSentinel(373294092);
    IPC::WriteParam(aWriter, (aVar).controller());
    // Sentinel = 'controller'
    (aWriter)->WriteSentinel(393348165);
    IPC::WriteParam(aWriter, (aVar).cookieJarSettings());
    // Sentinel = 'cookieJarSettings'
    (aWriter)->WriteSentinel(1031800553);
    IPC::WriteParam(aWriter, (aVar).needOnDataAvailable());
    // Sentinel = 'needOnDataAvailable'
    (aWriter)->WriteSentinel(1221592917);
    IPC::WriteParam(aWriter, (aVar).hasCSPEventListener());
    // Sentinel = 'hasCSPEventListener'
    (aWriter)->WriteSentinel(1203505003);
    IPC::WriteParam(aWriter, (aVar).isThirdPartyContext());
    // Sentinel = 'isThirdPartyContext'
    (aWriter)->WriteSentinel(1286735821);
    IPC::WriteParam(aWriter, (aVar).isWorkerRequest());
    // Sentinel = 'isWorkerRequest'
    (aWriter)->WriteSentinel(830342720);
    IPC::WriteParam(aWriter, (aVar).isOn3PCBExceptionList());
    // Sentinel = 'isOn3PCBExceptionList'
    (aWriter)->WriteSentinel(1400571885);
    (aWriter)->WriteBytes((&((aVar).associatedBrowsingContextID())), 8);
    // Sentinel = 'associatedBrowsingContextID'
    (aWriter)->WriteSentinel(2596145886);
}

auto ParamTraits<::mozilla::dom::FetchOpArgs>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___request = IPC::ReadParam<::mozilla::dom::IPCInternalRequest>(aReader);
    if (!maybe___request) {
        aReader->FatalError("Error deserializing 'request' (IPCInternalRequest) member of 'FetchOpArgs'");
        return {};

    }
    auto& _request = *maybe___request;
    // Sentinel = 'request'
    if ((!((aReader)->ReadSentinel(202703626)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'request' (IPCInternalRequest) member of 'FetchOpArgs'");
        return {};
    }
    auto maybe___principalInfo = IPC::ReadParam<::mozilla::ipc::PrincipalInfo>(aReader);
    if (!maybe___principalInfo) {
        aReader->FatalError("Error deserializing 'principalInfo' (PrincipalInfo) member of 'FetchOpArgs'");
        return {};

    }
    auto& _principalInfo = *maybe___principalInfo;
    // Sentinel = 'principalInfo'
    if ((!((aReader)->ReadSentinel(633472335)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'principalInfo' (PrincipalInfo) member of 'FetchOpArgs'");
        return {};
    }
    auto maybe___workerScript = IPC::ReadParam<::nsCString>(aReader);
    if (!maybe___workerScript) {
        aReader->FatalError("Error deserializing 'workerScript' (nsCString) member of 'FetchOpArgs'");
        return {};

    }
    auto& _workerScript = *maybe___workerScript;
    // Sentinel = 'workerScript'
    if ((!((aReader)->ReadSentinel(555353360)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'workerScript' (nsCString) member of 'FetchOpArgs'");
        return {};
    }
    auto maybe___clientInfo = IPC::ReadParam<::mozilla::dom::IPCClientInfo>(aReader);
    if (!maybe___clientInfo) {
        aReader->FatalError("Error deserializing 'clientInfo' (IPCClientInfo) member of 'FetchOpArgs'");
        return {};

    }
    auto& _clientInfo = *maybe___clientInfo;
    // Sentinel = 'clientInfo'
    if ((!((aReader)->ReadSentinel(373294092)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'clientInfo' (IPCClientInfo) member of 'FetchOpArgs'");
        return {};
    }
    auto maybe___controller = IPC::ReadParam<mozilla::Maybe<::mozilla::dom::IPCServiceWorkerDescriptor>>(aReader);
    if (!maybe___controller) {
        aReader->FatalError("Error deserializing 'controller' (IPCServiceWorkerDescriptor?) member of 'FetchOpArgs'");
        return {};

    }
    auto& _controller = *maybe___controller;
    // Sentinel = 'controller'
    if ((!((aReader)->ReadSentinel(393348165)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'controller' (IPCServiceWorkerDescriptor?) member of 'FetchOpArgs'");
        return {};
    }
    auto maybe___cookieJarSettings = IPC::ReadParam<mozilla::Maybe<::mozilla::net::CookieJarSettingsArgs>>(aReader);
    if (!maybe___cookieJarSettings) {
        aReader->FatalError("Error deserializing 'cookieJarSettings' (CookieJarSettingsArgs?) member of 'FetchOpArgs'");
        return {};

    }
    auto& _cookieJarSettings = *maybe___cookieJarSettings;
    // Sentinel = 'cookieJarSettings'
    if ((!((aReader)->ReadSentinel(1031800553)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'cookieJarSettings' (CookieJarSettingsArgs?) member of 'FetchOpArgs'");
        return {};
    }
    auto maybe___needOnDataAvailable = IPC::ReadParam<bool>(aReader);
    if (!maybe___needOnDataAvailable) {
        aReader->FatalError("Error deserializing 'needOnDataAvailable' (bool) member of 'FetchOpArgs'");
        return {};

    }
    auto& _needOnDataAvailable = *maybe___needOnDataAvailable;
    // Sentinel = 'needOnDataAvailable'
    if ((!((aReader)->ReadSentinel(1221592917)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'needOnDataAvailable' (bool) member of 'FetchOpArgs'");
        return {};
    }
    auto maybe___hasCSPEventListener = IPC::ReadParam<bool>(aReader);
    if (!maybe___hasCSPEventListener) {
        aReader->FatalError("Error deserializing 'hasCSPEventListener' (bool) member of 'FetchOpArgs'");
        return {};

    }
    auto& _hasCSPEventListener = *maybe___hasCSPEventListener;
    // Sentinel = 'hasCSPEventListener'
    if ((!((aReader)->ReadSentinel(1203505003)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'hasCSPEventListener' (bool) member of 'FetchOpArgs'");
        return {};
    }
    auto maybe___isThirdPartyContext = IPC::ReadParam<bool>(aReader);
    if (!maybe___isThirdPartyContext) {
        aReader->FatalError("Error deserializing 'isThirdPartyContext' (bool) member of 'FetchOpArgs'");
        return {};

    }
    auto& _isThirdPartyContext = *maybe___isThirdPartyContext;
    // Sentinel = 'isThirdPartyContext'
    if ((!((aReader)->ReadSentinel(1286735821)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'isThirdPartyContext' (bool) member of 'FetchOpArgs'");
        return {};
    }
    auto maybe___isWorkerRequest = IPC::ReadParam<bool>(aReader);
    if (!maybe___isWorkerRequest) {
        aReader->FatalError("Error deserializing 'isWorkerRequest' (bool) member of 'FetchOpArgs'");
        return {};

    }
    auto& _isWorkerRequest = *maybe___isWorkerRequest;
    // Sentinel = 'isWorkerRequest'
    if ((!((aReader)->ReadSentinel(830342720)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'isWorkerRequest' (bool) member of 'FetchOpArgs'");
        return {};
    }
    auto maybe___isOn3PCBExceptionList = IPC::ReadParam<bool>(aReader);
    if (!maybe___isOn3PCBExceptionList) {
        aReader->FatalError("Error deserializing 'isOn3PCBExceptionList' (bool) member of 'FetchOpArgs'");
        return {};

    }
    auto& _isOn3PCBExceptionList = *maybe___isOn3PCBExceptionList;
    // Sentinel = 'isOn3PCBExceptionList'
    if ((!((aReader)->ReadSentinel(1400571885)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'isOn3PCBExceptionList' (bool) member of 'FetchOpArgs'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_request),
            std::move(_principalInfo),
            std::move(_workerScript),
            std::move(_clientInfo),
            std::move(_controller),
            std::move(_cookieJarSettings),
            std::move(_needOnDataAvailable),
            std::move(_hasCSPEventListener),
            ::uint64_t{0},
            std::move(_isThirdPartyContext),
            std::move(_isWorkerRequest),
            std::move(_isOn3PCBExceptionList)};
    if ((!((aReader)->ReadBytesInto((&((result__)->associatedBrowsingContextID())), 8)))) {
        aReader->FatalError("Error bulk reading fields from uint64_t");
        return {};
    }
    // Sentinel = 'associatedBrowsingContextID'
    if ((!((aReader)->ReadSentinel(2596145886)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint64_t");
        return {};
    }
    return result__;
}

} // namespace IPC
