Bug 1348606 - Get rid of CSSVALUE_LIST_FOR_EXTRA_VALUES. r=xidorn

This makes it more annoying to put the class definition in a macro,
which we do in the next patch.

MozReview-Commit-ID: 443V7z4sMfi
This commit is contained in:
Bobby Holley 2017-03-18 17:33:48 -07:00
Родитель 24aabf9308
Коммит c64223ca7c
1 изменённых файлов: 7 добавлений и 10 удалений

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

@ -1098,30 +1098,27 @@ private:
const nsCSSValue* First() const { return mArray; }
#define CSSVALUE_LIST_FOR_EXTRA_VALUES(var) \
for (nsCSSValue *var = First() + 1, *var##_end = First() + mCount; \
var != var##_end; ++var)
explicit Array(size_t aItemCount)
: mRefCnt(0)
, mCount(aItemCount)
: mCount(aItemCount)
{
CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
for (nsCSSValue *val = First() + 1, *val_end = First() + mCount;
val != val_end; ++val)
{
new (val) nsCSSValue();
}
}
~Array()
{
CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
for (nsCSSValue *val = First() + 1, *val_end = First() + mCount;
val != val_end; ++val)
{
val->~nsCSSValue();
}
}
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
#undef CSSVALUE_LIST_FOR_EXTRA_VALUES
private:
Array(const Array& aOther) = delete;
Array& operator=(const Array& aOther) = delete;