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


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

namespace IPC {
auto ParamTraits<::mozilla::dom::PermissionRequest>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).type());
    // Sentinel = 'type'
    (aWriter)->WriteSentinel(75760067);
    IPC::WriteParam(aWriter, (aVar).options());
    // Sentinel = 'options'
    (aWriter)->WriteSentinel(204735245);
}

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

    }
    auto& _type = *maybe___type;
    // Sentinel = 'type'
    if ((!((aReader)->ReadSentinel(75760067)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'type' (nsCString) member of 'PermissionRequest'");
        return {};
    }
    auto maybe___options = IPC::ReadParam<nsTArray<::nsString>>(aReader);
    if (!maybe___options) {
        aReader->FatalError("Error deserializing 'options' (nsString[]) member of 'PermissionRequest'");
        return {};

    }
    auto& _options = *maybe___options;
    // Sentinel = 'options'
    if ((!((aReader)->ReadSentinel(204735245)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'options' (nsString[]) member of 'PermissionRequest'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_type),
            std::move(_options)};
    return result__;
}

} // namespace IPC

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

namespace IPC {
auto ParamTraits<::mozilla::dom::PermissionChoice>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).type());
    // Sentinel = 'type'
    (aWriter)->WriteSentinel(75760067);
    IPC::WriteParam(aWriter, (aVar).choice());
    // Sentinel = 'choice'
    (aWriter)->WriteSentinel(142738028);
}

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

    }
    auto& _type = *maybe___type;
    // Sentinel = 'type'
    if ((!((aReader)->ReadSentinel(75760067)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'type' (nsCString) member of 'PermissionChoice'");
        return {};
    }
    auto maybe___choice = IPC::ReadParam<::nsString>(aReader);
    if (!maybe___choice) {
        aReader->FatalError("Error deserializing 'choice' (nsString) member of 'PermissionChoice'");
        return {};

    }
    auto& _choice = *maybe___choice;
    // Sentinel = 'choice'
    if ((!((aReader)->ReadSentinel(142738028)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'choice' (nsString) member of 'PermissionChoice'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_type),
            std::move(_choice)};
    return result__;
}

} // namespace IPC
