Bug 1269365, part 1 - Swap fallible and infallible TArray ParamTraits. r=froydnj

This should not change the behavior, because fallible_t is passed to
the array methods.

Rename from InfallibleTArray to nsTArray, because that is more usual.

Remove unnecessary spaces from some template definitions.
This commit is contained in:
Andrew McCreight 2016-05-03 09:29:39 -07:00
Родитель 6f1c734ebb
Коммит 6266959835
1 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -427,9 +427,9 @@ struct ParamTraits<nsLiteralString> : ParamTraits<nsAString>
bool ByteLengthIsValid(uint32_t aNumElements, size_t aElementSize, int* aByteLength);
template <typename E>
struct ParamTraits<FallibleTArray<E> >
struct ParamTraits<nsTArray<E>>
{
typedef FallibleTArray<E> paramType;
typedef nsTArray<E> paramType;
// We write arrays of integer or floating-point data using a single pickling
// call, rather than writing each element individually. We deliberately do
@ -508,19 +508,19 @@ struct ParamTraits<FallibleTArray<E> >
};
template<typename E>
struct ParamTraits<InfallibleTArray<E> >
struct ParamTraits<FallibleTArray<E>>
{
typedef InfallibleTArray<E> paramType;
typedef FallibleTArray<E> paramType;
static void Write(Message* aMsg, const paramType& aParam)
{
WriteParam(aMsg, static_cast<const FallibleTArray<E>&>(aParam));
WriteParam(aMsg, static_cast<const nsTArray<E>&>(aParam));
}
// deserialize the array fallibly, but return an InfallibleTArray
// Deserialize the array infallibly, but return a FallibleTArray.
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
{
FallibleTArray<E> temp;
nsTArray<E> temp;
if (!ReadParam(aMsg, aIter, &temp))
return false;
@ -530,7 +530,7 @@ struct ParamTraits<InfallibleTArray<E> >
static void Log(const paramType& aParam, std::wstring* aLog)
{
LogParam(static_cast<const FallibleTArray<E>&>(aParam), aLog);
LogParam(static_cast<const nsTArray<E>&>(aParam), aLog);
}
};
@ -778,7 +778,7 @@ struct ParamTraits<nsIWidget::TouchPointerState>
};
template<class T>
struct ParamTraits< mozilla::Maybe<T> >
struct ParamTraits<mozilla::Maybe<T>>
{
typedef mozilla::Maybe<T> paramType;