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


#include "mozilla/dom/PermissionMessageUtils.h"
#include "mozilla/ipc/TransportSecurityInfoUtils.h"
#include "mozilla/ipc/URIUtils.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/GfxMessageUtils.h"
#include "mozilla/dom/CSPMessageUtils.h"
#include "mozilla/dom/PolicyContainerMessageUtils.h"
#include "mozilla/dom/DocShellMessageUtils.h"
#include "mozilla/dom/NavigationAPIIPCUtils.h"
#include "mozilla/dom/PermissionMessageUtils.h"
#include "mozilla/dom/PropertyBagUtils.h"
#include "mozilla/dom/ReferrerInfoUtils.h"
#include "mozilla/dom/TabMessageUtils.h"
#include "mozilla/dom/notification/IPCUtils.h"
#include "mozilla/ipc/URIUtils.h"
#include "mozilla/layers/LayersMessageUtils.h"
#include "mozilla/net/NeckoMessageUtils.h"
#include "mozilla/URLClassifierIPCUtils.h"
#include "mozilla/dom/WindowGlobalTypes.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"


//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct WindowGlobalInit|
//
namespace mozilla {
namespace dom {
auto WindowGlobalInit::StaticAssertions() const -> void
{
    static_assert(
        (offsetof(WindowGlobalInit, httpsOnlyStatus_) - offsetof(WindowGlobalInit, sandboxFlags_)) == 4,
        "Bad assumptions about field layout!");
}

} // namespace dom
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::dom::WindowGlobalInit>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).context());
    // Sentinel = 'context'
    (aWriter)->WriteSentinel(199164678);
    IPC::WriteParam(aWriter, (aVar).principal());
    // Sentinel = 'principal'
    (aWriter)->WriteSentinel(319620035);
    IPC::WriteParam(aWriter, (aVar).storagePrincipal());
    // Sentinel = 'storagePrincipal'
    (aWriter)->WriteSentinel(951518872);
    IPC::WriteParam(aWriter, (aVar).documentURI());
    // Sentinel = 'documentURI'
    (aWriter)->WriteSentinel(453706832);
    IPC::WriteParam(aWriter, (aVar).isInitialDocument());
    // Sentinel = 'isInitialDocument'
    (aWriter)->WriteSentinel(1029310182);
    IPC::WriteParam(aWriter, (aVar).blockAllMixedContent());
    // Sentinel = 'blockAllMixedContent'
    (aWriter)->WriteSentinel(1382287351);
    IPC::WriteParam(aWriter, (aVar).upgradeInsecureRequests());
    // Sentinel = 'upgradeInsecureRequests'
    (aWriter)->WriteSentinel(1898449283);
    IPC::WriteParam(aWriter, (aVar).cookieJarSettings());
    // Sentinel = 'cookieJarSettings'
    (aWriter)->WriteSentinel(1031800553);
    IPC::WriteParam(aWriter, (aVar).securityInfo());
    // Sentinel = 'securityInfo'
    (aWriter)->WriteSentinel(552535301);
    (aWriter)->WriteBytes((&((aVar).sandboxFlags())), 8);
    // Sentinel = 'sandboxFlags | httpsOnlyStatus'
    (aWriter)->WriteSentinel(3060206578);
}

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

    }
    auto& _context = *maybe___context;
    // Sentinel = 'context'
    if ((!((aReader)->ReadSentinel(199164678)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'context' (WindowContextInitializer) member of 'WindowGlobalInit'");
        return {};
    }
    auto maybe___principal = IPC::ReadParam<RefPtr<::nsIPrincipal>>(aReader);
    if (!maybe___principal) {
        aReader->FatalError("Error deserializing 'principal' (nsIPrincipal) member of 'WindowGlobalInit'");
        return {};

    }
    auto& _principal = *maybe___principal;
    // Sentinel = 'principal'
    if ((!((aReader)->ReadSentinel(319620035)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'principal' (nsIPrincipal) member of 'WindowGlobalInit'");
        return {};
    }
    auto maybe___storagePrincipal = IPC::ReadParam<RefPtr<::nsIPrincipal>>(aReader);
    if (!maybe___storagePrincipal) {
        aReader->FatalError("Error deserializing 'storagePrincipal' (nsIPrincipal) member of 'WindowGlobalInit'");
        return {};

    }
    auto& _storagePrincipal = *maybe___storagePrincipal;
    // Sentinel = 'storagePrincipal'
    if ((!((aReader)->ReadSentinel(951518872)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'storagePrincipal' (nsIPrincipal) member of 'WindowGlobalInit'");
        return {};
    }
    auto maybe___documentURI = IPC::ReadParam<RefPtr<::nsIURI>>(aReader);
    if (!maybe___documentURI) {
        aReader->FatalError("Error deserializing 'documentURI' (nsIURI) member of 'WindowGlobalInit'");
        return {};

    }
    auto& _documentURI = *maybe___documentURI;
    // Sentinel = 'documentURI'
    if ((!((aReader)->ReadSentinel(453706832)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'documentURI' (nsIURI) member of 'WindowGlobalInit'");
        return {};
    }
    auto maybe___isInitialDocument = IPC::ReadParam<bool>(aReader);
    if (!maybe___isInitialDocument) {
        aReader->FatalError("Error deserializing 'isInitialDocument' (bool) member of 'WindowGlobalInit'");
        return {};

    }
    auto& _isInitialDocument = *maybe___isInitialDocument;
    // Sentinel = 'isInitialDocument'
    if ((!((aReader)->ReadSentinel(1029310182)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'isInitialDocument' (bool) member of 'WindowGlobalInit'");
        return {};
    }
    auto maybe___blockAllMixedContent = IPC::ReadParam<bool>(aReader);
    if (!maybe___blockAllMixedContent) {
        aReader->FatalError("Error deserializing 'blockAllMixedContent' (bool) member of 'WindowGlobalInit'");
        return {};

    }
    auto& _blockAllMixedContent = *maybe___blockAllMixedContent;
    // Sentinel = 'blockAllMixedContent'
    if ((!((aReader)->ReadSentinel(1382287351)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'blockAllMixedContent' (bool) member of 'WindowGlobalInit'");
        return {};
    }
    auto maybe___upgradeInsecureRequests = IPC::ReadParam<bool>(aReader);
    if (!maybe___upgradeInsecureRequests) {
        aReader->FatalError("Error deserializing 'upgradeInsecureRequests' (bool) member of 'WindowGlobalInit'");
        return {};

    }
    auto& _upgradeInsecureRequests = *maybe___upgradeInsecureRequests;
    // Sentinel = 'upgradeInsecureRequests'
    if ((!((aReader)->ReadSentinel(1898449283)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'upgradeInsecureRequests' (bool) member of 'WindowGlobalInit'");
        return {};
    }
    auto maybe___cookieJarSettings = IPC::ReadParam<::mozilla::net::CookieJarSettingsArgs>(aReader);
    if (!maybe___cookieJarSettings) {
        aReader->FatalError("Error deserializing 'cookieJarSettings' (CookieJarSettingsArgs) member of 'WindowGlobalInit'");
        return {};

    }
    auto& _cookieJarSettings = *maybe___cookieJarSettings;
    // Sentinel = 'cookieJarSettings'
    if ((!((aReader)->ReadSentinel(1031800553)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'cookieJarSettings' (CookieJarSettingsArgs) member of 'WindowGlobalInit'");
        return {};
    }
    auto maybe___securityInfo = IPC::ReadParam<RefPtr<::nsITransportSecurityInfo>>(aReader);
    if (!maybe___securityInfo) {
        aReader->FatalError("Error deserializing 'securityInfo' (nsITransportSecurityInfo) member of 'WindowGlobalInit'");
        return {};

    }
    auto& _securityInfo = *maybe___securityInfo;
    // Sentinel = 'securityInfo'
    if ((!((aReader)->ReadSentinel(552535301)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'securityInfo' (nsITransportSecurityInfo) member of 'WindowGlobalInit'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_context),
            std::move(_principal),
            std::move(_storagePrincipal),
            std::move(_documentURI),
            std::move(_isInitialDocument),
            std::move(_blockAllMixedContent),
            std::move(_upgradeInsecureRequests),
            ::uint32_t{0},
            std::move(_cookieJarSettings),
            ::uint32_t{0},
            std::move(_securityInfo)};
    if ((!((aReader)->ReadBytesInto((&((result__)->sandboxFlags())), 8)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'sandboxFlags | httpsOnlyStatus'
    if ((!((aReader)->ReadSentinel(3060206578)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC
