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

#ifndef PBackgroundSDBConnection_h
#define PBackgroundSDBConnection_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/ipc/IPDLStructMember.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct SDBRequestOpenParams|
//
namespace mozilla {
namespace dom {
class SDBRequestOpenParams final
{
private:
    typedef ::nsString nsString;

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

    MOZ_IMPLICIT SDBRequestOpenParams(const nsString& _name) :
        name_(_name)
    {
    }

    MOZ_IMPLICIT SDBRequestOpenParams(nsString&& _name) :
        name_(std::move(_name))
    {
    }

    nsString&
    name()
    {
        return name_;
    }
    const nsString&
    name() const
    {
        return name_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<nsString> name_;
};
} // namespace dom
} // namespace mozilla

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


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct SDBRequestSeekParams|
//
namespace mozilla {
namespace dom {
class SDBRequestSeekParams final
{
private:
    typedef ::uint64_t uint64_t;

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

    MOZ_IMPLICIT SDBRequestSeekParams(const uint64_t& _offset) :
        offset_(_offset)
    {
    }

    MOZ_IMPLICIT SDBRequestSeekParams(uint64_t&& _offset) :
        offset_(std::move(_offset))
    {
    }

    uint64_t&
    offset()
    {
        return offset_;
    }
    const uint64_t&
    offset() const
    {
        return offset_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<uint64_t> offset_;
};
} // namespace dom
} // namespace mozilla

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


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct SDBRequestReadParams|
//
namespace mozilla {
namespace dom {
class SDBRequestReadParams final
{
private:
    typedef ::uint64_t uint64_t;

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

    MOZ_IMPLICIT SDBRequestReadParams(const uint64_t& _size) :
        size_(_size)
    {
    }

    MOZ_IMPLICIT SDBRequestReadParams(uint64_t&& _size) :
        size_(std::move(_size))
    {
    }

    uint64_t&
    size()
    {
        return size_;
    }
    const uint64_t&
    size() const
    {
        return size_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<uint64_t> size_;
};
} // namespace dom
} // namespace mozilla

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


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct SDBRequestWriteParams|
//
namespace mozilla {
namespace dom {
class SDBRequestWriteParams final
{
private:
    typedef ::nsCString nsCString;

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

    MOZ_IMPLICIT SDBRequestWriteParams(const nsCString& _data) :
        data_(_data)
    {
    }

    MOZ_IMPLICIT SDBRequestWriteParams(nsCString&& _data) :
        data_(std::move(_data))
    {
    }

    nsCString&
    data()
    {
        return data_;
    }
    const nsCString&
    data() const
    {
        return data_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<nsCString> data_;
};
} // namespace dom
} // namespace mozilla

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


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct SDBRequestCloseParams|
//
namespace mozilla {
namespace dom {
class SDBRequestCloseParams final
{
private:

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

private:
};
} // namespace dom
} // namespace mozilla

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


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union SDBRequestParams|
//
namespace mozilla {
namespace dom {
class SDBRequestParams final
{
public:
    enum Type {
        T__None,
        TSDBRequestOpenParams = 1,
        TSDBRequestSeekParams,
        TSDBRequestReadParams,
        TSDBRequestWriteParams,
        TSDBRequestCloseParams,
        T__Last = TSDBRequestCloseParams
    };

private:
    typedef ::mozilla::dom::SDBRequestOpenParams SDBRequestOpenParams;
    typedef ::mozilla::dom::SDBRequestSeekParams SDBRequestSeekParams;
    typedef ::mozilla::dom::SDBRequestReadParams SDBRequestReadParams;
    typedef ::mozilla::dom::SDBRequestWriteParams SDBRequestWriteParams;
    typedef ::mozilla::dom::SDBRequestCloseParams SDBRequestCloseParams;
    typedef SDBRequestOpenParams SDBRequestOpenParams__tdef;
    typedef SDBRequestSeekParams SDBRequestSeekParams__tdef;
    typedef SDBRequestReadParams SDBRequestReadParams__tdef;
    typedef SDBRequestWriteParams SDBRequestWriteParams__tdef;
    typedef SDBRequestCloseParams SDBRequestCloseParams__tdef;

    SDBRequestOpenParams*
    ptr_SDBRequestOpenParams()
    {
        return (&(mVSDBRequestOpenParams));
    }
    const SDBRequestOpenParams*
    constptr_SDBRequestOpenParams() const
    {
        return (&(mVSDBRequestOpenParams));
    }
    SDBRequestSeekParams*
    ptr_SDBRequestSeekParams()
    {
        return (&(mVSDBRequestSeekParams));
    }
    const SDBRequestSeekParams*
    constptr_SDBRequestSeekParams() const
    {
        return (&(mVSDBRequestSeekParams));
    }
    SDBRequestReadParams*
    ptr_SDBRequestReadParams()
    {
        return (&(mVSDBRequestReadParams));
    }
    const SDBRequestReadParams*
    constptr_SDBRequestReadParams() const
    {
        return (&(mVSDBRequestReadParams));
    }
    SDBRequestWriteParams*
    ptr_SDBRequestWriteParams()
    {
        return (&(mVSDBRequestWriteParams));
    }
    const SDBRequestWriteParams*
    constptr_SDBRequestWriteParams() const
    {
        return (&(mVSDBRequestWriteParams));
    }
    SDBRequestCloseParams*
    ptr_SDBRequestCloseParams()
    {
        return (&(mVSDBRequestCloseParams));
    }
    const SDBRequestCloseParams*
    constptr_SDBRequestCloseParams() const
    {
        return (&(mVSDBRequestCloseParams));
    }

    void
    MaybeDestroy();

    void
    AssertSanity() const
    {
        MOZ_RELEASE_ASSERT((T__None) <= (mType), "invalid type tag");
        MOZ_RELEASE_ASSERT((mType) <= (T__Last), "invalid type tag");
    }
    void
    AssertSanity(Type aType) const
    {
        AssertSanity();
        MOZ_RELEASE_ASSERT((mType) == (aType), "unexpected type tag");
    }

public:
    MOZ_IMPLICIT SDBRequestParams() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT SDBRequestParams(const SDBRequestOpenParams& aOther);

    MOZ_IMPLICIT SDBRequestParams(SDBRequestOpenParams&& aOther);

    MOZ_IMPLICIT SDBRequestParams(const SDBRequestSeekParams& aOther);

    MOZ_IMPLICIT SDBRequestParams(SDBRequestSeekParams&& aOther);

    MOZ_IMPLICIT SDBRequestParams(const SDBRequestReadParams& aOther);

    MOZ_IMPLICIT SDBRequestParams(SDBRequestReadParams&& aOther);

    MOZ_IMPLICIT SDBRequestParams(const SDBRequestWriteParams& aOther);

    MOZ_IMPLICIT SDBRequestParams(SDBRequestWriteParams&& aOther);

    MOZ_IMPLICIT SDBRequestParams(const SDBRequestCloseParams& aOther);

    MOZ_IMPLICIT SDBRequestParams(SDBRequestCloseParams&& aOther);

    MOZ_IMPLICIT SDBRequestParams(const SDBRequestParams& aOther);

    MOZ_IMPLICIT SDBRequestParams(SDBRequestParams&& aOther);

    ~SDBRequestParams();

    Type
    type() const
    {
        return mType;
    }

    SDBRequestParams&
    operator=(const SDBRequestOpenParams& aRhs);

    SDBRequestParams&
    operator=(SDBRequestOpenParams&& aRhs);

    SDBRequestParams&
    operator=(const SDBRequestSeekParams& aRhs);

    SDBRequestParams&
    operator=(SDBRequestSeekParams&& aRhs);

    SDBRequestParams&
    operator=(const SDBRequestReadParams& aRhs);

    SDBRequestParams&
    operator=(SDBRequestReadParams&& aRhs);

    SDBRequestParams&
    operator=(const SDBRequestWriteParams& aRhs);

    SDBRequestParams&
    operator=(SDBRequestWriteParams&& aRhs);

    SDBRequestParams&
    operator=(const SDBRequestCloseParams& aRhs);

    SDBRequestParams&
    operator=(SDBRequestCloseParams&& aRhs);

    SDBRequestParams&
    operator=(const SDBRequestParams& aRhs);

    SDBRequestParams&
    operator=(SDBRequestParams&& aRhs);

    SDBRequestOpenParams&
    get_SDBRequestOpenParams()
    {
        AssertSanity(TSDBRequestOpenParams);
        return (*(ptr_SDBRequestOpenParams()));
    }
    const SDBRequestOpenParams&
    get_SDBRequestOpenParams() const
    {
        AssertSanity(TSDBRequestOpenParams);
        return (*(constptr_SDBRequestOpenParams()));
    }
    operator SDBRequestOpenParams&()
    {
        return get_SDBRequestOpenParams();
    }
    operator const SDBRequestOpenParams&() const
    {
        return get_SDBRequestOpenParams();
    }

    SDBRequestSeekParams&
    get_SDBRequestSeekParams()
    {
        AssertSanity(TSDBRequestSeekParams);
        return (*(ptr_SDBRequestSeekParams()));
    }
    const SDBRequestSeekParams&
    get_SDBRequestSeekParams() const
    {
        AssertSanity(TSDBRequestSeekParams);
        return (*(constptr_SDBRequestSeekParams()));
    }
    operator SDBRequestSeekParams&()
    {
        return get_SDBRequestSeekParams();
    }
    operator const SDBRequestSeekParams&() const
    {
        return get_SDBRequestSeekParams();
    }

    SDBRequestReadParams&
    get_SDBRequestReadParams()
    {
        AssertSanity(TSDBRequestReadParams);
        return (*(ptr_SDBRequestReadParams()));
    }
    const SDBRequestReadParams&
    get_SDBRequestReadParams() const
    {
        AssertSanity(TSDBRequestReadParams);
        return (*(constptr_SDBRequestReadParams()));
    }
    operator SDBRequestReadParams&()
    {
        return get_SDBRequestReadParams();
    }
    operator const SDBRequestReadParams&() const
    {
        return get_SDBRequestReadParams();
    }

    SDBRequestWriteParams&
    get_SDBRequestWriteParams()
    {
        AssertSanity(TSDBRequestWriteParams);
        return (*(ptr_SDBRequestWriteParams()));
    }
    const SDBRequestWriteParams&
    get_SDBRequestWriteParams() const
    {
        AssertSanity(TSDBRequestWriteParams);
        return (*(constptr_SDBRequestWriteParams()));
    }
    operator SDBRequestWriteParams&()
    {
        return get_SDBRequestWriteParams();
    }
    operator const SDBRequestWriteParams&() const
    {
        return get_SDBRequestWriteParams();
    }

    SDBRequestCloseParams&
    get_SDBRequestCloseParams()
    {
        AssertSanity(TSDBRequestCloseParams);
        return (*(ptr_SDBRequestCloseParams()));
    }
    const SDBRequestCloseParams&
    get_SDBRequestCloseParams() const
    {
        AssertSanity(TSDBRequestCloseParams);
        return (*(constptr_SDBRequestCloseParams()));
    }
    operator SDBRequestCloseParams&()
    {
        return get_SDBRequestCloseParams();
    }
    operator const SDBRequestCloseParams&() const
    {
        return get_SDBRequestCloseParams();
    }

private:
    union {
        SDBRequestOpenParams mVSDBRequestOpenParams;
        SDBRequestSeekParams mVSDBRequestSeekParams;
        SDBRequestReadParams mVSDBRequestReadParams;
        SDBRequestWriteParams mVSDBRequestWriteParams;
        SDBRequestCloseParams mVSDBRequestCloseParams;
    };
    Type mType;
};
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::SDBRequestParams>
{
    typedef ::mozilla::dom::SDBRequestParams 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 PBackgroundSDBConnectionParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PBackgroundSDBConnectionChild;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PBackgroundSDBConnectionChild and PBackgroundSDBConnectionParent
//
namespace mozilla {
namespace dom {
namespace PBackgroundSDBConnection {

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

enum MessageType {
    PBackgroundSDBConnectionStart = PBackgroundSDBConnectionMsgStart << 16,
    Msg_DeleteMe__ID,
    Msg_PBackgroundSDBRequestConstructor__ID,
    Reply_PBackgroundSDBRequestConstructor__ID,
    Msg___delete____ID,
    Reply___delete____ID,
    Msg_AllowToClose__ID,
    Msg_Closed__ID,
    PBackgroundSDBConnectionEnd
};

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

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

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

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

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



} // namespace PBackgroundSDBConnection
} // namespace dom
} // namespace mozilla

#endif // ifndef PBackgroundSDBConnection_h
