Bug 819791 - Part 2: Don't use nsTArray allocators in IPCMessageUtils traits. r=cjones

The allocators will be restricted to non-public use in a later patch.
This commit is contained in:
Justin Lebar 2012-12-18 20:16:06 -05:00
parent 900c0a0310
commit 075232ceca

View File

@ -336,10 +336,10 @@ struct ParamTraits<nsString> : ParamTraits<nsAString>
typedef nsString paramType;
};
template <typename E, class A>
struct ParamTraits<nsTArray<E, A> >
template <typename E>
struct ParamTraits<FallibleTArray<E> >
{
typedef nsTArray<E, A> paramType;
typedef FallibleTArray<E> paramType;
static void Write(Message* aMsg, const paramType& aParam)
{
@ -380,12 +380,14 @@ struct ParamTraits<nsTArray<E, A> >
};
template<typename E>
struct ParamTraits<InfallibleTArray<E> > :
ParamTraits<nsTArray<E, nsTArrayInfallibleAllocator> >
struct ParamTraits<InfallibleTArray<E> >
{
typedef InfallibleTArray<E> paramType;
// use nsTArray Write() method
static void Write(Message* aMsg, const paramType& aParam)
{
WriteParam(aMsg, static_cast<const FallibleTArray<E>&>(aParam));
}
// deserialize the array fallibly, but return an InfallibleTArray
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
@ -398,7 +400,10 @@ struct ParamTraits<InfallibleTArray<E> > :
return true;
}
// use nsTArray Log() method
static void Log(const paramType& aParam, std::wstring* aLog)
{
LogParam(static_cast<const FallibleTArray<E>&>(aParam), aLog);
}
};
template<>