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


#include "mozilla/gmp/PGMPContentParent.h"
#include "mozilla/gmp/PGMPContentChild.h"
#include "GMPMessageUtils.h"
#include "mozilla/gmp/PGMPService.h"
#include "mozilla/gmp/PGMPServiceParent.h"
#include "mozilla/gmp/PGMPServiceChild.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 gmp {
namespace PGMPService {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::gmp::PGMPServiceParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::gmp::PGMPServiceChild>* aChild)
{
    return mozilla::ipc::CreateEndpoints(
        mozilla::ipc::PrivateIPDLInterface(),
        aParentDestInfo, aChildDestInfo, aParent, aChild);
}
mozilla::UniquePtr<IPC::Message>
Msg_LaunchGMP(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_LaunchGMP__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_LaunchGMP(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_LaunchGMP__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_GetGMPNodeId(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_GetGMPNodeId__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_GetGMPNodeId(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_GetGMPNodeId__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_BeginShutdown(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_BeginShutdown__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));
}

} // namespace PGMPService
} // namespace gmp
} // namespace mozilla

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct GMPLaunchResult|
//
namespace mozilla {
namespace gmp {
} // namespace gmp
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::gmp::GMPLaunchResult>::Write(
        IPC::MessageWriter* aWriter,
        paramType&& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).pluginType());
    // Sentinel = 'pluginType'
    (aWriter)->WriteSentinel(390792242);
    IPC::WriteParam(aWriter, (aVar).pid());
    // Sentinel = 'pid'
    (aWriter)->WriteSentinel(42533182);
    IPC::WriteParam(aWriter, (aVar).displayName());
    // Sentinel = 'displayName'
    (aWriter)->WriteSentinel(455935096);
    IPC::WriteParam(aWriter, std::move((aVar).endpoint()));
    // Sentinel = 'endpoint'
    (aWriter)->WriteSentinel(251724642);
    IPC::WriteParam(aWriter, (aVar).result());
    // Sentinel = 'result'
    (aWriter)->WriteSentinel(153223840);
    IPC::WriteParam(aWriter, (aVar).errorDescription());
    // Sentinel = 'errorDescription'
    (aWriter)->WriteSentinel(945882799);
    (aWriter)->WriteBytes((&((aVar).pluginId())), 4);
    // Sentinel = 'pluginId'
    (aWriter)->WriteSentinel(253821757);
}

auto ParamTraits<::mozilla::gmp::GMPLaunchResult>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___pluginType = IPC::ReadParam<::GMPPluginType>(aReader);
    if (!maybe___pluginType) {
        aReader->FatalError("Error deserializing 'pluginType' (GMPPluginType) member of 'GMPLaunchResult'");
        return {};

    }
    auto& _pluginType = *maybe___pluginType;
    // Sentinel = 'pluginType'
    if ((!((aReader)->ReadSentinel(390792242)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'pluginType' (GMPPluginType) member of 'GMPLaunchResult'");
        return {};
    }
    auto maybe___pid = IPC::ReadParam<::base::ProcessId>(aReader);
    if (!maybe___pid) {
        aReader->FatalError("Error deserializing 'pid' (ProcessId) member of 'GMPLaunchResult'");
        return {};

    }
    auto& _pid = *maybe___pid;
    // Sentinel = 'pid'
    if ((!((aReader)->ReadSentinel(42533182)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'pid' (ProcessId) member of 'GMPLaunchResult'");
        return {};
    }
    auto maybe___displayName = IPC::ReadParam<::nsCString>(aReader);
    if (!maybe___displayName) {
        aReader->FatalError("Error deserializing 'displayName' (nsCString) member of 'GMPLaunchResult'");
        return {};

    }
    auto& _displayName = *maybe___displayName;
    // Sentinel = 'displayName'
    if ((!((aReader)->ReadSentinel(455935096)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'displayName' (nsCString) member of 'GMPLaunchResult'");
        return {};
    }
    auto maybe___endpoint = IPC::ReadParam<::mozilla::ipc::Endpoint<::mozilla::gmp::PGMPContentParent>>(aReader);
    if (!maybe___endpoint) {
        aReader->FatalError("Error deserializing 'endpoint' (Endpoint<::mozilla::gmp::PGMPContentParent>) member of 'GMPLaunchResult'");
        return {};

    }
    auto& _endpoint = *maybe___endpoint;
    // Sentinel = 'endpoint'
    if ((!((aReader)->ReadSentinel(251724642)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'endpoint' (Endpoint<::mozilla::gmp::PGMPContentParent>) member of 'GMPLaunchResult'");
        return {};
    }
    auto maybe___result = IPC::ReadParam<::nsresult>(aReader);
    if (!maybe___result) {
        aReader->FatalError("Error deserializing 'result' (nsresult) member of 'GMPLaunchResult'");
        return {};

    }
    auto& _result = *maybe___result;
    // Sentinel = 'result'
    if ((!((aReader)->ReadSentinel(153223840)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'result' (nsresult) member of 'GMPLaunchResult'");
        return {};
    }
    auto maybe___errorDescription = IPC::ReadParam<::nsCString>(aReader);
    if (!maybe___errorDescription) {
        aReader->FatalError("Error deserializing 'errorDescription' (nsCString) member of 'GMPLaunchResult'");
        return {};

    }
    auto& _errorDescription = *maybe___errorDescription;
    // Sentinel = 'errorDescription'
    if ((!((aReader)->ReadSentinel(945882799)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'errorDescription' (nsCString) member of 'GMPLaunchResult'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            ::uint32_t{0},
            std::move(_pluginType),
            std::move(_pid),
            std::move(_displayName),
            std::move(_endpoint),
            std::move(_result),
            std::move(_errorDescription)};
    if ((!((aReader)->ReadBytesInto((&((result__)->pluginId())), 4)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'pluginId'
    if ((!((aReader)->ReadSentinel(253821757)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC
