mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-24 05:44:10 +00:00
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:
parent
3ff706b49a
commit
6fcdca9677
@ -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<>
|
||||
|
Loading…
x
Reference in New Issue
Block a user