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


#include "mozilla/dom/locks/IPCUtils.h"
#include "mozilla/ipc/PBackgroundParent.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/dom/locks/PLockRequestParent.h"
#include "mozilla/dom/locks/PLockRequestChild.h"
#include "mozilla/dom/locks/PLockManager.h"
#include "mozilla/dom/locks/PLockManagerParent.h"
#include "mozilla/dom/locks/PLockManagerChild.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 locks {
namespace PLockManager {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::dom::locks::PLockManagerParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::dom::locks::PLockManagerChild>* aChild)
{
    return mozilla::ipc::CreateEndpoints(
        mozilla::ipc::PrivateIPDLInterface(),
        aParentDestInfo, aChildDestInfo, aParent, aChild);
}
mozilla::UniquePtr<IPC::Message>
Msg_Query(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_Query__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_Query(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_Query__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));
}
mozilla::UniquePtr<IPC::Message>
Msg_PLockRequestConstructor(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_PLockRequestConstructor__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply_PLockRequestConstructor(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_PLockRequestConstructor__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::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 PLockManager
} // namespace locks
} // namespace dom
} // namespace mozilla

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

namespace IPC {
auto ParamTraits<::mozilla::dom::locks::IPCLockRequest>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).name());
    // Sentinel = 'name'
    (aWriter)->WriteSentinel(69075362);
    IPC::WriteParam(aWriter, (aVar).lockMode());
    // Sentinel = 'lockMode'
    (aWriter)->WriteSentinel(243794735);
    IPC::WriteParam(aWriter, (aVar).ifAvailable());
    // Sentinel = 'ifAvailable'
    (aWriter)->WriteSentinel(430113873);
    IPC::WriteParam(aWriter, (aVar).steal());
    // Sentinel = 'steal'
    (aWriter)->WriteSentinel(108069402);
}

auto ParamTraits<::mozilla::dom::locks::IPCLockRequest>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___name = IPC::ReadParam<::nsString>(aReader);
    if (!maybe___name) {
        aReader->FatalError("Error deserializing 'name' (nsString) member of 'IPCLockRequest'");
        return {};

    }
    auto& _name = *maybe___name;
    // Sentinel = 'name'
    if ((!((aReader)->ReadSentinel(69075362)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'name' (nsString) member of 'IPCLockRequest'");
        return {};
    }
    auto maybe___lockMode = IPC::ReadParam<::mozilla::dom::LockMode>(aReader);
    if (!maybe___lockMode) {
        aReader->FatalError("Error deserializing 'lockMode' (LockMode) member of 'IPCLockRequest'");
        return {};

    }
    auto& _lockMode = *maybe___lockMode;
    // Sentinel = 'lockMode'
    if ((!((aReader)->ReadSentinel(243794735)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'lockMode' (LockMode) member of 'IPCLockRequest'");
        return {};
    }
    auto maybe___ifAvailable = IPC::ReadParam<bool>(aReader);
    if (!maybe___ifAvailable) {
        aReader->FatalError("Error deserializing 'ifAvailable' (bool) member of 'IPCLockRequest'");
        return {};

    }
    auto& _ifAvailable = *maybe___ifAvailable;
    // Sentinel = 'ifAvailable'
    if ((!((aReader)->ReadSentinel(430113873)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'ifAvailable' (bool) member of 'IPCLockRequest'");
        return {};
    }
    auto maybe___steal = IPC::ReadParam<bool>(aReader);
    if (!maybe___steal) {
        aReader->FatalError("Error deserializing 'steal' (bool) member of 'IPCLockRequest'");
        return {};

    }
    auto& _steal = *maybe___steal;
    // Sentinel = 'steal'
    if ((!((aReader)->ReadSentinel(108069402)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'steal' (bool) member of 'IPCLockRequest'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_name),
            std::move(_lockMode),
            std::move(_ifAvailable),
            std::move(_steal)};
    return result__;
}

} // namespace IPC
