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

#ifndef PCookieStore_h
#define PCookieStore_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 "ipc/IPCMessageUtils.h"
#include "mozilla/ipc/IPDLStructMember.h"
#include "mozilla/ipc/PBackgroundSharedTypes.h"
#include "mozilla/net/NeckoChannelParams.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union MaybeCookieStruct|
//
namespace mozilla {
namespace dom {
class MaybeCookieStruct final
{
public:
    enum Type {
        T__None,
        TCookieStruct = 1,
        Tvoid_t,
        T__Last = Tvoid_t
    };

private:
    typedef ::mozilla::net::CookieStruct CookieStruct;
    typedef ::mozilla::void_t void_t;
    typedef CookieStruct CookieStruct__tdef;
    typedef void_t void_t__tdef;

    CookieStruct*
    ptr_CookieStruct()
    {
        return (&(mVCookieStruct));
    }
    const CookieStruct*
    constptr_CookieStruct() const
    {
        return (&(mVCookieStruct));
    }
    void_t*
    ptr_void_t()
    {
        return (&(mVvoid_t));
    }
    const void_t*
    constptr_void_t() const
    {
        return (&(mVvoid_t));
    }

    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 MaybeCookieStruct() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT MaybeCookieStruct(const CookieStruct& aOther);

    MOZ_IMPLICIT MaybeCookieStruct(CookieStruct&& aOther);

    MOZ_IMPLICIT MaybeCookieStruct(const void_t& aOther);

    MOZ_IMPLICIT MaybeCookieStruct(void_t&& aOther);

    MOZ_IMPLICIT MaybeCookieStruct(const MaybeCookieStruct& aOther);

    MOZ_IMPLICIT MaybeCookieStruct(MaybeCookieStruct&& aOther);

    ~MaybeCookieStruct();

    Type
    type() const
    {
        return mType;
    }

    MaybeCookieStruct&
    operator=(const CookieStruct& aRhs);

    MaybeCookieStruct&
    operator=(CookieStruct&& aRhs);

    MaybeCookieStruct&
    operator=(const void_t& aRhs);

    MaybeCookieStruct&
    operator=(void_t&& aRhs);

    MaybeCookieStruct&
    operator=(const MaybeCookieStruct& aRhs);

    MaybeCookieStruct&
    operator=(MaybeCookieStruct&& aRhs);

    CookieStruct&
    get_CookieStruct()
    {
        AssertSanity(TCookieStruct);
        return (*(ptr_CookieStruct()));
    }
    const CookieStruct&
    get_CookieStruct() const
    {
        AssertSanity(TCookieStruct);
        return (*(constptr_CookieStruct()));
    }
    operator CookieStruct&()
    {
        return get_CookieStruct();
    }
    operator const CookieStruct&() const
    {
        return get_CookieStruct();
    }

    void_t&
    get_void_t()
    {
        AssertSanity(Tvoid_t);
        return (*(ptr_void_t()));
    }
    const void_t&
    get_void_t() const
    {
        AssertSanity(Tvoid_t);
        return (*(constptr_void_t()));
    }
    operator void_t&()
    {
        return get_void_t();
    }
    operator const void_t&() const
    {
        return get_void_t();
    }

private:
    union {
        CookieStruct mVCookieStruct;
        void_t mVvoid_t;
    };
    Type mType;
};
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::MaybeCookieStruct>
{
    typedef ::mozilla::dom::MaybeCookieStruct 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 CookieSubscription|
//
namespace mozilla {
namespace dom {
class CookieSubscription 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
    CookieSubscription() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT CookieSubscription(
            const mozilla::Maybe<nsString>& _name,
            const nsString& _url) :
        name_(_name),
        url_(_url)
    {
    }

    MOZ_IMPLICIT CookieSubscription(
            mozilla::Maybe<nsString>&& _name,
            nsString&& _url) :
        name_(std::move(_name)),
        url_(std::move(_url))
    {
    }

    mozilla::Maybe<nsString>&
    name()
    {
        return name_;
    }
    const mozilla::Maybe<nsString>&
    name() const
    {
        return name_;
    }

    nsString&
    url()
    {
        return url_;
    }
    const nsString&
    url() const
    {
        return url_;
    }

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

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::CookieSubscription>
{
    typedef ::mozilla::dom::CookieSubscription 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 CookieStoreResult|
//
namespace mozilla {
namespace dom {
class CookieStoreResult final
{
private:

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

    MOZ_IMPLICIT CookieStoreResult(
            const bool& _success,
            const bool& _waitForNotification) :
        success_(_success),
        waitForNotification_(_waitForNotification)
    {
    }

    MOZ_IMPLICIT CookieStoreResult(
            bool&& _success,
            bool&& _waitForNotification) :
        success_(std::move(_success)),
        waitForNotification_(std::move(_waitForNotification))
    {
    }

    bool&
    success()
    {
        return success_;
    }
    const bool&
    success() const
    {
        return success_;
    }

    bool&
    waitForNotification()
    {
        return waitForNotification_;
    }
    const bool&
    waitForNotification() const
    {
        return waitForNotification_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<bool> success_;
    ::mozilla::ipc::IPDLStructMember<bool> waitForNotification_;
};
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::CookieStoreResult>
{
    typedef ::mozilla::dom::CookieStoreResult 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 PCookieStoreParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PCookieStoreChild;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PCookieStoreChild and PCookieStoreParent
//
namespace mozilla {
namespace dom {
namespace PCookieStore {

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

enum MessageType {
    PCookieStoreStart = PCookieStoreMsgStart << 16,
    Msg_GetRequest__ID,
    Reply_GetRequest__ID,
    Msg_SetRequest__ID,
    Reply_SetRequest__ID,
    Msg_DeleteRequest__ID,
    Reply_DeleteRequest__ID,
    Msg_GetSubscriptionsRequest__ID,
    Reply_GetSubscriptionsRequest__ID,
    Msg_SubscribeOrUnsubscribeRequest__ID,
    Reply_SubscribeOrUnsubscribeRequest__ID,
    Msg_Close__ID,
    Msg___delete____ID,
    Reply___delete____ID,
    PCookieStoreEnd
};

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

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

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

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

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

mozilla::UniquePtr<IPC::Message>
Msg_Close(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);



} // namespace PCookieStore
} // namespace dom
} // namespace mozilla

#endif // ifndef PCookieStore_h
