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


#include "mozilla/dom/IPCNavigationPreloadState.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 IPCNavigationPreloadState|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::dom::IPCNavigationPreloadState>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).enabled());
    // Sentinel = 'enabled'
    (aWriter)->WriteSentinel(188547788);
    IPC::WriteParam(aWriter, (aVar).headerValue());
    // Sentinel = 'headerValue'
    (aWriter)->WriteSentinel(439485543);
}

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

    }
    auto& _enabled = *maybe___enabled;
    // Sentinel = 'enabled'
    if ((!((aReader)->ReadSentinel(188547788)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'enabled' (bool) member of 'IPCNavigationPreloadState'");
        return {};
    }
    auto maybe___headerValue = IPC::ReadParam<::nsCString>(aReader);
    if (!maybe___headerValue) {
        aReader->FatalError("Error deserializing 'headerValue' (nsCString) member of 'IPCNavigationPreloadState'");
        return {};

    }
    auto& _headerValue = *maybe___headerValue;
    // Sentinel = 'headerValue'
    if ((!((aReader)->ReadSentinel(439485543)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'headerValue' (nsCString) member of 'IPCNavigationPreloadState'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_enabled),
            std::move(_headerValue)};
    return result__;
}

} // namespace IPC
