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

#ifndef PScriptCache_h
#define PScriptCache_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/TimeStamp.h"
#include "mozilla/ipc/IPDLStructMember.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ScriptData|
//
namespace mozilla {
namespace loader {
class ScriptData final
{
private:
    typedef ::nsCString nsCString;
    typedef ::mozilla::TimeStamp TimeStamp;
    typedef ::uint8_t uint8_t;

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

    MOZ_IMPLICIT ScriptData(
            const nsCString& _url,
            const nsCString& _cachePath,
            const TimeStamp& _loadTime,
            const nsTArray<uint8_t>& _xdrData) :
        url_(_url),
        cachePath_(_cachePath),
        loadTime_(_loadTime),
        xdrData_(_xdrData)
    {
    }

    MOZ_IMPLICIT ScriptData(
            nsCString&& _url,
            nsCString&& _cachePath,
            TimeStamp&& _loadTime,
            nsTArray<uint8_t>&& _xdrData) :
        url_(std::move(_url)),
        cachePath_(std::move(_cachePath)),
        loadTime_(std::move(_loadTime)),
        xdrData_(std::move(_xdrData))
    {
    }

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

    nsCString&
    cachePath()
    {
        return cachePath_;
    }
    const nsCString&
    cachePath() const
    {
        return cachePath_;
    }

    TimeStamp&
    loadTime()
    {
        return loadTime_;
    }
    const TimeStamp&
    loadTime() const
    {
        return loadTime_;
    }

    nsTArray<uint8_t>&
    xdrData()
    {
        return xdrData_;
    }
    const nsTArray<uint8_t>&
    xdrData() const
    {
        return xdrData_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<nsCString> url_;
    ::mozilla::ipc::IPDLStructMember<nsCString> cachePath_;
    ::mozilla::ipc::IPDLStructMember<TimeStamp> loadTime_;
    ::mozilla::ipc::IPDLStructMember<CopyableTArray<uint8_t>> xdrData_;
};
} // namespace loader
} // namespace mozilla

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

namespace mozilla {
namespace loader {
class PScriptCacheParent;
} // namespace loader
} // namespace mozilla
namespace mozilla {
namespace loader {
class PScriptCacheChild;
} // namespace loader
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PScriptCacheChild and PScriptCacheParent
//
namespace mozilla {
namespace loader {
namespace PScriptCache {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::loader::PScriptCacheParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::loader::PScriptCacheChild>* aChild);

enum MessageType {
    PScriptCacheStart = PScriptCacheMsgStart << 16,
    Msg___delete____ID,
    Reply___delete____ID,
    PScriptCacheEnd
};

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



} // namespace PScriptCache
} // namespace loader
} // namespace mozilla

#endif // ifndef PScriptCache_h
