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


#include "mozilla/dom/PContentParent.h"
#include "mozilla/dom/PContentChild.h"
#include "mozilla/dom/PHandlerService.h"
#include "mozilla/dom/PHandlerServiceParent.h"
#include "mozilla/dom/PHandlerServiceChild.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 PHandlerService {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::dom::PHandlerServiceParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::dom::PHandlerServiceChild>* aChild)
{
    return mozilla::ipc::CreateEndpoints(
        mozilla::ipc::PrivateIPDLInterface(),
        aParentDestInfo, aChildDestInfo, aParent, aChild);
}
mozilla::UniquePtr<IPC::Message>
Msg_FillHandlerInfo(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_FillHandlerInfo__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::SYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply_FillHandlerInfo(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_FillHandlerInfo__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::SYNC, IPC::Message::REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_ExistsForProtocolOS(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_ExistsForProtocolOS__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::SYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply_ExistsForProtocolOS(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_ExistsForProtocolOS__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::SYNC, IPC::Message::REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_ExistsForProtocol(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_ExistsForProtocol__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::SYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply_ExistsForProtocol(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_ExistsForProtocol__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::SYNC, IPC::Message::REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_Exists(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_Exists__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::SYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply_Exists(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_Exists__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::SYNC, IPC::Message::REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_GetTypeFromExtension(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_GetTypeFromExtension__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::SYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply_GetTypeFromExtension(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_GetTypeFromExtension__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::SYNC, IPC::Message::REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_GetMIMEInfoFromOS(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_GetMIMEInfoFromOS__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::SYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply_GetMIMEInfoFromOS(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_GetMIMEInfoFromOS__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::SYNC, IPC::Message::REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_GetApplicationDescription(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_GetApplicationDescription__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::SYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply_GetApplicationDescription(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_GetApplicationDescription__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::SYNC, 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 PHandlerService
} // namespace dom
} // namespace mozilla

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

namespace IPC {
auto ParamTraits<::mozilla::dom::HandlerApp>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).name());
    // Sentinel = 'name'
    (aWriter)->WriteSentinel(69075362);
    IPC::WriteParam(aWriter, (aVar).detailedDescription());
    // Sentinel = 'detailedDescription'
    (aWriter)->WriteSentinel(1280903105);
}

auto ParamTraits<::mozilla::dom::HandlerApp>::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 'HandlerApp'");
        return {};

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

    }
    auto& _detailedDescription = *maybe___detailedDescription;
    // Sentinel = 'detailedDescription'
    if ((!((aReader)->ReadSentinel(1280903105)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'detailedDescription' (nsString) member of 'HandlerApp'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_name),
            std::move(_detailedDescription)};
    return result__;
}

} // namespace IPC

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

namespace IPC {
auto ParamTraits<::mozilla::dom::HandlerInfo>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).type());
    // Sentinel = 'type'
    (aWriter)->WriteSentinel(75760067);
    IPC::WriteParam(aWriter, (aVar).isMIMEInfo());
    // Sentinel = 'isMIMEInfo'
    (aWriter)->WriteSentinel(325452689);
    IPC::WriteParam(aWriter, (aVar).description());
    // Sentinel = 'description'
    (aWriter)->WriteSentinel(461833381);
    IPC::WriteParam(aWriter, (aVar).alwaysAskBeforeHandling());
    // Sentinel = 'alwaysAskBeforeHandling'
    (aWriter)->WriteSentinel(1848379689);
    IPC::WriteParam(aWriter, (aVar).extensions());
    // Sentinel = 'extensions'
    (aWriter)->WriteSentinel(397018193);
    IPC::WriteParam(aWriter, (aVar).preferredApplicationHandler());
    // Sentinel = 'preferredApplicationHandler'
    (aWriter)->WriteSentinel(2583497458);
    IPC::WriteParam(aWriter, (aVar).possibleApplicationHandlers());
    // Sentinel = 'possibleApplicationHandlers'
    (aWriter)->WriteSentinel(2600209159);
    (aWriter)->WriteBytes((&((aVar).preferredAction())), 4);
    // Sentinel = 'preferredAction'
    (aWriter)->WriteSentinel(826344990);
}

auto ParamTraits<::mozilla::dom::HandlerInfo>::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 'HandlerInfo'");
        return {};

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

    }
    auto& _isMIMEInfo = *maybe___isMIMEInfo;
    // Sentinel = 'isMIMEInfo'
    if ((!((aReader)->ReadSentinel(325452689)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'isMIMEInfo' (bool) member of 'HandlerInfo'");
        return {};
    }
    auto maybe___description = IPC::ReadParam<::nsString>(aReader);
    if (!maybe___description) {
        aReader->FatalError("Error deserializing 'description' (nsString) member of 'HandlerInfo'");
        return {};

    }
    auto& _description = *maybe___description;
    // Sentinel = 'description'
    if ((!((aReader)->ReadSentinel(461833381)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'description' (nsString) member of 'HandlerInfo'");
        return {};
    }
    auto maybe___alwaysAskBeforeHandling = IPC::ReadParam<bool>(aReader);
    if (!maybe___alwaysAskBeforeHandling) {
        aReader->FatalError("Error deserializing 'alwaysAskBeforeHandling' (bool) member of 'HandlerInfo'");
        return {};

    }
    auto& _alwaysAskBeforeHandling = *maybe___alwaysAskBeforeHandling;
    // Sentinel = 'alwaysAskBeforeHandling'
    if ((!((aReader)->ReadSentinel(1848379689)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'alwaysAskBeforeHandling' (bool) member of 'HandlerInfo'");
        return {};
    }
    auto maybe___extensions = IPC::ReadParam<nsTArray<::nsCString>>(aReader);
    if (!maybe___extensions) {
        aReader->FatalError("Error deserializing 'extensions' (nsCString[]) member of 'HandlerInfo'");
        return {};

    }
    auto& _extensions = *maybe___extensions;
    // Sentinel = 'extensions'
    if ((!((aReader)->ReadSentinel(397018193)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'extensions' (nsCString[]) member of 'HandlerInfo'");
        return {};
    }
    auto maybe___preferredApplicationHandler = IPC::ReadParam<::mozilla::dom::HandlerApp>(aReader);
    if (!maybe___preferredApplicationHandler) {
        aReader->FatalError("Error deserializing 'preferredApplicationHandler' (HandlerApp) member of 'HandlerInfo'");
        return {};

    }
    auto& _preferredApplicationHandler = *maybe___preferredApplicationHandler;
    // Sentinel = 'preferredApplicationHandler'
    if ((!((aReader)->ReadSentinel(2583497458)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'preferredApplicationHandler' (HandlerApp) member of 'HandlerInfo'");
        return {};
    }
    auto maybe___possibleApplicationHandlers = IPC::ReadParam<nsTArray<::mozilla::dom::HandlerApp>>(aReader);
    if (!maybe___possibleApplicationHandlers) {
        aReader->FatalError("Error deserializing 'possibleApplicationHandlers' (HandlerApp[]) member of 'HandlerInfo'");
        return {};

    }
    auto& _possibleApplicationHandlers = *maybe___possibleApplicationHandlers;
    // Sentinel = 'possibleApplicationHandlers'
    if ((!((aReader)->ReadSentinel(2600209159)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'possibleApplicationHandlers' (HandlerApp[]) member of 'HandlerInfo'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_type),
            std::move(_isMIMEInfo),
            std::move(_description),
            std::move(_alwaysAskBeforeHandling),
            std::move(_extensions),
            std::move(_preferredApplicationHandler),
            std::move(_possibleApplicationHandlers),
            ::int32_t{0}};
    if ((!((aReader)->ReadBytesInto((&((result__)->preferredAction())), 4)))) {
        aReader->FatalError("Error bulk reading fields from int32_t");
        return {};
    }
    // Sentinel = 'preferredAction'
    if ((!((aReader)->ReadSentinel(826344990)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from int32_t");
        return {};
    }
    return result__;
}

} // namespace IPC
