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

#ifndef PBackgroundLSDatabase_h
#define PBackgroundLSDatabase_h

#include "mozilla/Attributes.h"
#include "IPCMessageStart.h"
#include "mozilla/RefPtr.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
#include "mozilla/MozPromise.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/ipc/ByteBuf.h"
#include "mozilla/ipc/FileDescriptor.h"
#include "mozilla/ipc/IPCForwards.h"
#include "mozilla/ipc/Shmem.h"

// Headers for typedefs
#include "mozilla/dom/LSSnapshot.h"
#include "mozilla/ipc/IPDLStructMember.h"
#include "mozilla/dom/PBackgroundLSSharedTypes.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct LSSnapshotInitInfo|
//
namespace mozilla {
namespace dom {
class LSSnapshotInitInfo final
{
private:
    typedef ::mozilla::dom::LSItemInfo LSItemInfo;
    typedef ::uint32_t uint32_t;
    typedef ::int64_t int64_t;
    typedef ::mozilla::dom::LSSnapshot::LoadState LoadState;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    LSSnapshotInitInfo() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT LSSnapshotInitInfo(
            const bool& _addKeyToUnknownItems,
            const nsTArray<LSItemInfo>& _itemInfos,
            const uint32_t& _totalLength,
            const int64_t& _usage,
            const int64_t& _peakUsage,
            const LoadState& _loadState,
            const bool& _hasOtherProcessDatabases,
            const bool& _hasOtherProcessObservers) :
        addKeyToUnknownItems_(_addKeyToUnknownItems),
        itemInfos_(_itemInfos),
        loadState_(_loadState),
        hasOtherProcessDatabases_(_hasOtherProcessDatabases),
        hasOtherProcessObservers_(_hasOtherProcessObservers),
        usage_(_usage),
        peakUsage_(_peakUsage),
        totalLength_(_totalLength)
    {
    }

    MOZ_IMPLICIT LSSnapshotInitInfo(
            bool&& _addKeyToUnknownItems,
            nsTArray<LSItemInfo>&& _itemInfos,
            uint32_t&& _totalLength,
            int64_t&& _usage,
            int64_t&& _peakUsage,
            LoadState&& _loadState,
            bool&& _hasOtherProcessDatabases,
            bool&& _hasOtherProcessObservers) :
        addKeyToUnknownItems_(std::move(_addKeyToUnknownItems)),
        itemInfos_(std::move(_itemInfos)),
        loadState_(std::move(_loadState)),
        hasOtherProcessDatabases_(std::move(_hasOtherProcessDatabases)),
        hasOtherProcessObservers_(std::move(_hasOtherProcessObservers)),
        usage_(std::move(_usage)),
        peakUsage_(std::move(_peakUsage)),
        totalLength_(std::move(_totalLength))
    {
    }

    bool&
    addKeyToUnknownItems()
    {
        return addKeyToUnknownItems_;
    }
    const bool&
    addKeyToUnknownItems() const
    {
        return addKeyToUnknownItems_;
    }

    nsTArray<LSItemInfo>&
    itemInfos()
    {
        return itemInfos_;
    }
    const nsTArray<LSItemInfo>&
    itemInfos() const
    {
        return itemInfos_;
    }

    uint32_t&
    totalLength()
    {
        return totalLength_;
    }
    const uint32_t&
    totalLength() const
    {
        return totalLength_;
    }

    int64_t&
    usage()
    {
        return usage_;
    }
    const int64_t&
    usage() const
    {
        return usage_;
    }

    int64_t&
    peakUsage()
    {
        return peakUsage_;
    }
    const int64_t&
    peakUsage() const
    {
        return peakUsage_;
    }

    LoadState&
    loadState()
    {
        return loadState_;
    }
    const LoadState&
    loadState() const
    {
        return loadState_;
    }

    bool&
    hasOtherProcessDatabases()
    {
        return hasOtherProcessDatabases_;
    }
    const bool&
    hasOtherProcessDatabases() const
    {
        return hasOtherProcessDatabases_;
    }

    bool&
    hasOtherProcessObservers()
    {
        return hasOtherProcessObservers_;
    }
    const bool&
    hasOtherProcessObservers() const
    {
        return hasOtherProcessObservers_;
    }

private:
    void
    StaticAssertions() const;
    ::mozilla::ipc::IPDLStructMember<bool> addKeyToUnknownItems_;
    ::mozilla::ipc::IPDLStructMember<CopyableTArray<LSItemInfo>> itemInfos_;
    ::mozilla::ipc::IPDLStructMember<LoadState> loadState_;
    ::mozilla::ipc::IPDLStructMember<bool> hasOtherProcessDatabases_;
    ::mozilla::ipc::IPDLStructMember<bool> hasOtherProcessObservers_;
    ::mozilla::ipc::IPDLStructMember<int64_t> usage_;
    ::mozilla::ipc::IPDLStructMember<int64_t> peakUsage_;
    ::mozilla::ipc::IPDLStructMember<uint32_t> totalLength_;
};
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::LSSnapshotInitInfo>
{
    typedef ::mozilla::dom::LSSnapshotInitInfo paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC

namespace mozilla {
namespace dom {
class PBackgroundLSDatabaseParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PBackgroundLSDatabaseChild;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PBackgroundLSDatabaseChild and PBackgroundLSDatabaseParent
//
namespace mozilla {
namespace dom {
namespace PBackgroundLSDatabase {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::dom::PBackgroundLSDatabaseParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::dom::PBackgroundLSDatabaseChild>* aChild);

nsresult
CreateEndpoints(
        mozilla::ipc::Endpoint<::mozilla::dom::PBackgroundLSDatabaseParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::dom::PBackgroundLSDatabaseChild>* aChild);

enum MessageType {
    PBackgroundLSDatabaseStart = PBackgroundLSDatabaseMsgStart << 16,
    Msg_AllowToClose__ID,
    Msg_PBackgroundLSSnapshotConstructor__ID,
    Reply_PBackgroundLSSnapshotConstructor__ID,
    Msg_RequestAllowToClose__ID,
    PBackgroundLSDatabaseEnd
};

mozilla::UniquePtr<IPC::Message>
Msg_AllowToClose(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_PBackgroundLSSnapshotConstructor(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_PBackgroundLSSnapshotConstructor(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_RequestAllowToClose(IPC::Message::routeid_t routingId);



} // namespace PBackgroundLSDatabase
} // namespace dom
} // namespace mozilla

#endif // ifndef PBackgroundLSDatabase_h
