--- a/accessible/atk/AccessibleWrap.cpp
+++ b/accessible/atk/AccessibleWrap.cpp
@@ -754,17 +754,17 @@ getAttributesCB(AtkObject *aAtkObj)
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (accWrap)
return GetAttributeSet(accWrap);
ProxyAccessible* proxy = GetProxy(aAtkObj);
if (!proxy)
return nullptr;
- nsAutoTArray<Attribute, 10> attrs;
+ AutoTArray<Attribute, 10> attrs;
proxy->Attributes(&attrs);
if (attrs.IsEmpty())
return nullptr;
AtkAttributeSet* objAttributeSet = nullptr;
for (uint32_t i = 0; i < attrs.Length(); i++) {
AtkAttribute *objAttr = (AtkAttribute *)g_malloc(sizeof(AtkAttribute));
objAttr->name = g_strdup(attrs[i].Name().get());
@@ -1014,17 +1014,17 @@ refRelationSetCB(AtkObject *aAtkObj)
proxy->Relations(&types, &targetSets);
size_t relationCount = types.Length();
for (size_t i = 0; i < relationCount; i++) {
if (typeMap[static_cast<uint32_t>(types[i])] == ATK_RELATION_NULL)
continue;
size_t targetCount = targetSets[i].Length();
- nsAutoTArray<AtkObject*, 5> wrappers;
+ AutoTArray<AtkObject*, 5> wrappers;
for (size_t j = 0; j < targetCount; j++)
wrappers.AppendElement(GetWrapperFor(targetSets[i][j]));
AtkRelationType atkType = typeMap[static_cast<uint32_t>(types[i])];
AtkRelation* atkRelation =
atk_relation_set_get_relation_by_type(relation_set, atkType);
if (atkRelation)
atk_relation_set_remove(relation_set, atkRelation);
@@ -1659,17 +1659,17 @@ AccessibleWrap::GetColumnHeader(TableAcc
}
// otherwise get column header for the data cell at the first row.
TableCellAccessible* tableCell = cell->AsTableCell();
if (!tableCell) {
return nullptr;
}
- nsAutoTArray<Accessible*, 10> headerCells;
+ AutoTArray<Accessible*, 10> headerCells;
tableCell->ColHeaderCells(&headerCells);
if (headerCells.IsEmpty()) {
return nullptr;
}
return headerCells[0];
}
@@ -1693,16 +1693,16 @@ AccessibleWrap::GetRowHeader(TableAccess
}
// otherwise get row header for the data cell at the first column.
TableCellAccessible* tableCell = cell->AsTableCell();
if (!tableCell) {
return nullptr;
}
- nsAutoTArray<Accessible*, 10> headerCells;
+ AutoTArray<Accessible*, 10> headerCells;
tableCell->RowHeaderCells(&headerCells);
if (headerCells.IsEmpty()) {
return nullptr;
}
return headerCells[0];
}
--- a/accessible/atk/nsMaiInterfaceTable.cpp
+++ b/accessible/atk/nsMaiInterfaceTable.cpp
@@ -268,17 +268,17 @@ getSummaryCB(AtkTable *aTable)
return nullptr;
}
static gint
getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
{
*aSelected = nullptr;
- nsAutoTArray<uint32_t, 10> cols;
+ AutoTArray<uint32_t, 10> cols;
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->SelectedColIndices(&cols);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
proxy->TableSelectedColumnIndices(&cols);
} else {
return 0;
}
@@ -295,17 +295,17 @@ getSelectedColumnsCB(AtkTable *aTable, g
memcpy(atkColumns, cols.Elements(), cols.Length() * sizeof(uint32_t));
*aSelected = atkColumns;
return cols.Length();
}
static gint
getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
{
- nsAutoTArray<uint32_t, 10> rows;
+ AutoTArray<uint32_t, 10> rows;
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->SelectedRowIndices(&rows);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
proxy->TableSelectedRowIndices(&rows);
} else {
return 0;
}
--- a/accessible/atk/nsMaiInterfaceText.cpp
+++ b/accessible/atk/nsMaiInterfaceText.cpp
@@ -306,17 +306,17 @@ getRunAttributesCB(AtkText *aText, gint
return ConvertToAtkTextAttributeSet(attributes);
}
ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText));
if (!proxy) {
return nullptr;
}
- nsAutoTArray<Attribute, 10> attrs;
+ AutoTArray<Attribute, 10> attrs;
proxy->TextAttributes(false, aOffset, &attrs, &startOffset, &endOffset);
*aStartOffset = startOffset;
*aEndOffset = endOffset;
return ConvertToAtkTextAttributeSet(attrs);
}
static AtkAttributeSet*
getDefaultAttributesCB(AtkText *aText)
@@ -332,17 +332,17 @@ getDefaultAttributesCB(AtkText *aText)
return ConvertToAtkTextAttributeSet(attributes);
}
ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText));
if (!proxy) {
return nullptr;
}
- nsAutoTArray<Attribute, 10> attrs;
+ AutoTArray<Attribute, 10> attrs;
proxy->DefaultTextAttributes(&attrs);
return ConvertToAtkTextAttributeSet(attrs);
}
static void
getCharacterExtentsCB(AtkText *aText, gint aOffset,
gint *aX, gint *aY,
gint *aWidth, gint *aHeight,
--- a/accessible/base/EventQueue.h
+++ b/accessible/base/EventQueue.h
@@ -71,17 +71,17 @@ private:
protected:
/**
* The document accessible reference owning this queue.
*/
DocAccessible* mDocument;
/**
- * Pending events array. Don't make this an nsAutoTArray; we use
+ * Pending events array. Don't make this an AutoTArray; we use
* SwapElements() on it.
*/
nsTArray<RefPtr<AccEvent> > mEvents;
};
} // namespace a11y
} // namespace mozilla
--- a/accessible/base/NotificationController.h
+++ b/accessible/base/NotificationController.h
@@ -270,17 +270,17 @@ private:
RefPtr<Accessible> mContainer;
// Array of inserted contents.
nsTArray<nsCOMPtr<nsIContent> > mInsertedContent;
};
/**
* A pending accessible tree update notifications for content insertions.
- * Don't make this an nsAutoTArray; we use SwapElements() on it.
+ * Don't make this an AutoTArray; we use SwapElements() on it.
*/
nsTArray<RefPtr<ContentInsertion> > mContentInsertions;
template<class T>
class nsCOMPtrHashKey : public PLDHashEntryHdr
{
public:
typedef T* KeyType;
@@ -304,17 +304,17 @@ private:
};
/**
* A pending accessible tree update notifications for rendered text changes.
*/
nsTHashtable<nsCOMPtrHashKey<nsIContent> > mTextHash;
/**
- * Other notifications like DOM events. Don't make this an nsAutoTArray; we
+ * Other notifications like DOM events. Don't make this an AutoTArray; we
* use SwapElements() on it.
*/
nsTArray<RefPtr<Notification> > mNotifications;
/**
* Holds all scheduled relocations.
*/
nsTArray<RefPtr<Accessible> > mRelocations;
--- a/accessible/base/TextRange-inl.h
+++ b/accessible/base/TextRange-inl.h
@@ -12,17 +12,17 @@
namespace mozilla {
namespace a11y {
inline Accessible*
TextRange::Container() const
{
uint32_t pos1 = 0, pos2 = 0;
- nsAutoTArray<Accessible*, 30> parents1, parents2;
+ AutoTArray<Accessible*, 30> parents1, parents2;
return CommonParent(mStartContainer, mEndContainer,
&parents1, &pos1, &parents2, &pos2);
}
} // namespace a11y
} // namespace mozilla
--- a/accessible/base/TextRange.cpp
+++ b/accessible/base/TextRange.cpp
@@ -19,17 +19,17 @@ bool
TextPoint::operator <(const TextPoint& aPoint) const
{
if (mContainer == aPoint.mContainer)
return mOffset < aPoint.mOffset;
// Build the chain of parents
Accessible* p1 = mContainer;
Accessible* p2 = aPoint.mContainer;
- nsAutoTArray<Accessible*, 30> parents1, parents2;
+ AutoTArray<Accessible*, 30> parents1, parents2;
do {
parents1.AppendElement(p1);
p1 = p1->Parent();
} while (p1);
do {
parents2.AppendElement(p2);
p2 = p2->Parent();
} while (p2);
@@ -71,17 +71,17 @@ TextRange::EmbeddedChildren(nsTArray<Acc
}
return;
}
Accessible* p1 = mStartContainer->GetChildAtOffset(mStartOffset);
Accessible* p2 = mEndContainer->GetChildAtOffset(mEndOffset);
uint32_t pos1 = 0, pos2 = 0;
- nsAutoTArray<Accessible*, 30> parents1, parents2;
+ AutoTArray<Accessible*, 30> parents1, parents2;
Accessible* container =
CommonParent(p1, p2, &parents1, &pos1, &parents2, &pos2);
// Traverse the tree up to the container and collect embedded objects.
for (uint32_t idx = 0; idx < pos1 - 1; idx++) {
Accessible* parent = parents1[idx + 1];
Accessible* child = parents1[idx];
uint32_t childCount = parent->ChildCount();
@@ -141,17 +141,17 @@ TextRange::Normalize(ETextUnit aUnit)
{
}
bool
TextRange::Crop(Accessible* aContainer)
{
uint32_t boundaryPos = 0, containerPos = 0;
- nsAutoTArray<Accessible*, 30> boundaryParents, containerParents;
+ AutoTArray<Accessible*, 30> boundaryParents, containerParents;
// Crop the start boundary.
Accessible* container = nullptr;
Accessible* boundary = mStartContainer->GetChildAtOffset(mStartOffset);
if (boundary != aContainer) {
CommonParent(boundary, aContainer, &boundaryParents, &boundaryPos,
&containerParents, &containerPos);
--- a/accessible/base/TreeWalker.h
+++ b/accessible/base/TreeWalker.h
@@ -82,17 +82,17 @@ private:
/**
* Pop state from stack.
*/
ChildrenIterator* PopState();
DocAccessible* mDoc;
Accessible* mContext;
nsIContent* mAnchorNode;
- nsAutoTArray<ChildrenIterator, 20> mStateStack;
+ AutoTArray<ChildrenIterator, 20> mStateStack;
int32_t mChildFilter;
uint32_t mFlags;
};
} // namespace a11y
} // namespace mozilla
#endif // mozilla_a11y_TreeWalker_h_
--- a/accessible/ipc/DocAccessibleChild.cpp
+++ b/accessible/ipc/DocAccessibleChild.cpp
@@ -1043,17 +1043,17 @@ DocAccessibleChild::RecvRowExtent(const
}
bool
DocAccessibleChild::RecvColHeaderCells(const uint64_t& aID,
nsTArray<uint64_t>* aCells)
{
TableCellAccessible* acc = IdToTableCellAccessible(aID);
if (acc) {
- nsAutoTArray<Accessible*, 10> headerCells;
+ AutoTArray<Accessible*, 10> headerCells;
acc->ColHeaderCells(&headerCells);
aCells->SetCapacity(headerCells.Length());
for (uint32_t i = 0; i < headerCells.Length(); ++i) {
aCells->AppendElement(
reinterpret_cast<uint64_t>(headerCells[i]->UniqueID()));
}
}
@@ -1061,17 +1061,17 @@ DocAccessibleChild::RecvColHeaderCells(c
}
bool
DocAccessibleChild::RecvRowHeaderCells(const uint64_t& aID,
nsTArray<uint64_t>* aCells)
{
TableCellAccessible* acc = IdToTableCellAccessible(aID);
if (acc) {
- nsAutoTArray<Accessible*, 10> headerCells;
+ AutoTArray<Accessible*, 10> headerCells;
acc->RowHeaderCells(&headerCells);
aCells->SetCapacity(headerCells.Length());
for (uint32_t i = 0; i < headerCells.Length(); ++i) {
aCells->AppendElement(
reinterpret_cast<uint64_t>(headerCells[i]->UniqueID()));
}
}
@@ -1363,17 +1363,17 @@ DocAccessibleChild::RecvTableSelectedRow
}
bool
DocAccessibleChild::RecvTableSelectedCells(const uint64_t& aID,
nsTArray<uint64_t>* aCellIDs)
{
TableAccessible* acc = IdToTableAccessible(aID);
if (acc) {
- nsAutoTArray<Accessible*, 30> cells;
+ AutoTArray<Accessible*, 30> cells;
acc->SelectedCells(&cells);
aCellIDs->SetCapacity(cells.Length());
for (uint32_t i = 0; i < cells.Length(); ++i) {
aCellIDs->AppendElement(
reinterpret_cast<uint64_t>(cells[i]->UniqueID()));
}
}
@@ -1524,17 +1524,17 @@ DocAccessibleChild::RecvAtkTableRowHeade
}
bool
DocAccessibleChild::RecvSelectedItems(const uint64_t& aID,
nsTArray<uint64_t>* aSelectedItemIDs)
{
Accessible* acc = IdToAccessibleSelect(aID);
if (acc) {
- nsAutoTArray<Accessible*, 10> selectedItems;
+ AutoTArray<Accessible*, 10> selectedItems;
acc->SelectedItems(&selectedItems);
aSelectedItemIDs->SetCapacity(selectedItems.Length());
for (size_t i = 0; i < selectedItems.Length(); ++i) {
aSelectedItemIDs->AppendElement(
reinterpret_cast<uint64_t>(selectedItems[i]->UniqueID()));
}
}
--- a/accessible/ipc/ProxyAccessible.cpp
+++ b/accessible/ipc/ProxyAccessible.cpp
@@ -773,17 +773,17 @@ ProxyAccessible::TableSelectedRowCount()
uint32_t count = 0;
Unused << mDoc->SendTableSelectedRowCount(mID, &count);
return count;
}
void
ProxyAccessible::TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs)
{
- nsAutoTArray<uint64_t, 30> cellIDs;
+ AutoTArray<uint64_t, 30> cellIDs;
Unused << mDoc->SendTableSelectedCells(mID, &cellIDs);
aCellIDs->SetCapacity(cellIDs.Length());
for (uint32_t i = 0; i < cellIDs.Length(); ++i) {
aCellIDs->AppendElement(mDoc->GetAccessible(cellIDs[i]));
}
}
void
@@ -852,17 +852,17 @@ ProxyAccessible::AtkTableRowHeader(int32
bool ok = false;
Unused << mDoc->SendAtkTableRowHeader(mID, aRow, &headerID, &ok);
return ok ? mDoc->GetAccessible(headerID) : nullptr;
}
void
ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems)
{
- nsAutoTArray<uint64_t, 10> itemIDs;
+ AutoTArray<uint64_t, 10> itemIDs;
Unused << mDoc->SendSelectedItems(mID, &itemIDs);
aSelectedItems->SetCapacity(itemIDs.Length());
for (size_t i = 0; i < itemIDs.Length(); ++i) {
aSelectedItems->AppendElement(mDoc->GetAccessible(itemIDs[i]));
}
}
uint32_t
--- a/accessible/mac/mozAccessible.mm
+++ b/accessible/mac/mozAccessible.mm
@@ -415,17 +415,17 @@ ConvertToNSArray(nsTArray<ProxyAccessibl
// Per the MathML 3 spec, the latter happens iff the linethickness
// attribute is of the form [zero-float][optional-unit]. In that case we
// set line thickness to zero and in the other cases we set it to one.
nsAutoString thickness;
if (accWrap) {
nsCOMPtr<nsIPersistentProperties> attributes = accWrap->Attributes();
nsAccUtils::GetAccAttr(attributes, nsGkAtoms::linethickness_, thickness);
} else {
- nsAutoTArray<Attribute, 10> attrs;
+ AutoTArray<Attribute, 10> attrs;
proxy->Attributes(&attrs);
for (size_t i = 0 ; i < attrs.Length() ; i++) {
if (attrs.ElementAt(i).Name() == "thickness") {
thickness = attrs.ElementAt(i).Value();
break;
}
}
}
@@ -679,21 +679,21 @@ ConvertToNSArray(nsTArray<ProxyAccessibl
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
AccessibleWrap* accWrap = [self getGeckoAccessible];
if (mChildren || (accWrap && !accWrap->AreChildrenCached()))
return mChildren;
// get the array of children.
if (accWrap) {
- nsAutoTArray<Accessible*, 10> childrenArray;
+ AutoTArray<Accessible*, 10> childrenArray;
accWrap->GetUnignoredChildren(&childrenArray);
mChildren = ConvertToNSArray(childrenArray);
} else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
- nsAutoTArray<ProxyAccessible*, 10> childrenArray;
+ AutoTArray<ProxyAccessible*, 10> childrenArray;
GetProxyUnignoredChildren(proxy, &childrenArray);
mChildren = ConvertToNSArray(childrenArray);
}
#ifdef DEBUG_hakan
// make sure we're not returning any ignored accessibles.
NSEnumerator *e = [mChildren objectEnumerator];
mozAccessible *m = nil;
--- a/accessible/mac/mozTableAccessible.mm
+++ b/accessible/mac/mozTableAccessible.mm
@@ -202,22 +202,22 @@
TableCellAccessible* cell = accWrap->AsTableCell();
if ([attribute isEqualToString:NSAccessibilityRowIndexRangeAttribute])
return [NSValue valueWithRange:NSMakeRange(cell->RowIdx(),
cell->RowExtent())];
if ([attribute isEqualToString:NSAccessibilityColumnIndexRangeAttribute])
return [NSValue valueWithRange:NSMakeRange(cell->ColIdx(),
cell->ColExtent())];
if ([attribute isEqualToString:NSAccessibilityRowHeaderUIElementsAttribute]) {
- nsAutoTArray<Accessible*, 10> headerCells;
+ AutoTArray<Accessible*, 10> headerCells;
cell->RowHeaderCells(&headerCells);
return ConvertToNSArray(headerCells);
}
if ([attribute isEqualToString:NSAccessibilityColumnHeaderUIElementsAttribute]) {
- nsAutoTArray<Accessible*, 10> headerCells;
+ AutoTArray<Accessible*, 10> headerCells;
cell->ColHeaderCells(&headerCells);
return ConvertToNSArray(headerCells);
}
} else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
if ([attribute isEqualToString:NSAccessibilityRowIndexRangeAttribute])
return [NSValue valueWithRange:NSMakeRange(proxy->RowIdx(),
proxy->RowExtent())];
if ([attribute isEqualToString:NSAccessibilityColumnIndexRangeAttribute])
--- a/accessible/windows/ia2/ia2Accessible.cpp
+++ b/accessible/windows/ia2/ia2Accessible.cpp
@@ -763,17 +763,17 @@ ia2Accessible::get_selectionRanges(IA2Ra
return E_INVALIDARG;
*aNRanges = 0;
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
- nsAutoTArray<TextRange, 1> ranges;
+ AutoTArray<TextRange, 1> ranges;
acc->Document()->SelectionRanges(&ranges);
uint32_t len = ranges.Length();
for (uint32_t idx = 0; idx < len; idx++) {
if (!ranges[idx].Crop(acc)) {
ranges.RemoveElementAt(idx);
}
}
--- a/accessible/windows/ia2/ia2AccessibleTable.cpp
+++ b/accessible/windows/ia2/ia2AccessibleTable.cpp
@@ -366,17 +366,17 @@ ia2AccessibleTable::get_selectedChildren
if (!aChildren || !aNChildren)
return E_INVALIDARG;
*aChildren = nullptr;
*aNChildren = 0;
if (!mTable)
return CO_E_OBJNOTCONNECTED;
- nsAutoTArray<uint32_t, 30> cellIndices;
+ AutoTArray<uint32_t, 30> cellIndices;
mTable->SelectedCellIndices(&cellIndices);
uint32_t maxCells = cellIndices.Length();
if (maxCells == 0)
return S_FALSE;
*aChildren = static_cast<LONG*>(moz_xmalloc(sizeof(LONG) * maxCells));
*aNChildren = maxCells;
@@ -658,17 +658,17 @@ ia2AccessibleTable::get_selectedCells(IU
if (!aCells || !aNSelectedCells)
return E_INVALIDARG;
*aCells = nullptr;
*aNSelectedCells = 0;
if (!mTable)
return CO_E_OBJNOTCONNECTED;
- nsAutoTArray<Accessible*, 30> cells;
+ AutoTArray<Accessible*, 30> cells;
mTable->SelectedCells(&cells);
if (cells.IsEmpty())
return S_FALSE;
*aCells =
static_cast<IUnknown**>(::CoTaskMemAlloc(sizeof(IUnknown*) *
cells.Length()));
if (!*aCells)
@@ -694,17 +694,17 @@ ia2AccessibleTable::get_selectedColumns(
if (!aColumns || !aNColumns)
return E_INVALIDARG;
*aColumns = nullptr;
*aNColumns = 0;
if (!mTable)
return CO_E_OBJNOTCONNECTED;
- nsAutoTArray<uint32_t, 30> colIndices;
+ AutoTArray<uint32_t, 30> colIndices;
mTable->SelectedColIndices(&colIndices);
uint32_t maxCols = colIndices.Length();
if (maxCols == 0)
return S_FALSE;
*aColumns = static_cast<LONG*>(moz_xmalloc(sizeof(LONG) * maxCols));
*aNColumns = maxCols;
@@ -724,17 +724,17 @@ ia2AccessibleTable::get_selectedRows(lon
if (!aRows || !aNRows)
return E_INVALIDARG;
*aRows = nullptr;
*aNRows = 0;
if (!mTable)
return CO_E_OBJNOTCONNECTED;
- nsAutoTArray<uint32_t, 30> rowIndices;
+ AutoTArray<uint32_t, 30> rowIndices;
mTable->SelectedRowIndices(&rowIndices);
uint32_t maxRows = rowIndices.Length();
if (maxRows == 0)
return S_FALSE;
*aRows = static_cast<LONG*>(moz_xmalloc(sizeof(LONG) * maxRows));
*aNRows = maxRows;
--- a/accessible/windows/ia2/ia2AccessibleTableCell.cpp
+++ b/accessible/windows/ia2/ia2AccessibleTableCell.cpp
@@ -95,17 +95,17 @@ ia2AccessibleTableCell::get_columnHeader
if (!aCellAccessibles || !aNColumnHeaderCells)
return E_INVALIDARG;
*aCellAccessibles = nullptr;
*aNColumnHeaderCells = 0;
if (!mTableCell)
return CO_E_OBJNOTCONNECTED;
- nsAutoTArray<Accessible*, 10> cells;
+ AutoTArray<Accessible*, 10> cells;
mTableCell->ColHeaderCells(&cells);
*aNColumnHeaderCells = cells.Length();
*aCellAccessibles =
static_cast<IUnknown**>(::CoTaskMemAlloc(sizeof(IUnknown*) *
cells.Length()));
if (!*aCellAccessibles)
@@ -167,17 +167,17 @@ ia2AccessibleTableCell::get_rowHeaderCel
if (!aCellAccessibles || !aNRowHeaderCells)
return E_INVALIDARG;
*aCellAccessibles = nullptr;
*aNRowHeaderCells = 0;
if (!mTableCell)
return CO_E_OBJNOTCONNECTED;
- nsAutoTArray<Accessible*, 10> cells;
+ AutoTArray<Accessible*, 10> cells;
mTableCell->RowHeaderCells(&cells);
*aNRowHeaderCells = cells.Length();
*aCellAccessibles =
static_cast<IUnknown**>(::CoTaskMemAlloc(sizeof(IUnknown*) *
cells.Length()));
if (!*aCellAccessibles)
return E_OUTOFMEMORY;
--- a/accessible/windows/ia2/ia2AccessibleText.cpp
+++ b/accessible/windows/ia2/ia2AccessibleText.cpp
@@ -56,17 +56,17 @@ ia2AccessibleText::get_attributes(long a
*aStartOffset = 0;
*aEndOffset = 0;
*aTextAttributes = nullptr;
int32_t startOffset = 0, endOffset = 0;
HRESULT hr;
if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
- nsAutoTArray<Attribute, 10> attrs;
+ AutoTArray<Attribute, 10> attrs;
proxy->TextAttributes(true, aOffset, &attrs, &startOffset, &endOffset);
hr = AccessibleWrap::ConvertToIA2Attributes(&attrs, aTextAttributes);
} else {
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsCOMPtr<nsIPersistentProperties> attributes =
--- a/accessible/windows/msaa/AccessibleWrap.cpp
+++ b/accessible/windows/msaa/AccessibleWrap.cpp
@@ -829,17 +829,17 @@ AccessibleWrap::get_accSelection(VARIANT
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
// TODO make this work with proxies.
if (IsProxy())
return E_NOTIMPL;
if (IsSelect()) {
- nsAutoTArray<Accessible*, 10> selectedItems;
+ AutoTArray<Accessible*, 10> selectedItems;
if (IsProxy()) {
nsTArray<ProxyAccessible*> proxies;
Proxy()->SelectedItems(&proxies);
uint32_t selectedCount = proxies.Length();
for (uint32_t i = 0; i < selectedCount; i++) {
selectedItems.AppendElement(WrapperFor(proxies[i]));
}
--- a/accessible/xpcom/xpcAccessibleHyperText.cpp
+++ b/accessible/xpcom/xpcAccessibleHyperText.cpp
@@ -366,17 +366,17 @@ xpcAccessibleHyperText::GetSelectionRang
if (!Intl())
return NS_ERROR_FAILURE;
nsresult rv = NS_OK;
nsCOMPtr<nsIMutableArray> xpcRanges =
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
- nsAutoTArray<TextRange, 1> ranges;
+ AutoTArray<TextRange, 1> ranges;
Intl()->SelectionRanges(&ranges);
uint32_t len = ranges.Length();
for (uint32_t idx = 0; idx < len; idx++)
xpcRanges->AppendElement(new xpcAccessibleTextRange(Move(ranges[idx])),
false);
xpcRanges.forget(aRanges);
return NS_OK;
--- a/accessible/xpcom/xpcAccessibleSelectable.cpp
+++ b/accessible/xpcom/xpcAccessibleSelectable.cpp
@@ -16,17 +16,17 @@ xpcAccessibleSelectable::GetSelectedItem
{
NS_ENSURE_ARG_POINTER(aSelectedItems);
*aSelectedItems = nullptr;
if (!Intl())
return NS_ERROR_FAILURE;
NS_PRECONDITION(Intl()->IsSelect(), "Called on non selectable widget!");
- nsAutoTArray<Accessible*, 10> items;
+ AutoTArray<Accessible*, 10> items;
Intl()->SelectedItems(&items);
uint32_t itemCount = items.Length();
if (itemCount == 0)
return NS_OK;
nsresult rv = NS_OK;
nsCOMPtr<nsIMutableArray> xpcItems =
--- a/accessible/xpcom/xpcAccessibleTable.cpp
+++ b/accessible/xpcom/xpcAccessibleTable.cpp
@@ -268,17 +268,17 @@ xpcAccessibleTable::GetSelectedCells(nsI
if (!Intl())
return NS_ERROR_FAILURE;
nsresult rv = NS_OK;
nsCOMPtr<nsIMutableArray> selCells =
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
- nsAutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray;
+ AutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray;
Intl()->SelectedCells(&cellsArray);
uint32_t totalCount = cellsArray.Length();
for (uint32_t idx = 0; idx < totalCount; idx++) {
Accessible* cell = cellsArray.ElementAt(idx);
selCells->AppendElement(static_cast<nsIAccessible*>(ToXPC(cell)), false);
}
@@ -294,17 +294,17 @@ xpcAccessibleTable::GetSelectedCellIndic
*aCellsArraySize = 0;
NS_ENSURE_ARG_POINTER(aCellsArray);
*aCellsArray = 0;
if (!Intl())
return NS_ERROR_FAILURE;
- nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> cellsArray;
+ AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> cellsArray;
Intl()->SelectedCellIndices(&cellsArray);
*aCellsArraySize = cellsArray.Length();
*aCellsArray = static_cast<int32_t*>
(moz_xmalloc(*aCellsArraySize * sizeof(int32_t)));
memcpy(*aCellsArray, cellsArray.Elements(),
*aCellsArraySize * sizeof(int32_t));
@@ -319,17 +319,17 @@ xpcAccessibleTable::GetSelectedColumnInd
*aColsArraySize = 0;
NS_ENSURE_ARG_POINTER(aColsArray);
*aColsArray = 0;
if (!Intl())
return NS_ERROR_FAILURE;
- nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> colsArray;
+ AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> colsArray;
Intl()->SelectedColIndices(&colsArray);
*aColsArraySize = colsArray.Length();
*aColsArray = static_cast<int32_t*>
(moz_xmalloc(*aColsArraySize * sizeof(int32_t)));
memcpy(*aColsArray, colsArray.Elements(),
*aColsArraySize * sizeof(int32_t));
@@ -344,17 +344,17 @@ xpcAccessibleTable::GetSelectedRowIndice
*aRowsArraySize = 0;
NS_ENSURE_ARG_POINTER(aRowsArray);
*aRowsArray = 0;
if (!Intl())
return NS_ERROR_FAILURE;
- nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> rowsArray;
+ AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> rowsArray;
Intl()->SelectedRowIndices(&rowsArray);
*aRowsArraySize = rowsArray.Length();
*aRowsArray = static_cast<int32_t*>
(moz_xmalloc(*aRowsArraySize * sizeof(int32_t)));
memcpy(*aRowsArray, rowsArray.Elements(),
*aRowsArraySize * sizeof(int32_t));
--- a/accessible/xpcom/xpcAccessibleTableCell.cpp
+++ b/accessible/xpcom/xpcAccessibleTableCell.cpp
@@ -103,17 +103,17 @@ NS_IMETHODIMP
xpcAccessibleTableCell::GetColumnHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nullptr;
if (!Intl())
return NS_ERROR_FAILURE;
- nsAutoTArray<Accessible*, 10> headerCells;
+ AutoTArray<Accessible*, 10> headerCells;
Intl()->ColHeaderCells(&headerCells);
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
NS_ENSURE_TRUE(cells, NS_ERROR_FAILURE);
for (uint32_t idx = 0; idx < headerCells.Length(); idx++) {
cells->AppendElement(static_cast<nsIAccessible*>(ToXPC(headerCells[idx])),
false);
@@ -127,17 +127,17 @@ NS_IMETHODIMP
xpcAccessibleTableCell::GetRowHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nullptr;
if (!Intl())
return NS_ERROR_FAILURE;
- nsAutoTArray<Accessible*, 10> headerCells;
+ AutoTArray<Accessible*, 10> headerCells;
Intl()->RowHeaderCells(&headerCells);
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
NS_ENSURE_TRUE(cells, NS_ERROR_FAILURE);
for (uint32_t idx = 0; idx < headerCells.Length(); idx++) {
cells->AppendElement(static_cast<nsIAccessible*>(ToXPC(headerCells[idx])),
false);
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -1683,17 +1683,17 @@ nsDocShell::FirePageHideNotification(boo
}
mContentViewer->PageHide(aIsUnload);
if (mTiming) {
mTiming->NotifyUnloadEventEnd();
}
- nsAutoTArray<nsCOMPtr<nsIDocShell>, 8> kids;
+ AutoTArray<nsCOMPtr<nsIDocShell>, 8> kids;
uint32_t n = mChildList.Length();
kids.SetCapacity(n);
for (uint32_t i = 0; i < n; i++) {
kids.AppendElement(do_QueryInterface(ChildAt(i)));
}
n = kids.Length();
for (uint32_t i = 0; i < n; ++i) {
@@ -4391,17 +4391,17 @@ nsDocShell::RemoveFromSessionHistory()
}
}
if (!internalHistory) {
return NS_OK;
}
int32_t index = 0;
sessionHistory->GetIndex(&index);
- nsAutoTArray<uint64_t, 16> ids;
+ AutoTArray<uint64_t, 16> ids;
ids.AppendElement(mHistoryID);
internalHistory->RemoveEntries(ids, index);
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::SetCreatedDynamically(bool aDynamic)
{
@@ -4482,17 +4482,17 @@ nsDocShell::ClearFrameHistory(nsISHEntry
GetRootSessionHistory(getter_AddRefs(rootSH));
nsCOMPtr<nsISHistoryInternal> history = do_QueryInterface(rootSH);
if (!history || !shcontainer) {
return;
}
int32_t count = 0;
shcontainer->GetChildCount(&count);
- nsAutoTArray<uint64_t, 16> ids;
+ AutoTArray<uint64_t, 16> ids;
for (int32_t i = 0; i < count; ++i) {
nsCOMPtr<nsISHEntry> child;
shcontainer->GetChildAt(i, getter_AddRefs(child));
if (child) {
uint64_t id = 0;
child->GetDocshellID(&id);
ids.AppendElement(id);
}
--- a/docshell/shistory/nsSHistory.cpp
+++ b/docshell/shistory/nsSHistory.cpp
@@ -1400,17 +1400,17 @@ nsSHistory::RemoveEntries(nsTArray<uint6
void
nsSHistory::RemoveDynEntries(int32_t aOldIndex, int32_t aNewIndex)
{
// Search for the entries which are in the current index,
// but not in the new one.
nsCOMPtr<nsISHEntry> originalSH;
GetEntryAtIndex(aOldIndex, false, getter_AddRefs(originalSH));
nsCOMPtr<nsISHContainer> originalContainer = do_QueryInterface(originalSH);
- nsAutoTArray<uint64_t, 16> toBeRemovedEntries;
+ AutoTArray<uint64_t, 16> toBeRemovedEntries;
if (originalContainer) {
nsTArray<uint64_t> originalDynDocShellIDs;
GetDynamicChildren(originalContainer, originalDynDocShellIDs, true);
if (originalDynDocShellIDs.Length()) {
nsCOMPtr<nsISHEntry> currentSH;
GetEntryAtIndex(aNewIndex, false, getter_AddRefs(currentSH));
nsCOMPtr<nsISHContainer> newContainer = do_QueryInterface(currentSH);
if (newContainer) {
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -573,17 +573,17 @@ EffectCompositor::ComposeAnimationRule(d
}
/* static */ void
EffectCompositor::GetOverriddenProperties(nsStyleContext* aStyleContext,
EffectSet& aEffectSet,
nsCSSPropertySet&
aPropertiesOverridden)
{
- nsAutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
+ AutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
{
nsCSSPropertySet propertiesToTrackAsSet;
for (KeyframeEffectReadOnly* effect : aEffectSet) {
for (const AnimationProperty& property : effect->Properties()) {
if (nsCSSProps::PropHasFlags(property.mProperty,
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR) &&
!propertiesToTrackAsSet.HasProperty(property.mProperty)) {
propertiesToTrackAsSet.AddProperty(property.mProperty);
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -1400,17 +1400,17 @@ BuildAnimationPropertyListFromKeyframeSe
JSContext* aCx,
Element* aTarget,
JS::ForOfIterator& aIterator,
nsTArray<AnimationProperty>& aResult,
ErrorResult& aRv)
{
// Convert the object in aIterator to sequence<Keyframe>, producing
// an array of OffsetIndexedKeyframe objects.
- nsAutoTArray<OffsetIndexedKeyframe,4> keyframes;
+ AutoTArray<OffsetIndexedKeyframe,4> keyframes;
if (!ConvertKeyframeSequence(aCx, aIterator, keyframes)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
// If the sequence<> had zero elements, we won't generate any
// keyframes.
if (keyframes.IsEmpty()) {
--- a/dom/base/DOMMatrix.cpp
+++ b/dom/base/DOMMatrix.cpp
@@ -262,31 +262,31 @@ template <typename T> void GetDataFromMa
aData[13] = static_cast<T>(aMatrix->M42());
aData[14] = static_cast<T>(aMatrix->M43());
aData[15] = static_cast<T>(aMatrix->M44());
}
void
DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle<JSObject*> aResult, ErrorResult& aRv) const
{
- nsAutoTArray<float, 16> arr;
+ AutoTArray<float, 16> arr;
arr.SetLength(16);
GetDataFromMatrix(this, arr.Elements());
JS::Rooted<JS::Value> value(aCx);
if (!ToJSValue(aCx, TypedArrayCreator<Float32Array>(arr), &value)) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
aResult.set(&value.toObject());
}
void
DOMMatrixReadOnly::ToFloat64Array(JSContext* aCx, JS::MutableHandle<JSObject*> aResult, ErrorResult& aRv) const
{
- nsAutoTArray<double, 16> arr;
+ AutoTArray<double, 16> arr;
arr.SetLength(16);
GetDataFromMatrix(this, arr.Elements());
JS::Rooted<JS::Value> value(aCx);
if (!ToJSValue(aCx, TypedArrayCreator<Float64Array>(arr), &value)) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
aResult.set(&value.toObject());
--- a/dom/base/File.cpp
+++ b/dom/base/File.cpp
@@ -254,17 +254,17 @@ Blob::ToFile()
}
return file.forget();
}
already_AddRefed<File>
Blob::ToFile(const nsAString& aName, ErrorResult& aRv) const
{
- nsAutoTArray<RefPtr<BlobImpl>, 1> blobImpls;
+ AutoTArray<RefPtr<BlobImpl>, 1> blobImpls;
blobImpls.AppendElement(mImpl);
nsAutoString contentType;
mImpl->GetType(contentType);
RefPtr<MultipartBlobImpl> impl =
MultipartBlobImpl::Create(blobImpls, aName, contentType, aRv);
if (NS_WARN_IF(aRv.Failed())) {
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -303,17 +303,17 @@ nsIContent::GetBaseURI(bool aTryUseXHRDo
// Start with document base
nsCOMPtr<nsIURI> base = doc->GetBaseURI(aTryUseXHRDocBaseURI);
// Collect array of xml:base attribute values up the parent chain. This
// is slightly slower for the case when there are xml:base attributes, but
// faster for the far more common case of there not being any such
// attributes.
// Also check for SVG elements which require special handling
- nsAutoTArray<nsString, 5> baseAttrs;
+ AutoTArray<nsString, 5> baseAttrs;
nsString attr;
const nsIContent *elem = this;
do {
// First check for SVG specialness (why is this SVG specific?)
if (elem->IsSVGElement()) {
nsIContent* bindingParent = elem->GetBindingParent();
if (bindingParent) {
nsXBLBinding* binding = bindingParent->GetXBLBinding();
@@ -1323,17 +1323,17 @@ public:
SUBTREE_UNBINDINGS_PER_RUNNABLE) {
sContentUnbinder->mLast->mNext = new ContentUnbinder();
sContentUnbinder->mLast = sContentUnbinder->mLast->mNext;
}
sContentUnbinder->mLast->mSubtreeRoots.AppendElement(aSubtreeRoot);
}
private:
- nsAutoTArray<nsCOMPtr<nsIContent>,
+ AutoTArray<nsCOMPtr<nsIContent>,
SUBTREE_UNBINDINGS_PER_RUNNABLE> mSubtreeRoots;
RefPtr<ContentUnbinder> mNext;
ContentUnbinder* mLast;
static ContentUnbinder* sContentUnbinder;
};
ContentUnbinder* ContentUnbinder::sContentUnbinder = nullptr;
@@ -1523,21 +1523,21 @@ FragmentOrElement::CanSkipInCC(nsINode*
}
if (!gCCBlackMarkedNodes) {
gCCBlackMarkedNodes = new nsTHashtable<nsPtrHashKey<nsINode> >(1020);
}
// nodesToUnpurple contains nodes which will be removed
// from the purple buffer if the DOM tree is black.
- nsAutoTArray<nsIContent*, 1020> nodesToUnpurple;
+ AutoTArray<nsIContent*, 1020> nodesToUnpurple;
// grayNodes need script traverse, so they aren't removed from
// the purple buffer, but are marked to be in black subtree so that
// traverse is faster.
- nsAutoTArray<nsINode*, 1020> grayNodes;
+ AutoTArray<nsINode*, 1020> grayNodes;
bool foundBlack = root->IsBlack();
if (root != currentDoc) {
currentDoc = nullptr;
if (NeedsScriptTraverse(root)) {
grayNodes.AppendElement(root);
} else if (static_cast<nsIContent*>(root)->IsPurple()) {
nodesToUnpurple.AppendElement(static_cast<nsIContent*>(root));
@@ -1593,18 +1593,18 @@ FragmentOrElement::CanSkipInCC(nsINode*
// Can't remove currently handled purple node.
if (purple != aNode) {
purple->RemovePurple();
}
}
return !NeedsScriptTraverse(aNode);
}
-nsAutoTArray<nsINode*, 1020>* gPurpleRoots = nullptr;
-nsAutoTArray<nsIContent*, 1020>* gNodesToUnbind = nullptr;
+AutoTArray<nsINode*, 1020>* gPurpleRoots = nullptr;
+AutoTArray<nsIContent*, 1020>* gNodesToUnbind = nullptr;
void ClearCycleCollectorCleanupData()
{
if (gPurpleRoots) {
uint32_t len = gPurpleRoots->Length();
for (uint32_t i = 0; i < len; ++i) {
nsINode* n = gPurpleRoots->ElementAt(i);
n->SetIsPurpleRoot(false);
@@ -1697,17 +1697,17 @@ FragmentOrElement::CanSkip(nsINode* aNod
// Subtree has been traversed already, and aNode has
// been handled in a way that doesn't require revisiting it.
if (root->IsPurpleRoot()) {
return false;
}
// nodesToClear contains nodes which are either purple or
// gray.
- nsAutoTArray<nsIContent*, 1020> nodesToClear;
+ AutoTArray<nsIContent*, 1020> nodesToClear;
bool foundBlack = root->IsBlack();
bool domOnlyCycle = false;
if (root != currentDoc) {
currentDoc = nullptr;
if (!foundBlack) {
domOnlyCycle = static_cast<nsIContent*>(root)->OwnedOnlyByTheDOMTree();
}
@@ -1746,29 +1746,29 @@ FragmentOrElement::CanSkip(nsINode* aNod
}
}
}
if (!currentDoc || !foundBlack) {
root->SetIsPurpleRoot(true);
if (domOnlyCycle) {
if (!gNodesToUnbind) {
- gNodesToUnbind = new nsAutoTArray<nsIContent*, 1020>();
+ gNodesToUnbind = new AutoTArray<nsIContent*, 1020>();
}
gNodesToUnbind->AppendElement(static_cast<nsIContent*>(root));
for (uint32_t i = 0; i < nodesToClear.Length(); ++i) {
nsIContent* n = nodesToClear[i];
if ((n != aNode || aRemovingAllowed) && n->IsPurple()) {
n->RemovePurple();
}
}
return true;
} else {
if (!gPurpleRoots) {
- gPurpleRoots = new nsAutoTArray<nsINode*, 1020>();
+ gPurpleRoots = new AutoTArray<nsINode*, 1020>();
}
gPurpleRoots->AppendElement(root);
}
}
if (!foundBlack) {
return false;
}
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -861,17 +861,17 @@ Navigator::RemoveIdleObserver(MozIdleObs
if (NS_FAILED(mWindow->UnregisterIdleObserver(obs))) {
NS_WARNING("Failed to remove idle observer.");
}
}
bool
Navigator::Vibrate(uint32_t aDuration)
{
- nsAutoTArray<uint32_t, 1> pattern;
+ AutoTArray<uint32_t, 1> pattern;
pattern.AppendElement(aDuration);
return Vibrate(pattern);
}
bool
Navigator::Vibrate(const nsTArray<uint32_t>& aPattern)
{
if (!mWindow) {
--- a/dom/base/nsContentIterator.cpp
+++ b/dom/base/nsContentIterator.cpp
@@ -150,17 +150,17 @@ protected:
virtual void LastRelease();
nsCOMPtr<nsINode> mCurNode;
nsCOMPtr<nsINode> mFirst;
nsCOMPtr<nsINode> mLast;
nsCOMPtr<nsINode> mCommonParent;
// used by nsContentIterator to cache indices
- nsAutoTArray<int32_t, 8> mIndexes;
+ AutoTArray<int32_t, 8> mIndexes;
// used by nsSubtreeIterator to cache indices. Why put them in the base
// class? Because otherwise I have to duplicate the routines GetNextSibling
// etc across both classes, with slight variations for caching. Or
// alternately, create a base class for the cache itself and have all the
// cache manipulation go through a vptr. I think this is the best space and
// speed combo, even though it's ugly.
int32_t mCachedIndex;
@@ -1053,18 +1053,18 @@ nsContentIterator::PositionAt(nsINode* a
firstNode, firstOffset,
lastNode, lastOffset)))) {
mIsDone = true;
return NS_ERROR_FAILURE;
}
// We can be at ANY node in the sequence. Need to regenerate the array of
// indexes back to the root or common parent!
- nsAutoTArray<nsINode*, 8> oldParentStack;
- nsAutoTArray<int32_t, 8> newIndexes;
+ AutoTArray<nsINode*, 8> oldParentStack;
+ AutoTArray<int32_t, 8> newIndexes;
// Get a list of the parents up to the root, then compare the new node with
// entries in that array until we find a match (lowest common ancestor). If
// no match, use IndexOf, take the parent, and repeat. This avoids using
// IndexOf() N times on possibly large arrays. We still end up doing it a
// fair bit. It's better to use Clone() if possible.
// we know the depth we're down (though we may not have started at the top).
@@ -1208,18 +1208,18 @@ protected:
nsContentSubtreeIterator(const nsContentSubtreeIterator&);
nsContentSubtreeIterator& operator=(const nsContentSubtreeIterator&);
virtual void LastRelease() override;
RefPtr<nsRange> mRange;
// these arrays all typically are used and have elements
- nsAutoTArray<nsIContent*, 8> mEndNodes;
- nsAutoTArray<int32_t, 8> mEndOffsets;
+ AutoTArray<nsIContent*, 8> mEndNodes;
+ AutoTArray<int32_t, 8> mEndOffsets;
};
NS_IMPL_ADDREF_INHERITED(nsContentSubtreeIterator, nsContentIterator)
NS_IMPL_RELEASE_INHERITED(nsContentSubtreeIterator, nsContentIterator)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsContentSubtreeIterator)
NS_INTERFACE_MAP_END_INHERITING(nsContentIterator)
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -543,17 +543,17 @@ void
nsContentList::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
{
if (!(aFlags & JSITER_HIDDEN)) {
return;
}
BringSelfUpToDate(true);
- nsAutoTArray<nsIAtom*, 8> atoms;
+ AutoTArray<nsIAtom*, 8> atoms;
for (uint32_t i = 0; i < mElements.Length(); ++i) {
nsIContent *content = mElements.ElementAt(i);
if (content->HasID()) {
nsIAtom* id = content->GetID();
MOZ_ASSERT(id != nsGkAtoms::_empty,
"Empty ids don't get atomized");
if (!atoms.Contains(id)) {
atoms.AppendElement(id);
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -2281,17 +2281,17 @@ nsINode*
nsContentUtils::GetCommonAncestor(nsINode* aNode1,
nsINode* aNode2)
{
if (aNode1 == aNode2) {
return aNode1;
}
// Build the chain of parents
- nsAutoTArray<nsINode*, 30> parents1, parents2;
+ AutoTArray<nsINode*, 30> parents1, parents2;
do {
parents1.AppendElement(aNode1);
aNode1 = aNode1->GetParentNode();
} while (aNode1);
do {
parents2.AppendElement(aNode2);
aNode2 = aNode2->GetParentNode();
} while (aNode2);
@@ -2330,17 +2330,17 @@ nsContentUtils::ComparePoints(nsINode* a
bool* aDisconnected)
{
if (aParent1 == aParent2) {
return aOffset1 < aOffset2 ? -1 :
aOffset1 > aOffset2 ? 1 :
0;
}
- nsAutoTArray<nsINode*, 32> parents1, parents2;
+ AutoTArray<nsINode*, 32> parents1, parents2;
nsINode* node1 = aParent1;
nsINode* node2 = aParent2;
do {
parents1.AppendElement(node1);
node1 = node1->GetParentNode();
} while (node1);
do {
parents2.AppendElement(node2);
@@ -4282,17 +4282,17 @@ nsContentUtils::CreateContextualFragment
(document->GetCompatibilityMode() ==
eCompatibility_NavQuirks),
aPreventScriptExecution);
}
return frag.forget();
}
- nsAutoTArray<nsString, 32> tagStack;
+ AutoTArray<nsString, 32> tagStack;
nsAutoString uriStr, nameStr;
nsCOMPtr<nsIContent> content = do_QueryInterface(aContextNode);
// just in case we have a text node
if (content && !content->IsElement())
content = content->GetParent();
while (content && content->IsElement()) {
nsString& tagName = *tagStack.AppendElement();
@@ -6848,17 +6848,17 @@ void
nsContentUtils::FireMutationEventsForDirectParsing(nsIDocument* aDoc,
nsIContent* aDest,
int32_t aOldChildCount)
{
// Fire mutation events. Optimize for the case when there are no listeners
int32_t newChildCount = aDest->GetChildCount();
if (newChildCount && nsContentUtils::
HasMutationListeners(aDoc, NS_EVENT_BITS_MUTATION_NODEINSERTED)) {
- nsAutoTArray<nsCOMPtr<nsIContent>, 50> childNodes;
+ AutoTArray<nsCOMPtr<nsIContent>, 50> childNodes;
NS_ASSERTION(newChildCount - aOldChildCount >= 0,
"What, some unexpected dom mutation has happened?");
childNodes.SetCapacity(newChildCount - aOldChildCount);
for (nsIContent* child = aDest->GetFirstChild();
child;
child = child->GetNextSibling()) {
childNodes.AppendElement(child);
}
@@ -7915,17 +7915,17 @@ nsContentUtils::FirePageHideEvent(nsIDoc
EventTarget* aChromeEventHandler)
{
nsCOMPtr<nsIDocument> doc = aItem->GetDocument();
NS_ASSERTION(doc, "What happened here?");
doc->OnPageHide(true, aChromeEventHandler);
int32_t childCount = 0;
aItem->GetChildCount(&childCount);
- nsAutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
+ AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
kids.AppendElements(childCount);
for (int32_t i = 0; i < childCount; ++i) {
aItem->GetChildAt(i, getter_AddRefs(kids[i]));
}
for (uint32_t i = 0; i < kids.Length(); ++i) {
if (kids[i]) {
FirePageHideEvent(kids[i], aChromeEventHandler);
@@ -7940,17 +7940,17 @@ nsContentUtils::FirePageHideEvent(nsIDoc
/* static */
void
nsContentUtils::FirePageShowEvent(nsIDocShellTreeItem* aItem,
EventTarget* aChromeEventHandler,
bool aFireIfShowing)
{
int32_t childCount = 0;
aItem->GetChildCount(&childCount);
- nsAutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
+ AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
kids.AppendElements(childCount);
for (int32_t i = 0; i < childCount; ++i) {
aItem->GetChildAt(i, getter_AddRefs(kids[i]));
}
for (uint32_t i = 0; i < kids.Length(); ++i) {
if (kids[i]) {
FirePageShowEvent(kids[i], aChromeEventHandler, aFireIfShowing);
@@ -8529,17 +8529,17 @@ private:
default:
aOut.Append(c);
break;
}
}
}
}
- nsAutoTArray<Unit, STRING_BUFFER_UNITS> mUnits;
+ AutoTArray<Unit, STRING_BUFFER_UNITS> mUnits;
nsAutoPtr<StringBuilder> mNext;
StringBuilder* mLast;
// mLength is used only in the first StringBuilder object in the linked list.
uint32_t mLength;
};
} // namespace
--- a/dom/base/nsDOMMutationObserver.cpp
+++ b/dom/base/nsDOMMutationObserver.cpp
@@ -17,25 +17,25 @@
#include "nsIScriptGlobalObject.h"
#include "nsServiceManagerUtils.h"
#include "nsTextFragment.h"
#include "nsThreadUtils.h"
using mozilla::dom::TreeOrderComparator;
using mozilla::dom::Animation;
-nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
+AutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
nsDOMMutationObserver::sScheduledMutationObservers = nullptr;
nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr;
uint32_t nsDOMMutationObserver::sMutationLevel = 0;
uint64_t nsDOMMutationObserver::sCount = 0;
-nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
+AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
nsDOMMutationObserver::sCurrentlyHandlingObservers = nullptr;
nsINodeList*
nsDOMMutationRecord::AddedNodes()
{
if (!mAddedNodes) {
mAddedNodes = new nsSimpleContentList(mTarget);
}
@@ -580,17 +580,17 @@ nsDOMMutationObserver::ScheduleForRun()
mWaitingForRun = true;
RescheduleForRun();
}
void
nsDOMMutationObserver::RescheduleForRun()
{
if (!sScheduledMutationObservers) {
- sScheduledMutationObservers = new nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
+ sScheduledMutationObservers = new AutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
}
bool didInsert = false;
for (uint32_t i = 0; i < sScheduledMutationObservers->Length(); ++i) {
if (static_cast<nsDOMMutationObserver*>((*sScheduledMutationObservers)[i])
->mId > mId) {
sScheduledMutationObservers->InsertElementAt(i, this);
didInsert = true;
@@ -877,17 +877,17 @@ nsDOMMutationObserver::HandleMutationsIn
// This does *not* catch all cases, but should work for stuff running
// in separate tabs.
return;
}
nsTArray<RefPtr<nsDOMMutationObserver> >* suppressedObservers = nullptr;
while (sScheduledMutationObservers) {
- nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>* observers =
+ AutoTArray<RefPtr<nsDOMMutationObserver>, 4>* observers =
sScheduledMutationObservers;
sScheduledMutationObservers = nullptr;
for (uint32_t i = 0; i < observers->Length(); ++i) {
sCurrentObserver = static_cast<nsDOMMutationObserver*>((*observers)[i]);
if (!sCurrentObserver->Suppressed()) {
sCurrentObserver->HandleMutation();
} else {
if (!suppressedObservers) {
@@ -990,17 +990,17 @@ nsDOMMutationObserver::AddCurrentlyHandl
if (aMutationLevel > 1) {
// MutationObserver must be in the currently handling observer list
// in all the nested levels.
AddCurrentlyHandlingObserver(aObserver, aMutationLevel - 1);
}
if (!sCurrentlyHandlingObservers) {
sCurrentlyHandlingObservers =
- new nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
+ new AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
}
while (sCurrentlyHandlingObservers->Length() < aMutationLevel) {
sCurrentlyHandlingObservers->InsertElementAt(
sCurrentlyHandlingObservers->Length());
}
uint32_t index = aMutationLevel - 1;
--- a/dom/base/nsDOMMutationObserver.h
+++ b/dom/base/nsDOMMutationObserver.h
@@ -600,37 +600,37 @@ protected:
uint32_t aMutationLevel);
nsCOMPtr<nsPIDOMWindowInner> mOwner;
nsCOMArray<nsMutationReceiver> mReceivers;
nsClassHashtable<nsISupportsHashKey,
nsCOMArray<nsMutationReceiver> > mTransientReceivers;
// MutationRecords which are being constructed.
- nsAutoTArray<nsDOMMutationRecord*, 4> mCurrentMutations;
+ AutoTArray<nsDOMMutationRecord*, 4> mCurrentMutations;
// MutationRecords which will be handed to the callback at the end of
// the microtask.
RefPtr<nsDOMMutationRecord> mFirstPendingMutation;
nsDOMMutationRecord* mLastPendingMutation;
uint32_t mPendingMutationCount;
RefPtr<mozilla::dom::MutationCallback> mCallback;
bool mWaitingForRun;
bool mIsChrome;
bool mMergeAttributeRecords;
uint64_t mId;
static uint64_t sCount;
- static nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>* sScheduledMutationObservers;
+ static AutoTArray<RefPtr<nsDOMMutationObserver>, 4>* sScheduledMutationObservers;
static nsDOMMutationObserver* sCurrentObserver;
static uint32_t sMutationLevel;
- static nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
+ static AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
sCurrentlyHandlingObservers;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsDOMMutationObserver, NS_DOM_MUTATION_OBSERVER_IID)
class nsAutoMutationBatch
{
public:
@@ -735,17 +735,17 @@ private:
struct BatchObserver
{
nsDOMMutationObserver* mObserver;
bool mWantsChildList;
};
static nsAutoMutationBatch* sCurrentBatch;
nsAutoMutationBatch* mPreviousBatch;
- nsAutoTArray<BatchObserver, 2> mObservers;
+ AutoTArray<BatchObserver, 2> mObservers;
nsTArray<nsCOMPtr<nsIContent> > mRemovedNodes;
nsTArray<nsCOMPtr<nsIContent> > mAddedNodes;
nsINode* mBatchTarget;
bool mRemovalDone;
bool mFromFirstToLast;
bool mAllowNestedBatches;
nsCOMPtr<nsINode> mPrevSibling;
nsCOMPtr<nsINode> mNextSibling;
@@ -902,17 +902,17 @@ private:
struct Entry
{
RefPtr<mozilla::dom::Animation> mAnimation;
State mState;
bool mChanged;
};
static nsAutoAnimationMutationBatch* sCurrentBatch;
- nsAutoTArray<nsDOMMutationObserver*, 2> mObservers;
+ AutoTArray<nsDOMMutationObserver*, 2> mObservers;
typedef nsTArray<Entry> EntryArray;
nsClassHashtable<nsPtrHashKey<nsINode>, EntryArray> mEntryTable;
// List of nodes referred to by mEntryTable so we can sort them
nsTArray<nsINode*> mBatchTargets;
};
inline
nsDOMMutationObserver*
--- a/dom/base/nsDOMTokenList.cpp
+++ b/dom/base/nsDOMTokenList.cpp
@@ -129,17 +129,17 @@ nsDOMTokenList::AddInternal(const nsAttr
nsAutoString resultStr;
if (aAttr) {
aAttr->ToString(resultStr);
}
bool oneWasAdded = false;
- nsAutoTArray<nsString, 10> addedClasses;
+ AutoTArray<nsString, 10> addedClasses;
for (uint32_t i = 0, l = aTokens.Length(); i < l; ++i) {
const nsString& aToken = aTokens[i];
if ((aAttr && aAttr->Contains(aToken)) ||
addedClasses.Contains(aToken)) {
continue;
}
@@ -170,17 +170,17 @@ nsDOMTokenList::Add(const nsTArray<nsStr
const nsAttrValue* attr = GetParsedAttr();
AddInternal(attr, aTokens);
}
void
nsDOMTokenList::Add(const nsAString& aToken, mozilla::ErrorResult& aError)
{
- nsAutoTArray<nsString, 1> tokens;
+ AutoTArray<nsString, 1> tokens;
tokens.AppendElement(aToken);
Add(tokens, aError);
}
void
nsDOMTokenList::RemoveInternal(const nsAttrValue* aAttr,
const nsTArray<nsString>& aTokens)
{
@@ -256,17 +256,17 @@ nsDOMTokenList::Remove(const nsTArray<ns
}
RemoveInternal(attr, aTokens);
}
void
nsDOMTokenList::Remove(const nsAString& aToken, mozilla::ErrorResult& aError)
{
- nsAutoTArray<nsString, 1> tokens;
+ AutoTArray<nsString, 1> tokens;
tokens.AppendElement(aToken);
Remove(tokens, aError);
}
bool
nsDOMTokenList::Toggle(const nsAString& aToken,
const Optional<bool>& aForce,
ErrorResult& aError)
@@ -276,17 +276,17 @@ nsDOMTokenList::Toggle(const nsAString&
return false;
}
const nsAttrValue* attr = GetParsedAttr();
const bool forceOn = aForce.WasPassed() && aForce.Value();
const bool forceOff = aForce.WasPassed() && !aForce.Value();
bool isPresent = attr && attr->Contains(aToken);
- nsAutoTArray<nsString, 1> tokens;
+ AutoTArray<nsString, 1> tokens;
(*tokens.AppendElement()).Rebind(aToken.Data(), aToken.Length());
if (isPresent) {
if (!forceOn) {
RemoveInternal(attr, tokens);
isPresent = false;
}
} else {
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3361,17 +3361,17 @@ nsDocument::NodesFromRectHelper(float aX
nsIPresShell *ps = GetShell();
NS_ENSURE_STATE(ps);
nsIFrame *rootFrame = ps->GetRootFrame();
// XUL docs, unlike HTML, have no frame tree until everything's done loading
if (!rootFrame)
return NS_OK; // return nothing to premature XUL callers as a reminder to wait
- nsAutoTArray<nsIFrame*,8> outFrames;
+ AutoTArray<nsIFrame*,8> outFrames;
nsLayoutUtils::GetFramesForArea(rootFrame, rect, outFrames,
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC |
(aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
// Used to filter out repeated elements in sequence.
nsIContent* lastAdded = nullptr;
for (uint32_t i = 0; i < outFrames.Length(); i++) {
@@ -11183,17 +11183,17 @@ nsDocument::RestorePreviousFullScreenSta
NS_ASSERTION(!IsFullScreenDoc() || !FullscreenRoots::IsEmpty(),
"Should have at least 1 fullscreen root when fullscreen!");
if (!IsFullScreenDoc() || !GetWindow() || FullscreenRoots::IsEmpty()) {
return;
}
nsCOMPtr<nsIDocument> fullScreenDoc = GetFullscreenLeaf(this);
- nsAutoTArray<nsDocument*, 8> exitDocs;
+ AutoTArray<nsDocument*, 8> exitDocs;
nsIDocument* doc = fullScreenDoc;
// Collect all subdocuments.
for (; doc != this; doc = doc->GetParentDocument()) {
exitDocs.AppendElement(static_cast<nsDocument*>(doc));
}
MOZ_ASSERT(doc == this, "Must have reached this doc");
// Collect all ancestor documents which we are going to change.
@@ -11800,17 +11800,17 @@ nsDocument::ApplyFullscreen(const Fullsc
// to detect if the origin which is fullscreen has changed.
nsCOMPtr<nsIDocument> previousFullscreenDoc = GetFullscreenLeaf(this);
// Stores a list of documents which we must dispatch "mozfullscreenchange"
// too. We're required by the spec to dispatch the events in root-to-leaf
// order, but we traverse the doctree in a leaf-to-root order, so we save
// references to the documents we must dispatch to so that we get the order
// as specified.
- nsAutoTArray<nsIDocument*, 8> changed;
+ AutoTArray<nsIDocument*, 8> changed;
// Remember the root document, so that if a full-screen document is hidden
// we can reset full-screen state in the remaining visible full-screen documents.
nsIDocument* fullScreenRootDoc = nsContentUtils::GetRootDocument(this);
// If a document is already in fullscreen, then unlock the mouse pointer
// before setting a new document to fullscreen
UnlockPointer();
--- a/dom/base/nsDocumentEncoder.cpp
+++ b/dom/base/nsDocumentEncoder.cpp
@@ -157,21 +157,21 @@ protected:
nsString mMimeType;
nsCString mCharset;
uint32_t mFlags;
uint32_t mWrapColumn;
uint32_t mStartDepth;
uint32_t mEndDepth;
int32_t mStartRootIndex;
int32_t mEndRootIndex;
- nsAutoTArray<nsINode*, 8> mCommonAncestors;
- nsAutoTArray<nsIContent*, 8> mStartNodes;
- nsAutoTArray<int32_t, 8> mStartOffsets;
- nsAutoTArray<nsIContent*, 8> mEndNodes;
- nsAutoTArray<int32_t, 8> mEndOffsets;
+ AutoTArray<nsINode*, 8> mCommonAncestors;
+ AutoTArray<nsIContent*, 8> mStartNodes;
+ AutoTArray<int32_t, 8> mStartOffsets;
+ AutoTArray<nsIContent*, 8> mEndNodes;
+ AutoTArray<int32_t, 8> mEndOffsets;
bool mHaltRangeHint;
// Used when context has already been serialized for
// table cell selections (where parent is <tr>)
bool mDisableContextSerialize;
bool mIsCopying; // Set to true only while copying
bool mNodeIsContainer;
nsStringBuffer* mCachedBuffer;
};
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -1365,17 +1365,17 @@ nsFocusManager::GetCommonAncestor(nsPIDO
NS_ENSURE_TRUE(aWindow1 && aWindow2, nullptr);
nsCOMPtr<nsIDocShellTreeItem> dsti1 = aWindow1->GetDocShell();
NS_ENSURE_TRUE(dsti1, nullptr);
nsCOMPtr<nsIDocShellTreeItem> dsti2 = aWindow2->GetDocShell();
NS_ENSURE_TRUE(dsti2, nullptr);
- nsAutoTArray<nsIDocShellTreeItem*, 30> parents1, parents2;
+ AutoTArray<nsIDocShellTreeItem*, 30> parents1, parents2;
do {
parents1.AppendElement(dsti1);
nsCOMPtr<nsIDocShellTreeItem> parentDsti1;
dsti1->GetParent(getter_AddRefs(parentDsti1));
dsti1.swap(parentDsti1);
} while (dsti1);
do {
parents2.AppendElement(dsti2);
--- a/dom/base/nsFrameMessageManager.h
+++ b/dom/base/nsFrameMessageManager.h
@@ -394,17 +394,17 @@ protected:
bool aRunInGlobalScope,
bool aShouldCache,
JS::MutableHandle<JSScript*> aScriptp);
void TryCacheLoadAndCompileScript(const nsAString& aURL,
bool aRunInGlobalScope);
bool InitChildGlobalInternal(nsISupports* aScope, const nsACString& aID);
nsCOMPtr<nsIXPConnectJSObjectHolder> mGlobal;
nsCOMPtr<nsIPrincipal> mPrincipal;
- nsAutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;
+ AutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;
static nsDataHashtable<nsStringHashKey, nsMessageManagerScriptHolder*>* sCachedScripts;
static nsScriptCacheCleaner* sScriptCacheCleaner;
};
class nsScriptCacheCleaner final : public nsIObserver
{
~nsScriptCacheCleaner() {}
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -1815,17 +1815,17 @@ public:
MOZ_ASSERT(aObserver, "Must have observer");
mObservers.AppendElement(aObserver);
}
const nsTArray< nsCOMPtr<nsIObserver> > & Observers() {
return mObservers;
}
protected:
- nsAutoTArray< nsCOMPtr<nsIObserver>, 8 > mObservers;
+ AutoTArray< nsCOMPtr<nsIObserver>, 8 > mObservers;
};
/**
* Request an external resource document for aURI. This will return the
* resource document if available. If one is not available yet, it will
* start loading as needed, and the pending load object will be returned in
* aPendingLoad so that the caller can register an observer to wait for the
* load. If this function returns null and doesn't return a pending load,
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -590,17 +590,17 @@ nsINode::RemoveChild(nsIDOMNode* aOldChi
}
return rv.StealNSResult();
}
void
nsINode::Normalize()
{
// First collect list of nodes to be removed
- nsAutoTArray<nsCOMPtr<nsIContent>, 50> nodes;
+ AutoTArray<nsCOMPtr<nsIContent>, 50> nodes;
bool canMerge = false;
for (nsIContent* node = this->GetFirstChild();
node;
node = node->GetNextNode(this)) {
if (node->NodeType() != nsIDOMNode::TEXT_NODE) {
canMerge = false;
continue;
@@ -859,17 +859,17 @@ nsINode::CompareDocumentPosition(nsINode
MOZ_ASSERT(GetParentNode() == aOtherNode.GetParentNode());
return static_cast<uint16_t>(nsIDOMNode::DOCUMENT_POSITION_PRECEDING);
}
if (GetNextSibling() == &aOtherNode) {
MOZ_ASSERT(GetParentNode() == aOtherNode.GetParentNode());
return static_cast<uint16_t>(nsIDOMNode::DOCUMENT_POSITION_FOLLOWING);
}
- nsAutoTArray<const nsINode*, 32> parents1, parents2;
+ AutoTArray<const nsINode*, 32> parents1, parents2;
const nsINode *node1 = &aOtherNode, *node2 = this;
// Check if either node is an attribute
const Attr* attr1 = nullptr;
if (node1->IsNodeOfType(nsINode::eATTRIBUTE)) {
attr1 = static_cast<const Attr*>(node1);
const Element* elem = attr1->GetElement();
@@ -1987,17 +1987,17 @@ nsINode::ReplaceOrInsertBefore(bool aRep
nodeToInsertBefore = aRefChild;
}
if (nodeToInsertBefore == aNewChild) {
// We're going to remove aNewChild from its parent, so use its next sibling
// as the node to insert before.
nodeToInsertBefore = nodeToInsertBefore->GetNextSibling();
}
- Maybe<nsAutoTArray<nsCOMPtr<nsIContent>, 50> > fragChildren;
+ Maybe<AutoTArray<nsCOMPtr<nsIContent>, 50> > fragChildren;
// Remove the new child from the old parent if one exists
nsIContent* newContent = aNewChild->AsContent();
nsCOMPtr<nsINode> oldParent = newContent->GetParentNode();
if (oldParent) {
int32_t removeIndex = oldParent->IndexOf(newContent);
if (removeIndex < 0) {
// newContent is anonymous. We can't deal with this, so just bail
@@ -2697,17 +2697,17 @@ nsINode::QuerySelector(const nsAString&
already_AddRefed<nsINodeList>
nsINode::QuerySelectorAll(const nsAString& aSelector, ErrorResult& aResult)
{
RefPtr<nsSimpleContentList> contentList = new nsSimpleContentList(this);
nsCSSSelectorList* selectorList = ParseSelectorList(aSelector, aResult);
if (selectorList) {
- FindMatchingElements<false, nsAutoTArray<Element*, 128>>(this,
+ FindMatchingElements<false, AutoTArray<Element*, 128>>(this,
selectorList,
*contentList,
aResult);
} else {
// Either we failed (and aResult already has the exception), or this
// is a pseudo-element-only selector that matches nothing.
}
--- a/dom/base/nsLineBreaker.cpp
+++ b/dom/base/nsLineBreaker.cpp
@@ -54,17 +54,17 @@ SetupCapitalization(const char16_t* aWor
}
}
}
nsresult
nsLineBreaker::FlushCurrentWord()
{
uint32_t length = mCurrentWord.Length();
- nsAutoTArray<uint8_t,4000> breakState;
+ AutoTArray<uint8_t,4000> breakState;
if (!breakState.AppendElements(length))
return NS_ERROR_OUT_OF_MEMORY;
nsTArray<bool> capitalizationState;
if (!mCurrentWordContainsComplexChar) {
// For break-strict set everything internal to "break", otherwise
// to "no break"!
@@ -182,17 +182,17 @@ nsLineBreaker::AppendText(nsIAtom* aHyph
return NS_OK;
// We encountered whitespace, so we're done with this word
nsresult rv = FlushCurrentWord();
if (NS_FAILED(rv))
return rv;
}
- nsAutoTArray<uint8_t,4000> breakState;
+ AutoTArray<uint8_t,4000> breakState;
if (aSink) {
if (!breakState.AppendElements(aLength))
return NS_ERROR_OUT_OF_MEMORY;
}
bool noCapitalizationNeeded = true;
nsTArray<bool> capitalizationState;
if (aSink && (aFlags & BREAK_NEED_CAPITALIZATION)) {
@@ -363,17 +363,17 @@ nsLineBreaker::AppendText(nsIAtom* aHyph
}
// We encountered whitespace, so we're done with this word
nsresult rv = FlushCurrentWord();
if (NS_FAILED(rv))
return rv;
}
- nsAutoTArray<uint8_t,4000> breakState;
+ AutoTArray<uint8_t,4000> breakState;
if (aSink) {
if (!breakState.AppendElements(aLength))
return NS_ERROR_OUT_OF_MEMORY;
}
uint32_t start = offset;
bool noBreaksNeeded = !aSink ||
((aFlags & NO_BREAKS_NEEDED_FLAGS) == NO_BREAKS_NEEDED_FLAGS &&
--- a/dom/base/nsLineBreaker.h
+++ b/dom/base/nsLineBreaker.h
@@ -201,19 +201,19 @@ private:
void UpdateCurrentWordLanguage(nsIAtom *aHyphenationLanguage);
void FindHyphenationPoints(nsHyphenator *aHyphenator,
const char16_t *aTextStart,
const char16_t *aTextLimit,
uint8_t *aBreakState);
- nsAutoTArray<char16_t,100> mCurrentWord;
+ AutoTArray<char16_t,100> mCurrentWord;
// All the items that contribute to mCurrentWord
- nsAutoTArray<TextItem,2> mTextItems;
+ AutoTArray<TextItem,2> mTextItems;
nsIAtom* mCurrentWordLanguage;
bool mCurrentWordContainsMixedLang;
bool mCurrentWordContainsComplexChar;
// True if the previous character was breakable whitespace
bool mAfterBreakableSpace;
// True if a break must be allowed at the current position because
// a run of breakable whitespace ends here
--- a/dom/base/nsPerformance.cpp
+++ b/dom/base/nsPerformance.cpp
@@ -987,17 +987,17 @@ PerformanceBase::ClearMarks(const Option
{
ClearUserEntries(aName, NS_LITERAL_STRING("mark"));
}
DOMHighResTimeStamp
PerformanceBase::ResolveTimestampFromName(const nsAString& aName,
ErrorResult& aRv)
{
- nsAutoTArray<RefPtr<PerformanceEntry>, 1> arr;
+ AutoTArray<RefPtr<PerformanceEntry>, 1> arr;
DOMHighResTimeStamp ts;
Optional<nsAString> typeParam;
nsAutoString str;
str.AssignLiteral("mark");
typeParam = &str;
GetEntriesByName(aName, typeParam, arr);
if (!arr.IsEmpty()) {
return arr.LastElement()->StartTime();
--- a/dom/base/nsPlainTextSerializer.h
+++ b/dom/base/nsPlainTextSerializer.h
@@ -194,20 +194,20 @@ private:
Number of previous headers of
the same depth and in the same
section.
mHeaderCounter[1] for <h1> etc. */
RefPtr<mozilla::dom::Element> mElement;
// For handling table rows
- nsAutoTArray<bool, 8> mHasWrittenCellsForRow;
+ AutoTArray<bool, 8> mHasWrittenCellsForRow;
// Values gotten in OpenContainer that is (also) needed in CloseContainer
- nsAutoTArray<bool, 8> mIsInCiteBlockquote;
+ AutoTArray<bool, 8> mIsInCiteBlockquote;
// The output data
nsAString* mOutputString;
// The tag stack: the stack of tags we're operating on, so we can nest.
// The stack only ever points to static atoms, so they don't need to be
// refcounted.
nsIAtom** mTagStack;
--- a/dom/base/nsXHTMLContentSerializer.h
+++ b/dom/base/nsXHTMLContentSerializer.h
@@ -147,17 +147,17 @@ protected:
int32_t startVal;
// is true only before the serialization of the first li of an ol
// should be false for other li in the list
bool isFirstListItem;
};
// Stack to store one olState struct per <OL>.
- nsAutoTArray<olState, 8> mOLStateStack;
+ AutoTArray<olState, 8> mOLStateStack;
bool HasNoChildren(nsIContent* aContent);
};
nsresult
NS_NewXHTMLContentSerializer(nsIContentSerializer** aSerializer);
#endif
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -4469,18 +4469,18 @@ def getJSToNativeConversionInfo(type, de
elementType = type.inner.inner
else:
elementType = type.inner
# We want to use auto arrays if we can, but we have to be careful with
# reallocation behavior for arrays. In particular, if we use auto
# arrays for sequences and have a sequence of elements which are
# themselves sequences or have sequences as members, we have a problem.
- # In that case, resizing the outermost nsAutoTarray to the right size
- # will memmove its elements, but nsAutoTArrays are not memmovable and
+ # In that case, resizing the outermost AutoTArray to the right size
+ # will memmove its elements, but AutoTArrays are not memmovable and
# hence will end up with pointers to bogus memory, which is bad. To
# deal with this, we typically map WebIDL sequences to our Sequence
# type, which is in fact memmovable. The one exception is when we're
# passing in a sequence directly as an argument without any sort of
# optional or nullable complexity going on. In that situation, we can
# use an AutoSequence instead. We have to keep using Sequence in the
# nullable and optional cases because we don't want to leak the
# AutoSequence type to consumers, which would be unavoidable with
@@ -8384,17 +8384,17 @@ class CGEnumerateHook(CGAbstractBindingM
Argument('JS::Handle<JSObject*>', 'obj')]
# Our "self" is actually the "obj" argument in this case, not the thisval.
CGAbstractBindingMethod.__init__(
self, descriptor, ENUMERATE_HOOK_NAME,
args, getThisObj="", callArgs="")
def generate_code(self):
return CGGeneric(dedent("""
- nsAutoTArray<nsString, 8> names;
+ AutoTArray<nsString, 8> names;
ErrorResult rv;
self->GetOwnPropertyNames(cx, names, rv);
if (rv.MaybeSetPendingException(cx)) {
return false;
}
bool dummy;
for (uint32_t i = 0; i < names.Length(); ++i) {
if (!JS_HasUCProperty(cx, obj, names[i].get(), names[i].Length(), &dummy)) {
@@ -10451,17 +10451,17 @@ class CGEnumerateOwnPropertiesViaGetOwnP
Argument('JS::AutoIdVector&', 'props')]
CGAbstractBindingMethod.__init__(self, descriptor,
"EnumerateOwnPropertiesViaGetOwnPropertyNames",
args, getThisObj="",
callArgs="")
def generate_code(self):
return CGGeneric(dedent("""
- nsAutoTArray<nsString, 8> names;
+ AutoTArray<nsString, 8> names;
ErrorResult rv;
self->GetOwnPropertyNames(cx, names, rv);
if (rv.MaybeSetPendingException(cx)) {
return false;
}
// OK to pass null as "proxy" because it's ignored if
// shadowPrototypeProperties is true
return AppendNamedPropertyIds(cx, nullptr, names, true, props);
--- a/dom/bluetooth/common/BluetoothService.cpp
+++ b/dom/bluetooth/common/BluetoothService.cpp
@@ -89,17 +89,17 @@ ShutdownTimeExceeded(nsITimer* aTimer, v
}
void
GetAllBluetoothActors(InfallibleTArray<BluetoothParent*>& aActors)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aActors.IsEmpty());
- nsAutoTArray<ContentParent*, 20> contentActors;
+ AutoTArray<ContentParent*, 20> contentActors;
ContentParent::GetAll(contentActors);
for (uint32_t contentIndex = 0;
contentIndex < contentActors.Length();
contentIndex++) {
MOZ_ASSERT(contentActors[contentIndex]);
AutoInfallibleTArray<PBluetoothParent*, 5> bluetoothActors;
--- a/dom/cache/AutoUtils.cpp
+++ b/dom/cache/AutoUtils.cpp
@@ -42,17 +42,17 @@ enum CleanupAction
void
CleanupChildFds(CacheReadStream& aReadStream, CleanupAction aAction)
{
if (aReadStream.fds().type() !=
OptionalFileDescriptorSet::TPFileDescriptorSetChild) {
return;
}
- nsAutoTArray<FileDescriptor, 4> fds;
+ AutoTArray<FileDescriptor, 4> fds;
FileDescriptorSetChild* fdSetActor =
static_cast<FileDescriptorSetChild*>(aReadStream.fds().get_PFileDescriptorSetChild());
MOZ_ASSERT(fdSetActor);
if (aAction == Delete) {
Unused << fdSetActor->Send__delete__(fdSetActor);
}
@@ -102,17 +102,17 @@ CleanupChild(CacheReadStreamOrVoid& aRea
void
CleanupParentFds(CacheReadStream& aReadStream, CleanupAction aAction)
{
if (aReadStream.fds().type() !=
OptionalFileDescriptorSet::TPFileDescriptorSetParent) {
return;
}
- nsAutoTArray<FileDescriptor, 4> fds;
+ AutoTArray<FileDescriptor, 4> fds;
FileDescriptorSetParent* fdSetActor =
static_cast<FileDescriptorSetParent*>(aReadStream.fds().get_PFileDescriptorSetParent());
MOZ_ASSERT(fdSetActor);
if (aAction == Delete) {
Unused << fdSetActor->Send__delete__(fdSetActor);
}
@@ -301,17 +301,17 @@ MatchInPutList(InternalRequest* aRequest
}
RefPtr<InternalHeaders> cachedRequestHeaders =
TypeUtils::ToInternalHeaders(cachedRequest.headers());
RefPtr<InternalHeaders> cachedResponseHeaders =
TypeUtils::ToInternalHeaders(cachedResponse.headers());
- nsAutoTArray<nsCString, 16> varyHeaders;
+ AutoTArray<nsCString, 16> varyHeaders;
ErrorResult rv;
cachedResponseHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv);
MOZ_ALWAYS_TRUE(!rv.Failed());
// Assume the vary headers match until we find a conflict
bool varyHeadersMatch = true;
for (uint32_t j = 0; j < varyHeaders.Length(); ++j) {
--- a/dom/cache/Cache.cpp
+++ b/dom/cache/Cache.cpp
@@ -109,17 +109,17 @@ public:
// Stop holding the worker alive when we leave this method.
RefPtr<Feature> feature;
feature.swap(mFeature);
// Promise::All() passed an array of fetch() Promises should give us
// an Array of Response objects. The following code unwraps these
// JS values back to an nsTArray<RefPtr<Response>>.
- nsAutoTArray<RefPtr<Response>, 256> responseList;
+ AutoTArray<RefPtr<Response>, 256> responseList;
responseList.SetCapacity(mRequestList.Length());
bool isArray;
if (NS_WARN_IF(!JS_IsArrayObject(aCx, aValue, &isArray) || !isArray)) {
Fail();
return;
}
@@ -566,17 +566,17 @@ Cache::AddAll(const GlobalObject& aGloba
if (NS_WARN_IF(!promise)) {
return nullptr;
}
promise->MaybeResolve(JS::UndefinedHandleValue);
return promise.forget();
}
- nsAutoTArray<RefPtr<Promise>, 256> fetchList;
+ AutoTArray<RefPtr<Promise>, 256> fetchList;
fetchList.SetCapacity(aRequestList.Length());
// Begin fetching each request in parallel. For now, if an error occurs just
// abandon our previous fetch calls. In theory we could cancel them in the
// future once fetch supports it.
for (uint32_t i = 0; i < aRequestList.Length(); ++i) {
RequestOrUSVString requestOrString;
--- a/dom/cache/CacheOpChild.cpp
+++ b/dom/cache/CacheOpChild.cpp
@@ -214,31 +214,31 @@ CacheOpChild::HandleResponse(const Cache
RefPtr<Response> response = ToResponse(cacheResponse);
mPromise->MaybeResolve(response);
}
void
CacheOpChild::HandleResponseList(const nsTArray<CacheResponse>& aResponseList)
{
- nsAutoTArray<RefPtr<Response>, 256> responses;
+ AutoTArray<RefPtr<Response>, 256> responses;
responses.SetCapacity(aResponseList.Length());
for (uint32_t i = 0; i < aResponseList.Length(); ++i) {
AddFeatureToStreamChild(aResponseList[i], GetFeature());
responses.AppendElement(ToResponse(aResponseList[i]));
}
mPromise->MaybeResolve(responses);
}
void
CacheOpChild::HandleRequestList(const nsTArray<CacheRequest>& aRequestList)
{
- nsAutoTArray<RefPtr<Request>, 256> requests;
+ AutoTArray<RefPtr<Request>, 256> requests;
requests.SetCapacity(aRequestList.Length());
for (uint32_t i = 0; i < aRequestList.Length(); ++i) {
AddFeatureToStreamChild(aRequestList[i], GetFeature());
requests.AppendElement(ToRequest(aRequestList[i]));
}
mPromise->MaybeResolve(requests);
--- a/dom/cache/CacheOpParent.cpp
+++ b/dom/cache/CacheOpParent.cpp
@@ -74,18 +74,18 @@ CacheOpParent::Execute(Manager* aManager
// Handle put op
if (mOpArgs.type() == CacheOpArgs::TCachePutAllArgs) {
MOZ_ASSERT(mCacheId != INVALID_CACHE_ID);
const CachePutAllArgs& args = mOpArgs.get_CachePutAllArgs();
const nsTArray<CacheRequestResponse>& list = args.requestResponseList();
- nsAutoTArray<nsCOMPtr<nsIInputStream>, 256> requestStreamList;
- nsAutoTArray<nsCOMPtr<nsIInputStream>, 256> responseStreamList;
+ AutoTArray<nsCOMPtr<nsIInputStream>, 256> requestStreamList;
+ AutoTArray<nsCOMPtr<nsIInputStream>, 256> responseStreamList;
for (uint32_t i = 0; i < list.Length(); ++i) {
requestStreamList.AppendElement(
DeserializeCacheStream(list[i].request().body()));
responseStreamList.AppendElement(
DeserializeCacheStream(list[i].response().body()));
}
@@ -216,17 +216,17 @@ CacheOpParent::DeserializeCacheStream(co
// Option 2: One of our own ReadStreams was passed back to us with a stream
// control actor.
stream = ReadStream::Create(readStream);
if (stream) {
return stream.forget();
}
// Option 3: A stream was serialized using normal methods.
- nsAutoTArray<FileDescriptor, 4> fds;
+ AutoTArray<FileDescriptor, 4> fds;
if (readStream.fds().type() ==
OptionalFileDescriptorSet::TPFileDescriptorSetChild) {
FileDescriptorSetParent* fdSetActor =
static_cast<FileDescriptorSetParent*>(readStream.fds().get_PFileDescriptorSetParent());
MOZ_ASSERT(fdSetActor);
fdSetActor->ForgetFileDescriptors(fds);
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -583,21 +583,21 @@ DeleteCacheId(mozIStorageConnection* aCo
nsTArray<nsID>& aDeletedBodyIdListOut)
{
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(aConn);
// Delete the bodies explicitly as we need to read out the body IDs
// anyway. These body IDs must be deleted one-by-one as content may
// still be referencing them invidivually.
- nsAutoTArray<EntryId, 256> matches;
+ AutoTArray<EntryId, 256> matches;
nsresult rv = QueryAll(aConn, aCacheId, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
- nsAutoTArray<IdCount, 16> deletedSecurityIdList;
+ AutoTArray<IdCount, 16> deletedSecurityIdList;
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
deletedSecurityIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
rv = DeleteSecurityInfoList(aConn, deletedSecurityIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
// Delete the remainder of the cache using cascade semantics.
@@ -715,17 +715,17 @@ CacheMatch(mozIStorageConnection* aConn,
{
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(aConn);
MOZ_ASSERT(aFoundResponseOut);
MOZ_ASSERT(aSavedResponseOut);
*aFoundResponseOut = false;
- nsAutoTArray<EntryId, 1> matches;
+ AutoTArray<EntryId, 1> matches;
nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches, 1);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
if (matches.IsEmpty()) {
return rv;
}
rv = ReadResponse(aConn, matches[0], aSavedResponseOut);
@@ -742,17 +742,17 @@ CacheMatchAll(mozIStorageConnection* aCo
const CacheRequestOrVoid& aRequestOrVoid,
const CacheQueryParams& aParams,
nsTArray<SavedResponse>& aSavedResponsesOut)
{
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(aConn);
nsresult rv;
- nsAutoTArray<EntryId, 256> matches;
+ AutoTArray<EntryId, 256> matches;
if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) {
rv = QueryAll(aConn, aCacheId, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
} else {
rv = QueryCache(aConn, aCacheId, aRequestOrVoid, aParams, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
}
@@ -776,21 +776,21 @@ CachePut(mozIStorageConnection* aConn, C
const nsID* aResponseBodyId,
nsTArray<nsID>& aDeletedBodyIdListOut)
{
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(aConn);
CacheQueryParams params(false, false, false, false,
NS_LITERAL_STRING(""));
- nsAutoTArray<EntryId, 256> matches;
+ AutoTArray<EntryId, 256> matches;
nsresult rv = QueryCache(aConn, aCacheId, aRequest, params, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
- nsAutoTArray<IdCount, 16> deletedSecurityIdList;
+ AutoTArray<IdCount, 16> deletedSecurityIdList;
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
deletedSecurityIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
rv = InsertEntry(aConn, aCacheId, aRequest, aRequestBodyId, aResponse,
aResponseBodyId);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@@ -809,25 +809,25 @@ CacheDelete(mozIStorageConnection* aConn
nsTArray<nsID>& aDeletedBodyIdListOut, bool* aSuccessOut)
{
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(aConn);
MOZ_ASSERT(aSuccessOut);
*aSuccessOut = false;
- nsAutoTArray<EntryId, 256> matches;
+ AutoTArray<EntryId, 256> matches;
nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
if (matches.IsEmpty()) {
return rv;
}
- nsAutoTArray<IdCount, 16> deletedSecurityIdList;
+ AutoTArray<IdCount, 16> deletedSecurityIdList;
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
deletedSecurityIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
rv = DeleteSecurityInfoList(aConn, deletedSecurityIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
*aSuccessOut = true;
@@ -840,17 +840,17 @@ CacheKeys(mozIStorageConnection* aConn,
const CacheRequestOrVoid& aRequestOrVoid,
const CacheQueryParams& aParams,
nsTArray<SavedRequest>& aSavedRequestsOut)
{
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(aConn);
nsresult rv;
- nsAutoTArray<EntryId, 256> matches;
+ AutoTArray<EntryId, 256> matches;
if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) {
rv = QueryAll(aConn, aCacheId, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
} else {
rv = QueryCache(aConn, aCacheId, aRequestOrVoid, aParams, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
}
@@ -907,17 +907,17 @@ StorageMatch(mozIStorageConnection* aCon
rv = aConn->CreateStatement(NS_LITERAL_CSTRING(
"SELECT cache_id FROM storage WHERE namespace=:namespace ORDER BY rowid;"
), getter_AddRefs(state));
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
rv = state->BindInt32ByName(NS_LITERAL_CSTRING("namespace"), aNamespace);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
- nsAutoTArray<CacheId, 32> cacheIdList;
+ AutoTArray<CacheId, 32> cacheIdList;
bool hasMoreData = false;
while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {
CacheId cacheId = INVALID_CACHE_ID;
rv = state->GetInt64(0, &cacheId);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
cacheIdList.AppendElement(cacheId);
}
@@ -1213,17 +1213,17 @@ MatchByVaryHeader(mozIStorageConnection*
"SELECT value FROM response_headers "
"WHERE name='vary' AND entry_id=:entry_id;"
), getter_AddRefs(state));
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
rv = state->BindInt32ByName(NS_LITERAL_CSTRING("entry_id"), entryId);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
- nsAutoTArray<nsCString, 8> varyValues;
+ AutoTArray<nsCString, 8> varyValues;
bool hasMoreData = false;
while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {
nsAutoCString value;
rv = state->GetUTF8String(0, value);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
varyValues.AppendElement(value);
}
--- a/dom/cache/Manager.cpp
+++ b/dom/cache/Manager.cpp
@@ -69,31 +69,31 @@ public:
// Note, this must be done after any schema version updates to
// ensure our DBSchema methods work correctly.
if (MarkerFileExists(aQuotaInfo)) {
NS_WARNING("Cache not shutdown cleanly! Cleaning up stale data...");
mozStorageTransaction trans(aConn, false,
mozIStorageConnection::TRANSACTION_IMMEDIATE);
// Clean up orphaned Cache objects
- nsAutoTArray<CacheId, 8> orphanedCacheIdList;
+ AutoTArray<CacheId, 8> orphanedCacheIdList;
nsresult rv = db::FindOrphanedCacheIds(aConn, orphanedCacheIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
for (uint32_t i = 0; i < orphanedCacheIdList.Length(); ++i) {
- nsAutoTArray<nsID, 16> deletedBodyIdList;
+ AutoTArray<nsID, 16> deletedBodyIdList;
rv = db::DeleteCacheId(aConn, orphanedCacheIdList[i], deletedBodyIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
rv = BodyDeleteFiles(aDBDir, deletedBodyIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
}
// Clean up orphaned body objects
- nsAutoTArray<nsID, 64> knownBodyIdList;
+ AutoTArray<nsID, 64> knownBodyIdList;
rv = db::GetKnownBodyIds(aConn, knownBodyIdList);
rv = BodyDeleteOrphanedFiles(aDBDir, knownBodyIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
}
return rv;
}
@@ -1368,17 +1368,17 @@ Manager::Listener::OnOpComplete(ErrorRes
nsTArray<SavedRequest>(), nullptr);
}
void
Manager::Listener::OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult,
const SavedResponse& aSavedResponse,
StreamList* aStreamList)
{
- nsAutoTArray<SavedResponse, 1> responseList;
+ AutoTArray<SavedResponse, 1> responseList;
responseList.AppendElement(aSavedResponse);
OnOpComplete(Move(aRv), aResult, INVALID_CACHE_ID, responseList,
nsTArray<SavedRequest>(), aStreamList);
}
void
Manager::Listener::OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult,
const nsTArray<SavedResponse>& aSavedResponseList,
@@ -1897,17 +1897,17 @@ Manager::SetBodyIdOrphanedIfRefed(const
return false;
}
void
Manager::NoteOrphanedBodyIdList(const nsTArray<nsID>& aDeletedBodyIdList)
{
NS_ASSERT_OWNINGTHREAD(Manager);
- nsAutoTArray<nsID, 64> deleteNowList;
+ AutoTArray<nsID, 64> deleteNowList;
deleteNowList.SetCapacity(aDeletedBodyIdList.Length());
for (uint32_t i = 0; i < aDeletedBodyIdList.Length(); ++i) {
if (!SetBodyIdOrphanedIfRefed(aDeletedBodyIdList[i])) {
deleteNowList.AppendElement(aDeletedBodyIdList[i]);
}
}
--- a/dom/cache/ReadStream.cpp
+++ b/dom/cache/ReadStream.cpp
@@ -217,17 +217,17 @@ ReadStream::Inner::Serialize(CacheReadSt
// If we are sending a ReadStream, then we never want to set the
// pushStream actors at the same time.
aReadStreamOut->pushStreamChild() = nullptr;
aReadStreamOut->pushStreamParent() = nullptr;
aReadStreamOut->id() = mId;
mControl->SerializeControl(aReadStreamOut);
- nsAutoTArray<FileDescriptor, 4> fds;
+ AutoTArray<FileDescriptor, 4> fds;
SerializeInputStream(mStream, aReadStreamOut->params(), fds);
mControl->SerializeFds(aReadStreamOut, fds);
// We're passing ownership across the IPC barrier with the control, so
// do not signal that the stream is closed here.
Forget();
}
@@ -446,17 +446,17 @@ ReadStream::Create(const CacheReadStream
auto actor = static_cast<CacheStreamControlChild*>(aReadStream.controlChild());
control = actor;
} else {
auto actor = static_cast<CacheStreamControlParent*>(aReadStream.controlParent());
control = actor;
}
MOZ_ASSERT(control);
- nsAutoTArray<FileDescriptor, 4> fds;
+ AutoTArray<FileDescriptor, 4> fds;
control->DeserializeFds(aReadStream, fds);
nsCOMPtr<nsIInputStream> stream =
DeserializeInputStream(aReadStream.params(), fds);
MOZ_ASSERT(stream);
// Currently we expect all cache read streams to be blocking file streams.
#ifdef DEBUG
--- a/dom/cache/TypeUtils.cpp
+++ b/dom/cache/TypeUtils.cpp
@@ -39,17 +39,17 @@ using mozilla::ipc::FileDescriptor;
using mozilla::ipc::PBackgroundChild;
using mozilla::ipc::PFileDescriptorSetChild;
namespace {
static bool
HasVaryStar(mozilla::dom::InternalHeaders* aHeaders)
{
- nsAutoTArray<nsCString, 16> varyHeaders;
+ AutoTArray<nsCString, 16> varyHeaders;
ErrorResult rv;
aHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv);
MOZ_ALWAYS_TRUE(!rv.Failed());
for (uint32_t i = 0; i < varyHeaders.Length(); ++i) {
nsAutoCString varyValue(varyHeaders[i]);
char* rawBuffer = varyValue.BeginWriting();
char* token = nsCRT::strtok(rawBuffer, NS_HTTP_HEADER_SEPS, &rawBuffer);
@@ -62,17 +62,17 @@ HasVaryStar(mozilla::dom::InternalHeader
}
}
return false;
}
void
SerializeNormalStream(nsIInputStream* aStream, CacheReadStream& aReadStreamOut)
{
- nsAutoTArray<FileDescriptor, 4> fds;
+ AutoTArray<FileDescriptor, 4> fds;
SerializeInputStream(aStream, aReadStreamOut.params(), fds);
PFileDescriptorSetChild* fdSet = nullptr;
if (!fds.IsEmpty()) {
// We should not be serializing until we have an actor ready
PBackgroundChild* manager = BackgroundChild::GetForCurrentThread();
MOZ_ASSERT(manager);
@@ -89,17 +89,17 @@ SerializeNormalStream(nsIInputStream* aS
}
}
void
ToHeadersEntryList(nsTArray<HeadersEntry>& aOut, InternalHeaders* aHeaders)
{
MOZ_ASSERT(aHeaders);
- nsAutoTArray<InternalHeaders::Entry, 16> entryList;
+ AutoTArray<InternalHeaders::Entry, 16> entryList;
aHeaders->GetEntries(entryList);
for (uint32_t i = 0; i < entryList.Length(); ++i) {
InternalHeaders::Entry& entry = entryList[i];
aOut.AppendElement(HeadersEntry(entry.mName, entry.mValue));
}
}
--- a/dom/camera/GonkCameraControl.cpp
+++ b/dom/camera/GonkCameraControl.cpp
@@ -242,34 +242,34 @@ nsGonkCameraControl::Initialize()
mLuminanceSupported ? "" : "NOT ");
if (mFlashSupported) {
DOM_CAMERA_LOGI(" - flash: supported, default mode '%s'\n",
NS_ConvertUTF16toUTF8(flashMode).get());
} else {
DOM_CAMERA_LOGI(" - flash: NOT supported\n");
}
- nsAutoTArray<Size, 16> sizes;
+ AutoTArray<Size, 16> sizes;
mParams.Get(CAMERA_PARAM_SUPPORTED_VIDEOSIZES, sizes);
if (sizes.Length() > 0) {
mSeparateVideoAndPreviewSizesSupported = true;
DOM_CAMERA_LOGI(" - support for separate preview and video sizes\n");
mParams.Get(CAMERA_PARAM_VIDEOSIZE, mLastRecorderSize);
DOM_CAMERA_LOGI(" - default video recorder size: %u x %u\n",
mLastRecorderSize.width, mLastRecorderSize.height);
Size preferred;
mParams.Get(CAMERA_PARAM_PREFERRED_PREVIEWSIZE_FOR_VIDEO, preferred);
DOM_CAMERA_LOGI(" - preferred video preview size: %u x %u\n",
preferred.width, preferred.height);
} else {
mLastRecorderSize = mCurrentConfiguration.mPreviewSize;
}
- nsAutoTArray<nsString, 8> modes;
+ AutoTArray<nsString, 8> modes;
mParams.Get(CAMERA_PARAM_SUPPORTED_METERINGMODES, modes);
if (!modes.IsEmpty()) {
nsString mode;
const char* kCenterWeighted = "center-weighted";
mParams.Get(CAMERA_PARAM_METERINGMODE, mode);
if (!mode.EqualsASCII(kCenterWeighted)) {
nsTArray<nsString>::index_type i = modes.Length();
@@ -297,17 +297,17 @@ nsGonkCameraControl::~nsGonkCameraContro
StopImpl();
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
}
nsresult
nsGonkCameraControl::ValidateConfiguration(const Configuration& aConfig, Configuration& aValidatedConfig)
{
- nsAutoTArray<Size, 16> supportedSizes;
+ AutoTArray<Size, 16> supportedSizes;
Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
nsresult rv = GetSupportedSize(aConfig.mPictureSize, supportedSizes,
aValidatedConfig.mPictureSize);
if (NS_FAILED(rv)) {
DOM_CAMERA_LOGW("Unable to find a picture size close to %ux%u\n",
aConfig.mPictureSize.width, aConfig.mPictureSize.height);
return NS_ERROR_INVALID_ARG;
@@ -918,17 +918,17 @@ nsGonkCameraControl::SetThumbnailSizeImp
* Some drivers will fail to take a picture if the thumbnail does not have
* the same aspect ratio as the set picture size, so we need to enforce that
* too.
*/
int smallestDelta = INT_MAX;
uint32_t smallestDeltaIndex = UINT32_MAX;
int targetArea = aSize.width * aSize.height;
- nsAutoTArray<Size, 8> supportedSizes;
+ AutoTArray<Size, 8> supportedSizes;
Get(CAMERA_PARAM_SUPPORTED_JPEG_THUMBNAIL_SIZES, supportedSizes);
for (uint32_t i = 0; i < supportedSizes.Length(); ++i) {
int area = supportedSizes[i].width * supportedSizes[i].height;
int delta = abs(area - targetArea);
if (area != 0 &&
delta < smallestDelta &&
@@ -1023,17 +1023,17 @@ nsGonkCameraControl::SetPictureSizeImpl(
}
if (aSize.width == mCurrentConfiguration.mPictureSize.width &&
aSize.height == mCurrentConfiguration.mPictureSize.height) {
DOM_CAMERA_LOGI("Requested picture size %ux%u unchanged\n", aSize.width, aSize.height);
return NS_OK;
}
- nsAutoTArray<Size, 8> supportedSizes;
+ AutoTArray<Size, 8> supportedSizes;
Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
Size best;
nsresult rv = GetSupportedSize(aSize, supportedSizes, best);
if (NS_FAILED(rv)) {
DOM_CAMERA_LOGW("Unable to find a picture size close to %ux%u\n",
aSize.width, aSize.height);
return NS_ERROR_INVALID_ARG;
@@ -1722,17 +1722,17 @@ nsGonkCameraControl::SelectCaptureAndPre
// At this point, we know the capture size has been validated and replaced
// if necessary with the best matching supported value.
DOM_CAMERA_LOGI("Select capture size %ux%u, preview size %ux%u, maximum size %ux%u\n",
aCaptureSize.width, aCaptureSize.height,
aPreviewSize.width, aPreviewSize.height,
aMaxSize.width, aMaxSize.height);
- nsAutoTArray<Size, 16> sizes;
+ AutoTArray<Size, 16> sizes;
nsresult rv = Get(CAMERA_PARAM_SUPPORTED_PREVIEWSIZES, sizes);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
// May optionally apply a ceiling to the preview size. Any supported preview
// size with an area larger than the maximum will be ignored regardless of
// aspect ratio or delta to requested preview size.
--- a/dom/canvas/CanvasRenderingContext2D.h
+++ b/dom/canvas/CanvasRenderingContext2D.h
@@ -1029,17 +1029,17 @@ protected:
RefPtr<nsSVGFilterChainObserver> filterChainObserver;
mozilla::gfx::FilterDescription filter;
nsTArray<RefPtr<mozilla::gfx::SourceSurface>> filterAdditionalImages;
bool imageSmoothingEnabled;
bool fontExplicitLanguage;
};
- nsAutoTArray<ContextState, 3> mStyleStack;
+ AutoTArray<ContextState, 3> mStyleStack;
inline ContextState& CurrentState() {
return mStyleStack[mStyleStack.Length() - 1];
}
inline const ContextState& CurrentState() const {
return mStyleStack[mStyleStack.Length() - 1];
}
--- a/dom/canvas/ImageBitmapRenderingContext.cpp
+++ b/dom/canvas/ImageBitmapRenderingContext.cpp
@@ -234,17 +234,17 @@ ImageBitmapRenderingContext::GetCanvasLa
}
RefPtr<ImageContainer> imageContainer = imageLayer->GetContainer();
if (!imageContainer) {
imageContainer = aManager->CreateImageContainer();
imageLayer->SetContainer(imageContainer);
}
- nsAutoTArray<ImageContainer::NonOwningImage, 1> imageList;
+ AutoTArray<ImageContainer::NonOwningImage, 1> imageList;
RefPtr<layers::Image> image = ClipToIntrinsicSize();
imageList.AppendElement(ImageContainer::NonOwningImage(image));
imageContainer->SetCurrentImages(imageList);
return imageLayer.forget();
}
void
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -726,17 +726,17 @@ EventStateManager::PreHandleEvent(nsPres
modifierMask |= NS_MODIFIER_META;
if (keyEvent->IsOS())
modifierMask |= NS_MODIFIER_OS;
// Prevent keyboard scrolling while an accesskey modifier is in use.
if (modifierMask &&
(modifierMask == Prefs::ChromeAccessModifierMask() ||
modifierMask == Prefs::ContentAccessModifierMask())) {
- nsAutoTArray<uint32_t, 10> accessCharCodes;
+ AutoTArray<uint32_t, 10> accessCharCodes;
nsContentUtils::GetAccessKeyCandidates(keyEvent, accessCharCodes);
if (HandleAccessKey(aPresContext, accessCharCodes,
keyEvent->mFlags.mIsTrusted, modifierMask)) {
*aStatus = nsEventStatus_eConsumeNoDefault;
}
}
}
@@ -1286,17 +1286,17 @@ EventStateManager::HandleCrossProcessEve
!CrossProcessSafeEvent(*aEvent)) {
return false;
}
// Collect the remote event targets we're going to forward this
// event to.
//
// NB: the elements of |targets| must be unique, for correctness.
- nsAutoTArray<nsCOMPtr<nsIContent>, 1> targets;
+ AutoTArray<nsCOMPtr<nsIContent>, 1> targets;
if (aEvent->mClass != eTouchEventClass || aEvent->mMessage == eTouchStart) {
// If this event only has one target, and it's remote, add it to
// the array.
nsIFrame* frame = GetEventTarget();
nsIContent* target = frame ? frame->GetContent() : nullptr;
if (IsRemoteTarget(target)) {
targets.AppendElement(target);
}
--- a/dom/events/TextComposition.h
+++ b/dom/events/TextComposition.h
@@ -424,17 +424,17 @@ private:
* there. Even if user switches native IME context, it's very rare that
* second or more composition is started.
* It's assumed that this is used by IMEStateManager for storing all active
* compositions in the process. If the instance is it, each TextComposition
* in the array can be destroyed by calling some methods of itself.
*/
class TextCompositionArray final :
- public nsAutoTArray<RefPtr<TextComposition>, 2>
+ public AutoTArray<RefPtr<TextComposition>, 2>
{
public:
// Looking for per native IME context.
index_type IndexOf(const widget::NativeIMEContext& aNativeIMEContext);
index_type IndexOf(nsIWidget* aWidget);
TextComposition* GetCompositionFor(nsIWidget* aWidget);
TextComposition* GetCompositionFor(
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -333,17 +333,17 @@ FetchDriver::HttpFetch()
}
// If preflight is required, start a "CORS preflight fetch"
// https://fetch.spec.whatwg.org/#cors-preflight-fetch-0. All the
// implementation is handled by the http channel calling into
// nsCORSListenerProxy. We just inform it which unsafe headers are included
// in the request.
if (mRequest->Mode() == RequestMode::Cors) {
- nsAutoTArray<nsCString, 5> unsafeHeaders;
+ AutoTArray<nsCString, 5> unsafeHeaders;
mRequest->Headers()->GetUnsafeHeaders(unsafeHeaders);
nsCOMPtr<nsILoadInfo> loadInfo = chan->GetLoadInfo();
loadInfo->SetCorsPreflightInfo(unsafeHeaders, false);
}
rv = chan->AsyncOpen2(this);
NS_ENSURE_SUCCESS(rv, rv);
@@ -704,17 +704,17 @@ FetchDriver::SetDocument(nsIDocument* aD
mDocument = aDocument;
}
void
FetchDriver::SetRequestHeaders(nsIHttpChannel* aChannel) const
{
MOZ_ASSERT(aChannel);
- nsAutoTArray<InternalHeaders::Entry, 5> headers;
+ AutoTArray<InternalHeaders::Entry, 5> headers;
mRequest->Headers()->GetEntries(headers);
bool hasAccept = false;
for (uint32_t i = 0; i < headers.Length(); ++i) {
if (!hasAccept && headers[i].mName.EqualsLiteral("accept")) {
hasAccept = true;
}
if (headers[i].mValue.IsEmpty()) {
aChannel->SetEmptyRequestHeader(headers[i].mName);
--- a/dom/fetch/InternalHeaders.cpp
+++ b/dom/fetch/InternalHeaders.cpp
@@ -304,17 +304,17 @@ InternalHeaders::CORSHeaders(InternalHea
{
RefPtr<InternalHeaders> cors = new InternalHeaders(aHeaders->mGuard);
ErrorResult result;
nsAutoCString acExposedNames;
aHeaders->Get(NS_LITERAL_CSTRING("Access-Control-Expose-Headers"), acExposedNames, result);
MOZ_ASSERT(!result.Failed());
- nsAutoTArray<nsCString, 5> exposeNamesArray;
+ AutoTArray<nsCString, 5> exposeNamesArray;
nsCCharSeparatedTokenizer exposeTokens(acExposedNames, ',');
while (exposeTokens.hasMoreTokens()) {
const nsDependentCSubstring& token = exposeTokens.nextToken();
if (token.IsEmpty()) {
continue;
}
if (!NS_IsValidHTTPToken(token)) {
--- a/dom/gamepad/linux/LinuxGamepad.cpp
+++ b/dom/gamepad/linux/LinuxGamepad.cpp
@@ -72,17 +72,17 @@ private:
static gboolean OnUdevMonitor(GIOChannel *source,
GIOCondition condition,
gpointer data);
udev_lib mUdev;
struct udev_monitor* mMonitor;
guint mMonitorSourceID;
// Information about currently connected gamepads.
- nsAutoTArray<Gamepad,4> mGamepads;
+ AutoTArray<Gamepad,4> mGamepads;
};
// singleton instance
LinuxGamepadService* gService = nullptr;
void
LinuxGamepadService::AddDevice(struct udev_device* dev)
{
--- a/dom/html/HTMLAllCollection.cpp
+++ b/dom/html/HTMLAllCollection.cpp
@@ -168,17 +168,17 @@ void
HTMLAllCollection::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
{
if (!(aFlags & JSITER_HIDDEN)) {
return;
}
// XXXbz this is very similar to nsContentList::GetSupportedNames,
// but has to check IsAllNamedElement for the name case.
- nsAutoTArray<nsIAtom*, 8> atoms;
+ AutoTArray<nsIAtom*, 8> atoms;
for (uint32_t i = 0; i < Length(); ++i) {
nsIContent *content = Item(i);
if (content->HasID()) {
nsIAtom* id = content->GetID();
MOZ_ASSERT(id != nsGkAtoms::_empty,
"Empty ids don't get atomized");
if (!atoms.Contains(id)) {
atoms.AppendElement(id);
--- a/dom/html/HTMLOptionsCollection.cpp
+++ b/dom/html/HTMLOptionsCollection.cpp
@@ -282,17 +282,17 @@ HTMLOptionsCollection::NamedItem(const n
void
HTMLOptionsCollection::GetSupportedNames(unsigned aFlags,
nsTArray<nsString>& aNames)
{
if (!(aFlags & JSITER_HIDDEN)) {
return;
}
- nsAutoTArray<nsIAtom*, 8> atoms;
+ AutoTArray<nsIAtom*, 8> atoms;
for (uint32_t i = 0; i < mElements.Length(); ++i) {
HTMLOptionElement* content = mElements.ElementAt(i);
if (content) {
// Note: HasName means the names is exposed on the document,
// which is false for options, so we don't check it here.
const nsAttrValue* val = content->GetParsedAttr(nsGkAtoms::name);
if (val && val->Type() == nsAttrValue::eAtom) {
nsIAtom* name = val->GetAtomValue();
--- a/dom/html/TimeRanges.cpp
+++ b/dom/html/TimeRanges.cpp
@@ -107,17 +107,17 @@ TimeRanges::GetEndTime()
}
return mRanges[mRanges.Length() - 1].mEnd;
}
void
TimeRanges::Normalize(double aTolerance)
{
if (mRanges.Length() >= 2) {
- nsAutoTArray<TimeRange,4> normalized;
+ AutoTArray<TimeRange,4> normalized;
mRanges.Sort(CompareTimeRanges());
// This merges the intervals.
TimeRange current(mRanges[0]);
for (uint32_t i = 1; i < mRanges.Length(); i++) {
if (current.mStart <= mRanges[i].mStart &&
current.mEnd >= mRanges[i].mEnd) {
@@ -142,17 +142,17 @@ TimeRanges::Union(const TimeRanges* aOth
{
mRanges.AppendElements(aOtherRanges->mRanges);
Normalize(aTolerance);
}
void
TimeRanges::Intersection(const TimeRanges* aOtherRanges)
{
- nsAutoTArray<TimeRange,4> intersection;
+ AutoTArray<TimeRange,4> intersection;
const nsTArray<TimeRange>& otherRanges = aOtherRanges->mRanges;
for (index_type i = 0, j = 0; i < mRanges.Length() && j < otherRanges.Length();) {
double start = std::max(mRanges[i].mStart, otherRanges[j].mStart);
double end = std::min(mRanges[i].mEnd, otherRanges[j].mEnd);
if (start < end) {
intersection.AppendElement(TimeRange(start, end));
}
--- a/dom/html/TimeRanges.h
+++ b/dom/html/TimeRanges.h
@@ -88,17 +88,17 @@ private:
return aTr1.mStart == aTr2.mStart && aTr1.mEnd == aTr2.mEnd;
}
bool LessThan(const TimeRange& aTr1, const TimeRange& aTr2) const {
return aTr1.mStart < aTr2.mStart;
}
};
- nsAutoTArray<TimeRange,4> mRanges;
+ AutoTArray<TimeRange,4> mRanges;
nsCOMPtr<nsISupports> mParent;
public:
typedef nsTArray<TimeRange>::index_type index_type;
static const index_type NoIndex = index_type(-1);
index_type Find(double aTime, double aTolerance = 0);
--- a/dom/html/nsHTMLContentSink.cpp
+++ b/dom/html/nsHTMLContentSink.cpp
@@ -155,17 +155,17 @@ protected:
// The maximum length of a text run
int32_t mMaxTextRun;
RefPtr<nsGenericHTMLElement> mRoot;
RefPtr<nsGenericHTMLElement> mBody;
RefPtr<nsGenericHTMLElement> mHead;
- nsAutoTArray<SinkContext*, 8> mContextStack;
+ AutoTArray<SinkContext*, 8> mContextStack;
SinkContext* mCurrentContext;
SinkContext* mHeadContext;
// Boolean indicating whether we've seen a <head> tag that might have had
// attributes once already.
bool mHaveSeenHead;
// Boolean indicating whether we've notified insertion of our root content
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -16347,20 +16347,20 @@ QuotaClient::InitOrigin(PersistenceType
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
// We need to see if there are any files in the directory already. If they
// are database files then we need to cleanup stored files (if it's needed)
// and also get the usage.
- nsAutoTArray<nsString, 20> subdirsToProcess;
+ AutoTArray<nsString, 20> subdirsToProcess;
nsTArray<nsCOMPtr<nsIFile>> unknownFiles;
nsTHashtable<nsStringHashKey> validSubdirs(20);
- nsAutoTArray<FileManagerInitInfo, 20> initInfos;
+ AutoTArray<FileManagerInitInfo, 20> initInfos;
nsCOMPtr<nsISimpleEnumerator> entries;
rv = directory->GetDirectoryEntries(getter_AddRefs(entries));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
const NS_ConvertASCIItoUTF16 filesSuffix(
@@ -18212,17 +18212,17 @@ DatabaseOperationBase::GetStructuredClon
if (NS_WARN_IF(!snappy::RawUncompress(compressed, compressedLength,
uncompressedBuffer))) {
return NS_ERROR_FILE_CORRUPTED;
}
aInfo->mData.SwapElements(uncompressed);
if (!aFileIds.IsVoid()) {
- nsAutoTArray<int64_t, 10> array;
+ AutoTArray<int64_t, 10> array;
nsresult rv = ConvertFileIdsToArray(aFileIds, array);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
for (uint32_t count = array.Length(), index = 0; index < count; index++) {
int64_t id = array[index];
MOZ_ASSERT(id != 0);
@@ -23339,17 +23339,17 @@ UpdateIndexDataValuesFunction::OnFunctio
cloneInfo,
&clone))) {
return NS_ERROR_DOM_DATA_CLONE_ERR;
}
const IndexMetadata& metadata = mOp->mMetadata;
const int64_t& objectStoreId = mOp->mObjectStoreId;
- nsAutoTArray<IndexUpdateInfo, 32> updateInfos;
+ AutoTArray<IndexUpdateInfo, 32> updateInfos;
rv = IDBObjectStore::AppendIndexUpdateInfo(metadata.id(),
metadata.keyPath(),
metadata.unique(),
metadata.multiEntry(),
metadata.locale(),
mCx,
clone,
updateInfos);
--- a/dom/indexedDB/IDBDatabase.cpp
+++ b/dom/indexedDB/IDBDatabase.cpp
@@ -662,17 +662,17 @@ IDBDatabase::Transaction(const StringOrS
IDB_REPORT_INTERNAL_ERR();
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
}
if (mClosed || RunningVersionChangeTransaction()) {
return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
}
- nsAutoTArray<nsString, 1> stackSequence;
+ AutoTArray<nsString, 1> stackSequence;
if (aStoreNames.IsString()) {
stackSequence.AppendElement(aStoreNames.GetAsString());
} else {
MOZ_ASSERT(aStoreNames.IsStringSequence());
if (aStoreNames.GetAsStringSequence().IsEmpty()) {
return NS_ERROR_DOM_INVALID_ACCESS_ERR;
}
@@ -843,18 +843,18 @@ IDBDatabase::UnregisterTransaction(IDBTr
void
IDBDatabase::AbortTransactions(bool aShouldWarn)
{
AssertIsOnOwningThread();
class MOZ_STACK_CLASS Helper final
{
- typedef nsAutoTArray<RefPtr<IDBTransaction>, 20> StrongTransactionArray;
- typedef nsAutoTArray<IDBTransaction*, 20> WeakTransactionArray;
+ typedef AutoTArray<RefPtr<IDBTransaction>, 20> StrongTransactionArray;
+ typedef AutoTArray<IDBTransaction*, 20> WeakTransactionArray;
public:
static void
AbortTransactions(IDBDatabase* aDatabase, const bool aShouldWarn)
{
MOZ_ASSERT(aDatabase);
aDatabase->AssertIsOnOwningThread();
--- a/dom/indexedDB/Key.cpp
+++ b/dom/indexedDB/Key.cpp
@@ -465,17 +465,17 @@ Key::EncodeLocaleString(const nsDependen
UErrorCode uerror = U_ZERO_ERROR;
UCollator* collator = ucol_open(aLocale.get(), &uerror);
if (NS_WARN_IF(U_FAILURE(uerror))) {
return NS_ERROR_FAILURE;
}
MOZ_ASSERT(collator);
- nsAutoTArray<uint8_t, 128> keyBuffer;
+ AutoTArray<uint8_t, 128> keyBuffer;
int32_t sortKeyLength = ucol_getSortKey(collator, ustr, length,
keyBuffer.Elements(),
keyBuffer.Length());
if (sortKeyLength > (int32_t)keyBuffer.Length()) {
keyBuffer.SetLength(sortKeyLength);
sortKeyLength = ucol_getSortKey(collator, ustr, length,
keyBuffer.Elements(),
sortKeyLength);
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -602,17 +602,17 @@ public:
NS_IMPL_ISUPPORTS(ContentParentsMemoryReporter, nsIMemoryReporter)
NS_IMETHODIMP
ContentParentsMemoryReporter::CollectReports(nsIMemoryReporterCallback* cb,
nsISupports* aClosure,
bool aAnonymize)
{
- nsAutoTArray<ContentParent*, 16> cps;
+ AutoTArray<ContentParent*, 16> cps;
ContentParent::GetAllEvenIfDead(cps);
for (uint32_t i = 0; i < cps.Length(); i++) {
ContentParent* cp = cps[i];
MessageChannel* channel = cp->GetIPCChannel();
nsString friendlyName;
cp->FriendlyName(friendlyName, aAnonymize);
@@ -906,17 +906,17 @@ ContentParent::JoinProcessesIOThread(con
// Don't touch any arguments to this function from now on.
}
/*static*/ void
ContentParent::JoinAllSubprocesses()
{
MOZ_ASSERT(NS_IsMainThread());
- nsAutoTArray<ContentParent*, 8> processes;
+ AutoTArray<ContentParent*, 8> processes;
GetAll(processes);
if (processes.IsEmpty()) {
printf_stderr("There are no live subprocesses.");
return;
}
printf_stderr("Subprocesses are still alive. Doing emergency join.\n");
@@ -5140,17 +5140,17 @@ ContentParent::IgnoreIPCPrincipal()
"dom.testing.ignore_ipc_principal", false);
}
return sIgnoreIPCPrincipal;
}
void
ContentParent::NotifyUpdatedDictionaries()
{
- nsAutoTArray<ContentParent*, 8> processes;
+ AutoTArray<ContentParent*, 8> processes;
GetAll(processes);
nsCOMPtr<nsISpellChecker> spellChecker(do_GetService(NS_SPELLCHECKER_CONTRACTID));
MOZ_ASSERT(spellChecker, "No spell checker?");
InfallibleTArray<nsString> dictionaries;
spellChecker->GetDictionaryList(&dictionaries);
--- a/dom/ipc/PreallocatedProcessManager.cpp
+++ b/dom/ipc/PreallocatedProcessManager.cpp
@@ -66,18 +66,18 @@ public:
private:
void NuwaFork();
// initialization off the critical path of app startup.
CancelableTask* mPreallocateAppProcessTask;
// The array containing the preallocated processes. 4 as the inline storage size
- // should be enough so we don't need to grow the nsAutoTArray.
- nsAutoTArray<RefPtr<ContentParent>, 4> mSpareProcesses;
+ // should be enough so we don't need to grow the AutoTArray.
+ AutoTArray<RefPtr<ContentParent>, 4> mSpareProcesses;
// Nuwa process is ready for creating new process.
bool mIsNuwaReady;
#endif
private:
static mozilla::StaticRefPtr<PreallocatedProcessManagerImpl> sSingleton;
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -701,17 +701,17 @@ private:
RefPtr<nsIContentChild> mManager;
uint32_t mChromeFlags;
int32_t mActiveSuppressDisplayport;
uint64_t mLayersId;
CSSRect mUnscaledOuterRect;
// Whether we have already received a FileDescriptor for the app package.
bool mAppPackageFileDescriptorRecved;
// At present only 1 of these is really expected.
- nsAutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
+ AutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
mCachedFileDescriptorInfos;
nscolor mLastBackgroundColor;
bool mDidFakeShow;
bool mNotified;
bool mTriedBrowserInit;
ScreenOrientationInternal mOrientation;
bool mUpdateHitRegion;
@@ -729,17 +729,17 @@ private:
double mDefaultScale;
bool mIPCOpen;
bool mParentIsActive;
bool mAsyncPanZoomEnabled;
CSSSize mUnscaledInnerSize;
bool mDidSetRealShowInfo;
- nsAutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
+ AutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_TabChild_h
--- a/dom/media/AudioCaptureStream.cpp
+++ b/dom/media/AudioCaptureStream.cpp
@@ -97,18 +97,18 @@ AudioCaptureStream::ProcessInput(GraphTi
mBuffer.AdvanceKnownTracksTime(GraphTimeToStreamTimeWithBlocking((aTo)));
}
void
AudioCaptureStream::MixerCallback(AudioDataValue* aMixedBuffer,
AudioSampleFormat aFormat, uint32_t aChannels,
uint32_t aFrames, uint32_t aSampleRate)
{
- nsAutoTArray<nsTArray<AudioDataValue>, MONO> output;
- nsAutoTArray<const AudioDataValue*, MONO> bufferPtrs;
+ AutoTArray<nsTArray<AudioDataValue>, MONO> output;
+ AutoTArray<const AudioDataValue*, MONO> bufferPtrs;
output.SetLength(MONO);
bufferPtrs.SetLength(MONO);
uint32_t written = 0;
// We need to copy here, because the mixer will reuse the storage, we should
// not hold onto it. Buffers are in planar format.
for (uint32_t channel = 0; channel < aChannels; channel++) {
AudioDataValue* out = output[channel].AppendElements(aFrames);
--- a/dom/media/AudioSegment.cpp
+++ b/dom/media/AudioSegment.cpp
@@ -80,19 +80,19 @@ PointerForOffsetInChannel(AudioDataValue
"Offset request out of bounds.");
return aData + beginningOfChannel + aOffsetSamples;
}
void
AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels,
uint32_t aSampleRate)
{
- nsAutoTArray<AudioDataValue, SilentChannel::AUDIO_PROCESSING_FRAMES* GUESS_AUDIO_CHANNELS>
+ AutoTArray<AudioDataValue, SilentChannel::AUDIO_PROCESSING_FRAMES* GUESS_AUDIO_CHANNELS>
buf;
- nsAutoTArray<const AudioDataValue*, GUESS_AUDIO_CHANNELS> channelData;
+ AutoTArray<const AudioDataValue*, GUESS_AUDIO_CHANNELS> channelData;
uint32_t offsetSamples = 0;
uint32_t duration = GetDuration();
if (duration <= 0) {
MOZ_ASSERT(duration == 0);
return;
}
@@ -127,17 +127,17 @@ AudioSegment::Mix(AudioMixer& aMixer, ui
PointerForOffsetInChannel(buf.Elements(), outBufferLength,
aOutputChannels, channel, offsetSamples);
PodCopy(ptr, reinterpret_cast<const AudioDataValue*>(channelData[channel]),
frames);
}
MOZ_ASSERT(channelData.Length() == aOutputChannels);
} else if (channelData.Length() > aOutputChannels) {
// Down mix.
- nsAutoTArray<AudioDataValue*, GUESS_AUDIO_CHANNELS> outChannelPtrs;
+ AutoTArray<AudioDataValue*, GUESS_AUDIO_CHANNELS> outChannelPtrs;
outChannelPtrs.SetLength(aOutputChannels);
uint32_t offsetSamples = 0;
for (uint32_t channel = 0; channel < aOutputChannels; channel++) {
outChannelPtrs[channel] =
PointerForOffsetInChannel(buf.Elements(), outBufferLength,
aOutputChannels, channel, offsetSamples);
}
AudioChannelsDownMix(channelData, outChannelPtrs.Elements(),
@@ -161,17 +161,17 @@ AudioSegment::Mix(AudioMixer& aMixer, ui
"We forgot to write some samples?");
aMixer.Mix(buf.Elements(), aOutputChannels, offsetSamples, aSampleRate);
}
}
void
AudioSegment::WriteTo(uint64_t aID, AudioMixer& aMixer, uint32_t aOutputChannels, uint32_t aSampleRate)
{
- nsAutoTArray<AudioDataValue,SilentChannel::AUDIO_PROCESSING_FRAMES*GUESS_AUDIO_CHANNELS> buf;
+ AutoTArray<AudioDataValue,SilentChannel::AUDIO_PROCESSING_FRAMES*GUESS_AUDIO_CHANNELS> buf;
// Offset in the buffer that will be written to the mixer, in samples.
uint32_t offset = 0;
if (GetDuration() <= 0) {
MOZ_ASSERT(GetDuration() == 0);
return;
}
--- a/dom/media/AudioSegment.h
+++ b/dom/media/AudioSegment.h
@@ -113,18 +113,18 @@ DownmixAndInterleave(const nsTArray<cons
int32_t aDuration, float aVolume, uint32_t aOutputChannels,
DestT* aOutput)
{
if (aChannelData.Length() == aOutputChannels) {
InterleaveAndConvertBuffer(aChannelData.Elements(),
aDuration, aVolume, aOutputChannels, aOutput);
} else {
- nsAutoTArray<SrcT*,GUESS_AUDIO_CHANNELS> outputChannelData;
- nsAutoTArray<SrcT, SilentChannel::AUDIO_PROCESSING_FRAMES * GUESS_AUDIO_CHANNELS> outputBuffers;
+ AutoTArray<SrcT*,GUESS_AUDIO_CHANNELS> outputChannelData;
+ AutoTArray<SrcT, SilentChannel::AUDIO_PROCESSING_FRAMES * GUESS_AUDIO_CHANNELS> outputBuffers;
outputChannelData.SetLength(aOutputChannels);
outputBuffers.SetLength(aDuration * aOutputChannels);
for (uint32_t i = 0; i < aOutputChannels; i++) {
outputChannelData[i] = outputBuffers.Elements() + aDuration * i;
}
AudioChannelsDownMix(aChannelData,
outputChannelData.Elements(),
aOutputChannels,
@@ -249,18 +249,18 @@ public:
void Resample(SpeexResamplerState* aResampler, uint32_t aInRate, uint32_t aOutRate)
{
mDuration = 0;
#ifdef DEBUG
uint32_t segmentChannelCount = ChannelCount();
#endif
for (ChunkIterator ci(*this); !ci.IsEnded(); ci.Next()) {
- nsAutoTArray<nsTArray<T>, GUESS_AUDIO_CHANNELS> output;
- nsAutoTArray<const T*, GUESS_AUDIO_CHANNELS> bufferPtrs;
+ AutoTArray<nsTArray<T>, GUESS_AUDIO_CHANNELS> output;
+ AutoTArray<const T*, GUESS_AUDIO_CHANNELS> bufferPtrs;
AudioChunk& c = *ci;
// If this chunk is null, don't bother resampling, just alter its duration
if (c.IsNull()) {
c.mDuration = (c.mDuration * aOutRate) / aInRate;
mDuration += c.mDuration;
continue;
}
uint32_t channels = c.mChannelData.Length();
@@ -390,17 +390,17 @@ public:
}
};
template<typename SrcT>
void WriteChunk(AudioChunk& aChunk,
uint32_t aOutputChannels,
AudioDataValue* aOutputBuffer)
{
- nsAutoTArray<const SrcT*,GUESS_AUDIO_CHANNELS> channelData;
+ AutoTArray<const SrcT*,GUESS_AUDIO_CHANNELS> channelData;
channelData = aChunk.ChannelData<SrcT>();
if (channelData.Length() < aOutputChannels) {
// Up-mix. Note that this might actually make channelData have more
// than aOutputChannels temporarily.
AudioChannelsUpMix(&channelData, aOutputChannels, SilentChannel::ZeroChannel<SrcT>());
}
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -108,17 +108,17 @@ public:
// sample rate = 44.1k file, the error will be less than 1 microsecond
// after playing 24 hours. So we are fine with that.
mBaseOffset += c.totalFrames;
mBasePosition += FramesToUs<double>(c.servicedFrames, c.rate);
mChunks.RemoveElementAt(0);
}
}
private:
- nsAutoTArray<Chunk, 7> mChunks;
+ AutoTArray<Chunk, 7> mChunks;
int64_t mBaseOffset;
double mBasePosition;
};
AudioStream::AudioStream(DataSource& aSource)
: mMonitor("AudioStream")
, mInRate(0)
, mOutRate(0)
@@ -282,17 +282,17 @@ WriteDumpFile(FILE* aDumpFile, AudioStre
uint32_t samples = aStream->GetOutChannels()*aFrames;
if (AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_S16) {
fwrite(aBuffer, 2, samples, aDumpFile);
return;
}
NS_ASSERTION(AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_FLOAT32, "bad format");
- nsAutoTArray<uint8_t, 1024*2> buf;
+ AutoTArray<uint8_t, 1024*2> buf;
buf.SetLength(samples*2);
float* input = static_cast<float*>(aBuffer);
uint8_t* output = buf.Elements();
for (uint32_t i = 0; i < samples; ++i) {
SetUint16LE(output + i*2, int16_t(input[i]*32767.0f));
}
fwrite(output, 2, samples, aDumpFile);
fflush(aDumpFile);
@@ -611,17 +611,17 @@ AudioStream::GetTimeStretched(AudioBuffe
if (c->Frames() == 0) {
break;
}
MOZ_ASSERT(c->Frames() <= toPopFrames);
if (Downmix(c.get())) {
mTimeStretcher->putSamples(c->Data(), c->Frames());
} else {
// Write silence if downmixing fails.
- nsAutoTArray<AudioDataValue, 1000> buf;
+ AutoTArray<AudioDataValue, 1000> buf;
buf.SetLength(mOutChannels * c->Frames());
memset(buf.Elements(), 0, buf.Length() * sizeof(AudioDataValue));
mTimeStretcher->putSamples(buf.Elements(), c->Frames());
}
}
auto timeStretcher = mTimeStretcher;
aWriter.Write([timeStretcher] (AudioDataValue* aPtr, uint32_t aFrames) {
--- a/dom/media/DOMMediaStream.h
+++ b/dom/media/DOMMediaStream.h
@@ -578,20 +578,20 @@ protected:
// This port connects mInputStream to mOwnedStream. All tracks forwarded.
RefPtr<MediaInputPort> mOwnedPort;
// This port connects mOwnedStream to mPlaybackStream. All tracks not
// explicitly blocked due to removal are forwarded.
RefPtr<MediaInputPort> mPlaybackPort;
// MediaStreamTracks corresponding to tracks in our mOwnedStream.
- nsAutoTArray<RefPtr<TrackPort>, 2> mOwnedTracks;
+ AutoTArray<RefPtr<TrackPort>, 2> mOwnedTracks;
// MediaStreamTracks corresponding to tracks in our mPlaybackStream.
- nsAutoTArray<RefPtr<TrackPort>, 2> mTracks;
+ AutoTArray<RefPtr<TrackPort>, 2> mTracks;
RefPtr<OwnedStreamListener> mOwnedListener;
RefPtr<PlaybackStreamListener> mPlaybackListener;
nsTArray<nsAutoPtr<OnTracksAvailableCallback> > mRunOnTracksAvailable;
// Set to true after MediaStreamGraph has created tracks for mPlaybackStream.
bool mTracksCreated;
--- a/dom/media/FileBlockCache.h
+++ b/dom/media/FileBlockCache.h
@@ -197,17 +197,17 @@ private:
// cached in memory waiting to be written, or this block is the target of a
// block move.
nsTArray< RefPtr<BlockChange> > mBlockChanges;
// Thread upon which block writes and block moves are performed. This is
// created upon open, and shutdown (asynchronously) upon close (on the
// main thread).
nsCOMPtr<nsIThread> mThread;
// Queue of pending block indexes that need to be written or moved.
- //nsAutoTArray<int32_t, 8> mChangeIndexList;
+ //AutoTArray<int32_t, 8> mChangeIndexList;
Int32Queue mChangeIndexList;
// True if we've dispatched an event to commit all pending block changes
// to file on mThread.
bool mIsWriteScheduled;
// True if the writer is ready to write data to file.
bool mIsOpen;
};
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -1093,17 +1093,17 @@ AudioCallbackDriver::EnqueueStreamAndPro
MonitorAutoLock mon(mGraphImpl->GetMonitor());
mPromisesForOperation.AppendElement(StreamAndPromiseForOperation(aStream,
aPromise,
aOperation));
}
void AudioCallbackDriver::CompleteAudioContextOperations(AsyncCubebOperation aOperation)
{
- nsAutoTArray<StreamAndPromiseForOperation, 1> array;
+ AutoTArray<StreamAndPromiseForOperation, 1> array;
// We can't lock for the whole function because AudioContextOperationCompleted
// will grab the monitor
{
MonitorAutoLock mon(GraphImpl()->GetMonitor());
array.SwapElements(mPromisesForOperation);
}
--- a/dom/media/GraphDriver.h
+++ b/dom/media/GraphDriver.h
@@ -514,17 +514,17 @@ private:
~AutoInCallback();
AudioCallbackDriver* mDriver;
};
/* Thread for off-main-thread initialization and
* shutdown of the audio stream. */
nsCOMPtr<nsIThread> mInitShutdownThread;
/* This must be accessed with the graph monitor held. */
- nsAutoTArray<StreamAndPromiseForOperation, 1> mPromisesForOperation;
+ AutoTArray<StreamAndPromiseForOperation, 1> mPromisesForOperation;
/* This is set during initialization, and can be read safely afterwards. */
dom::AudioChannel mAudioChannel;
/* Used to queue us to add the mixer callback on first run. */
bool mAddedMixer;
/* This is atomic and is set by the audio callback thread. It can be read by
* any thread safely. */
Atomic<bool> mInCallback;
--- a/dom/media/Intervals.h
+++ b/dom/media/Intervals.h
@@ -250,17 +250,17 @@ private:
// An IntervalSet in a collection of Intervals. The IntervalSet is always
// normalized.
template<typename T>
class IntervalSet
{
public:
typedef IntervalSet<T> SelfType;
typedef Interval<T> ElemType;
- typedef nsAutoTArray<ElemType,4> ContainerType;
+ typedef AutoTArray<ElemType,4> ContainerType;
typedef typename ContainerType::index_type IndexType;
IntervalSet()
{
}
virtual ~IntervalSet()
{
}
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -789,17 +789,17 @@ MediaCache::FindReusableBlock(TimeStamp
blockIndex = mFreeBlocks.GetNextBlock(blockIndex);
} while (blockIndex >= 0);
}
// Build a list of the blocks we should consider for the "latest
// predicted time of next use". We can exploit the fact that the block
// linked lists are ordered by increasing time of next use. This is
// actually the whole point of having the linked lists.
- nsAutoTArray<uint32_t,8> candidates;
+ AutoTArray<uint32_t,8> candidates;
for (uint32_t i = 0; i < mStreams.Length(); ++i) {
MediaCacheStream* stream = mStreams[i];
if (stream->mPinCount > 0) {
// No point in even looking at this stream's blocks
continue;
}
AppendMostReusableBlock(&stream->mMetadataBlocks, &candidates, length);
@@ -1035,17 +1035,17 @@ void
MediaCache::Update()
{
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
// The action to use for each stream. We store these so we can make
// decisions while holding the cache lock but implement those decisions
// without holding the cache lock, since we need to call out to
// stream, decoder and element code.
- nsAutoTArray<StreamAction,10> actions;
+ AutoTArray<StreamAction,10> actions;
{
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
mUpdateQueued = false;
#ifdef DEBUG
mInUpdate = true;
#endif
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -601,17 +601,17 @@ MediaStreamGraphImpl::CreateOrDestroyAud
if (!aStream->GetStreamBuffer().GetAndResetTracksDirty() &&
!aStream->mAudioOutputStreams.IsEmpty()) {
return;
}
STREAM_LOG(LogLevel::Debug, ("Updating AudioOutputStreams for MediaStream %p", aStream));
- nsAutoTArray<bool,2> audioOutputStreamsFound;
+ AutoTArray<bool,2> audioOutputStreamsFound;
for (uint32_t i = 0; i < aStream->mAudioOutputStreams.Length(); ++i) {
audioOutputStreamsFound.AppendElement(false);
}
for (StreamBuffer::TrackIter tracks(aStream->GetStreamBuffer(), MediaSegment::AUDIO);
!tracks.IsEnded(); tracks.Next()) {
uint32_t i;
for (i = 0; i < audioOutputStreamsFound.Length(); ++i) {
@@ -786,17 +786,17 @@ MediaStreamGraphImpl::PlayVideo(MediaStr
MOZ_ASSERT(mRealtime, "Should only attempt to play video in realtime mode");
if (aStream->mVideoOutputs.IsEmpty())
return;
TimeStamp currentTimeStamp = CurrentDriver()->GetCurrentTimeStamp();
// Collect any new frames produced in this iteration.
- nsAutoTArray<ImageContainer::NonOwningImage,4> newImages;
+ AutoTArray<ImageContainer::NonOwningImage,4> newImages;
RefPtr<Image> blackImage;
MOZ_ASSERT(mProcessedTime >= aStream->mBufferStartTime, "frame position before buffer?");
// We only look at the non-blocking interval
StreamTime frameBufferTime = aStream->GraphTimeToStreamTime(mProcessedTime);
StreamTime bufferEndTime = aStream->GraphTimeToStreamTime(aStream->mStartBlocking);
StreamTime start;
const VideoChunk* chunk;
@@ -856,24 +856,24 @@ MediaStreamGraphImpl::PlayVideo(MediaStr
newImages.AppendElement(ImageContainer::NonOwningImage(image, targetTime));
aStream->mLastPlayedVideoFrame = *frame;
}
if (!aStream->mLastPlayedVideoFrame.GetImage())
return;
- nsAutoTArray<ImageContainer::NonOwningImage,4> images;
+ AutoTArray<ImageContainer::NonOwningImage,4> images;
bool haveMultipleImages = false;
for (uint32_t i = 0; i < aStream->mVideoOutputs.Length(); ++i) {
VideoFrameContainer* output = aStream->mVideoOutputs[i];
// Find previous frames that may still be valid.
- nsAutoTArray<ImageContainer::OwningImage,4> previousImages;
+ AutoTArray<ImageContainer::OwningImage,4> previousImages;
output->GetImageContainer()->GetCurrentImages(&previousImages);
uint32_t j = previousImages.Length();
if (j) {
// Re-use the most recent frame before currentTimeStamp and subsequent,
// always keeping at least one frame.
do {
--j;
} while (j > 0 && previousImages[j].mTimeStamp > currentTimeStamp);
--- a/dom/media/TrackUnionStream.cpp
+++ b/dom/media/TrackUnionStream.cpp
@@ -62,18 +62,18 @@ TrackUnionStream::TrackUnionStream(DOMMe
}
ProcessedMediaStream::RemoveInput(aPort);
}
void TrackUnionStream::ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags)
{
if (IsFinishedOnGraphThread()) {
return;
}
- nsAutoTArray<bool,8> mappedTracksFinished;
- nsAutoTArray<bool,8> mappedTracksWithMatchingInputTracks;
+ AutoTArray<bool,8> mappedTracksFinished;
+ AutoTArray<bool,8> mappedTracksWithMatchingInputTracks;
for (uint32_t i = 0; i < mTrackMap.Length(); ++i) {
mappedTracksFinished.AppendElement(true);
mappedTracksWithMatchingInputTracks.AppendElement(false);
}
bool allFinished = !mInputs.IsEmpty();
bool allHaveCurrentData = !mInputs.IsEmpty();
for (uint32_t i = 0; i < mInputs.Length(); ++i) {
MediaStream* stream = mInputs[i]->GetSource();
--- a/dom/media/VideoFrameContainer.cpp
+++ b/dom/media/VideoFrameContainer.cpp
@@ -30,17 +30,17 @@ VideoFrameContainer::~VideoFrameContaine
{}
void VideoFrameContainer::SetCurrentFrame(const gfx::IntSize& aIntrinsicSize,
Image* aImage,
const TimeStamp& aTargetTime)
{
if (aImage) {
MutexAutoLock lock(mMutex);
- nsAutoTArray<ImageContainer::NonOwningImage,1> imageList;
+ AutoTArray<ImageContainer::NonOwningImage,1> imageList;
imageList.AppendElement(
ImageContainer::NonOwningImage(aImage, aTargetTime, ++mFrameID));
SetCurrentFramesLocked(aIntrinsicSize, imageList);
} else {
ClearCurrentFrame(aIntrinsicSize);
}
}
--- a/dom/media/encoder/OpusTrackEncoder.cpp
+++ b/dom/media/encoder/OpusTrackEncoder.cpp
@@ -308,17 +308,17 @@ OpusTrackEncoder::GetEncodedTrack(Encode
// original data, the pcm duration will be calculated at rate 48K later.
if (mEndOfStream && !mEosSetInEncoder) {
mEosSetInEncoder = true;
mSourceSegment.AppendNullData(mLookahead);
}
}
// Start encoding data.
- nsAutoTArray<AudioDataValue, 9600> pcm;
+ AutoTArray<AudioDataValue, 9600> pcm;
pcm.SetLength(GetPacketDuration() * mChannels);
AudioSegment::ChunkIterator iter(mSourceSegment);
int frameCopied = 0;
while (!iter.IsEnded() && frameCopied < framesToFetch) {
AudioChunk chunk = *iter;
// Chunk to the required frame size.
@@ -339,17 +339,17 @@ OpusTrackEncoder::GetEncodedTrack(Encode
frameCopied += frameToCopy;
iter.Next();
}
RefPtr<EncodedFrame> audiodata = new EncodedFrame();
audiodata->SetFrameType(EncodedFrame::OPUS_AUDIO_FRAME);
int framesInPCM = frameCopied;
if (mResampler) {
- nsAutoTArray<AudioDataValue, 9600> resamplingDest;
+ AutoTArray<AudioDataValue, 9600> resamplingDest;
// We want to consume all the input data, so we slightly oversize the
// resampled data buffer so we can fit the output data in. We cannot really
// predict the output frame count at each call.
uint32_t outframes = frameCopied * kOpusSamplingRate / mSamplingRate + 1;
uint32_t inframes = frameCopied;
resamplingDest.SetLength(outframes * mChannels);
--- a/dom/media/encoder/TrackEncoder.cpp
+++ b/dom/media/encoder/TrackEncoder.cpp
@@ -135,26 +135,26 @@ AudioTrackEncoder::AppendAudioSegment(co
void
AudioTrackEncoder::InterleaveTrackData(AudioChunk& aChunk,
int32_t aDuration,
uint32_t aOutputChannels,
AudioDataValue* aOutput)
{
switch(aChunk.mBufferFormat) {
case AUDIO_FORMAT_S16: {
- nsAutoTArray<const int16_t*, 2> array;
+ AutoTArray<const int16_t*, 2> array;
array.SetLength(aOutputChannels);
for (uint32_t i = 0; i < array.Length(); i++) {
array[i] = static_cast<const int16_t*>(aChunk.mChannelData[i]);
}
InterleaveTrackData(array, aDuration, aOutputChannels, aOutput, aChunk.mVolume);
break;
}
case AUDIO_FORMAT_FLOAT32: {
- nsAutoTArray<const float*, 2> array;
+ AutoTArray<const float*, 2> array;
array.SetLength(aOutputChannels);
for (uint32_t i = 0; i < array.Length(); i++) {
array[i] = static_cast<const float*>(aChunk.mChannelData[i]);
}
InterleaveTrackData(array, aDuration, aOutputChannels, aOutput, aChunk.mVolume);
break;
}
case AUDIO_FORMAT_SILENCE: {
--- a/dom/media/encoder/VorbisTrackEncoder.cpp
+++ b/dom/media/encoder/VorbisTrackEncoder.cpp
@@ -197,18 +197,18 @@ VorbisTrackEncoder::GetEncodedTrack(Enco
// Start encoding data.
AudioSegment::ChunkIterator iter(*sourceSegment);
AudioDataValue **vorbisBuffer =
vorbis_analysis_buffer(&mVorbisDsp, (int)sourceSegment->GetDuration());
int framesCopied = 0;
- nsAutoTArray<AudioDataValue, 9600> interleavedPcm;
- nsAutoTArray<AudioDataValue, 9600> nonInterleavedPcm;
+ AutoTArray<AudioDataValue, 9600> interleavedPcm;
+ AutoTArray<AudioDataValue, 9600> nonInterleavedPcm;
interleavedPcm.SetLength(sourceSegment->GetDuration() * mChannels);
nonInterleavedPcm.SetLength(sourceSegment->GetDuration() * mChannels);
while (!iter.IsEnded()) {
AudioChunk chunk = *iter;
int frameToCopy = chunk.GetDuration();
if (!chunk.IsNull()) {
InterleaveTrackData(chunk, frameToCopy, mChannels,
interleavedPcm.Elements() + framesCopied * mChannels);
--- a/dom/media/gmp/GMPDecryptorChild.cpp
+++ b/dom/media/gmp/GMPDecryptorChild.cpp
@@ -152,17 +152,17 @@ GMPDecryptorChild::SessionError(const ch
void
GMPDecryptorChild::KeyStatusChanged(const char* aSessionId,
uint32_t aSessionIdLength,
const uint8_t* aKeyId,
uint32_t aKeyIdLength,
GMPMediaKeyStatus aStatus)
{
- nsAutoTArray<uint8_t, 16> kid;
+ AutoTArray<uint8_t, 16> kid;
kid.AppendElements(aKeyId, aKeyIdLength);
CALL_ON_GMP_THREAD(SendKeyStatusChanged,
nsCString(aSessionId, aSessionIdLength), kid,
aStatus);
}
void
GMPDecryptorChild::Decrypted(GMPBuffer* aBuffer, GMPErr aResult)
--- a/dom/media/gtest/TestVorbisTrackEncoder.cpp
+++ b/dom/media/gtest/TestVorbisTrackEncoder.cpp
@@ -178,17 +178,17 @@ TEST(VorbisTrackEncoder, EncodedFrame)
// Generate 1 second samples.
// Reference PeerConnectionMedia.h::Fake_AudioGenerator
RefPtr<mozilla::SharedBuffer> samples =
mozilla::SharedBuffer::Create(rate * sizeof(AudioDataValue));
AudioDataValue* data = static_cast<AudioDataValue*>(samples->Data());
for (int i = 0; i < rate; i++) {
data[i] = ((i%8)*4000) - (7*4000)/2;
}
- nsAutoTArray<const AudioDataValue*,1> channelData;
+ AutoTArray<const AudioDataValue*,1> channelData;
channelData.AppendElement(data);
AudioSegment segment;
segment.AppendFrames(samples.forget(), channelData, 44100);
// Track change notification.
encoder.NotifyQueuedTrackChanges(nullptr, 0, 0, 0, segment);
// Pull Encoded data back from encoder and verify encoded samples.
--- a/dom/media/mediasink/DecodedStream.cpp
+++ b/dom/media/mediasink/DecodedStream.cpp
@@ -495,17 +495,17 @@ SendStreamAudio(DecodedStreamData* aStre
aOutput->AppendFrom(&silence);
}
// Always write the whole sample without truncation to be consistent with
// DecodedAudioDataSink::PlayFromAudioQueue()
audio->EnsureAudioBuffer();
RefPtr<SharedBuffer> buffer = audio->mAudioBuffer;
AudioDataValue* bufferData = static_cast<AudioDataValue*>(buffer->Data());
- nsAutoTArray<const AudioDataValue*, 2> channels;
+ AutoTArray<const AudioDataValue*, 2> channels;
for (uint32_t i = 0; i < audio->mChannels; ++i) {
channels.AppendElement(bufferData + i * audio->mFrames);
}
aOutput->AppendFrames(buffer.forget(), channels, audio->mFrames);
aStream->mAudioFramesWritten += audio->mFrames;
aOutput->ApplyVolume(aVolume);
aStream->mNextAudioTime = audio->GetEndTime();
@@ -517,17 +517,17 @@ DecodedStream::SendAudio(double aVolume,
AssertOwnerThread();
if (!mInfo.HasAudio()) {
return;
}
AudioSegment output;
uint32_t rate = mInfo.mAudio.mRate;
- nsAutoTArray<RefPtr<MediaData>,10> audio;
+ AutoTArray<RefPtr<MediaData>,10> audio;
TrackID audioTrackId = mInfo.mAudio.mTrackId;
SourceMediaStream* sourceStream = mData->mStream;
// It's OK to hold references to the AudioData because AudioData
// is ref-counted.
mAudioQueue.GetElementsAfter(mData->mNextAudioTime, &audio);
for (uint32_t i = 0; i < audio.Length(); ++i) {
SendStreamAudio(mData.get(), mStartTime.ref(), audio[i], &output, rate, aVolume);
@@ -582,17 +582,17 @@ DecodedStream::SendVideo(bool aIsSameOri
AssertOwnerThread();
if (!mInfo.HasVideo()) {
return;
}
VideoSegment output;
TrackID videoTrackId = mInfo.mVideo.mTrackId;
- nsAutoTArray<RefPtr<MediaData>, 10> video;
+ AutoTArray<RefPtr<MediaData>, 10> video;
SourceMediaStream* sourceStream = mData->mStream;
// It's OK to hold references to the VideoData because VideoData
// is ref-counted.
mVideoQueue.GetElementsAfter(mData->mNextVideoTime, &video);
for (uint32_t i = 0; i < video.Length(); ++i) {
VideoData* v = video[i]->As<VideoData>();
--- a/dom/media/mediasink/VideoSink.cpp
+++ b/dom/media/mediasink/VideoSink.cpp
@@ -309,23 +309,23 @@ VideoSink::DisconnectListener()
void
VideoSink::RenderVideoFrames(int32_t aMaxFrames,
int64_t aClockTime,
const TimeStamp& aClockTimeStamp)
{
AssertOwnerThread();
- nsAutoTArray<RefPtr<MediaData>,16> frames;
+ AutoTArray<RefPtr<MediaData>,16> frames;
VideoQueue().GetFirstElements(aMaxFrames, &frames);
if (frames.IsEmpty() || !mContainer) {
return;
}
- nsAutoTArray<ImageContainer::NonOwningImage,16> images;
+ AutoTArray<ImageContainer::NonOwningImage,16> images;
TimeStamp lastFrameTime;
MediaSink::PlaybackParams params = mAudioSink->GetPlaybackParams();
for (uint32_t i = 0; i < frames.Length(); ++i) {
VideoData* frame = frames[i]->As<VideoData>();
frame->mSentToCompositor = true;
if (!frame->mImage || !frame->mImage->IsValid()) {
--- a/dom/media/ogg/OggReader.cpp
+++ b/dom/media/ogg/OggReader.cpp
@@ -291,17 +291,17 @@ void OggReader::SetupTargetSkeleton(Skel
if (aSkeletonState) {
if (!HasAudio() && !HasVideo()) {
// We have a skeleton track, but no audio or video, may as well disable
// the skeleton, we can't do anything useful with this media.
aSkeletonState->Deactivate();
} else if (ReadHeaders(aSkeletonState) && aSkeletonState->HasIndex()) {
// Extract the duration info out of the index, so we don't need to seek to
// the end of resource to get it.
- nsAutoTArray<uint32_t, 2> tracks;
+ AutoTArray<uint32_t, 2> tracks;
BuildSerialList(tracks);
int64_t duration = 0;
if (NS_SUCCEEDED(aSkeletonState->GetDuration(tracks, duration))) {
LOG(LogLevel::Debug, ("Got duration from Skeleton index %lld", duration));
mInfo.mMetadataDuration.emplace(TimeUnit::FromMicroseconds(duration));
}
}
}
@@ -390,17 +390,17 @@ nsresult OggReader::ReadMetadata(MediaIn
// We read packets until all bitstreams have read all their header packets.
// We record the offset of the first non-header page so that we know
// what page to seek to when seeking to the media start.
NS_ASSERTION(aTags, "Called with null MetadataTags**.");
*aTags = nullptr;
ogg_page page;
- nsAutoTArray<OggCodecState*,4> bitstreams;
+ AutoTArray<OggCodecState*,4> bitstreams;
nsTArray<uint32_t> serials;
bool readAllBOS = false;
while (!readAllBOS) {
if (!ReadOggPage(&page)) {
// Some kind of error...
break;
}
@@ -1249,17 +1249,17 @@ OggReader::IndexedSeekResult OggReader::
}
OggReader::IndexedSeekResult OggReader::SeekToKeyframeUsingIndex(int64_t aTarget)
{
if (!HasSkeleton() || !mSkeletonState->HasIndex()) {
return SEEK_INDEX_FAIL;
}
// We have an index from the Skeleton track, try to use it to seek.
- nsAutoTArray<uint32_t, 2> tracks;
+ AutoTArray<uint32_t, 2> tracks;
BuildSerialList(tracks);
SkeletonState::nsSeekTarget keyframe;
if (NS_FAILED(mSkeletonState->IndexedSeekTarget(aTarget,
tracks,
keyframe)))
{
// Could not locate a keypoint for the target in the index.
return SEEK_INDEX_FAIL;
@@ -1444,17 +1444,17 @@ nsresult OggReader::SeekInternal(int64_t
// have a way of asking Skeleton to seek to a different target for each
// stream yet. Using adjustedTarget here is at least correct, if slow.
IndexedSeekResult sres = SeekToKeyframeUsingIndex(adjustedTarget);
NS_ENSURE_TRUE(sres != SEEK_FATAL_ERROR, NS_ERROR_FAILURE);
if (sres == SEEK_INDEX_FAIL) {
// No index or other non-fatal index-related failure. Try to seek
// using a bisection search. Determine the already downloaded data
// in the media cache, so we can try to seek in the cached data first.
- nsAutoTArray<SeekRange, 16> ranges;
+ AutoTArray<SeekRange, 16> ranges;
res = GetSeekRanges(ranges);
NS_ENSURE_SUCCESS(res,res);
// Figure out if the seek target lies in a buffered range.
SeekRange r = SelectSeekRange(ranges, aTarget, StartTime(), aEndTime, true);
if (!r.IsNull()) {
// We know the buffered range in which the seek target lies, do a
--- a/dom/media/omx/OMXCodecWrapper.cpp
+++ b/dom/media/omx/OMXCodecWrapper.cpp
@@ -746,17 +746,17 @@ public:
if (aChunk.IsNull()) {
bytesCopied = SendSilenceToBuffer(chunkSamples);
} else {
bytesCopied = SendChunkToBuffer(aChunk, chunkSamples);
}
UpdateAfterSendChunk(chunkSamples, bytesCopied, aSamplesRead);
} else {
// Interleave data to a temporary buffer.
- nsAutoTArray<AudioDataValue, 9600> pcm;
+ AutoTArray<AudioDataValue, 9600> pcm;
pcm.SetLength(bytesToCopy);
AudioDataValue* interleavedSource = pcm.Elements();
AudioTrackEncoder::InterleaveTrackData(aChunk, chunkSamples,
mOMXAEncoder.mChannels,
interleavedSource);
// When the data size of chunk is larger than the buffer capacity,
// we split it into sub-chunks to fill up buffers.
@@ -848,17 +848,17 @@ private:
// and return the copied bytes number of audio data.
size_t SendChunkToBuffer(AudioChunk& aSource, size_t aSamplesNum)
{
AudioDataValue* dst = reinterpret_cast<AudioDataValue*>(GetPointer());
size_t bytesToCopy = aSamplesNum * mOMXAEncoder.mResamplingRatio
* mOMXAEncoder.mChannels * sizeof(AudioDataValue);
uint32_t dstSamplesCopied = aSamplesNum;
if (mOMXAEncoder.mResampler) {
- nsAutoTArray<AudioDataValue, 9600> pcm;
+ AutoTArray<AudioDataValue, 9600> pcm;
pcm.SetLength(bytesToCopy);
AudioTrackEncoder::InterleaveTrackData(aSource, aSamplesNum,
mOMXAEncoder.mChannels,
pcm.Elements());
int16_t* tempSource = reinterpret_cast<int16_t*>(pcm.Elements());
speex_resampler_process_interleaved_int(mOMXAEncoder.mResampler, tempSource,
&aSamplesNum, dst,
&dstSamplesCopied);
--- a/dom/media/platforms/agnostic/VorbisDecoder.cpp
+++ b/dom/media/platforms/agnostic/VorbisDecoder.cpp
@@ -66,18 +66,18 @@ VorbisDataDecoder::Shutdown()
RefPtr<MediaDataDecoder::InitPromise>
VorbisDataDecoder::Init()
{
vorbis_info_init(&mVorbisInfo);
vorbis_comment_init(&mVorbisComment);
PodZero(&mVorbisDsp);
PodZero(&mVorbisBlock);
- nsAutoTArray<unsigned char*,4> headers;
- nsAutoTArray<size_t,4> headerLens;
+ AutoTArray<unsigned char*,4> headers;
+ AutoTArray<size_t,4> headerLens;
if (!XiphExtradataToHeaders(headers, headerLens,
mInfo.mCodecSpecificConfig->Elements(),
mInfo.mCodecSpecificConfig->Length())) {
return InitPromise::CreateAndReject(DecoderFailureReason::INIT_ERROR, __func__);
}
for (size_t i = 0; i < headers.Length(); i++) {
if (NS_FAILED(DecodeHeader(headers[i], headerLens[i]))) {
return InitPromise::CreateAndReject(DecoderFailureReason::INIT_ERROR, __func__);
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
@@ -118,17 +118,17 @@ private:
}
// Remove all elements of the map.
void Clear()
{
mMap.Clear();
}
private:
- nsAutoTArray<DurationElement, 16> mMap;
+ AutoTArray<DurationElement, 16> mMap;
};
DurationMap mDurationMap;
};
} // namespace mozilla
#endif // __FFmpegVideoDecoder_h__
--- a/dom/media/systemservices/MediaUtils.h
+++ b/dom/media/systemservices/MediaUtils.h
@@ -316,17 +316,17 @@ public:
}
private:
static uint32_t GetNextId()
{
static uint32_t counter = 0;
return ++counter;
};
- nsAutoTArray<Element, 3> mElements;
+ AutoTArray<Element, 3> mElements;
};
/* media::Refcountable - Add threadsafe ref-counting to something that isn't.
*
* Often, reference counting is the most practical way to share an object with
* another thread without imposing lifetime restrictions, even if there's
* otherwise no concurrent access happening on the object. For instance, an
* algorithm on another thread may find it more expedient to modify a passed-in
--- a/dom/media/webaudio/AudioBuffer.h
+++ b/dom/media/webaudio/AudioBuffer.h
@@ -114,17 +114,17 @@ protected:
already_AddRefed<ThreadSharedFloatArrayBufferList>
StealJSArrayDataIntoSharedChannels(JSContext* aJSContext);
void ClearJSChannels();
nsWeakPtr mOwnerWindow;
// Float32Arrays
- nsAutoTArray<JS::Heap<JSObject*>, 2> mJSChannels;
+ AutoTArray<JS::Heap<JSObject*>, 2> mJSChannels;
// mSharedChannels aggregates the data from mJSChannels. This is non-null
// if and only if the mJSChannels' buffers are detached.
RefPtr<ThreadSharedFloatArrayBufferList> mSharedChannels;
uint32_t mLength;
float mSampleRate;
};
--- a/dom/media/webaudio/AudioNodeEngine.h
+++ b/dom/media/webaudio/AudioNodeEngine.h
@@ -123,17 +123,17 @@ public:
}
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}
private:
- nsAutoTArray<Storage, 2> mContents;
+ AutoTArray<Storage, 2> mContents;
};
/**
* aChunk must have been allocated by AllocateAudioBlock.
*/
void WriteZeroesToAudioBlock(AudioBlock* aChunk, uint32_t aStart,
uint32_t aLength);
@@ -248,17 +248,17 @@ AudioBufferSumOfSquares(const float* aIn
/**
* All methods of this class and its subclasses are called on the
* MediaStreamGraph thread.
*/
class AudioNodeEngine
{
public:
// This should be compatible with AudioNodeStream::OutputChunks.
- typedef nsAutoTArray<AudioBlock, 1> OutputChunks;
+ typedef AutoTArray<AudioBlock, 1> OutputChunks;
explicit AudioNodeEngine(dom::AudioNode* aNode)
: mNode(aNode)
, mInputCount(aNode ? aNode->NumberOfInputs() : 1)
, mOutputCount(aNode ? aNode->NumberOfOutputs() : 0)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_COUNT_CTOR(AudioNodeEngine);
--- a/dom/media/webaudio/AudioNodeExternalInputStream.cpp
+++ b/dom/media/webaudio/AudioNodeExternalInputStream.cpp
@@ -44,17 +44,17 @@ AudioNodeExternalInputStream::Create(Med
* count that's a superset of the channels in aInput.
*/
template <typename T>
static void
CopyChunkToBlock(AudioChunk& aInput, AudioBlock *aBlock,
uint32_t aOffsetInBlock)
{
uint32_t blockChannels = aBlock->ChannelCount();
- nsAutoTArray<const T*,2> channels;
+ AutoTArray<const T*,2> channels;
if (aInput.IsNull()) {
channels.SetLength(blockChannels);
PodZero(channels.Elements(), blockChannels);
} else {
const nsTArray<const T*>& inputChannels = aInput.ChannelData<T>();
channels.SetLength(inputChannels.Length());
PodCopy(channels.Elements(), inputChannels.Elements(), channels.Length());
if (channels.Length() != blockChannels) {
@@ -132,17 +132,17 @@ AudioNodeExternalInputStream::ProcessInp
if (!IsEnabled() || mInputs.IsEmpty() || mPassThrough) {
mLastChunks[0].SetNull(WEBAUDIO_BLOCK_SIZE);
return;
}
MOZ_ASSERT(mInputs.Length() == 1);
MediaStream* source = mInputs[0]->GetSource();
- nsAutoTArray<AudioSegment,1> audioSegments;
+ AutoTArray<AudioSegment,1> audioSegments;
uint32_t inputChannels = 0;
for (StreamBuffer::TrackIter tracks(source->mBuffer, MediaSegment::AUDIO);
!tracks.IsEnded(); tracks.Next()) {
const StreamBuffer::Track& inputTrack = *tracks;
if (!mInputs[0]->PassTrackThrough(tracks->GetID())) {
continue;
}
@@ -187,17 +187,17 @@ AudioNodeExternalInputStream::ProcessInp
for (AudioSegment::ChunkIterator iter(segment); !iter.IsEnded(); iter.Next()) {
inputChannels = GetAudioChannelsSuperset(inputChannels, iter->ChannelCount());
}
}
uint32_t accumulateIndex = 0;
if (inputChannels) {
- nsAutoTArray<float,GUESS_AUDIO_CHANNELS*WEBAUDIO_BLOCK_SIZE> downmixBuffer;
+ AutoTArray<float,GUESS_AUDIO_CHANNELS*WEBAUDIO_BLOCK_SIZE> downmixBuffer;
for (uint32_t i = 0; i < audioSegments.Length(); ++i) {
AudioBlock tmpChunk;
ConvertSegmentToAudioBlock(&audioSegments[i], &tmpChunk, inputChannels);
if (!tmpChunk.IsNull()) {
if (accumulateIndex == 0) {
mLastChunks[0].AllocateChannels(inputChannels);
}
AccumulateInputChunk(accumulateIndex, tmpChunk, &mLastChunks[0], &downmixBuffer);
--- a/dom/media/webaudio/AudioNodeStream.cpp
+++ b/dom/media/webaudio/AudioNodeStream.cpp
@@ -403,17 +403,17 @@ AudioNodeStream::AdvanceAndResume(Stream
}
void
AudioNodeStream::ObtainInputBlock(AudioBlock& aTmpChunk,
uint32_t aPortIndex)
{
uint32_t inputCount = mInputs.Length();
uint32_t outputChannelCount = 1;
- nsAutoTArray<const AudioBlock*,250> inputChunks;
+ AutoTArray<const AudioBlock*,250> inputChunks;
for (uint32_t i = 0; i < inputCount; ++i) {
if (aPortIndex != mInputs[i]->InputNumber()) {
// This input is connected to a different port
continue;
}
MediaStream* s = mInputs[i]->GetSource();
AudioNodeStream* a = static_cast<AudioNodeStream*>(s);
MOZ_ASSERT(a == s->AsAudioNodeStream());
@@ -449,30 +449,30 @@ AudioNodeStream::ObtainInputBlock(AudioB
if (outputChannelCount == 0) {
aTmpChunk.SetNull(WEBAUDIO_BLOCK_SIZE);
return;
}
aTmpChunk.AllocateChannels(outputChannelCount);
// The static storage here should be 1KB, so it's fine
- nsAutoTArray<float, GUESS_AUDIO_CHANNELS*WEBAUDIO_BLOCK_SIZE> downmixBuffer;
+ AutoTArray<float, GUESS_AUDIO_CHANNELS*WEBAUDIO_BLOCK_SIZE> downmixBuffer;
for (uint32_t i = 0; i < inputChunkCount; ++i) {
AccumulateInputChunk(i, *inputChunks[i], &aTmpChunk, &downmixBuffer);
}
}
void
AudioNodeStream::AccumulateInputChunk(uint32_t aInputIndex,
const AudioBlock& aChunk,
AudioBlock* aBlock,
nsTArray<float>* aDownmixBuffer)
{
- nsAutoTArray<const float*,GUESS_AUDIO_CHANNELS> channels;
+ AutoTArray<const float*,GUESS_AUDIO_CHANNELS> channels;
UpMixDownMixChunk(&aChunk, aBlock->ChannelCount(), channels, *aDownmixBuffer);
for (uint32_t c = 0; c < channels.Length(); ++c) {
const float* inputData = static_cast<const float*>(channels[c]);
float* outputData = aBlock->ChannelFloatsForWrite(c);
if (inputData) {
if (aInputIndex == 0) {
AudioBlockCopyChannelWithScale(inputData, aChunk.mVolume, outputData);
@@ -504,17 +504,17 @@ AudioNodeStream::UpMixDownMixChunk(const
} else {
// Fill up the remaining aOutputChannels by zeros
for (uint32_t j = aOutputChannels.Length(); j < aOutputChannelCount; ++j) {
aOutputChannels.AppendElement(nullptr);
}
}
} else if (aOutputChannels.Length() > aOutputChannelCount) {
if (mChannelInterpretation == ChannelInterpretation::Speakers) {
- nsAutoTArray<float*,GUESS_AUDIO_CHANNELS> outputChannels;
+ AutoTArray<float*,GUESS_AUDIO_CHANNELS> outputChannels;
outputChannels.SetLength(aOutputChannelCount);
aDownmixBuffer.SetLength(aOutputChannelCount * WEBAUDIO_BLOCK_SIZE);
for (uint32_t j = 0; j < aOutputChannelCount; ++j) {
outputChannels[j] = &aDownmixBuffer[j * WEBAUDIO_BLOCK_SIZE];
}
AudioChannelsDownMix(aOutputChannels, outputChannels.Elements(),
aOutputChannelCount, WEBAUDIO_BLOCK_SIZE);
--- a/dom/media/webaudio/AudioNodeStream.h
+++ b/dom/media/webaudio/AudioNodeStream.h
@@ -36,17 +36,17 @@ class AudioNodeStream : public Processed
typedef dom::ChannelCountMode ChannelCountMode;
typedef dom::ChannelInterpretation ChannelInterpretation;
public:
typedef mozilla::dom::AudioContext AudioContext;
enum { AUDIO_TRACK = 1 };
- typedef nsAutoTArray<AudioBlock, 1> OutputChunks;
+ typedef AutoTArray<AudioBlock, 1> OutputChunks;
// Flags re main thread updates and stream output.
typedef unsigned Flags;
enum : Flags {
NO_STREAM_FLAGS = 0U,
NEED_MAIN_THREAD_FINISHED = 1U << 0,
NEED_MAIN_THREAD_CURRENT_TIME = 1U << 1,
// Internal AudioNodeStreams can only pass their output to another
--- a/dom/media/webaudio/DelayBuffer.h
+++ b/dom/media/webaudio/DelayBuffer.h
@@ -89,17 +89,17 @@ private:
int OffsetForPosition(int aPosition);
int ChunkForDelay(int aDelay);
void UpdateUpmixChannels(int aNewReadChunk, uint32_t channelCount,
ChannelInterpretation aChannelInterpretation);
// Circular buffer for capturing delayed samples.
FallibleTArray<AudioChunk> mChunks;
// Cache upmixed channel arrays.
- nsAutoTArray<const float*,GUESS_AUDIO_CHANNELS> mUpmixChannels;
+ AutoTArray<const float*,GUESS_AUDIO_CHANNELS> mUpmixChannels;
double mSmoothingRate;
// Current delay, in fractional ticks
double mCurrentDelay;
// Maximum delay, in ticks
int mMaxDelayTicks;
// The current position in the circular buffer. The next write will be to
// this chunk, and the next read may begin before this chunk.
int mCurrentChunk;
--- a/dom/media/webaudio/WebAudioUtils.cpp
+++ b/dom/media/webaudio/WebAudioUtils.cpp
@@ -31,18 +31,18 @@ WebAudioUtils::Shutdown()
int
WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler,
uint32_t aChannel,
const float* aIn, uint32_t* aInLen,
float* aOut, uint32_t* aOutLen)
{
#ifdef MOZ_SAMPLE_TYPE_S16
- nsAutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp1;
- nsAutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp2;
+ AutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp1;
+ AutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp2;
tmp1.SetLength(*aInLen);
tmp2.SetLength(*aOutLen);
ConvertAudioSamples(aIn, tmp1.Elements(), *aInLen);
int result = speex_resampler_process_int(aResampler, aChannel, tmp1.Elements(), aInLen, tmp2.Elements(), aOutLen);
ConvertAudioSamples(tmp2.Elements(), aOut, *aOutLen);
return result;
#else
return speex_resampler_process_float(aResampler, aChannel, aIn, aInLen, aOut, aOutLen);
@@ -50,17 +50,17 @@ WebAudioUtils::SpeexResamplerProcess(Spe
}
int
WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler,
uint32_t aChannel,
const int16_t* aIn, uint32_t* aInLen,
float* aOut, uint32_t* aOutLen)
{
- nsAutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp;
+ AutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp;
#ifdef MOZ_SAMPLE_TYPE_S16
tmp.SetLength(*aOutLen);
int result = speex_resampler_process_int(aResampler, aChannel, aIn, aInLen, tmp.Elements(), aOutLen);
ConvertAudioSamples(tmp.Elements(), aOut, *aOutLen);
return result;
#else
tmp.SetLength(*aInLen);
ConvertAudioSamples(aIn, tmp.Elements(), *aInLen);
@@ -73,18 +73,18 @@ int
WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler,
uint32_t aChannel,
const int16_t* aIn, uint32_t* aInLen,
int16_t* aOut, uint32_t* aOutLen)
{
#ifdef MOZ_SAMPLE_TYPE_S16
return speex_resampler_process_int(aResampler, aChannel, aIn, aInLen, aOut, aOutLen);
#else
- nsAutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp1;
- nsAutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp2;
+ AutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp1;
+ AutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp2;
tmp1.SetLength(*aInLen);
tmp2.SetLength(*aOutLen);
ConvertAudioSamples(aIn, tmp1.Elements(), *aInLen);
int result = speex_resampler_process_float(aResampler, aChannel, tmp1.Elements(), aInLen, tmp2.Elements(), aOutLen);
ConvertAudioSamples(tmp2.Elements(), aOut, *aOutLen);
return result;
#endif
}
--- a/dom/media/webaudio/blink/HRTFElevation.cpp
+++ b/dom/media/webaudio/blink/HRTFElevation.cpp
@@ -123,17 +123,17 @@ nsReturnRef<HRTFKernel> HRTFElevation::c
float response[ResponseFrameSize];
ConvertAudioSamples(impulse_response_data, response, ResponseFrameSize);
float* resampledResponse;
#endif
// Note that depending on the fftSize returned by the panner, we may be truncating the impulse response.
const size_t resampledResponseLength = fftSizeForSampleRate(sampleRate) / 2;
- nsAutoTArray<AudioDataValue, 2 * ResponseFrameSize> resampled;
+ AutoTArray<AudioDataValue, 2 * ResponseFrameSize> resampled;
if (sampleRate == rawSampleRate) {
resampledResponse = response;
MOZ_ASSERT(resampledResponseLength == ResponseFrameSize);
} else {
resampled.SetLength(resampledResponseLength);
resampledResponse = resampled.Elements();
speex_resampler_skip_zeros(resampler);
@@ -158,17 +158,17 @@ nsReturnRef<HRTFKernel> HRTFElevation::c
PodZero(resampled.Elements() + out_index,
resampled.Length() - out_index);
}
speex_resampler_reset_mem(resampler);
}
#ifdef MOZ_SAMPLE_TYPE_S16
- nsAutoTArray<float, 2 * ResponseFrameSize> floatArray;
+ AutoTArray<float, 2 * ResponseFrameSize> floatArray;
floatArray.SetLength(resampledResponseLength);
float *floatResponse = floatArray.Elements();
ConvertAudioSamples(resampledResponse,
floatResponse, resampledResponseLength);
#else
float *floatResponse = resampledResponse;
#endif
#undef RESAMPLER_PROCESS
--- a/dom/media/webaudio/blink/Reverb.cpp
+++ b/dom/media/webaudio/blink/Reverb.cpp
@@ -76,21 +76,21 @@ static float calculateNormalizationScale
return scale;
}
Reverb::Reverb(ThreadSharedFloatArrayBufferList* impulseResponse, size_t impulseResponseBufferLength, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads, bool normalize, float sampleRate)
{
float scale = 1;
- nsAutoTArray<const float*,4> irChannels;
+ AutoTArray<const float*,4> irChannels;
for (size_t i = 0; i < impulseResponse->GetChannels(); ++i) {
irChannels.AppendElement(impulseResponse->GetData(i));
}
- nsAutoTArray<float,1024> tempBuf;
+ AutoTArray<float,1024> tempBuf;
if (normalize) {
scale = calculateNormalizationScale(impulseResponse, impulseResponseBufferLength, sampleRate);
if (scale) {
tempBuf.SetLength(irChannels.Length()*impulseResponseBufferLength);
for (uint32_t i = 0; i < irChannels.Length(); ++i) {
float* buf = &tempBuf[i*impulseResponseBufferLength];
--- a/dom/media/webm/WebMDemuxer.cpp
+++ b/dom/media/webm/WebMDemuxer.cpp
@@ -384,18 +384,18 @@ WebMDemuxer::ReadMetadata()
mInfo.mAudio.mChannels = params.channels;
unsigned int nheaders = 0;
r = nestegg_track_codec_data_count(mContext, track, &nheaders);
if (r == -1) {
return NS_ERROR_FAILURE;
}
- nsAutoTArray<const unsigned char*,4> headers;
- nsAutoTArray<size_t,4> headerLens;
+ AutoTArray<const unsigned char*,4> headers;
+ AutoTArray<size_t,4> headerLens;
for (uint32_t header = 0; header < nheaders; ++header) {
unsigned char* data = 0;
size_t length = 0;
r = nestegg_track_codec_data(mContext, track, header, &data, &length);
if (r == -1) {
return NS_ERROR_FAILURE;
}
headers.AppendElement(data);
--- a/dom/media/webrtc/MediaEngineDefault.cpp
+++ b/dom/media/webrtc/MediaEngineDefault.cpp
@@ -505,17 +505,17 @@ MediaEngineDefaultAudioSource::Restart(c
void
MediaEngineDefaultAudioSource::AppendToSegment(AudioSegment& aSegment,
TrackTicks aSamples)
{
RefPtr<SharedBuffer> buffer = SharedBuffer::Create(aSamples * sizeof(int16_t));
int16_t* dest = static_cast<int16_t*>(buffer->Data());
mSineGenerator->generate(dest, aSamples);
- nsAutoTArray<const int16_t*,1> channels;
+ AutoTArray<const int16_t*,1> channels;
channels.AppendElement(dest);
aSegment.AppendFrames(buffer.forget(), channels, aSamples);
}
NS_IMETHODIMP
MediaEngineDefaultAudioSource::Notify(nsITimer* aTimer)
{
TimeStamp now = TimeStamp::Now();
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -634,17 +634,17 @@ MediaEngineWebRTCMicrophoneSource::Proce
uint32_t len = mSources.Length();
for (uint32_t i = 0; i < len; i++) {
RefPtr<SharedBuffer> buffer = SharedBuffer::Create(length * sizeof(sample));
sample* dest = static_cast<sample*>(buffer->Data());
memcpy(dest, audio10ms, length * sizeof(sample));
nsAutoPtr<AudioSegment> segment(new AudioSegment());
- nsAutoTArray<const sample*,1> channels;
+ AutoTArray<const sample*,1> channels;
channels.AppendElement(dest);
segment->AppendFrames(buffer.forget(), channels, length);
TimeStamp insertTime;
segment->GetStartTime(insertTime);
if (mSources[i]) {
// Make sure we include the stream and the track.
// The 0:1 is a flag to note when we've done the final insert for a given input block.
--- a/dom/media/webspeech/recognition/SpeechRecognition.cpp
+++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp
@@ -927,17 +927,17 @@ SpeechRecognition::SplitSamplesBuffer(co
AudioSegment*
SpeechRecognition::CreateAudioSegment(nsTArray<RefPtr<SharedBuffer>>& aChunks)
{
AudioSegment* segment = new AudioSegment();
for (uint32_t i = 0; i < aChunks.Length(); ++i) {
RefPtr<SharedBuffer> buffer = aChunks[i];
const int16_t* chunkData = static_cast<const int16_t*>(buffer->Data());
- nsAutoTArray<const int16_t*, 1> channels;
+ AutoTArray<const int16_t*, 1> channels;
channels.AppendElement(chunkData);
segment->AppendFrames(buffer.forget(), channels, mAudioSamplesPerChunk);
}
return segment;
}
void
@@ -954,17 +954,17 @@ SpeechRecognition::FeedAudioData(already
// chunks, we must buffer and split them in chunks of mAudioSamplesPerChunk
// (a multiple of Endpointer's frame size) before feeding to Endpointer.
// ensure aSamples is deleted
RefPtr<SharedBuffer> refSamples = aSamples;
uint32_t samplesIndex = 0;
const int16_t* samples = static_cast<int16_t*>(refSamples->Data());
- nsAutoTArray<RefPtr<SharedBuffer>, 5> chunksToSend;
+ AutoTArray<RefPtr<SharedBuffer>, 5> chunksToSend;
// fill up our buffer and make a chunk out of it, if possible
if (mBufferedSamples > 0) {
samplesIndex += FillSamplesBuffer(samples, aDuration);
if (mBufferedSamples == mAudioSamplesPerChunk) {
chunksToSend.AppendElement(mAudioSamplesBuffer.forget());
mBufferedSamples = 0;
--- a/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm
+++ b/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm
@@ -270,17 +270,17 @@ private:
RefPtr<OSXSpeechSynthesizerService> mSpeechService;
};
NS_IMETHODIMP
EnumVoicesRunnable::Run()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
- nsAutoTArray<OSXVoice, 64> list;
+ AutoTArray<OSXVoice, 64> list;
NSArray* voices = [NSSpeechSynthesizer availableVoices];
NSString* defaultVoice = [NSSpeechSynthesizer defaultVoice];
for (NSString* voice in voices) {
OSXVoice item;
NSDictionary* attr = [NSSpeechSynthesizer attributesForVoice:voice];
--- a/dom/media/webspeech/synth/nsSpeechTask.cpp
+++ b/dom/media/webspeech/synth/nsSpeechTask.cpp
@@ -318,17 +318,17 @@ void
nsSpeechTask::SendAudioImpl(RefPtr<mozilla::SharedBuffer>& aSamples, uint32_t aDataLen)
{
if (aDataLen == 0) {
mStream->EndAllTrackAndFinish();
return;
}
AudioSegment segment;
- nsAutoTArray<const int16_t*, 1> channelData;
+ AutoTArray<const int16_t*, 1> channelData;
channelData.AppendElement(static_cast<int16_t*>(aSamples->Data()));
segment.AppendFrames(aSamples.forget(), channelData, aDataLen);
mStream->AppendToTrack(1, &segment);
mStream->AdvanceKnownTracksTime(STREAM_TIME_MAX);
}
NS_IMETHODIMP
nsSpeechTask::DispatchStart()
--- a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
+++ b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
@@ -31,17 +31,17 @@ extern mozilla::LogModule* GetSpeechSynt
namespace {
void
GetAllSpeechSynthActors(InfallibleTArray<mozilla::dom::SpeechSynthesisParent*>& aActors)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aActors.IsEmpty());
- nsAutoTArray<mozilla::dom::ContentParent*, 20> contentActors;
+ AutoTArray<mozilla::dom::ContentParent*, 20> contentActors;
mozilla::dom::ContentParent::GetAll(contentActors);
for (uint32_t contentIndex = 0;
contentIndex < contentActors.Length();
++contentIndex) {
MOZ_ASSERT(contentActors[contentIndex]);
AutoInfallibleTArray<mozilla::dom::PSpeechSynthesisParent*, 5> speechsynthActors;
--- a/dom/messagechannel/MessagePort.cpp
+++ b/dom/messagechannel/MessagePort.cpp
@@ -470,20 +470,20 @@ MessagePort::PostMessage(JSContext* aCx,
if (mState == eStateEntangling) {
mMessagesForTheOtherPort.AppendElement(data);
return;
}
MOZ_ASSERT(mActor);
MOZ_ASSERT(mMessagesForTheOtherPort.IsEmpty());
- nsAutoTArray<RefPtr<SharedMessagePortMessage>, 1> array;
+ AutoTArray<RefPtr<SharedMessagePortMessage>, 1> array;
array.AppendElement(data);
- nsAutoTArray<MessagePortMessage, 1> messages;
+ AutoTArray<MessagePortMessage, 1> messages;
SharedMessagePortMessage::FromSharedToMessagesChild(mActor, array, messages);
mActor->SendPostMessages(messages);
}
void
MessagePort::Start()
{
if (mMessageQueueEnabled) {
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -153,17 +153,17 @@ public:
NS_IMETHOD Done(JSContext* aCx) final
{
AutoJSAPI jsapi;
DebugOnly<bool> ok = jsapi.Init(mWindow, aCx);
MOZ_ASSERT(ok);
ErrorResult result;
- nsAutoTArray<RefPtr<Notification>, 5> notifications;
+ AutoTArray<RefPtr<Notification>, 5> notifications;
for (uint32_t i = 0; i < mStrings.Length(); ++i) {
RefPtr<Notification> n =
Notification::ConstructFromFields(mWindow,
mStrings[i].mID,
mStrings[i].mTitle,
mStrings[i].mDir,
mStrings[i].mLang,
@@ -2089,17 +2089,17 @@ public:
}
void
WorkerRunInternal(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
{
RefPtr<Promise> workerPromise = mPromiseProxy->WorkerPromise();
ErrorResult result;
- nsAutoTArray<RefPtr<Notification>, 5> notifications;
+ AutoTArray<RefPtr<Notification>, 5> notifications;
for (uint32_t i = 0; i < mStrings.Length(); ++i) {
RefPtr<Notification> n =
Notification::ConstructFromFields(aWorkerPrivate->GlobalScope(),
mStrings[i].mID,
mStrings[i].mTitle,
mStrings[i].mDir,
mStrings[i].mLang,
mStrings[i].mBody,
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -1688,17 +1688,17 @@ void
if (s->UTF8Characters) {
#if defined(MOZ_MEMORY_WINDOWS)
if (malloc_usable_size((void *)s->UTF8Characters) != 0) {
PR_Free((void *)s->UTF8Characters);
} else {
void *p = (void *)s->UTF8Characters;
DWORD nheaps = 0;
- nsAutoTArray<HANDLE, 50> heaps;
+ AutoTArray<HANDLE, 50> heaps;
nheaps = GetProcessHeaps(0, heaps.Elements());
heaps.AppendElements(nheaps);
GetProcessHeaps(nheaps, heaps.Elements());
for (DWORD i = 0; i < nheaps; i++) {
if (InHeap(heaps[i], p)) {
HeapFree(heaps[i], 0, p);
break;
}
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -2106,17 +2106,17 @@ nsresult nsPluginHost::ScanPluginsDirect
("nsPluginHost::ScanPluginsDirectory dir=%s\n", dirPath.get()));
#endif
nsCOMPtr<nsISimpleEnumerator> iter;
rv = pluginsDir->GetDirectoryEntries(getter_AddRefs(iter));
if (NS_FAILED(rv))
return rv;
- nsAutoTArray<nsCOMPtr<nsIFile>, 6> pluginFiles;
+ AutoTArray<nsCOMPtr<nsIFile>, 6> pluginFiles;
bool hasMore;
while (NS_SUCCEEDED(iter->HasMoreElements(&hasMore)) && hasMore) {
nsCOMPtr<nsISupports> supports;
rv = iter->GetNext(getter_AddRefs(supports));
if (NS_FAILED(rv))
continue;
nsCOMPtr<nsIFile> dirEntry(do_QueryInterface(supports, &rv));
@@ -3661,17 +3661,17 @@ nsPluginHost::ParsePostBufferToFixHeader
*outPostData = 0;
*outPostDataLen = 0;
const char CR = '\r';
const char LF = '\n';
const char CRLFCRLF[] = {CR,LF,CR,LF,'\0'}; // C string"\r\n\r\n"
const char ContentLenHeader[] = "Content-length";
- nsAutoTArray<const char*, 8> singleLF;
+ AutoTArray<const char*, 8> singleLF;
const char *pSCntlh = 0;// pointer to start of ContentLenHeader in inPostData
const char *pSod = 0; // pointer to start of data in inPostData
const char *pEoh = 0; // pointer to end of headers in inPostData
const char *pEod = inPostData + inPostDataLen; // pointer to end of inPostData
if (*inPostData == LF) {
// If no custom headers are required, simply add a blank
// line ('\n') to the beginning of the file or buffer.
// so *inPostData == '\n' is valid
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -898,17 +898,17 @@ nsPluginInstanceOwner::GetCompositionStr
case GCS_COMPCLAUSE: {
RefPtr<TextRangeArray> ranges = composition->GetLastRanges();
if (!ranges || ranges->IsEmpty()) {
aDist->SetLength(sizeof(uint32_t));
memset(aDist->Elements(), 0, sizeof(uint32_t));
*aLength = aDist->Length();
return true;
}
- nsAutoTArray<uint32_t, 16> clauses;
+ AutoTArray<uint32_t, 16> clauses;
clauses.AppendElement(0);
for (TextRange& range : *ranges) {
if (!range.IsClause()) {
continue;
}
clauses.AppendElement(range.mEndOffset);
}
--- a/dom/plugins/base/nsPluginsDirUtils.h
+++ b/dom/plugins/base/nsPluginsDirUtils.h
@@ -21,17 +21,17 @@ static nsresult
ParsePluginMimeDescription(const char *mdesc, nsPluginInfo &info)
{
nsresult rv = NS_ERROR_FAILURE;
if (!mdesc || !*mdesc)
return rv;
char *mdescDup = PL_strdup(mdesc); // make a dup of intput string we'll change it content
char anEmptyString[] = "";
- nsAutoTArray<char*, 8> tmpMimeTypeArr;
+ AutoTArray<char*, 8> tmpMimeTypeArr;
char delimiters[] = {':',':',';'};
int mimeTypeVariantCount = 0;
char *p = mdescDup; // make a dup of intput string we'll change it content
while(p) {
char *ptrMimeArray[] = {anEmptyString, anEmptyString, anEmptyString};
// It's easy to point out ptrMimeArray[0] to the string sounds like
// "Mime type is not specified, plugin will not function properly."
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -2038,17 +2038,17 @@ PluginInstanceChild::ImmGetCompositionSt
LPVOID aBuf, DWORD aLen)
{
if (aIMC != sHookIMC) {
return sImm32ImmGetCompositionStringStub(aIMC, aIndex, aBuf, aLen);
}
if (!sCurrentPluginInstance) {
return IMM_ERROR_GENERAL;
}
- nsAutoTArray<uint8_t, 16> dist;
+ AutoTArray<uint8_t, 16> dist;
int32_t length = 0; // IMM_ERROR_NODATA
sCurrentPluginInstance->SendGetCompositionString(aIndex, &dist, &length);
if (length == IMM_ERROR_NODATA || length == IMM_ERROR_GENERAL) {
return length;
}
if (aBuf && aLen >= static_cast<DWORD>(length)) {
memcpy(aBuf, dist.Elements(), length);
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -802,17 +802,17 @@ PluginInstanceParent::RecvShowDirectBitm
void
PluginInstanceParent::SetCurrentImage(Image* aImage)
{
MOZ_ASSERT(IsUsingDirectDrawing());
ImageContainer::NonOwningImage holder(aImage);
holder.mFrameID = ++mFrameID;
- nsAutoTArray<ImageContainer::NonOwningImage,1> imageList;
+ AutoTArray<ImageContainer::NonOwningImage,1> imageList;
imageList.AppendElement(holder);
mImageContainer->SetCurrentImages(imageList);
RecordDrawingModel();
}
bool
PluginInstanceParent::RecvShowDirectDXGISurface(const WindowsHandle& handle,
@@ -954,17 +954,17 @@ PluginInstanceParent::RecvShow(const NPR
updatedRect.right - updatedRect.left,
updatedRect.bottom - updatedRect.top);
surface->MarkDirty(ur);
RefPtr<gfx::SourceSurface> sourceSurface =
gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface);
RefPtr<SourceSurfaceImage> image = new SourceSurfaceImage(surface->GetSize(), sourceSurface);
- nsAutoTArray<ImageContainer::NonOwningImage,1> imageList;
+ AutoTArray<ImageContainer::NonOwningImage,1> imageList;
imageList.AppendElement(
ImageContainer::NonOwningImage(image));
ImageContainer *container = GetImageContainer();
container->SetCurrentImages(imageList);
}
else if (mImageContainer) {
mImageContainer->ClearAllImages();
--- a/dom/plugins/ipc/PluginModuleChild.h
+++ b/dom/plugins/ipc/PluginModuleChild.h
@@ -358,17 +358,17 @@ private:
: _spinning(false)
, _savedNestableTasksAllowed(false)
{ }
bool _spinning;
bool _savedNestableTasksAllowed;
};
- nsAutoTArray<IncallFrame, 8> mIncallPumpingStack;
+ AutoTArray<IncallFrame, 8> mIncallPumpingStack;
static LRESULT CALLBACK NestedInputEventHook(int code,
WPARAM wParam,
LPARAM lParam);
static LRESULT CALLBACK CallWindowProcHook(int code,
WPARAM wParam,
LPARAM lParam);
void SetEventHooks();
--- a/dom/power/PowerManager.cpp
+++ b/dom/power/PowerManager.cpp
@@ -130,17 +130,17 @@ PowerManager::Callback(const nsAString &
/**
* We maintain a local listener list instead of using the global
* list so that when the window is destroyed we don't have to
* cleanup the mess.
* Copy the listeners list before we walk through the callbacks
* because the callbacks may install new listeners. We expect no
* more than one listener per window, so it shouldn't be too long.
*/
- nsAutoTArray<nsCOMPtr<nsIDOMMozWakeLockListener>, 2> listeners(mListeners);
+ AutoTArray<nsCOMPtr<nsIDOMMozWakeLockListener>, 2> listeners(mListeners);
for (uint32_t i = 0; i < listeners.Length(); ++i) {
listeners[i]->Callback(aTopic, aState);
}
return NS_OK;
}
bool
--- a/dom/power/PowerManagerService.cpp
+++ b/dom/power/PowerManagerService.cpp
@@ -107,17 +107,17 @@ PowerManagerService::Notify(const WakeLo
nsAutoString state;
ComputeWakeLockState(aWakeLockInfo, state);
/**
* Copy the listeners list before we walk through the callbacks
* because the callbacks may install new listeners. We expect no
* more than one listener per window, so it shouldn't be too long.
*/
- nsAutoTArray<nsCOMPtr<nsIDOMMozWakeLockListener>, 2> listeners(mWakeLockListeners);
+ AutoTArray<nsCOMPtr<nsIDOMMozWakeLockListener>, 2> listeners(mWakeLockListeners);
for (uint32_t i = 0; i < listeners.Length(); ++i) {
listeners[i]->Callback(aWakeLockInfo.topic(), state);
}
}
void
PowerManagerService::SyncProfile()
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -2471,17 +2471,17 @@ QuotaObject::MaybeUpdateSize(int64_t aSi
AssertNoOverflow(quotaManager->mTemporaryStorageUsage, delta);
uint64_t newTemporaryStorageUsage = quotaManager->mTemporaryStorageUsage +
delta;
if (newTemporaryStorageUsage > quotaManager->mTemporaryStorageLimit) {
// This will block the thread without holding the lock while waitting.
- nsAutoTArray<RefPtr<DirectoryLockImpl>, 10> locks;
+ AutoTArray<RefPtr<DirectoryLockImpl>, 10> locks;
uint64_t sizeToBeFreed =
quotaManager->LockedCollectOriginsForEviction(delta, locks);
if (!sizeToBeFreed) {
return false;
}
@@ -3796,17 +3796,17 @@ QuotaManager::OpenDirectoryInternal(Null
MOZ_ASSERT(lock);
if (!aExclusive) {
return;
}
// All the locks that block this new exclusive lock need to be invalidated.
// We also need to notify clients to abort operations for them.
- nsAutoTArray<nsAutoPtr<nsTHashtable<nsCStringHashKey>>,
+ AutoTArray<nsAutoPtr<nsTHashtable<nsCStringHashKey>>,
Client::TYPE_MAX> origins;
origins.SetLength(Client::TYPE_MAX);
const nsTArray<DirectoryLockImpl*>& blockedOnLocks =
lock->GetBlockedOnLocks();
for (DirectoryLockImpl* blockedOnLock : blockedOnLocks) {
blockedOnLock->Invalidate();
--- a/dom/quota/QuotaManager.h
+++ b/dom/quota/QuotaManager.h
@@ -495,17 +495,17 @@ private:
// A timer that gets activated at shutdown to ensure we close all storages.
nsCOMPtr<nsITimer> mShutdownTimer;
// A list of all successfully initialized origins. This list isn't protected
// by any mutex but it is only ever touched on the IO thread.
nsTArray<nsCString> mInitializedOrigins;
- nsAutoTArray<RefPtr<Client>, Client::TYPE_MAX> mClients;
+ AutoTArray<RefPtr<Client>, Client::TYPE_MAX> mClients;
nsString mIndexedDBPath;
nsString mStoragePath;
nsString mPermanentStoragePath;
nsString mTemporaryStoragePath;
nsString mDefaultStoragePath;
uint64_t mTemporaryStorageLimit;
--- a/dom/svg/SVGLengthList.h
+++ b/dom/svg/SVGLengthList.h
@@ -125,30 +125,30 @@ private:
bool AppendItem(SVGLength aLength) {
return !!mLengths.AppendElement(aLength, fallible);
}
protected:
/* Rationale for using nsTArray<SVGLength> and not nsTArray<SVGLength, 1>:
*
- * It might seem like we should use nsAutoTArray<SVGLength, 1> instead of
+ * It might seem like we should use AutoTArray<SVGLength, 1> instead of
* nsTArray<SVGLength>. That would preallocate space for one SVGLength and
* avoid an extra memory allocation call in the common case of the 'x'
* and 'y' attributes each containing a single length (and the 'dx' and 'dy'
* attributes being empty). However, consider this:
*
- * An empty nsTArray uses sizeof(Header*). An nsAutoTArray<class E,
+ * An empty nsTArray uses sizeof(Header*). An AutoTArray<class E,
* uint32_t N> on the other hand uses sizeof(Header*) +
* (2 * sizeof(uint32_t)) + (N * sizeof(E)), which for one SVGLength is
* sizeof(Header*) + 16 bytes.
*
* Now consider that for text elements we have four length list attributes
* (x, y, dx, dy), each of which can have a baseVal and an animVal list. If
- * we were to go the nsAutoTArray<SVGLength, 1> route for each of these, we'd
+ * we were to go the AutoTArray<SVGLength, 1> route for each of these, we'd
* end up using at least 160 bytes for these four attributes alone, even
* though we only need storage for two SVGLengths (16 bytes) in the common
* case!!
*
* A compromise might be to template SVGLengthList to allow
* SVGAnimatedLengthList to preallocate space for an SVGLength for the
* baseVal lists only, and that would cut the space used by the four
* attributes to 96 bytes. Taking that even further and templating
--- a/dom/voicemail/Voicemail.h
+++ b/dom/voicemail/Voicemail.h
@@ -82,17 +82,17 @@ private:
private:
nsCOMPtr<nsIVoicemailService> mService;
RefPtr<Listener> mListener;
// |mStatuses| keeps all instantiated VoicemailStatus objects as well as the
// empty slots for not interested ones. The length of |mStatuses| is decided
// in the constructor and is never changed ever since.
- nsAutoTArray<RefPtr<VoicemailStatus>, 1> mStatuses;
+ AutoTArray<RefPtr<VoicemailStatus>, 1> mStatuses;
// Return a nsIVoicemailProvider instance based on the requests from external
// components. Return nullptr if aOptionalServiceId contains an invalid
// service id or the default one is just not available.
already_AddRefed<nsIVoicemailProvider>
GetItemByServiceId(const Optional<uint32_t>& aOptionalServiceId,
uint32_t& aActualServiceId) const;
--- a/dom/workers/Queue.h
+++ b/dom/workers/Queue.h
@@ -12,17 +12,17 @@
#include "mozilla/Mutex.h"
#include "nsTArray.h"
BEGIN_WORKERS_NAMESPACE
template <typename T, int TCount>
struct StorageWithTArray
{
- typedef nsAutoTArray<T, TCount> StorageType;
+ typedef AutoTArray<T, TCount> StorageType;
static void Reverse(StorageType& aStorage)
{
uint32_t length = aStorage.Length();
for (uint32_t index = 0; index < length / 2; index++) {
uint32_t reverseIndex = length - 1 - index;
T t1 = aStorage.ElementAt(index);
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -121,17 +121,17 @@ static_assert(MAX_WORKERS_PER_DOMAIN >=
#define GC_REQUEST_OBSERVER_TOPIC "child-gc-request"
#define CC_REQUEST_OBSERVER_TOPIC "child-cc-request"
#define MEMORY_PRESSURE_OBSERVER_TOPIC "memory-pressure"
#define BROADCAST_ALL_WORKERS(_func, ...) \
PR_BEGIN_MACRO \
AssertIsOnMainThread(); \
\
- nsAutoTArray<WorkerPrivate*, 100> workers; \
+ AutoTArray<WorkerPrivate*, 100> workers; \
{ \
MutexAutoLock lock(mMutex); \
\
AddAllTopLevelWorkersToArray(workers); \
} \
\
if (!workers.IsEmpty()) { \
AutoSafeJSContext cx; \
@@ -1783,17 +1783,17 @@ RuntimeService::ShutdownIdleThreads(nsIT
NS_ASSERTION(aTimer == runtime->mIdleThreadTimer, "Wrong timer!");
// Cheat a little and grab all threads that expire within one second of now.
TimeStamp now = TimeStamp::NowLoRes() + TimeDuration::FromSeconds(1);
TimeStamp nextExpiration;
- nsAutoTArray<RefPtr<WorkerThread>, 20> expiredThreads;
+ AutoTArray<RefPtr<WorkerThread>, 20> expiredThreads;
{
MutexAutoLock lock(runtime->mMutex);
for (uint32_t index = 0; index < runtime->mIdleThreadArray.Length();
index++) {
IdleThreadInfo& info = runtime->mIdleThreadArray[index];
if (info.mExpirationTime > now) {
nextExpiration = info.mExpirationTime;
@@ -1987,17 +1987,17 @@ RuntimeService::Shutdown()
if (obs && NS_FAILED(obs->NotifyObservers(nullptr, WORKERS_SHUTDOWN_TOPIC,
nullptr))) {
NS_WARNING("NotifyObservers failed!");
}
{
MutexAutoLock lock(mMutex);
- nsAutoTArray<WorkerPrivate*, 100> workers;
+ AutoTArray<WorkerPrivate*, 100> workers;
AddAllTopLevelWorkersToArray(workers);
if (!workers.IsEmpty()) {
// Cancel all top-level workers.
{
MutexAutoUnlock unlock(mMutex);
AutoSafeJSContext cx;
@@ -2028,26 +2028,26 @@ RuntimeService::Cleanup()
NS_WARNING("Failed to cancel idle timer!");
}
mIdleThreadTimer = nullptr;
}
{
MutexAutoLock lock(mMutex);
- nsAutoTArray<WorkerPrivate*, 100> workers;
+ AutoTArray<WorkerPrivate*, 100> workers;
AddAllTopLevelWorkersToArray(workers);
if (!workers.IsEmpty()) {
nsIThread* currentThread = NS_GetCurrentThread();
NS_ASSERTION(currentThread, "This should never be null!");
// Shut down any idle threads.
if (!mIdleThreadArray.IsEmpty()) {
- nsAutoTArray<RefPtr<WorkerThread>, 20> idleThreads;
+ AutoTArray<RefPtr<WorkerThread>, 20> idleThreads;
uint32_t idleThreadCount = mIdleThreadArray.Length();
idleThreads.SetLength(idleThreadCount);
for (uint32_t index = 0; index < idleThreadCount; index++) {
NS_ASSERTION(mIdleThreadArray[index].mThread, "Null thread!");
idleThreads[index].swap(mIdleThreadArray[index].mThread);
}
@@ -2192,17 +2192,17 @@ RuntimeService::GetWorkersForWindow(nsPI
}
}
void
RuntimeService::CancelWorkersForWindow(nsPIDOMWindowInner* aWindow)
{
AssertIsOnMainThread();
- nsAutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
+ AutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
GetWorkersForWindow(aWindow, workers);
if (!workers.IsEmpty()) {
AutoJSAPI jsapi;
if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(aWindow))) {
return;
}
JSContext* cx = jsapi.cx();
@@ -2220,17 +2220,17 @@ RuntimeService::CancelWorkersForWindow(n
}
void
RuntimeService::FreezeWorkersForWindow(nsPIDOMWindowInner* aWindow)
{
AssertIsOnMainThread();
MOZ_ASSERT(aWindow);
- nsAutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
+ AutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
GetWorkersForWindow(aWindow, workers);
if (!workers.IsEmpty()) {
AutoJSAPI jsapi;
if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(aWindow))) {
return;
}
JSContext* cx = jsapi.cx();
@@ -2244,17 +2244,17 @@ RuntimeService::FreezeWorkersForWindow(n
}
void
RuntimeService::ThawWorkersForWindow(nsPIDOMWindowInner* aWindow)
{
AssertIsOnMainThread();
MOZ_ASSERT(aWindow);
- nsAutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
+ AutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
GetWorkersForWindow(aWindow, workers);
if (!workers.IsEmpty()) {
AutoJSAPI jsapi;
if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(aWindow))) {
return;
}
JSContext* cx = jsapi.cx();
@@ -2268,31 +2268,31 @@ RuntimeService::ThawWorkersForWindow(nsP
}
void
RuntimeService::SuspendWorkersForWindow(nsPIDOMWindowInner* aWindow)
{
AssertIsOnMainThread();
MOZ_ASSERT(aWindow);
- nsAutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
+ AutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
GetWorkersForWindow(aWindow, workers);
for (uint32_t index = 0; index < workers.Length(); index++) {
workers[index]->Suspend();
}
}
void
RuntimeService::ResumeWorkersForWindow(nsPIDOMWindowInner* aWindow)
{
AssertIsOnMainThread();
MOZ_ASSERT(aWindow);
- nsAutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
+ AutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
GetWorkersForWindow(aWindow, workers);
for (uint32_t index = 0; index < workers.Length(); index++) {
workers[index]->Resume();
}
}
nsresult
--- a/dom/workers/ServiceWorkerEvents.cpp
+++ b/dom/workers/ServiceWorkerEvents.cpp
@@ -194,17 +194,17 @@ public:
rv = mChannel->SetChannelInfo(&channelInfo);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
mChannel->SynthesizeStatus(mInternalResponse->GetUnfilteredStatus(),
mInternalResponse->GetUnfilteredStatusText());
- nsAutoTArray<InternalHeaders::Entry, 5> entries;
+ AutoTArray<InternalHeaders::Entry, 5> entries;
mInternalResponse->UnfilteredHeaders()->GetEntries(entries);
for (uint32_t i = 0; i < entries.Length(); ++i) {
mChannel->SynthesizeHeader(entries[i].mName, entries[i].mValue);
}
loadInfo->MaybeIncreaseTainting(mInternalResponse->GetTainting());
rv = mChannel->FinishSynthesizedResponse(mResponseURLSpec);
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -2631,17 +2631,17 @@ ServiceWorkerManager::ReportToAllClients
uint32_t aFlags)
{
nsCOMPtr<nsIURI> uri;
nsresult rv = NS_NewURI(getter_AddRefs(uri), aFilename);
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
- nsAutoTArray<uint64_t, 16> windows;
+ AutoTArray<uint64_t, 16> windows;
// Report errors to every controlled document.
for (auto iter = mControlledDocuments.Iter(); !iter.Done(); iter.Next()) {
ServiceWorkerRegistrationInfo* reg = iter.UserData();
MOZ_ASSERT(reg);
if (!reg->mScope.Equals(aScope)) {
continue;
}
@@ -5120,17 +5120,17 @@ public:
for (size_t i = 0; i < mInstances.Length(); ++i) {
mInstances[i]->DispatchStateChange(mState);
}
return NS_OK;
}
private:
- nsAutoTArray<RefPtr<ServiceWorker>, 1> mInstances;
+ AutoTArray<RefPtr<ServiceWorker>, 1> mInstances;
ServiceWorkerState mState;
};
}
void
ServiceWorkerInfo::UpdateState(ServiceWorkerState aState)
{
--- a/dom/workers/ServiceWorkerManager.h
+++ b/dom/workers/ServiceWorkerManager.h
@@ -200,17 +200,17 @@ private:
// This id is shared with WorkerPrivate to match requests issued by service
// workers to their corresponding serviceWorkerInfo.
uint64_t mServiceWorkerID;
// We hold rawptrs since the ServiceWorker constructor and destructor ensure
// addition and removal.
// There is a high chance of there being at least one ServiceWorker
// associated with this all the time.
- nsAutoTArray<ServiceWorker*, 1> mInstances;
+ AutoTArray<ServiceWorker*, 1> mInstances;
RefPtr<ServiceWorkerPrivate> mServiceWorkerPrivate;
bool mSkipWaitingFlag;
~ServiceWorkerInfo();
// Generates a unique id for the service worker, with zero being treated as
// invalid.
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -3123,24 +3123,24 @@ WorkerPrivateParent<Derived>::BroadcastE
const nsAString& aFilename,
const nsAString& aLine,
uint32_t aLineNumber,
uint32_t aColumnNumber,
uint32_t aFlags)
{
AssertIsOnMainThread();
- nsAutoTArray<RefPtr<SharedWorker>, 10> sharedWorkers;
+ AutoTArray<RefPtr<SharedWorker>, 10> sharedWorkers;
GetAllSharedWorkers(sharedWorkers);
if (sharedWorkers.IsEmpty()) {
return;
}
- nsAutoTArray<WindowAction, 10> windowActions;
+ AutoTArray<WindowAction, 10> windowActions;
nsresult rv;
// First fire the error event at all SharedWorker objects. This may include
// multiple objects in a single window as well as objects in different
// windows.
for (size_t index = 0; index < sharedWorkers.Length(); index++) {
RefPtr<SharedWorker>& sharedWorker = sharedWorkers[index];
@@ -5149,17 +5149,17 @@ WorkerPrivate::NotifyFeatures(JSContext*
nsTObserverArray<WorkerFeature*>::ForwardIterator iter(mFeatures);
while (iter.HasMore()) {
WorkerFeature* feature = iter.GetNext();
if (!feature->Notify(aCx, aStatus)) {
NS_WARNING("Failed to notify feature!");
}
}
- nsAutoTArray<ParentType*, 10> children;
+ AutoTArray<ParentType*, 10> children;
children.AppendElements(mChildWorkers);
for (uint32_t index = 0; index < children.Length(); index++) {
if (!children[index]->Notify(aCx, aStatus)) {
NS_WARNING("Failed to notify child worker!");
}
}
}
@@ -5946,17 +5946,17 @@ WorkerPrivate::RunExpiredTimeouts(JSCont
const TimeStamp actual_now = TimeStamp::Now();
const TimeStamp now = std::max(actual_now, mTimeouts[0]->mTargetTime);
if (now != actual_now) {
LOG(TimeoutsLog(), ("Worker %p fudged timeout by %f ms.\n", this,
(now - actual_now).ToMilliseconds()));
}
- nsAutoTArray<TimeoutInfo*, 10> expiredTimeouts;
+ AutoTArray<TimeoutInfo*, 10> expiredTimeouts;
for (uint32_t index = 0; index < mTimeouts.Length(); index++) {
nsAutoPtr<TimeoutInfo>& info = mTimeouts[index];
if (info->mTargetTime > now) {
break;
}
expiredTimeouts.AppendElement(info);
}
--- a/dom/xbl/nsXBLEventHandler.cpp
+++ b/dom/xbl/nsXBLEventHandler.cpp
@@ -135,17 +135,17 @@ nsXBLKeyEventHandler::HandleEvent(nsIDOM
if (eventPhase != nsIDOMEvent::AT_TARGET)
return NS_OK;
}
nsCOMPtr<nsIDOMKeyEvent> key(do_QueryInterface(aEvent));
if (!key)
return NS_OK;
- nsAutoTArray<nsShortcutCandidate, 10> accessKeys;
+ AutoTArray<nsShortcutCandidate, 10> accessKeys;
nsContentUtils::GetAccelKeyCandidates(key, accessKeys);
if (accessKeys.IsEmpty()) {
ExecuteMatchedHandlers(key, 0, IgnoreModifierState());
return NS_OK;
}
for (uint32_t i = 0; i < accessKeys.Length(); ++i) {
--- a/dom/xbl/nsXBLService.cpp
+++ b/dom/xbl/nsXBLService.cpp
@@ -183,17 +183,17 @@ public:
void AddRequest(nsXBLBindingRequest* aRequest) { mBindingRequests.AppendElement(aRequest); }
bool HasRequest(nsIURI* aURI, nsIContent* aBoundElement);
private:
~nsXBLStreamListener();
nsCOMPtr<nsIStreamListener> mInner;
- nsAutoTArray<nsXBLBindingRequest*, 8> mBindingRequests;
+ AutoTArray<nsXBLBindingRequest*, 8> mBindingRequests;
nsCOMPtr<nsIWeakReference> mBoundDocument;
nsCOMPtr<nsIXMLContentSink> mSink; // Only set until OnStartRequest
nsCOMPtr<nsIDocument> mBindingDocument; // Only set until OnStartRequest
};
/* Implementation file */
NS_IMPL_ISUPPORTS(nsXBLStreamListener,
@@ -642,17 +642,17 @@ nsXBLService::BindingReady(nsIContent* a
}
nsresult
nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
bool aPeekOnly, nsIPrincipal* aOriginPrincipal,
bool* aIsReady, nsXBLBinding** aResult)
{
// More than 6 binding URIs are rare, see bug 55070 comment 18.
- nsAutoTArray<nsCOMPtr<nsIURI>, 6> uris;
+ AutoTArray<nsCOMPtr<nsIURI>, 6> uris;
return GetBinding(aBoundElement, aURI, aPeekOnly, aOriginPrincipal, aIsReady,
aResult, uris);
}
static bool
MayBindToContent(nsXBLPrototypeBinding* aProtoBinding, nsIContent* aBoundElement,
nsIURI* aURI)
{
--- a/dom/xbl/nsXBLWindowKeyHandler.cpp
+++ b/dom/xbl/nsXBLWindowKeyHandler.cpp
@@ -436,17 +436,17 @@ nsXBLWindowKeyHandler::IsHTMLEditableFie
//
bool
nsXBLWindowKeyHandler::WalkHandlersInternal(nsIDOMKeyEvent* aKeyEvent,
nsIAtom* aEventType,
nsXBLPrototypeHandler* aHandler,
bool aExecute,
bool* aOutReservedForChrome)
{
- nsAutoTArray<nsShortcutCandidate, 10> accessKeys;
+ AutoTArray<nsShortcutCandidate, 10> accessKeys;
nsContentUtils::GetAccelKeyCandidates(aKeyEvent, accessKeys);
if (accessKeys.IsEmpty()) {
return WalkHandlersAndExecute(aKeyEvent, aEventType, aHandler,
0, IgnoreModifierState(),
aExecute, aOutReservedForChrome);
}
--- a/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp
+++ b/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp
@@ -599,17 +599,17 @@ txXPathNodeUtils::comparePosition(const
if (document != otherDocument) {
return document < otherDocument ? -1 : 1;
}
// Now either both nodes are in orphan trees, or they are both in the
// same tree.
// Get parents up the tree.
- nsAutoTArray<nsINode*, 8> parents, otherParents;
+ AutoTArray<nsINode*, 8> parents, otherParents;
nsINode* node = aNode.mNode;
nsINode* otherNode = aOtherNode.mNode;
nsINode* parent;
nsINode* otherParent;
while (node && otherNode) {
parent = node->GetParentNode();
otherParent = otherNode->GetParentNode();
--- a/dom/xul/templates/nsTreeRows.h
+++ b/dom/xul/templates/nsTreeRows.h
@@ -182,17 +182,17 @@ protected:
public:
/**
* An iterator that can be used to traverse the tree view.
*/
class iterator {
protected:
int32_t mRowIndex;
- nsAutoTArray<Link, 8> mLink;
+ AutoTArray<Link, 8> mLink;
void Next();
void Prev();
friend class Subtree; // so InsertRowAt can initialize us
friend class nsTreeRows; // so nsTreeRows can initialize us
/**
--- a/dom/xul/templates/nsXULContentBuilder.cpp
+++ b/dom/xul/templates/nsXULContentBuilder.cpp
@@ -1265,17 +1265,17 @@ nsXULContentBuilder::IsOpen(nsIContent*
return true;
}
nsresult
nsXULContentBuilder::RemoveGeneratedContent(nsIContent* aElement)
{
// Keep a queue of "ungenerated" elements that we have to probe
// for generated content.
- nsAutoTArray<nsIContent*, 8> ungenerated;
+ AutoTArray<nsIContent*, 8> ungenerated;
if (ungenerated.AppendElement(aElement) == nullptr)
return NS_ERROR_OUT_OF_MEMORY;
uint32_t count;
while (0 != (count = ungenerated.Length())) {
// Pull the next "ungenerated" element off the queue.
uint32_t last = count - 1;
nsCOMPtr<nsIContent> element = ungenerated[last];
--- a/dom/xul/templates/nsXULTemplateBuilder.cpp
+++ b/dom/xul/templates/nsXULTemplateBuilder.cpp
@@ -2353,17 +2353,17 @@ nsXULTemplateBuilder::CompileBinding(nsT
nsresult
nsXULTemplateBuilder::AddSimpleRuleBindings(nsTemplateRule* aRule,
nsIContent* aElement)
{
// Crawl the content tree of a "simple" rule, adding a variable
// assignment for any attribute whose value is "rdf:".
- nsAutoTArray<nsIContent*, 8> elements;
+ AutoTArray<nsIContent*, 8> elements;
if (elements.AppendElement(aElement) == nullptr)
return NS_ERROR_OUT_OF_MEMORY;
while (elements.Length()) {
// Pop the next element off the stack
uint32_t i = elements.Length() - 1;
nsIContent* element = elements[i];
--- a/dom/xul/templates/nsXULTreeBuilder.cpp
+++ b/dom/xul/templates/nsXULTreeBuilder.cpp
@@ -1458,17 +1458,17 @@ nsXULTreeBuilder::OpenContainer(int32_t
}
nsresult
nsXULTreeBuilder::OpenSubtreeOf(nsTreeRows::Subtree* aSubtree,
int32_t aIndex,
nsIXULTemplateResult *aResult,
int32_t* aDelta)
{
- nsAutoTArray<int32_t, 8> open;
+ AutoTArray<int32_t, 8> open;
int32_t count = 0;
int32_t rulecount = mQuerySets.Length();
for (int32_t r = 0; r < rulecount; r++) {
nsTemplateQuerySet* queryset = mQuerySets[r];
OpenSubtreeForQuerySet(aSubtree, aIndex, aResult, queryset, &count, open);
}
--- a/editor/libeditor/nsEditor.cpp
+++ b/editor/libeditor/nsEditor.cpp
@@ -2659,17 +2659,17 @@ struct SavedRange {
};
nsresult
nsEditor::SplitNodeImpl(nsIContent& aExistingRightNode,
int32_t aOffset,
nsIContent& aNewLeftNode)
{
// Remember all selection points.
- nsAutoTArray<SavedRange, 10> savedRanges;
+ AutoTArray<SavedRange, 10> savedRanges;
for (size_t i = 0; i < nsISelectionController::NUM_SELECTIONTYPES - 1; ++i) {
SelectionType type(1 << i);
SavedRange range;
range.mSelection = GetSelection(type);
if (type == nsISelectionController::SELECTION_NORMAL) {
NS_ENSURE_TRUE(range.mSelection, NS_ERROR_NULL_POINTER);
} else if (!range.mSelection) {
// For non-normal selections, skip over the non-existing ones.
@@ -2806,17 +2806,17 @@ nsEditor::JoinNodesImpl(nsINode* aNodeTo
uint32_t firstNodeLength = aNodeToJoin->Length();
int32_t joinOffset;
GetNodeLocation(aNodeToJoin, &joinOffset);
int32_t keepOffset;
nsINode* parent = GetNodeLocation(aNodeToKeep, &keepOffset);
// Remember all selection points.
- nsAutoTArray<SavedRange, 10> savedRanges;
+ AutoTArray<SavedRange, 10> savedRanges;
for (size_t i = 0; i < nsISelectionController::NUM_SELECTIONTYPES - 1; ++i) {
SelectionType type(1 << i);
SavedRange range;
range.mSelection = GetSelection(type);
if (type == nsISelectionController::SELECTION_NORMAL) {
NS_ENSURE_TRUE(range.mSelection, NS_ERROR_NULL_POINTER);
} else if (!range.mSelection) {
// For non-normal selections, skip over the non-existing ones.
--- a/embedding/components/commandhandler/nsCommandGroup.cpp
+++ b/embedding/components/commandhandler/nsCommandGroup.cpp
@@ -209,17 +209,17 @@ nsControllerCommandGroup::ClearGroupsHas
NS_IMETHODIMP
nsControllerCommandGroup::AddCommandToGroup(const char* aCommand,
const char* aGroup)
{
nsDependentCString groupKey(aGroup);
nsTArray<nsCString>* commandList = mGroupsHash.Get(groupKey);
if (!commandList) {
// make this list
- commandList = new nsAutoTArray<nsCString, 8>;
+ commandList = new AutoTArray<nsCString, 8>;
mGroupsHash.Put(groupKey, commandList);
}
#ifdef DEBUG
nsCString* appended =
#endif
commandList->AppendElement(aCommand);
NS_ASSERTION(appended, "Append failed");
--- a/extensions/cookie/nsPermissionManager.h
+++ b/extensions/cookie/nsPermissionManager.h
@@ -116,17 +116,17 @@ public:
}
static PLDHashNumber HashKey(const PermissionKey* aKey)
{
return aKey->GetHashCode();
}
// Force the hashtable to use the copy constructor when shuffling entries
- // around, otherwise the Auto part of our nsAutoTArray won't be happy!
+ // around, otherwise the Auto part of our AutoTArray won't be happy!
enum { ALLOW_MEMMOVE = false };
inline nsTArray<PermissionEntry> & GetPermissions()
{
return mPermissions;
}
inline int32_t GetPermissionIndex(uint32_t aType) const
@@ -145,17 +145,17 @@ public:
return mPermissions[i];
// unknown permission... return relevant data
return PermissionEntry(-1, aType, nsIPermissionManager::UNKNOWN_ACTION,
nsIPermissionManager::EXPIRE_NEVER, 0, 0);
}
private:
- nsAutoTArray<PermissionEntry, 1> mPermissions;
+ AutoTArray<PermissionEntry, 1> mPermissions;
};
// nsISupports
NS_DECL_ISUPPORTS
NS_DECL_NSIPERMISSIONMANAGER
NS_DECL_NSIOBSERVER
nsPermissionManager();
--- a/gfx/2d/StackArray.h
+++ b/gfx/2d/StackArray.h
@@ -1,14 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* A handy class that will allocate data for size*T objects on the stack and
- * otherwise allocate them on the heap. It is similar in purpose to nsAutoTArray */
+ * otherwise allocate them on the heap. It is similar in purpose to AutoTArray */
template <class T, size_t size>
class StackArray
{
public:
StackArray(size_t count) {
if (count > size) {
mData = new T[count];
--- a/gfx/gl/DecomposeIntoNoRepeatTriangles.h
+++ b/gfx/gl/DecomposeIntoNoRepeatTriangles.h
@@ -40,18 +40,18 @@ public:
return mTexCoords;
}
unsigned int elements() {
return mVertexCoords.Length();
}
private:
// Reserve inline storage for one quad (2 triangles, 3 coords).
- nsAutoTArray<coord, 6> mVertexCoords;
- nsAutoTArray<coord, 6> mTexCoords;
+ AutoTArray<coord, 6> mVertexCoords;
+ AutoTArray<coord, 6> mTexCoords;
static void
AppendRectToCoordArray(InfallibleTArray<coord>& array, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1);
};
/**
* Decompose drawing the possibly-wrapped aTexCoordRect rectangle
* of a texture of aTexSize into one or more rectangles (represented
--- a/gfx/gl/GLContextProviderGLX.cpp
+++ b/gfx/gl/GLContextProviderGLX.cpp
@@ -773,17 +773,17 @@ GLContextGLX::CreateGLContext(
ScopedXErrorHandler xErrorHandler;
TRY_AGAIN_NO_SHARING:
error = false;
GLXContext glxContext = shareContext ? shareContext->mContext : nullptr;
if (glx.HasCreateContextAttribs()) {
- nsAutoTArray<int, 11> attrib_list;
+ AutoTArray<int, 11> attrib_list;
if (glx.HasRobustness()) {
int robust_attribs[] = {
LOCAL_GL_CONTEXT_FLAGS_ARB, LOCAL_GL_CONTEXT_ROBUST_ACCESS_BIT_ARB,
LOCAL_GL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB, LOCAL_GL_LOSE_CONTEXT_ON_RESET_ARB,
};
attrib_list.AppendElements(robust_attribs, MOZ_ARRAY_LENGTH(robust_attribs));
}
if (profile == ContextProfile::OpenGLCore) {
--- a/gfx/layers/ImageContainer.cpp
+++ b/gfx/layers/ImageContainer.cpp
@@ -288,17 +288,17 @@ ImageContainer::ClearAllImages()
}
void
ImageContainer::SetCurrentImageInTransaction(Image *aImage)
{
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
NS_ASSERTION(!mImageClient, "Should use async image transfer with ImageBridge.");
- nsAutoTArray<NonOwningImage,1> images;
+ AutoTArray<NonOwningImage,1> images;
images.AppendElement(NonOwningImage(aImage));
SetCurrentImageInternal(images);
}
bool ImageContainer::IsAsync() const
{
return mImageClient != nullptr;
}
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -629,17 +629,17 @@ public:
bool HasImage() const { return !mImages.IsEmpty(); }
Image* GetImage() const
{
return mImages.IsEmpty() ? nullptr : mImages[0].mImage.get();
}
private:
- nsAutoTArray<ImageContainer::OwningImage,4> mImages;
+ AutoTArray<ImageContainer::OwningImage,4> mImages;
};
struct PlanarYCbCrData {
// Luminance buffer
uint8_t* mYChannel;
int32_t mYStride;
gfx::IntSize mYSize;
int32_t mYSkip;
--- a/gfx/layers/LayerTreeInvalidation.cpp
+++ b/gfx/layers/LayerTreeInvalidation.cpp
@@ -16,17 +16,17 @@
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/mozalloc.h" // for operator new, etc
#include "nsAutoPtr.h" // for nsRefPtr, nsAutoPtr, etc
#include "nsDataHashtable.h" // for nsDataHashtable
#include "nsDebug.h" // for NS_ASSERTION
#include "nsHashKeys.h" // for nsPtrHashKey
#include "nsISupportsImpl.h" // for Layer::AddRef, etc
#include "nsRect.h" // for IntRect
-#include "nsTArray.h" // for nsAutoTArray, nsTArray_Impl
+#include "nsTArray.h" // for AutoTArray, nsTArray_Impl
#include "mozilla/layers/ImageHost.h"
#include "mozilla/layers/LayerManagerComposite.h"
using namespace mozilla::gfx;
namespace mozilla {
namespace layers {
@@ -378,17 +378,17 @@ struct ContainerLayerProperties : public
// else, effective transforms have applied on children.
result.OrWith(invalidOfLayer);
return result;
}
// The old list of children:
- nsAutoTArray<UniquePtr<LayerPropertiesBase>,1> mChildren;
+ AutoTArray<UniquePtr<LayerPropertiesBase>,1> mChildren;
float mPreXScale;
float mPreYScale;
};
struct ColorLayerProperties : public LayerPropertiesBase
{
explicit ColorLayerProperties(ColorLayer *aLayer)
: LayerPropertiesBase(aLayer)
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -1341,17 +1341,17 @@ ContainerLayer::Collect3DContextLeaves(n
aToSort.AppendElement(l);
}
}
}
void
ContainerLayer::SortChildrenBy3DZOrder(nsTArray<Layer*>& aArray)
{
- nsAutoTArray<Layer*, 10> toSort;
+ AutoTArray<Layer*, 10> toSort;
for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) {
ContainerLayer* container = l->AsContainerLayer();
if (container && container->Extend3DContext() &&
!container->UseIntermediateSurface()) {
container->Collect3DContextLeaves(toSort);
} else {
if (toSort.Length() > 0) {
--- a/gfx/layers/basic/BasicLayerManager.cpp
+++ b/gfx/layers/basic/BasicLayerManager.cpp
@@ -38,17 +38,17 @@
#include "mozilla/mozalloc.h" // for operator new
#include "nsAutoPtr.h" // for nsRefPtr
#include "nsCOMPtr.h" // for already_AddRefed
#include "nsDebug.h" // for NS_ASSERTION, etc
#include "nsISupportsImpl.h" // for gfxContext::Release, etc
#include "nsPoint.h" // for nsIntPoint
#include "nsRect.h" // for mozilla::gfx::IntRect
#include "nsRegion.h" // for nsIntRegion, etc
-#include "nsTArray.h" // for nsAutoTArray
+#include "nsTArray.h" // for AutoTArray
#ifdef MOZ_ENABLE_SKIA
#include "skia/include/core/SkCanvas.h" // for SkCanvas
#include "skia/include/core/SkBitmapDevice.h" // for SkBitmapDevice
#else
#define PIXMAN_DONT_DEFINE_STDINT
#include "pixman.h" // for pixman_f_transform, etc
#endif
class nsIWidget;
@@ -892,17 +892,17 @@ BasicLayerManager::PaintSelfOrChildren(P
} else {
data->Paint(aGroupTarget->GetDrawTarget(),
aGroupTarget->GetDeviceOffset(),
aPaintContext.mLayer->GetMaskLayer());
}
} else {
ContainerLayer* container =
static_cast<ContainerLayer*>(aPaintContext.mLayer);
- nsAutoTArray<Layer*, 12> children;
+ AutoTArray<Layer*, 12> children;
container->SortChildrenBy3DZOrder(children);
for (uint32_t i = 0; i < children.Length(); i++) {
Layer* layer = children.ElementAt(i);
if (layer->IsBackfaceHidden()) {
continue;
}
if (!layer->AsContainerLayer() && !layer->IsVisible()) {
continue;
--- a/gfx/layers/client/CanvasClient.cpp
+++ b/gfx/layers/client/CanvasClient.cpp
@@ -115,17 +115,17 @@ CanvasClient2D::Update(gfx::IntSize aSiz
}
if (bufferCreated && !AddTextureClient(mBuffer)) {
mBuffer = nullptr;
return;
}
if (updated) {
- nsAutoTArray<CompositableForwarder::TimedTextureClient,1> textures;
+ AutoTArray<CompositableForwarder::TimedTextureClient,1> textures;
CompositableForwarder::TimedTextureClient* t = textures.AppendElement();
t->mTextureClient = mBuffer;
t->mPictureRect = nsIntRect(nsIntPoint(0, 0), mBuffer->GetSize());
t->mFrameID = mFrameID;
GetForwarder()->UseTextures(this, textures);
mBuffer->SyncWithObject(GetForwarder()->GetSyncObject());
}
}
@@ -471,17 +471,17 @@ CanvasClientSharedSurface::Updated()
#endif
mFront = mNewFront;
mNewFront = nullptr;
// Add the new TexClient.
MOZ_ALWAYS_TRUE( AddTextureClient(mFront) );
- nsAutoTArray<CompositableForwarder::TimedTextureClient,1> textures;
+ AutoTArray<CompositableForwarder::TimedTextureClient,1> textures;
CompositableForwarder::TimedTextureClient* t = textures.AppendElement();
t->mTextureClient = mFront;
t->mPictureRect = nsIntRect(nsIntPoint(0, 0), mFront->GetSize());
t->mFrameID = mFrameID;
forwarder->UseTextures(this, textures);
}
void
--- a/gfx/layers/client/ClientContainerLayer.h
+++ b/gfx/layers/client/ClientContainerLayer.h
@@ -8,17 +8,17 @@
#include <stdint.h> // for uint32_t
#include "ClientLayerManager.h" // for ClientLayerManager, etc
#include "Layers.h" // for Layer, ContainerLayer, etc
#include "nsDebug.h" // for NS_ASSERTION
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
#include "nsISupportsUtils.h" // for NS_ADDREF, NS_RELEASE
#include "nsRegion.h" // for nsIntRegion
-#include "nsTArray.h" // for nsAutoTArray
+#include "nsTArray.h" // for AutoTArray
#include "ReadbackProcessor.h"
#include "ClientPaintedLayer.h"
namespace mozilla {
namespace layers {
class ShadowableLayer;
@@ -45,17 +45,17 @@ protected:
public:
virtual void RenderLayer() override
{
RenderMaskLayers(this);
DefaultComputeSupportsComponentAlphaChildren();
- nsAutoTArray<Layer*, 12> children;
+ AutoTArray<Layer*, 12> children;
SortChildrenBy3DZOrder(children);
ReadbackProcessor readback;
readback.BuildUpdates(this);
for (uint32_t i = 0; i < children.Length(); i++) {
Layer* child = children.ElementAt(i);
if (!child->IsVisible()) {
--- a/gfx/layers/client/ClientLayerManager.h
+++ b/gfx/layers/client/ClientLayerManager.h
@@ -345,18 +345,18 @@ private:
// An incrementing sequence number for paints.
// Incremented in BeginTransaction(), but not for repeat transactions.
uint32_t mPaintSequenceNumber;
APZTestData mApzTestData;
RefPtr<ShadowLayerForwarder> mForwarder;
- nsAutoTArray<RefPtr<TextureClientPool>,2> mTexturePools;
- nsAutoTArray<dom::OverfillCallback*,0> mOverfillCallbacks;
+ AutoTArray<RefPtr<TextureClientPool>,2> mTexturePools;
+ AutoTArray<dom::OverfillCallback*,0> mOverfillCallbacks;
mozilla::TimeStamp mTransactionStart;
nsTArray<DidCompositeObserver*> mDidCompositeObservers;
RefPtr<MemoryPressureObserver> mMemoryPressureObserver;
};
class ClientLayer : public ShadowableLayer
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -374,17 +374,17 @@ ContentClientRemoteBuffer::Updated(const
aVisibleRegion,
aDidSelfCopy);
MOZ_ASSERT(mTextureClient);
if (mTextureClientOnWhite) {
mForwarder->UseComponentAlphaTextures(this, mTextureClient,
mTextureClientOnWhite);
} else {
- nsAutoTArray<CompositableForwarder::TimedTextureClient,1> textures;
+ AutoTArray<CompositableForwarder::TimedTextureClient,1> textures;
CompositableForwarder::TimedTextureClient* t = textures.AppendElement();
t->mTextureClient = mTextureClient;
IntSize size = mTextureClient->GetSize();
t->mPictureRect = nsIntRect(0, 0, size.width, size.height);
GetForwarder()->UseTextures(this, textures);
}
mForwarder->UpdateTextureRegion(this,
ThebesBufferData(BufferRect(),
--- a/gfx/layers/client/ImageClient.cpp
+++ b/gfx/layers/client/ImageClient.cpp
@@ -118,17 +118,17 @@ ImageClientSingle::FlushAllImages(AsyncT
RemoveTextureWithWaiter(b.mTextureClient, aAsyncTransactionWaiter);
}
mBuffers.Clear();
}
bool
ImageClientSingle::UpdateImage(ImageContainer* aContainer, uint32_t aContentFlags)
{
- nsAutoTArray<ImageContainer::OwningImage,4> images;
+ AutoTArray<ImageContainer::OwningImage,4> images;
uint32_t generationCounter;
aContainer->GetCurrentImages(&images, &generationCounter);
if (mLastUpdateGenerationCounter == generationCounter) {
return true;
}
mLastUpdateGenerationCounter = generationCounter;
@@ -144,17 +144,17 @@ ImageClientSingle::UpdateImage(ImageCont
// SetCurrentImages call but before UpdateImageClientNow.
// This can also happen if all images in the list are invalid.
// We return true because the caller would attempt to recreate the
// ImageClient otherwise, and that isn't going to help.
return true;
}
nsTArray<Buffer> newBuffers;
- nsAutoTArray<CompositableForwarder::TimedTextureClient,4> textures;
+ AutoTArray<CompositableForwarder::TimedTextureClient,4> textures;
for (auto& img : images) {
Image* image = img.mImage;
#ifdef MOZ_WIDGET_GONK
if (image->GetFormat() == ImageFormat::OVERLAY_IMAGE) {
OverlayImage* overlayImage = static_cast<OverlayImage*>(image);
OverlaySource source;
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -1396,17 +1396,17 @@ AsyncCompositionManager::TransformShadow
if (ApplyAsyncContentTransformToTree(root, &foundRoot, clipDeferredFromChildren)) {
#if defined(MOZ_ANDROID_APZ)
MOZ_ASSERT(foundRoot);
if (foundRoot && mFixedLayerMargins != ScreenMargin()) {
MoveScrollbarForLayerMargin(root, mRootScrollableId, mFixedLayerMargins);
}
#endif
} else {
- nsAutoTArray<Layer*,1> scrollableLayers;
+ AutoTArray<Layer*,1> scrollableLayers;
#ifdef MOZ_WIDGET_ANDROID
mLayerManager->GetRootScrollableLayers(scrollableLayers);
#else
mLayerManager->GetScrollableLayers(scrollableLayers);
#endif
for (uint32_t i = 0; i < scrollableLayers.Length(); i++) {
if (scrollableLayers[i]) {
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -24,17 +24,17 @@
#include "mozilla/layers/AsyncCompositionManager.h" // for ViewTransform
#include "mozilla/layers/LayerMetricsWrapper.h" // for LayerMetricsWrapper
#include "mozilla/mozalloc.h" // for operator delete, etc
#include "mozilla/RefPtr.h" // for nsRefPtr
#include "nsDebug.h" // for NS_ASSERTION
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
#include "nsISupportsUtils.h" // for NS_ADDREF, NS_RELEASE
#include "nsRegion.h" // for nsIntRegion
-#include "nsTArray.h" // for nsAutoTArray
+#include "nsTArray.h" // for AutoTArray
#include "TextRenderer.h" // for TextRenderer
#include <vector>
#include "VRManager.h" // for VRManager
#include "GeckoProfiler.h" // for GeckoProfiler
#ifdef MOZ_ENABLE_PROFILER_SPS
#include "ProfilerMarkers.h" // for ProfilerMarkers
#endif
@@ -185,17 +185,17 @@ ContainerRenderVR(ContainerT* aContainer
}
}
gfx::IntRect rtBounds = previousTarget->GetRect();
DUMP("eyeResolution: %d %d targetRT: %d %d %d %d\n", WH(eyeResolution), XYWH(rtBounds));
compositor->SetRenderTarget(surface);
- nsAutoTArray<Layer*, 12> children;
+ AutoTArray<Layer*, 12> children;
aContainer->SortChildrenBy3DZOrder(children);
gfx::Matrix4x4 origTransform = aContainer->GetEffectiveTransform();
for (uint32_t i = 0; i < children.Length(); i++) {
LayerComposite* layerToRender = static_cast<LayerComposite*>(children.ElementAt(i)->ImplData());
Layer* layer = layerToRender->GetLayer();
uint32_t contentFlags = layer->GetContentFlags();
@@ -331,17 +331,17 @@ NeedToDrawCheckerboardingForLayer(Layer*
aLayer->IsOpaqueForVisibility() &&
LayerHasCheckerboardingAPZC(aLayer, aOutCheckerboardingColor);
}
/* all of the prepared data that we need in RenderLayer() */
struct PreparedData
{
RefPtr<CompositingRenderTarget> mTmpTarget;
- nsAutoTArray<PreparedLayer, 12> mLayers;
+ AutoTArray<PreparedLayer, 12> mLayers;
bool mNeedsSurfaceCopy;
};
// ContainerPrepare is shared between RefLayer and ContainerLayer
template<class ContainerT> void
ContainerPrepare(ContainerT* aContainer,
LayerManagerComposite* aManager,
const RenderTargetIntRect& aClipRect)
@@ -356,17 +356,17 @@ ContainerPrepare(ContainerT* aContainer,
// want to render thebes layers only once and then composite the intermeidate surfaces
// with different transforms twice.
return;
}
/**
* Determine which layers to draw.
*/
- nsAutoTArray<Layer*, 12> children;
+ AutoTArray<Layer*, 12> children;
aContainer->SortChildrenBy3DZOrder(children);
for (uint32_t i = 0; i < children.Length(); i++) {
LayerComposite* layerToRender = static_cast<LayerComposite*>(children.ElementAt(i)->ImplData());
RenderTargetIntRect clipRect = layerToRender->GetLayer()->
CalculateScissorRect(aClipRect);
--- a/gfx/layers/composite/FPSCounter.h
+++ b/gfx/layers/composite/FPSCounter.h
@@ -7,17 +7,17 @@
#define mozilla_layers_opengl_FPSCounter_h_
#include <algorithm> // for min
#include <stddef.h> // for size_t
#include <map> // for std::map
#include "GLDefs.h" // for GLuint
#include "mozilla/RefPtr.h" // for already_AddRefed, RefCounted
#include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration
-#include "nsTArray.h" // for nsAutoTArray, nsTArray_Impl, etc
+#include "nsTArray.h" // for AutoTArray, nsTArray_Impl, etc
#include "prio.h" // for NSPR file i/o
namespace mozilla {
namespace layers {
class DataTextureSource;
class Compositor;
@@ -82,17 +82,17 @@ private:
nsresult WriteFrameTimeStamps();
/***
* mFrameTimestamps is a psuedo circular buffer
* Since we have a constant write time and don't
* read at an offset except our latest write
* we don't need an explicit read pointer.
*/
- nsAutoTArray<TimeStamp, kMaxFrames> mFrameTimestamps;
+ AutoTArray<TimeStamp, kMaxFrames> mFrameTimestamps;
int mWriteIndex; // points to next open write slot
int mIteratorIndex; // used only when iterating
const char* mFPSName;
TimeStamp mLastInterval;
};
struct FPSState {
FPSState();
--- a/gfx/layers/composite/FrameUniformityData.h
+++ b/gfx/layers/composite/FrameUniformityData.h
@@ -25,17 +25,17 @@ public:
struct LayerTransforms {
LayerTransforms() {}
gfx::Point GetAverage();
gfx::Point GetStdDev();
// 60 fps * 5 seconds worth of data
- nsAutoTArray<gfx::Point, 300> mTransforms;
+ AutoTArray<gfx::Point, 300> mTransforms;
};
class LayerTransformRecorder {
public:
LayerTransformRecorder() {}
~LayerTransformRecorder();
void RecordTransform(Layer* aLayer, const gfx::Point& aTransform);
--- a/gfx/layers/ipc/CompositableTransactionParent.cpp
+++ b/gfx/layers/ipc/CompositableTransactionParent.cpp
@@ -167,17 +167,17 @@ CompositableParentManager::ReceiveCompos
op.transactionId()));
}
break;
}
case CompositableOperation::TOpUseTexture: {
const OpUseTexture& op = aEdit.get_OpUseTexture();
CompositableHost* compositable = AsCompositable(op);
- nsAutoTArray<CompositableHost::TimedTexture,4> textures;
+ AutoTArray<CompositableHost::TimedTexture,4> textures;
for (auto& timedTexture : op.textures()) {
CompositableHost::TimedTexture* t = textures.AppendElement();
t->mTexture =
TextureHost::AsTextureHost(timedTexture.textureParent());
MOZ_ASSERT(t->mTexture);
t->mTimeStamp = timedTexture.timeStamp();
t->mPictureRect = timedTexture.picture();
t->mFrameID = timedTexture.frameID();
--- a/gfx/layers/ipc/CompositorChild.cpp
+++ b/gfx/layers/ipc/CompositorChild.cpp
@@ -90,17 +90,17 @@ CompositorChild::Destroy()
// From now on the only message we can send is Stop.
if (mLayerManager) {
mLayerManager->Destroy();
mLayerManager = nullptr;
}
- nsAutoTArray<PLayerTransactionChild*, 16> transactions;
+ AutoTArray<PLayerTransactionChild*, 16> transactions;
ManagedPLayerTransactionChild(transactions);
for (int i = transactions.Length() - 1; i >= 0; --i) {
RefPtr<LayerTransactionChild> layers =
static_cast<LayerTransactionChild*>(transactions[i]);
layers->Destroy();
}
SendStop();
--- a/gfx/layers/ipc/CompositorChild.h
+++ b/gfx/layers/ipc/CompositorChild.h
@@ -190,17 +190,17 @@ private:
// Weakly hold the TabChild that made a request to be alerted when
// the transaction has been received.
nsWeakPtr mWeakTabChild; // type is TabChild
DISALLOW_EVIL_CONSTRUCTORS(CompositorChild);
// When we receive overfill numbers, notify these client layer managers
- nsAutoTArray<ClientLayerManager*,0> mOverfillObservers;
+ AutoTArray<ClientLayerManager*,0> mOverfillObservers;
// True until the beginning of the two-step shutdown sequence of this actor.
bool mCanSend;
};
} // namespace layers
} // namespace mozilla
--- a/gfx/layers/ipc/ImageBridgeChild.cpp
+++ b/gfx/layers/ipc/ImageBridgeChild.cpp
@@ -30,17 +30,17 @@
#include "mozilla/layers/ImageClient.h" // for ImageClient
#include "mozilla/layers/LayersMessages.h" // for CompositableOperation
#include "mozilla/layers/PCompositableChild.h" // for PCompositableChild
#include "mozilla/layers/PImageContainerChild.h"
#include "mozilla/layers/TextureClient.h" // for TextureClient
#include "mozilla/mozalloc.h" // for operator new, etc
#include "nsAutoPtr.h" // for nsRefPtr
#include "nsISupportsImpl.h" // for ImageContainer::AddRef, etc
-#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc
+#include "nsTArray.h" // for AutoTArray, nsTArray, etc
#include "nsTArrayForwardDeclare.h" // for AutoInfallibleTArray
#include "nsThreadUtils.h" // for NS_IsMainThread
#include "nsXULAppAPI.h" // for XRE_GetIOMessageLoop
#include "mozilla/StaticPtr.h" // for StaticRefPtr
#include "mozilla/layers/TextureClient.h"
namespace mozilla {
namespace ipc {
@@ -141,17 +141,17 @@ Atomic<bool> ImageBridgeChild::sIsShutDo
void
ImageBridgeChild::UseTextures(CompositableClient* aCompositable,
const nsTArray<TimedTextureClient>& aTextures)
{
MOZ_ASSERT(aCompositable);
MOZ_ASSERT(aCompositable->GetIPDLActor());
MOZ_ASSERT(aCompositable->IsConnected());
- nsAutoTArray<TimedTexture,4> textures;
+ AutoTArray<TimedTexture,4> textures;
for (auto& t : aTextures) {
MOZ_ASSERT(t.mTextureClient);
MOZ_ASSERT(t.mTextureClient->GetIPDLActor());
if (!t.mTextureClient->IsSharedWithCompositor()) {
return;
}
--- a/gfx/layers/ipc/ImageBridgeParent.cpp
+++ b/gfx/layers/ipc/ImageBridgeParent.cpp
@@ -327,17 +327,17 @@ public:
ImageBridgeParent::NotifyImageComposites(nsTArray<ImageCompositeNotification>& aNotifications)
{
// Group the notifications by destination process ID and then send the
// notifications in one message per group.
aNotifications.Sort(ProcessIdComparator());
uint32_t i = 0;
bool ok = true;
while (i < aNotifications.Length()) {
- nsAutoTArray<ImageCompositeNotification,1> notifications;
+ AutoTArray<ImageCompositeNotification,1> notifications;
notifications.AppendElement(aNotifications[i]);
uint32_t end = i + 1;
MOZ_ASSERT(aNotifications[i].imageContainerParent());
ProcessId pid = aNotifications[i].imageContainerParent()->OtherPid();
while (end < aNotifications.Length() &&
aNotifications[end].imageContainerParent()->OtherPid() == pid) {
notifications.AppendElement(aNotifications[end]);
++end;
--- a/gfx/layers/ipc/ImageContainerParent.h
+++ b/gfx/layers/ipc/ImageContainerParent.h
@@ -21,17 +21,17 @@ class ImageHost;
class ImageContainerParent : public PImageContainerParent
{
public:
ImageContainerParent() {}
~ImageContainerParent();
virtual bool RecvAsyncDelete() override;
- nsAutoTArray<ImageHost*,1> mImageHosts;
+ AutoTArray<ImageHost*,1> mImageHosts;
private:
virtual void ActorDestroy(ActorDestroyReason why) override {}
};
} // namespace layers
} // namespace mozilla
--- a/gfx/layers/ipc/ShadowLayers.cpp
+++ b/gfx/layers/ipc/ShadowLayers.cpp
@@ -24,17 +24,17 @@
#include "mozilla/layers/LayersMessages.h" // for Edit, etc
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor, etc
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_LOG
#include "mozilla/layers/LayerTransactionChild.h"
#include "ShadowLayerUtils.h"
#include "mozilla/layers/TextureClient.h" // for TextureClient
#include "mozilla/mozalloc.h" // for operator new, etc
#include "nsAutoPtr.h" // for nsRefPtr, getter_AddRefs, etc
-#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc
+#include "nsTArray.h" // for AutoTArray, nsTArray, etc
#include "nsXULAppAPI.h" // for XRE_GetProcessType, etc
#include "mozilla/ReentrantMonitor.h"
namespace mozilla {
namespace ipc {
class Shmem;
} // namespace ipc
@@ -382,17 +382,17 @@ ShadowLayerForwarder::UpdateTextureRegio
}
void
ShadowLayerForwarder::UseTextures(CompositableClient* aCompositable,
const nsTArray<TimedTextureClient>& aTextures)
{
MOZ_ASSERT(aCompositable && aCompositable->IsConnected());
- nsAutoTArray<TimedTexture,4> textures;
+ AutoTArray<TimedTexture,4> textures;
for (auto& t : aTextures) {
MOZ_ASSERT(t.mTextureClient);
MOZ_ASSERT(t.mTextureClient->GetIPDLActor());
FenceHandle fence = t.mTextureClient->GetAcquireFenceHandle();
textures.AppendElement(TimedTexture(nullptr, t.mTextureClient->GetIPDLActor(),
fence.IsValid() ? MaybeFence(fence) : MaybeFence(null_t()),
t.mTimeStamp, t.mPictureRect,
--- a/gfx/layers/opengl/CompositorOGL.h
+++ b/gfx/layers/opengl/CompositorOGL.h
@@ -23,17 +23,17 @@
#include "mozilla/gfx/Types.h" // for Float, SurfaceFormat, etc
#include "mozilla/layers/Compositor.h" // for SurfaceInitMode, Compositor, etc
#include "mozilla/layers/CompositorTypes.h" // for MaskType::MaskType::NumMaskTypes, etc
#include "mozilla/layers/LayersTypes.h"
#include "nsAutoPtr.h" // for nsRefPtr, nsAutoPtr
#include "nsCOMPtr.h" // for already_AddRefed
#include "nsDebug.h" // for NS_ASSERTION, NS_WARNING
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
-#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc
+#include "nsTArray.h" // for AutoTArray, nsTArray, etc
#include "nsThreadUtils.h" // for nsRunnable
#include "nsXULAppAPI.h" // for XRE_GetProcessType
#include "nscore.h" // for NS_IMETHOD
#include "gfxVR.h"
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 21
#include "nsTHashtable.h" // for nsTHashtable
#endif
--- a/gfx/src/nsRegion.cpp
+++ b/gfx/src/nsRegion.cpp
@@ -300,17 +300,17 @@ void nsRegion::SimplifyOutwardByArea(uin
if (!n)
return;
pixman_box32_t *end = boxes + n;
pixman_box32_t *topRectsEnd = boxes+1;
pixman_box32_t *topRects = boxes;
// we need some temporary storage for merging both rows of rectangles
- nsAutoTArray<pixman_box32_t, 10> tmpStorage;
+ AutoTArray<pixman_box32_t, 10> tmpStorage;
tmpStorage.SetCapacity(n);
pixman_box32_t *tmpRect = tmpStorage.Elements();
pixman_box32_t *destRect = boxes;
pixman_box32_t *rect = tmpRect;
// find the end of the first span of rectangles
while (topRectsEnd < end && topRectsEnd->y1 == topRects->y1) {
topRectsEnd++;
--- a/gfx/thebes/gfxCoreTextShaper.cpp
+++ b/gfx/thebes/gfxCoreTextShaper.cpp
@@ -344,20 +344,20 @@ gfxCoreTextShaper::SetGlyphsFromRun(gfxS
UniquePtr<CFIndex[]> glyphToCharArray;
const CGGlyph* glyphs = nullptr;
const CGPoint* positions = nullptr;
const CFIndex* glyphToChar = nullptr;
// Testing indicates that CTRunGetGlyphsPtr (almost?) always succeeds,
// and so allocating a new array and copying data with CTRunGetGlyphs
// will be extremely rare.
- // If this were not the case, we could use an nsAutoTArray<> to
+ // If this were not the case, we could use an AutoTArray<> to
// try and avoid the heap allocation for small runs.
// It's possible that some future change to CoreText will mean that
- // CTRunGetGlyphsPtr fails more often; if this happens, nsAutoTArray<>
+ // CTRunGetGlyphsPtr fails more often; if this happens, AutoTArray<>
// may become an attractive option.
glyphs = ::CTRunGetGlyphsPtr(aCTRun);
if (!glyphs) {
glyphsArray = MakeUniqueFallible<CGGlyph[]>(numGlyphs);
if (!glyphsArray) {
return NS_ERROR_OUT_OF_MEMORY;
}
::CTRunGetGlyphs(aCTRun, ::CFRangeMake(0, 0), glyphsArray.get());
@@ -385,17 +385,17 @@ gfxCoreTextShaper::SetGlyphsFromRun(gfxS
}
::CTRunGetStringIndices(aCTRun, ::CFRangeMake(0, 0), glyphToCharArray.get());
glyphToChar = glyphToCharArray.get();
}
double runWidth = ::CTRunGetTypographicBounds(aCTRun, ::CFRangeMake(0, 0),
nullptr, nullptr, nullptr);
- nsAutoTArray<gfxShapedText::DetailedGlyph,1> detailedGlyphs;
+ AutoTArray<gfxShapedText::DetailedGlyph,1> detailedGlyphs;
gfxShapedText::CompressedGlyph *charGlyphs =
aShapedText->GetCharacterGlyphs() + aOffset;
// CoreText gives us the glyphindex-to-charindex mapping, which relates each glyph
// to a source text character; we also need the charindex-to-glyphindex mapping to
// find the glyph for a given char. Note that some chars may not map to any glyph
// (ligature continuations), and some may map to several glyphs (eg Indic split vowels).
// We set the glyph index to NO_GLYPH for chars that have no associated glyph, and we
--- a/gfx/thebes/gfxDWriteFontList.cpp
+++ b/gfx/thebes/gfxDWriteFontList.cpp
@@ -65,17 +65,17 @@ GetDirectWriteFontName(IDWriteFont *aFon
RefPtr<IDWriteLocalizedStrings> names;
hr = aFont->GetFaceNames(getter_AddRefs(names));
if (FAILED(hr)) {
return hr;
}
BOOL exists;
- nsAutoTArray<wchar_t,32> faceName;
+ AutoTArray<wchar_t,32> faceName;
UINT32 englishIdx = 0;
hr = names->FindLocaleName(L"en-us", &englishIdx, &exists);
if (FAILED(hr)) {
return hr;
}
if (!exists) {
// No english found, use whatever is first in the list.
@@ -109,17 +109,17 @@ GetDirectWriteFaceName(IDWriteFont *aFon
BOOL exists;
RefPtr<IDWriteLocalizedStrings> infostrings;
hr = aFont->GetInformationalStrings(aWhichName, getter_AddRefs(infostrings), &exists);
if (FAILED(hr) || !exists) {
return E_FAIL;
}
- nsAutoTArray<wchar_t,32> faceName;
+ AutoTArray<wchar_t,32> faceName;
UINT32 englishIdx = 0;
hr = infostrings->FindLocaleName(L"en-us", &englishIdx, &exists);
if (FAILED(hr)) {
return hr;
}
if (!exists) {
// No english found, use whatever is first in the list.
@@ -628,17 +628,17 @@ gfxDWriteFontEntry::CreateFontFace(IDWri
!(mFontFace->GetSimulations() & DWRITE_FONT_SIMULATIONS_BOLD)) {
// if so, we need to return not mFontFace itself but a version that
// has the Bold simulation - unfortunately, DWrite doesn't provide
// a simple API for this
UINT32 numberOfFiles = 0;
if (FAILED(mFontFace->GetFiles(&numberOfFiles, nullptr))) {
return NS_ERROR_FAILURE;
}
- nsAutoTArray<IDWriteFontFile*,1> files;
+ AutoTArray<IDWriteFontFile*,1> files;
files.AppendElements(numberOfFiles);
if (FAILED(mFontFace->GetFiles(&numberOfFiles, files.Elements()))) {
return NS_ERROR_FAILURE;
}
HRESULT hr = gfxWindowsPlatform::GetPlatform()->GetDWriteFactory()->
CreateFontFace(mFontFace->GetType(),
numberOfFiles,
files.Elements(),
@@ -1512,17 +1512,17 @@ private:
RefPtr<IDWriteFontCollection> mBundledFonts;
#endif
};
void
DirectWriteFontInfo::LoadFontFamilyData(const nsAString& aFamilyName)
{
// lookup the family
- nsAutoTArray<wchar_t, 32> famName;
+ AutoTArray<wchar_t, 32> famName;
uint32_t len = aFamilyName.Length();
if(!famName.SetLength(len + 1, fallible)) {
return;
}
memcpy(famName.Elements(), aFamilyName.BeginReading(), len * sizeof(char16_t));
famName[len] = 0;
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -1348,17 +1348,17 @@ gfxFT2FontList::GetSystemFontList(Infall
auto family = static_cast<FT2FontFamily*>(iter.Data().get());
family->AddFacesToFontList(retValue, FT2FontFamily::kHidden);
}
}
static void
LoadSkipSpaceLookupCheck(nsTHashtable<nsStringHashKey>& aSkipSpaceLookupCheck)
{
- nsAutoTArray<nsString, 5> skiplist;
+ AutoTArray<nsString, 5> skiplist;
gfxFontUtils::GetPrefsFontList(
"font.whitelist.skip_default_features_space_check",
skiplist);
uint32_t numFonts = skiplist.Length();
for (uint32_t i = 0; i < numFonts; i++) {
ToLowerCase(skiplist[i]);
aSkipSpaceLookupCheck.PutEntry(skiplist[i]);
}
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -342,17 +342,17 @@ static void
LookupAlternateValues(gfxFontFeatureValueSet *featureLookup,
const nsAString& aFamily,
const nsTArray<gfxAlternateValue>& altValue,
nsTArray<gfxFontFeature>& aFontFeatures)
{
uint32_t numAlternates = altValue.Length();
for (uint32_t i = 0; i < numAlternates; i++) {
const gfxAlternateValue& av = altValue.ElementAt(i);
- nsAutoTArray<uint32_t,4> values;
+ AutoTArray<uint32_t,4> values;
// map <family, name, feature> ==> <values>
bool found =
featureLookup->GetFontFeatureValuesFor(aFamily, av.alternate,
av.value, values);
uint32_t numValues = values.Length();
// nothing defined, skip
@@ -517,17 +517,17 @@ gfxFontShaper::MergeFontFeatures(
break;
default:
MOZ_ASSERT_UNREACHABLE("Unexpected variantSubSuper");
break;
}
// add font-specific feature values from style rules
if (aStyle->featureValueLookup && numAlts > 0) {
- nsAutoTArray<gfxFontFeature,4> featureList;
+ AutoTArray<gfxFontFeature,4> featureList;
// insert list of alternate feature settings
LookupAlternateValues(aStyle->featureValueLookup, aFamilyName,
aStyle->alternateValues, featureList);
count = featureList.Length();
for (i = 0; i < count; i++) {
const gfxFontFeature& feature = featureList.ElementAt(i);
@@ -2185,18 +2185,18 @@ gfxFont::RenderSVGGlyph(gfxContext *aCon
bool
gfxFont::RenderColorGlyph(DrawTarget* aDrawTarget,
mozilla::gfx::ScaledFont* scaledFont,
GlyphRenderingOptions* aRenderingOptions,
mozilla::gfx::DrawOptions aDrawOptions,
const mozilla::gfx::Point& aPoint,
uint32_t aGlyphId) const
{
- nsAutoTArray<uint16_t, 8> layerGlyphs;
- nsAutoTArray<mozilla::gfx::Color, 8> layerColors;
+ AutoTArray<uint16_t, 8> layerGlyphs;
+ AutoTArray<mozilla::gfx::Color, 8> layerColors;
if (!GetFontEntry()->GetColorLayersInfo(aGlyphId, layerGlyphs, layerColors)) {
return false;
}
for (uint32_t layerIndex = 0; layerIndex < layerGlyphs.Length();
layerIndex++) {
Glyph glyph;
@@ -3143,18 +3143,18 @@ gfxFont::InitFakeSmallCapsRun(DrawTarget
// use reduced-size font, then fall through to uppercase the text
f = smallCapsFont;
MOZ_FALLTHROUGH;
case kUppercase:
// apply uppercase transform to the string
nsDependentSubstring origString(aText + runStart, runLength);
nsAutoString convertedString;
- nsAutoTArray<bool,50> charsToMergeArray;
- nsAutoTArray<bool,50> deletedCharsArray;
+ AutoTArray<bool,50> charsToMergeArray;
+ AutoTArray<bool,50> deletedCharsArray;
bool mergeNeeded = nsCaseTransformTextRunFactory::
TransformString(origString,
convertedString,
true,
mStyle.explicitLanguage
? mStyle.language.get() : nullptr,
charsToMergeArray,
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -2078,17 +2078,17 @@ protected:
// by the platform
bool mApplySyntheticBold;
bool mKerningSet; // kerning explicitly set?
bool mKerningEnabled; // if set, on or off?
nsExpirationState mExpirationState;
gfxFontStyle mStyle;
- nsAutoTArray<gfxGlyphExtents*,1> mGlyphExtentsArray;
+ AutoTArray<gfxGlyphExtents*,1> mGlyphExtentsArray;
nsAutoPtr<nsTHashtable<nsPtrHashKey<GlyphChangeObserver> > > mGlyphChangeObservers;
gfxFloat mAdjustedSize;
// Conversion factor from font units to dev units; note that this may be
// zero (in the degenerate case where mAdjustedSize has become zero).
// This is OK because we only multiply by this factor, never divide.
float mFUnitsConvFactor;
--- a/gfx/thebes/gfxFontEntry.cpp
+++ b/gfx/thebes/gfxFontEntry.cpp
@@ -1143,17 +1143,17 @@ gfxFontFamily::HasOtherFamilyNames()
}
return mHasOtherFamilyNames;
}
gfxFontEntry*
gfxFontFamily::FindFontForStyle(const gfxFontStyle& aFontStyle,
bool& aNeedsSyntheticBold)
{
- nsAutoTArray<gfxFontEntry*,4> matched;
+ AutoTArray<gfxFontEntry*,4> matched;
FindAllFontsForStyle(aFontStyle, matched, aNeedsSyntheticBold);
if (!matched.IsEmpty()) {
return matched[0];
}
return nullptr;
}
#define STYLE_SHIFT 2 // number of bits to contain style distance
@@ -1631,17 +1631,17 @@ gfxFontFamily::ReadOtherFamilyNamesForFa
// returns true if other names were found, false otherwise
bool
gfxFontFamily::ReadOtherFamilyNamesForFace(gfxPlatformFontList *aPlatformFontList,
hb_blob_t *aNameTable,
bool useFullName)
{
uint32_t dataLength;
const char *nameData = hb_blob_get_data(aNameTable, &dataLength);
- nsAutoTArray<nsString,4> otherFamilyNames;
+ AutoTArray<nsString,4> otherFamilyNames;
ReadOtherFamilyNamesForFace(mName, nameData, dataLength,
otherFamilyNames, useFullName);
uint32_t n = otherFamilyNames.Length();
for (uint32_t i = 0; i < n; i++) {
aPlatformFontList->AddOtherFamilyName(this, otherFamilyNames[i]);
}
@@ -1716,17 +1716,17 @@ gfxFontFamily::ReadFaceNames(gfxPlatform
}
#endif
if (!mOtherFamilyNamesInitialized &&
aFontInfoData &&
aFontInfoData->mLoadOtherNames &&
!asyncFontLoaderDisabled)
{
- nsAutoTArray<nsString,4> otherFamilyNames;
+ AutoTArray<nsString,4> otherFamilyNames;
bool foundOtherNames =
aFontInfoData->GetOtherFamilyNames(mName, otherFamilyNames);
if (foundOtherNames) {
uint32_t i, n = otherFamilyNames.Length();
for (i = 0; i < n; i++) {
aPlatformFontList->AddOtherFamilyName(this, otherFamilyNames[i]);
}
}
--- a/gfx/thebes/gfxFontconfigFonts.cpp
+++ b/gfx/thebes/gfxFontconfigFonts.cpp
@@ -184,17 +184,17 @@ public:
FcPattern *aFontPattern,
const nsAString& aName)
: gfxFcFontEntry(aName), mFontFace(aFontFace),
mFTFace(nullptr), mFTFaceInitialized(false)
{
cairo_font_face_reference(mFontFace);
cairo_font_face_set_user_data(mFontFace, &sFontEntryKey, this, nullptr);
- // mPatterns is an nsAutoTArray with 1 space always available, so the
+ // mPatterns is an AutoTArray with 1 space always available, so the
// AppendElement always succeeds.
// FIXME: Make this infallible after bug 968520 is done.
MOZ_ALWAYS_TRUE(mPatterns.AppendElement(fallible));
mPatterns[0] = aFontPattern;
FcChar8 *name;
if (FcPatternGetString(aFontPattern,
FC_FAMILY, 0, &name) == FcResultMatch) {
@@ -908,17 +908,17 @@ gfxFcFontSet::SortPreferredFonts(bool &a
// There are no direct fontconfig APIs to get the binding type. The
// binding only takes effect in the sort and match functions.
// |requiredLangs| is a list of requested languages that have not yet been
// satisfied. gfxFontconfigUtils only sets one FC_LANG property value,
// but FcConfigSubstitute may add more values (e.g. prepending "en" to
// "ja" will use western fonts to render Latin/Arabic numerals in Japanese
// text.)
- nsAutoTArray<LangSupportEntry,10> requiredLangs;
+ AutoTArray<LangSupportEntry,10> requiredLangs;
for (int v = 0; ; ++v) {
FcChar8 *lang;
FcResult result = FcPatternGetString(mSortPattern, FC_LANG, v, &lang);
if (result != FcResultMatch) {
// No need to check FcPatternGetLangSet() because
// gfxFontconfigUtils sets only a string value for FC_LANG and
// FcConfigSubstitute cannot add LangSets.
NS_ASSERTION(result != FcResultTypeMismatch,
@@ -1284,17 +1284,17 @@ gfxPangoFontGroup::Copy(const gfxFontSty
return new gfxPangoFontGroup(mFamilyList, aStyle, mUserFontSet, mDevToCssSize);
}
void
gfxPangoFontGroup::FindGenericFontsPFG(FontFamilyType aGenericType,
nsIAtom *aLanguage,
void *aClosure)
{
- nsAutoTArray<nsString, 5> resolvedGenerics;
+ AutoTArray<nsString, 5> resolvedGenerics;
ResolveGenericFontNamesPFG(aGenericType, aLanguage, resolvedGenerics);
uint32_t g = 0, numGenerics = resolvedGenerics.Length();
for (g = 0; g < numGenerics; g++) {
FindPlatformFontPFG(resolvedGenerics[g], false, aClosure);
}
}
/* static */ void
@@ -1489,17 +1489,17 @@ gfxPangoFontGroup::MakeFontSet(PangoLang
const char *lang = pango_language_to_string(aLang);
RefPtr<nsIAtom> langGroup;
if (aLang != mPangoLanguage) {
// Set up langGroup for Mozilla's font prefs.
langGroup = do_GetAtom(lang);
}
- nsAutoTArray<nsString, 20> fcFamilyList;
+ AutoTArray<nsString, 20> fcFamilyList;
EnumerateFontListPFG(langGroup ? langGroup.get() : mStyle.language.get(),
&fcFamilyList);
// To consider: A fontset cache here could be helpful.
// Get a pattern suitable for matching.
nsAutoRef<FcPattern> pattern
(gfxFontconfigUtils::NewPattern(fcFamilyList, mStyle, lang));
--- a/gfx/thebes/gfxFontconfigFonts.h
+++ b/gfx/thebes/gfxFontconfigFonts.h
@@ -68,17 +68,17 @@ private:
class FontSetByLangEntry {
public:
FontSetByLangEntry(PangoLanguage *aLang, gfxFcFontSet *aFontSet);
PangoLanguage *mLang;
RefPtr<gfxFcFontSet> mFontSet;
};
// There is only one of entry in this array unless characters from scripts
// of other languages are measured.
- nsAutoTArray<FontSetByLangEntry,1> mFontSets;
+ AutoTArray<FontSetByLangEntry,1> mFontSets;
gfxFloat mSizeAdjustFactor;
PangoLanguage *mPangoLanguage;
// @param aLang [in] language to use for pref fonts and system font
// resolution, or nullptr to guess a language from the gfxFontStyle.
// @param aMatchPattern [out] if non-nullptr, will return the pattern used.
already_AddRefed<gfxFcFontSet>
--- a/gfx/thebes/gfxFontconfigUtils.cpp
+++ b/gfx/thebes/gfxFontconfigUtils.cpp
@@ -980,17 +980,17 @@ gfxFontconfigUtils::GetLangSupportEntry(
// These FcFontSets are owned by fontconfig
FcFontSet *fontSets[] = {
FcConfigGetFonts(nullptr, FcSetSystem)
#ifdef MOZ_BUNDLED_FONTS
, FcConfigGetFonts(nullptr, FcSetApplication)
#endif
};
- nsAutoTArray<FcPattern*,100> fonts;
+ AutoTArray<FcPattern*,100> fonts;
for (unsigned fs = 0; fs < ArrayLength(fontSets); ++fs) {
FcFontSet *fontSet = fontSets[fs];
if (!fontSet) {
continue;
}
for (int f = 0; f < fontSet->nfont; ++f) {
FcPattern *font = fontSet->fonts[f];
--- a/gfx/thebes/gfxFontconfigUtils.h
+++ b/gfx/thebes/gfxFontconfigUtils.h
@@ -255,21 +255,21 @@ protected:
bool AddFont(FcPattern *aFont) {
return mFonts.AppendElement(aFont) != nullptr;
}
const nsTArray< nsCountedRef<FcPattern> >& GetFonts() {
return mFonts;
}
- // Don't memmove the nsAutoTArray.
+ // Don't memmove the AutoTArray.
enum { ALLOW_MEMMOVE = false };
private:
// There is usually only one font, but sometimes more.
- nsAutoTArray<nsCountedRef<FcPattern>,1> mFonts;
+ AutoTArray<nsCountedRef<FcPattern>,1> mFonts;
};
class LangSupportEntry : public CopiedFcStrEntry {
public:
explicit LangSupportEntry(KeyTypePointer aName)
: CopiedFcStrEntry(aName) { }
LangSupportEntry(const LangSupportEntry& toCopy)
--- a/gfx/thebes/gfxGraphiteShaper.cpp
+++ b/gfx/thebes/gfxGraphiteShaper.cpp
@@ -308,17 +308,17 @@ gfxGraphiteShaper::SetGlyphsFromSegment(
gfxShapedText::CompressedGlyph::IsSimpleGlyphID(gids[c.baseGlyph]) &&
gfxShapedText::CompressedGlyph::IsSimpleAdvance(appAdvance) &&
charGlyphs[offs].IsClusterStart() &&
yLocs[c.baseGlyph] == 0)
{
charGlyphs[offs].SetSimpleGlyph(appAdvance, gids[c.baseGlyph]);
} else {
// not a one-to-one mapping with simple metrics: use DetailedGlyph
- nsAutoTArray<gfxShapedText::DetailedGlyph,8> details;
+ AutoTArray<gfxShapedText::DetailedGlyph,8> details;
float clusterLoc;
for (uint32_t j = c.baseGlyph; j < c.baseGlyph + c.nGlyphs; ++j) {
gfxShapedText::DetailedGlyph* d = details.AppendElement();
d->mGlyphID = gids[j];
d->mYOffset = roundY ? NSToIntRound(-yLocs[j]) * dev2appUnits :
-yLocs[j] * dev2appUnits;
if (j == c.baseGlyph) {
d->mXOffset = 0;
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -1493,17 +1493,17 @@ gfxHarfBuzzShaper::ShapeText(DrawTarget
default:
break;
}
}
gfxFontEntry *entry = mFont->GetFontEntry();
// insert any merged features into hb_feature array
- nsAutoTArray<hb_feature_t,20> features;
+ AutoTArray<hb_feature_t,20> features;
MergeFontFeatures(style,
entry->mFeatureSettings,
aShapedText->DisableLigatures(),
entry->FamilyName(),
addSmallCaps,
AddOpenTypeFeature,
&features);
@@ -1574,17 +1574,17 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(Draw
bool aVertical)
{
uint32_t numGlyphs;
const hb_glyph_info_t *ginfo = hb_buffer_get_glyph_infos(aBuffer, &numGlyphs);
if (numGlyphs == 0) {
return NS_OK;
}
- nsAutoTArray<gfxTextRun::DetailedGlyph,1> detailedGlyphs;
+ AutoTArray<gfxTextRun::DetailedGlyph,1> detailedGlyphs;
uint32_t wordLength = aLength;
static const int32_t NO_GLYPH = -1;
AutoFallibleTArray<int32_t,SMALL_GLYPH_RUN> charToGlyphArray;
if (!charToGlyphArray.SetLength(wordLength, fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
--- a/gfx/thebes/gfxMacPlatformFontList.mm
+++ b/gfx/thebes/gfxMacPlatformFontList.mm
@@ -728,17 +728,17 @@ gfxMacPlatformFontList::InitFontList()
GetPrefsAndStartLoader();
return NS_OK;
}
void
gfxMacPlatformFontList::InitSingleFaceList()
{
- nsAutoTArray<nsString, 10> singleFaceFonts;
+ AutoTArray<nsString, 10> singleFaceFonts;
gfxFontUtils::GetPrefsFontList("font.single-face-list", singleFaceFonts);
uint32_t numFonts = singleFaceFonts.Length();
for (uint32_t i = 0; i < numFonts; i++) {
LOG_FONTLIST(("(fontlist-singleface) face name: %s\n",
NS_ConvertUTF16toUTF8(singleFaceFonts[i]).get()));
gfxFontEntry *fontEntry = LookupLocalFont(singleFaceFonts[i],
400, 0,
@@ -897,17 +897,17 @@ gfxMacPlatformFontList::InitSystemFonts(
[sysFamily compare:GetRealFamilyName([NSFont menuBarFontOfSize:0.0])] != NSOrderedSame ||
[sysFamily compare:GetRealFamilyName([NSFont toolTipsFontOfSize:0.0])] != NSOrderedSame) {
NS_WARNING("system font types map to different font families"
" -- please log a bug!!");
}
#endif
nsAutoCString en("en");
- nsAutoTArray<gfxFontFamily*,10> list;
+ AutoTArray<gfxFontFamily*,10> list;
LookupFontCascadeForLang(en, list);
mDefaultCascadeFamilies.AppendElements(list);
}
gfxFontFamily*
gfxMacPlatformFontList::FindSystemFontFamily(const nsAString& aFamily)
{
nsAutoString key;
@@ -1013,17 +1013,17 @@ gfxMacPlatformFontList::GlobalFontFallba
if (fallback) {
CFStringRef familyNameRef = ::CTFontCopyFamilyName(fallback);
::CFRelease(fallback);
if (familyNameRef &&
::CFStringCompare(familyNameRef, CFSTR("LastResort"),
kCFCompareCaseInsensitive) != kCFCompareEqualTo)
{
- nsAutoTArray<UniChar, 1024> buffer;
+ AutoTArray<UniChar, 1024> buffer;
CFIndex familyNameLen = ::CFStringGetLength(familyNameRef);
buffer.SetLength(familyNameLen+1);
::CFStringGetCharacters(familyNameRef, ::CFRangeMake(0, familyNameLen),
buffer.Elements());
buffer[familyNameLen] = 0;
nsDependentString familyNameString(reinterpret_cast<char16_t*>(buffer.Elements()), familyNameLen);
bool needsBold; // ignored in the system fallback case
@@ -1295,17 +1295,17 @@ gfxMacPlatformFontList::AppendLinkedSyst
// check to see if cached already
PrefFontList* fontsForLang = mNonDefaultCascadeFamilies.Get(lang);
if (fontsForLang) {
aFamilyList.AppendElements(*fontsForLang);
return;
}
// lookup the cascade fonts
- nsAutoTArray<gfxFontFamily*,30> list;
+ AutoTArray<gfxFontFamily*,30> list;
LookupFontCascadeForLang(lang, list);
// add cascade to cascade cache
fontsForLang = new PrefFontList;
fontsForLang->AppendElements(list);
mNonDefaultCascadeFamilies.Put(lang, fontsForLang);
// use the new list
@@ -1375,17 +1375,17 @@ MacFontInfo::LoadFontFamilyData(const ns
continue;
}
if (mLoadCmaps) {
// face name
CFStringRef faceName = (CFStringRef)
CTFontDescriptorCopyAttribute(faceDesc, kCTFontNameAttribute);
- nsAutoTArray<UniChar, 1024> buffer;
+ AutoTArray<UniChar, 1024> buffer;
CFIndex len = CFStringGetLength(faceName);
buffer.SetLength(len+1);
CFStringGetCharacters(faceName, ::CFRangeMake(0, len),
buffer.Elements());
buffer[len] = 0;
nsAutoString fontName(reinterpret_cast<char16_t*>(buffer.Elements()),
len);
--- a/gfx/thebes/gfxPlatformFontList.cpp
+++ b/gfx/thebes/gfxPlatformFontList.cpp
@@ -386,17 +386,17 @@ gfxPlatformFontList::LookupInFaceNameLis
}
return lookup;
}
void
gfxPlatformFontList::PreloadNamesList()
{
- nsAutoTArray<nsString, 10> preloadFonts;
+ AutoTArray<nsString, 10> preloadFonts;
gfxFontUtils::GetPrefsFontList("font.preload-names-list", preloadFonts);
uint32_t numFonts = preloadFonts.Length();
for (uint32_t i = 0; i < numFonts; i++) {
nsAutoString key;
GenerateFontListKey(preloadFonts[i], key);
// only search canonical names!
@@ -406,17 +406,17 @@ gfxPlatformFontList::PreloadNamesList()
}
}
}
void
gfxPlatformFontList::LoadBadUnderlineList()
{
- nsAutoTArray<nsString, 10> blacklist;
+ AutoTArray<nsString, 10> blacklist;
gfxFontUtils::GetPrefsFontList("font.blacklist.underline_offset", blacklist);
uint32_t numFonts = blacklist.Length();
for (uint32_t i = 0; i < numFonts; i++) {
nsAutoString key;
GenerateFontListKey(blacklist[i], key);
mBadUnderlineFamilyNames.PutEntry(key);
}
}
@@ -563,17 +563,17 @@ gfxPlatformFontList::SystemFindFontForCh
#define NUM_FALLBACK_FONTS 8
gfxFontEntry*
gfxPlatformFontList::CommonFontFallback(uint32_t aCh, uint32_t aNextCh,
int32_t aRunScript,
const gfxFontStyle* aMatchStyle,
gfxFontFamily** aMatchedFamily)
{
- nsAutoTArray<const char*,NUM_FALLBACK_FONTS> defaultFallbacks;
+ AutoTArray<const char*,NUM_FALLBACK_FONTS> defaultFallbacks;
uint32_t i, numFallbacks;
gfxPlatform::GetPlatform()->GetCommonFallbackFonts(aCh, aNextCh,
aRunScript,
defaultFallbacks);
numFallbacks = defaultFallbacks.Length();
for (i = 0; i < numFallbacks; i++) {
nsAutoString familyName;
@@ -790,17 +790,17 @@ gfxPlatformFontList::ResolveGenericFontN
{
const char* langGroupStr = GetPrefLangName(aPrefLang);
const char* generic = GetGenericName(aGenericType);
if (!generic) {
return;
}
- nsAutoTArray<nsString,4> genericFamilies;
+ AutoTArray<nsString,4> genericFamilies;
// load family for "font.name.generic.lang"
nsAutoCString prefFontName("font.name.");
prefFontName.Append(generic);
prefFontName.Append('.');
prefFontName.Append(langGroupStr);
gfxFontUtils::AppendPrefsFontList(prefFontName.get(), genericFamilies);
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -392,17 +392,17 @@ gfxTextRun::ShrinkToLigatureBoundaries(u
}
void
gfxTextRun::DrawGlyphs(gfxFont *aFont, uint32_t aStart, uint32_t aEnd,
gfxPoint *aPt, PropertyProvider *aProvider,
uint32_t aSpacingStart, uint32_t aSpacingEnd,
TextRunDrawParams& aParams, uint16_t aOrientation)
{
- nsAutoTArray<PropertyProvider::Spacing,200> spacingBuffer;
+ AutoTArray<PropertyProvider::Spacing,200> spacingBuffer;
bool haveSpacing = GetAdjustedSpacingArray(aStart, aEnd, aProvider,
aSpacingStart, aSpacingEnd, &spacingBuffer);
aParams.spacing = haveSpacing ? spacingBuffer.Elements() : nullptr;
aFont->Draw(this, aStart, aEnd, aPt, aParams, aOrientation);
}
static void
ClipPartialLigature(const gfxTextRun* aTextRun,
@@ -706,17 +706,17 @@ gfxTextRun::DrawEmphasisMarks(gfxContext
uint32_t end = iter.GetStringEnd();
uint32_t ligatureRunStart = start;
uint32_t ligatureRunEnd = end;
ShrinkToLigatureBoundaries(&ligatureRunStart, &ligatureRunEnd);
inlineCoord += direction *
ComputePartialLigatureWidth(start, ligatureRunStart, aProvider);
- nsAutoTArray<PropertyProvider::Spacing, 200> spacingBuffer;
+ AutoTArray<PropertyProvider::Spacing, 200> spacingBuffer;
bool haveSpacing = GetAdjustedSpacingArray(
ligatureRunStart, ligatureRunEnd, aProvider,
ligatureRunStart, ligatureRunEnd, &spacingBuffer);
params.spacing = haveSpacing ? spacingBuffer.Elements() : nullptr;
font->DrawEmphasisMarks(this, &aPt, ligatureRunStart,
ligatureRunEnd - ligatureRunStart, params);
inlineCoord += direction *
@@ -729,17 +729,17 @@ gfxTextRun::AccumulateMetricsForRun(gfxF
uint32_t aStart, uint32_t aEnd,
gfxFont::BoundingBoxType aBoundingBoxType,
DrawTarget* aRefDrawTarget,
PropertyProvider *aProvider,
uint32_t aSpacingStart, uint32_t aSpacingEnd,
uint16_t aOrientation,
Metrics *aMetrics)
{
- nsAutoTArray<PropertyProvider::Spacing,200> spacingBuffer;
+ AutoTArray<PropertyProvider::Spacing,200> spacingBuffer;
bool haveSpacing = GetAdjustedSpacingArray(aStart, aEnd, aProvider,
aSpacingStart, aSpacingEnd, &spacingBuffer);
Metrics metrics = aFont->Measure(this, aStart, aEnd, aBoundingBoxType,
aRefDrawTarget,
haveSpacing ? spacingBuffer.Elements() : nullptr,
aOrientation);
aMetrics->CombineWith(metrics, IsRightToLeft());
}
@@ -1022,17 +1022,17 @@ gfxTextRun::GetAdvanceWidth(uint32_t aSt
if (aSpacing) {
aSpacing->mBefore = aSpacing->mAfter = 0;
}
// Account for all remaining spacing here. This is more efficient than
// processing it along with the glyphs.
if (aProvider && (mFlags & gfxTextRunFactory::TEXT_ENABLE_SPACING)) {
uint32_t i;
- nsAutoTArray<PropertyProvider::Spacing,200> spacingBuffer;
+ AutoTArray<PropertyProvider::Spacing,200> spacingBuffer;
if (spacingBuffer.AppendElements(aLength)) {
GetAdjustedSpacing(this, ligatureRunStart, ligatureRunEnd, aProvider,
spacingBuffer.Elements());
for (i = 0; i < ligatureRunEnd - ligatureRunStart; ++i) {
PropertyProvider::Spacing *space = &spacingBuffer[i];
result += space->mBefore + space->mAfter;
}
if (aSpacing) {
@@ -1609,17 +1609,17 @@ gfxFontGroup::BuildFontList()
#elif defined(MOZ_WIDGET_QT)
enumerateFonts = false;
#endif
if (!enumerateFonts) {
return;
}
// initialize fonts in the font family list
- nsAutoTArray<gfxFontFamily*,4> fonts;
+ AutoTArray<gfxFontFamily*,4> fonts;
gfxPlatformFontList *pfl = gfxPlatformFontList::PlatformFontList();
// lookup fonts in the fontlist
for (const FontFamilyName& name : mFamilyList.GetFontlist()) {
if (name.IsNamed()) {
AddPlatformFont(name.mName, fonts);
} else {
pfl->AddGenericFonts(name.mType, mStyle.language, fonts);
@@ -1677,17 +1677,17 @@ gfxFontGroup::AddPlatformFont(const nsAS
}
}
}
void
gfxFontGroup::AddFamilyToFontList(gfxFontFamily* aFamily)
{
NS_ASSERTION(aFamily, "trying to add a null font family to fontlist");
- nsAutoTArray<gfxFontEntry*,4> fontEntryList;
+ AutoTArray<gfxFontEntry*,4> fontEntryList;
bool needsBold;
aFamily->FindAllFontsForStyle(mStyle, fontEntryList, needsBold);
// add these to the fontlist
for (gfxFontEntry* fe : fontEntryList) {
if (!HasFont(fe)) {
FamilyFace ff(aFamily, fe, needsBold);
if (fe->mIsUserFontContainer) {
ff.CheckState(mSkipDrawing);
@@ -1841,17 +1841,17 @@ gfxFontGroup::GetDefaultFont()
uint32_t numFonts = 0;
if (!mDefaultFont) {
// Try for a "font of last resort...."
// Because an empty font list would be Really Bad for later code
// that assumes it will be able to get valid metrics for layout,
// just look for the first usable font and put in the list.
// (see bug 554544)
- nsAutoTArray<RefPtr<gfxFontFamily>,200> familyList;
+ AutoTArray<RefPtr<gfxFontFamily>,200> familyList;
pfl->GetFontFamilyList(familyList);
numFonts = familyList.Length();
for (uint32_t i = 0; i < numFonts; ++i) {
gfxFontEntry *fe = familyList[i]->FindFontForStyle(mStyle,
needsBold);
if (fe) {
mDefaultFont = fe->FindOrMakeFont(&mStyle, needsBold);
if (mDefaultFont) {
@@ -2340,17 +2340,17 @@ gfxFontGroup::InitScriptRun(DrawTarget*
if (!mSkipUpdateUserFonts && mUserFontSet &&
mCurrGeneration != mUserFontSet->GetGeneration()) {
UpdateUserFonts();
}
gfxFont *mainFont = GetFirstValidFont();
uint32_t runStart = 0;
- nsAutoTArray<gfxTextRange,3> fontRanges;
+ AutoTArray<gfxTextRange,3> fontRanges;
ComputeRanges(fontRanges, aString, aLength, aRunScript,
aTextRun->GetFlags() & gfxTextRunFactory::TEXT_ORIENT_MASK);
uint32_t numRanges = fontRanges.Length();
bool missingChars = false;
for (uint32_t r = 0; r < numRanges; r++) {
const gfxTextRange& range = fontRanges[r];
uint32_t matchedLength = range.Length();
--- a/gfx/thebes/gfxTextRun.h
+++ b/gfx/thebes/gfxTextRun.h
@@ -712,17 +712,17 @@ private:
// **** drawing helper ****
void DrawGlyphs(gfxFont *aFont, uint32_t aStart, uint32_t aEnd,
gfxPoint *aPt, PropertyProvider *aProvider,
uint32_t aSpacingStart, uint32_t aSpacingEnd,
TextRunDrawParams& aParams, uint16_t aOrientation);
// XXX this should be changed to a GlyphRun plus a maybe-null GlyphRun*,
// for smaller size especially in the super-common one-glyphrun case
- nsAutoTArray<GlyphRun,1> mGlyphRuns;
+ AutoTArray<GlyphRun,1> mGlyphRuns;
void *mUserData;
gfxFontGroup *mFontGroup; // addrefed on creation, but our reference
// may be released by ReleaseFontGroup()
gfxSkipChars mSkipChars;
nsExpirationState mExpirationState;
bool mSkipDrawing; // true if the font group we used had a user font
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -1279,17 +1279,17 @@ gfxWindowsPlatform::UseClearTypeAlways()
void
gfxWindowsPlatform::GetDLLVersion(char16ptr_t aDLLPath, nsAString& aVersion)
{
DWORD versInfoSize, vers[4] = {0};
// version info not available case
aVersion.AssignLiteral(MOZ_UTF16("0.0.0.0"));
versInfoSize = GetFileVersionInfoSizeW(aDLLPath, nullptr);
- nsAutoTArray<BYTE,512> versionInfo;
+ AutoTArray<BYTE,512> versionInfo;
if (versInfoSize == 0 ||
!versionInfo.AppendElements(uint32_t(versInfoSize)))
{
return;
}
if (!GetFileVersionInfoW(aDLLPath, 0, versInfoSize,
--- a/hal/gonk/GonkSensor.cpp
+++ b/hal/gonk/GonkSensor.cpp
@@ -178,17 +178,17 @@ public:
NS_IMETHOD Run()
{
NotifySensorChange(mSensorData);
return NS_OK;
}
private:
SensorData mSensorData;
- nsAutoTArray<float, 4> mSensorValues;
+ AutoTArray<float, 4> mSensorValues;
};
namespace hal_impl {
static DebugOnly<int> sSensorRefCount[NUM_SENSOR_TYPE];
static base::Thread* sPollingThread;
static sensors_poll_device_t* sSensorDevice;
static sensors_module_t* sSensorModule;
--- a/image/RasterImage.cpp
+++ b/image/RasterImage.cpp
@@ -716,17 +716,17 @@ RasterImage::UpdateImageContainer()
DrawResult drawResult;
RefPtr<layers::Image> image;
Tie(drawResult, image) = GetCurrentImage(container, FLAG_NONE);
if (!image) {
return;
}
mLastImageContainerDrawResult = drawResult;
- nsAutoTArray<ImageContainer::NonOwningImage, 1> imageList;
+ AutoTArray<ImageContainer::NonOwningImage, 1> imageList;
imageList.AppendElement(ImageContainer::NonOwningImage(image));
container->SetCurrentImages(imageList);
}
size_t
RasterImage::SizeOfSourceWithComputedFallback(MallocSizeOf aMallocSizeOf) const
{
return mSourceBuffer->SizeOfIncludingThisWithComputedFallback(aMallocSizeOf);
--- a/image/decoders/icon/mac/nsIconChannelCocoa.mm
+++ b/image/decoders/icon/mac/nsIconChannelCocoa.mm
@@ -345,17 +345,17 @@ nsIconChannel::MakeInputStream(nsIInputS
actualImageSize * actualImageSize * 4,
NS_ERROR_UNEXPECTED);
// rgba, pre-multiplied data
uint8_t* bitmapRepData = (uint8_t*)[bitmapRep bitmapData];
// create our buffer
int32_t bufferCapacity = 2 + [bitmapRep bytesPerPlane];
- nsAutoTArray<uint8_t, 3 + 16 * 16 * 5> iconBuffer; // initial size is for
+ AutoTArray<uint8_t, 3 + 16 * 16 * 5> iconBuffer; // initial size is for
// 16x16
iconBuffer.SetLength(bufferCapacity);
uint8_t* iconBufferPtr = iconBuffer.Elements();
// write header data into buffer
*iconBufferPtr++ = actualImageSize;
*iconBufferPtr++ = actualImageSize;
--- a/image/imgLoader.cpp
+++ b/image/imgLoader.cpp
@@ -1351,17 +1351,17 @@ imgLoader::FindEntryProperties(nsIURI* u
return NS_OK;
}
NS_IMETHODIMP_(void)
imgLoader::ClearCacheForControlledDocument(nsIDocument* aDoc)
{
MOZ_ASSERT(aDoc);
- nsAutoTArray<RefPtr<imgCacheEntry>, 128> entriesToBeRemoved;
+ AutoTArray<RefPtr<imgCacheEntry>, 128> entriesToBeRemoved;
imgCacheTable& cache = GetCache(false);
for (auto iter = cache.Iter(); !iter.Done(); iter.Next()) {
auto& key = iter.Key();
if (key.ControlledDocument() == aDoc) {
entriesToBeRemoved.AppendElement(iter.Data());
}
}
for (auto& entry : entriesToBeRemoved) {
--- a/intl/hyphenation/glue/nsHyphenator.cpp
+++ b/intl/hyphenation/glue/nsHyphenator.cpp
@@ -116,17 +116,17 @@ nsHyphenator::Hyphenate(const nsAString&
} else {
utf8.Append(0xF0 | (ch >> 18));
utf8.Append(0x80 | (0x003F & (ch >> 12)));
utf8.Append(0x80 | (0x003F & (ch >> 6)));
utf8.Append(0x80 | (0x003F & ch));
}
}
- nsAutoTArray<char,200> utf8hyphens;
+ AutoTArray<char,200> utf8hyphens;
utf8hyphens.SetLength(utf8.Length() + 5);
char **rep = nullptr;
int *pos = nullptr;
int *cut = nullptr;
int err = hnj_hyphen_hyphenate2((HyphenDict*)mDict,
utf8.BeginReading(), utf8.Length(),
utf8hyphens.Elements(), nullptr,
&rep, &pos, &cut);
--- a/intl/locale/mac/nsDateTimeFormatMac.cpp
+++ b/intl/locale/mac/nsDateTimeFormatMac.cpp
@@ -212,17 +212,17 @@ nsresult nsDateTimeFormatMac::FormatTMTi
CFRelease(timeZone);
CFStringRef formattedDate = CFDateFormatterCreateStringWithAbsoluteTime(nullptr,
formatter,
absTime);
CFIndex stringLen = CFStringGetLength(formattedDate);
- nsAutoTArray<UniChar, 256> stringBuffer;
+ AutoTArray<UniChar, 256> stringBuffer;
stringBuffer.SetLength(stringLen + 1);
CFStringGetCharacters(formattedDate, CFRangeMake(0, stringLen), stringBuffer.Elements());
stringOut.Assign(reinterpret_cast<char16_t*>(stringBuffer.Elements()), stringLen);
CFRelease(formattedDate);
CFRelease(formatter);
return res;
--- a/intl/locale/nsLocaleService.cpp
+++ b/intl/locale/nsLocaleService.cpp
@@ -173,17 +173,17 @@ nsLocaleService::nsLocaleService(void)
#endif // XP_UNIX
#ifdef XP_MACOSX
// Get string representation of user's current locale
CFLocaleRef userLocaleRef = ::CFLocaleCopyCurrent();
CFStringRef userLocaleStr = ::CFLocaleGetIdentifier(userLocaleRef);
::CFRetain(userLocaleStr);
- nsAutoTArray<UniChar, 32> buffer;
+ AutoTArray<UniChar, 32> buffer;
int size = ::CFStringGetLength(userLocaleStr);
buffer.SetLength(size + 1);
CFRange range = ::CFRangeMake(0, size);
::CFStringGetCharacters(userLocaleStr, range, buffer.Elements());
buffer[size] = 0;
// Convert the locale string to the format that Mozilla expects
nsAutoString xpLocale(reinterpret_cast<char16_t*>(buffer.Elements()));
--- a/intl/lwbrk/nsJISx4051LineBreaker.cpp
+++ b/intl/lwbrk/nsJISx4051LineBreaker.cpp
@@ -769,17 +769,17 @@ nsJISx4051LineBreaker::WordMove(const ch
}
for (end = aPos + 1; end < int32_t(aLen) && !NS_IsSpace(aText[end]); ++end) {
if (IS_CJK_CHAR(aText[end]) || NS_NeedsPlatformNativeHandling(aText[end])) {
textNeedsJISx4051 = true;
}
}
int32_t ret;
- nsAutoTArray<uint8_t, 2000> breakState;
+ AutoTArray<uint8_t, 2000> breakState;
if (!textNeedsJISx4051 || !breakState.AppendElements(end - begin)) {
// No complex text character, do not try to do complex line break.
// (This is required for serializers. See Bug #344816.)
// Also fall back to this when out of memory.
if (aDirection < 0) {
ret = (begin == int32_t(aPos)) ? begin - 1 : begin;
} else {
ret = end;
--- a/intl/lwbrk/nsPangoBreaker.cpp
+++ b/intl/lwbrk/nsPangoBreaker.cpp
@@ -13,17 +13,17 @@
void
NS_GetComplexLineBreaks(const char16_t* aText, uint32_t aLength,
uint8_t* aBreakBefore)
{
NS_ASSERTION(aText, "aText shouldn't be null");
memset(aBreakBefore, false, aLength * sizeof(uint8_t));
- nsAutoTArray<PangoLogAttr, 2000> attrBuffer;
+ AutoTArray<PangoLogAttr, 2000> attrBuffer;
if (!attrBuffer.AppendElements(aLength + 1))
return;
NS_ConvertUTF16toUTF8 aUTF8(aText, aLength);
const gchar* p = aUTF8.Data();
const gchar* end = p + aUTF8.Length();
uint32_t u16Offset = 0;
--- a/intl/lwbrk/nsUniscribeBreaker.cpp
+++ b/intl/lwbrk/nsUniscribeBreaker.cpp
@@ -16,17 +16,17 @@
void
NS_GetComplexLineBreaks(const char16_t* aText, uint32_t aLength,
uint8_t* aBreakBefore)
{
NS_ASSERTION(aText, "aText shouldn't be null");
int outItems = 0;
HRESULT result;
- nsAutoTArray<SCRIPT_ITEM, 64> items;
+ AutoTArray<SCRIPT_ITEM, 64> items;
char16ptr_t text = aText;
memset(aBreakBefore, false, aLength);
if (!items.AppendElements(64))
return;
do {
@@ -37,17 +37,17 @@ NS_GetComplexLineBreaks(const char16_t*
if (!items.AppendElements(items.Length()))
return;
}
} while (result == E_OUTOFMEMORY);
for (int iItem = 0; iItem < outItems; ++iItem) {
uint32_t endOffset = (iItem + 1 == outItems ? aLength : items[iItem + 1].iCharPos);
uint32_t startOffset = items[iItem].iCharPos;
- nsAutoTArray<SCRIPT_LOGATTR, 64> sla;
+ AutoTArray<SCRIPT_LOGATTR, 64> sla;
if (!sla.AppendElements(endOffset - startOffset))
return;
if (ScriptBreak(text + startOffset, endOffset - startOffset,
&items[iItem].a, sla.Elements()) < 0)
return;
--- a/ipc/glue/IPCMessageUtils.h
+++ b/ipc/glue/IPCMessageUtils.h
@@ -537,19 +537,19 @@ struct ParamTraits<InfallibleTArray<E> >
static void Log(const paramType& aParam, std::wstring* aLog)
{
LogParam(static_cast<const FallibleTArray<E>&>(aParam), aLog);
}
};
template<typename E, size_t N>
-struct ParamTraits<nsAutoTArray<E, N>> : ParamTraits<nsTArray<E>>
+struct ParamTraits<AutoTArray<E, N>> : ParamTraits<nsTArray<E>>
{
- typedef nsAutoTArray<E, N> paramType;
+ typedef AutoTArray<E, N> paramType;
};
template<>
struct ParamTraits<float>
{
typedef float paramType;
static void Write(Message* aMsg, const paramType& aParam)
--- a/ipc/glue/WindowsMessageLoop.cpp
+++ b/ipc/glue/WindowsMessageLoop.cpp
@@ -825,17 +825,17 @@ MessageChannel::SyncStackFrame::SyncStac
return;
}
mChannel->mTopFrame = this;
sStaticTopFrame = this;
if (!mStaticPrev) {
NS_ASSERTION(!gNeuteredWindows, "Should only set this once!");
- gNeuteredWindows = new nsAutoTArray<HWND, 20>();
+ gNeuteredWindows = new AutoTArray<HWND, 20>();
NS_ASSERTION(gNeuteredWindows, "Out of memory!");
}
}
MessageChannel::SyncStackFrame::~SyncStackFrame()
{
if (!(mChannel->GetChannelFlags() & REQUIRE_DEFERRED_MESSAGE_PROTECTION)) {
return;
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -1283,17 +1283,17 @@ class MOZ_STACK_CLASS CallMethodHelper
// can still access the previous result.
nsresult mInvokeResult;
nsIInterfaceInfo* const mIFaceInfo;
const nsXPTMethodInfo* mMethodInfo;
nsISupports* const mCallee;
const uint16_t mVTableIndex;
HandleId mIdxValueId;
- nsAutoTArray<nsXPTCVariant, 8> mDispatchParams;
+ AutoTArray<nsXPTCVariant, 8> mDispatchParams;
uint8_t mJSContextIndex; // TODO make const
uint8_t mOptArgcIndex; // TODO make const
Value* const mArgv;
const uint32_t mArgc;
MOZ_ALWAYS_INLINE bool
GetArraySizeFromParam(uint8_t paramIndex, HandleValue maybeArray, uint32_t* result);
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -208,23 +208,23 @@ FrameLayerBuilder::DisplayItemData::Begi
}
if (!aItem) {
return;
}
// We avoid adding or removing element unnecessarily
// since we have to modify userdata each time
- nsAutoTArray<nsIFrame*, 4> copy(mFrameList);
+ AutoTArray<nsIFrame*, 4> copy(mFrameList);
if (!copy.RemoveElement(aItem->Frame())) {
AddFrame(aItem->Frame());
mFrameListChanges.AppendElement(aItem->Frame());
}
- nsAutoTArray<nsIFrame*,4> mergedFrames;
+ AutoTArray<nsIFrame*,4> mergedFrames;
aItem->GetMergedFrames(&mergedFrames);
for (uint32_t i = 0; i < mergedFrames.Length(); ++i) {
if (!copy.RemoveElement(mergedFrames[i])) {
AddFrame(mergedFrames[i]);
mFrameListChanges.AppendElement(mergedFrames[i]);
}
}
@@ -1377,17 +1377,17 @@ protected:
* We collect the list of children in here. During ProcessDisplayItems,
* the layers in this array either have mContainerLayer as their parent,
* or no parent.
* PaintedLayers have two entries in this array: the second one is used only if
* the PaintedLayer is optimized away to a ColorLayer or ImageLayer.
* It's essential that this array is only appended to, since PaintedLayerData
* records the index of its PaintedLayer in this array.
*/
- typedef nsAutoTArray<NewLayerEntry,1> AutoLayersArray;
+ typedef AutoTArray<NewLayerEntry,1> AutoLayersArray;
AutoLayersArray mNewChildLayers;
nsTHashtable<nsRefPtrHashKey<PaintedLayer>> mPaintedLayersAvailableForRecycling;
nscoord mAppUnitsPerDevPixel;
bool mSnappingEnabled;
bool mFlattenToSingleLayer;
struct MaskLayerKey {
MaskLayerKey() : mLayer(nullptr) {}
@@ -4662,17 +4662,17 @@ ContainerState::SetupScrollingMetadata(N
}
if (!mBuilder->IsPaintingToWindow()) {
// async scrolling not possible, and async scrolling info not computed
// for this paint.
return;
}
- nsAutoTArray<FrameMetrics,2> metricsArray;
+ AutoTArray<FrameMetrics,2> metricsArray;
if (aEntry->mBaseFrameMetrics) {
metricsArray.AppendElement(*aEntry->mBaseFrameMetrics);
// The base FrameMetrics was not computed by the nsIScrollableframe, so it
// should not have a mask layer.
MOZ_ASSERT(!aEntry->mBaseFrameMetrics->GetMaskLayerIndex());
}
@@ -4763,17 +4763,17 @@ GetStationaryClipInContainer(Layer* aLay
return aLayer->GetFrameMetrics(metricsCount - 1).GetClipRect();
}
return aLayer->GetClipRect();
}
void
ContainerState::PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer)
{
- nsAutoTArray<OpaqueRegionEntry,4> opaqueRegions;
+ AutoTArray<OpaqueRegionEntry,4> opaqueRegions;
bool hideAll = false;
int32_t opaqueRegionForContainer = -1;
for (int32_t i = mNewChildLayers.Length() - 1; i >= 0; --i) {
NewLayerEntry* e = &mNewChildLayers.ElementAt(i);
if (!e->mLayer) {
continue;
}
--- a/layout/base/FrameLayerBuilder.h
+++ b/layout/base/FrameLayerBuilder.h
@@ -484,29 +484,29 @@ public:
*/
void EndUpdate(nsAutoPtr<nsDisplayItemGeometry> aGeometry);
void EndUpdate();
LayerManagerData* mParent;
RefPtr<Layer> mLayer;
RefPtr<Layer> mOptLayer;
RefPtr<BasicLayerManager> mInactiveManager;
- nsAutoTArray<nsIFrame*, 1> mFrameList;
+ AutoTArray<nsIFrame*, 1> mFrameList;
nsAutoPtr<nsDisplayItemGeometry> mGeometry;
DisplayItemClip mClip;
uint32_t mDisplayItemKey;
uint32_t mContainerLayerGeneration;
LayerState mLayerState;
/**
* Temporary stoarage of the display item being referenced, only valid between
* BeginUpdate and EndUpdate.
*/
nsDisplayItem* mItem;
- nsAutoTArray<nsIFrame*, 1> mFrameListChanges;
+ AutoTArray<nsIFrame*, 1> mFrameListChanges;
/**
* Used to track if data currently stored in mFramesWithLayers (from an existing
* paint) has been updated in the current paint.
*/
bool mUsed;
bool mIsInvalid;
};
--- a/layout/base/PositionedEventTargeting.cpp
+++ b/layout/base/PositionedEventTargeting.cpp
@@ -590,17 +590,17 @@ FindFrameTargetedByInputEvent(WidgetGUIE
// would be targeted instead.
nsIFrame* restrictToDescendants = target ?
target->PresContext()->PresShell()->GetRootFrame() : aRootFrame;
nsRect targetRect = GetTargetRect(aRootFrame, aPointRelativeToRootFrame,
restrictToDescendants, prefs, aFlags);
PET_LOG("Expanded point to target rect %s\n",
mozilla::layers::Stringify(targetRect).c_str());
- nsAutoTArray<nsIFrame*,8> candidates;
+ AutoTArray<nsIFrame*,8> candidates;
nsresult rv = nsLayoutUtils::GetFramesForArea(aRootFrame, targetRect, candidates, flags);
if (NS_FAILED(rv)) {
return target;
}
int32_t elementsInCluster = 0;
nsIFrame* closestClickable =
--- a/layout/base/RestyleManager.h
+++ b/layout/base/RestyleManager.h
@@ -912,14 +912,14 @@ class MOZ_STACK_CLASS AutoDisplayContent
AutoDisplayContentsAncestorPusher(TreeMatchContext& aTreeMatchContext,
nsPresContext* aPresContext,
nsIContent* aParent);
~AutoDisplayContentsAncestorPusher();
bool IsEmpty() const { return mAncestors.Length() == 0; }
private:
TreeMatchContext& mTreeMatchContext;
nsPresContext* const mPresContext;
- nsAutoTArray<mozilla::dom::Element*, 4> mAncestors;
+ AutoTArray<mozilla::dom::Element*, 4> mAncestors;
};
} // namespace mozilla
#endif /* mozilla_RestyleManager_h */
--- a/layout/base/RestyleTracker.cpp
+++ b/layout/base/RestyleTracker.cpp
@@ -160,17 +160,17 @@ RestyleTracker::DoProcessRestyles()
static_cast<int>(mRestyleRoots.Length()),
GetDocumentURI(Document()).get());
LOG_RESTYLE_INDENT();
// loop so that we process any restyle events generated by processing
while (mPendingRestyles.Count()) {
if (mHaveLaterSiblingRestyles) {
// Convert them to individual restyles on all the later siblings
- nsAutoTArray<RefPtr<Element>, RESTYLE_ARRAY_STACKSIZE> laterSiblingArr;
+ AutoTArray<RefPtr<Element>, RESTYLE_ARRAY_STACKSIZE> laterSiblingArr;
for (auto iter = mPendingRestyles.Iter(); !iter.Done(); iter.Next()) {
auto element = static_cast<dom::Element*>(iter.Key());
// Only collect the entries that actually need restyling by us (and
// haven't, for example, already been restyled).
// It's important to not mess with the flags on entries not in our
// document.
if (element->GetCrossShadowCurrentDoc() == Document() &&
element->HasFlag(RestyleBit()) &&
@@ -275,17 +275,17 @@ RestyleTracker::DoProcessRestyles()
continue;
}
// Now we only have entries with change hints left. To be safe in
// case of reentry from the handing of the change hint, use a
// scratch array instead of calling out to ProcessOneRestyle while
// enumerating the hashtable. Use the stack if we can, otherwise
// fall back on heap-allocation.
- nsAutoTArray<RestyleEnumerateData, RESTYLE_ARRAY_STACKSIZE> restyleArr;
+ AutoTArray<RestyleEnumerateData, RESTYLE_ARRAY_STACKSIZE> restyleArr;
RestyleEnumerateData* restylesToProcess =
restyleArr.AppendElements(mPendingRestyles.Count());
if (restylesToProcess) {
RestyleEnumerateData* restyle = restylesToProcess;
#ifdef RESTYLE_LOGGING
uint32_t count = 0;
#endif
for (auto iter = mPendingRestyles.Iter(); !iter.Done(); iter.Next()) {
--- a/layout/base/RestyleTracker.h
+++ b/layout/base/RestyleTracker.h
@@ -385,17 +385,17 @@ private:
* before calling this function.
*/
inline void ProcessOneRestyle(Element* aElement,
nsRestyleHint aRestyleHint,
nsChangeHint aChangeHint,
const RestyleHintData& aRestyleHintData);
typedef nsClassHashtable<nsISupportsHashKey, RestyleData> PendingRestyleTable;
- typedef nsAutoTArray< RefPtr<Element>, 32> RestyleRootArray;
+ typedef AutoTArray< RefPtr<Element>, 32> RestyleRootArray;
// Our restyle bits. These will be a subset of ELEMENT_ALL_RESTYLE_FLAGS, and
// will include one flag from ELEMENT_PENDING_RESTYLE_FLAGS, one flag
// from ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS, and might also include
// ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR.
Element::FlagsType mRestyleBits;
RestyleManager* mRestyleManager; // Owns us
// A hashtable that maps elements to pointers to RestyleData structs. The
// values only make sense if the element's current document is our
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -100,17 +100,17 @@ static char16_t GetBidiControl(nsStyleCo
return kLRE;
}
}
return 0;
}
struct BidiParagraphData {
nsString mBuffer;
- nsAutoTArray<char16_t, 16> mEmbeddingStack;
+ AutoTArray<char16_t, 16> mEmbeddingStack;
nsTArray<nsIFrame*> mLogicalFrames;
nsTArray<nsLineBox*> mLinePerFrame;
nsDataHashtable<nsISupportsHashKey, int32_t> mContentToFrameIndex;
bool mIsVisual;
bool mReset;
nsBidiLevel mParaLevel;
nsIContent* mPrevContent;
nsAutoPtr<nsBidi> mBidiEngine;
@@ -389,17 +389,17 @@ struct BidiParagraphData {
}
};
struct BidiLineData {
nsTArray<nsIFrame*> mLogicalFrames;
nsTArray<nsIFrame*> mVisualFrames;
nsTArray<int32_t> mIndexMap;
- nsAutoTArray<uint8_t, 18> mLevels;
+ AutoTArray<uint8_t, 18> mLevels;
bool mIsReordered;
BidiLineData(nsIFrame* aFirstFrameOnLine, int32_t aNumFramesOnLine)
{
/**
* Initialize the logically-ordered array of frames using the top-level
* frames of a single line
*/
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -1305,17 +1305,17 @@ nsFrameConstructorState::ProcessFrameIns
nsIFrame* lastChild = childList.LastChild();
// CompareTreePosition uses placeholder hierarchy for out of flow frames,
// so this will make out-of-flows respect the ordering of placeholders,
// which is great because it takes care of anonymous content.
nsIFrame* firstNewFrame = aFrameItems.FirstChild();
// Cache the ancestor chain so that we can reuse it if needed.
- nsAutoTArray<nsIFrame*, 20> firstNewFrameAncestors;
+ AutoTArray<nsIFrame*, 20> firstNewFrameAncestors;
nsIFrame* notCommonAncestor = nullptr;
if (lastChild) {
notCommonAncestor = nsLayoutUtils::FillAncestors(firstNewFrame,
containingBlock,
&firstNewFrameAncestors);
}
if (!lastChild ||
@@ -1323,17 +1323,17 @@ nsFrameConstructorState::ProcessFrameIns
firstNewFrameAncestors,
notCommonAncestor ?
containingBlock : nullptr) < 0) {
// no lastChild, or lastChild comes before the new children, so just append
mFrameManager->AppendFrames(containingBlock, aChildListID, aFrameItems);
} else {
// Try the other children. First collect them to an array so that a
// reasonable fast binary search can be used to find the insertion point.
- nsAutoTArray<nsIFrame*, 128> children;
+ AutoTArray<nsIFrame*, 128> children;
for (nsIFrame* f = childList.FirstChild(); f != lastChild;
f = f->GetNextSibling()) {
children.AppendElement(f);
}
nsIFrame* insertionPoint = nullptr;
int32_t imin = 0;
int32_t max = children.Length();
@@ -2835,17 +2835,17 @@ nsCSSFrameConstructor::SetUpDocElementCo
void
nsCSSFrameConstructor::ConstructAnonymousContentForCanvas(nsFrameConstructorState& aState,
nsIFrame* aFrame,
nsIContent* aDocElement)
{
NS_ASSERTION(aFrame->GetType() == nsGkAtoms::canvasFrame, "aFrame should be canvas frame!");
- nsAutoTArray<nsIAnonymousContentCreator::ContentInfo, 4> anonymousItems;
+ AutoTArray<nsIAnonymousContentCreator::ContentInfo, 4> anonymousItems;
GetAnonymousContent(aDocElement, aFrame, anonymousItems);
if (anonymousItems.IsEmpty()) {
return;
}
FrameConstructionItemList itemsToConstruct;
nsContainerFrame* frameAsContainer = do_QueryFrame(aFrame);
AddFCItemsForAnonymousContent(aState, frameAsContainer, anonymousItems, itemsToConstruct);
@@ -3963,17 +3963,17 @@ nsCSSFrameConstructor::ConstructFrameFro
// anonymous content a node needs.
nsresult
nsCSSFrameConstructor::CreateAnonymousFrames(nsFrameConstructorState& aState,
nsIContent* aParent,
nsContainerFrame* aParentFrame,
PendingBinding* aPendingBinding,
nsFrameItems& aChildItems)
{
- nsAutoTArray<nsIAnonymousContentCreator::ContentInfo, 4> newAnonymousItems;
+ AutoTArray<nsIAnonymousContentCreator::ContentInfo, 4> newAnonymousItems;
nsresult rv = GetAnonymousContent(aParent, aParentFrame, newAnonymousItems);
NS_ENSURE_SUCCESS(rv, rv);
uint32_t count = newAnonymousItems.Length();
if (count == 0) {
return NS_OK;
}
@@ -10376,17 +10376,17 @@ nsCSSFrameConstructor::ProcessChildren(n
if (aAllowBlockStyles && !haveFirstLetterStyle && !haveFirstLineStyle) {
itemsToConstruct.SetLineBoundaryAtStart(true);
itemsToConstruct.SetLineBoundaryAtEnd(true);
}
// Create any anonymous frames we need here. This must happen before the
// non-anonymous children are processed to ensure that popups are never
// constructed before the popupset.
- nsAutoTArray<nsIAnonymousContentCreator::ContentInfo, 4> anonymousItems;
+ AutoTArray<nsIAnonymousContentCreator::ContentInfo, 4> anonymousItems;
GetAnonymousContent(aContent, aPossiblyLeafFrame, anonymousItems);
#ifdef DEBUG
for (uint32_t i = 0; i < anonymousItems.Length(); ++i) {
MOZ_ASSERT(anonymousItems[i].mContent->IsRootOfAnonymousSubtree(),
"Content should know it's an anonymous subtree");
}
#endif
AddFCItemsForAnonymousContent(aState, aFrame, anonymousItems,
--- a/layout/base/nsCounterManager.cpp
+++ b/layout/base/nsCounterManager.cpp
@@ -89,17 +89,17 @@ void nsCounterChangeNode::Calc(nsCounter
}
// The text that should be displayed for this counter.
void
nsCounterUseNode::GetText(nsString& aResult)
{
aResult.Truncate();
- nsAutoTArray<nsCounterNode*, 8> stack;
+ AutoTArray<nsCounterNode*, 8> stack;
stack.AppendElement(static_cast<nsCounterNode*>(this));
if (mAllCounters && mScopeStart)
for (nsCounterNode *n = mScopeStart; n->mScopePrev; n = n->mScopeStart)
stack.AppendElement(n->mScopePrev);
const char16_t* separator;
if (mAllCounters)
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -961,17 +961,17 @@ nsDisplayListBuilder::MarkFramesForDispl
* @param aDirtyFrame is the frame to mark children extending context.
* @param aDirtyRect is the same as the dirty rect of the root of the
* current 3D context, but be translated relative to
* the aDirtyFrame.
*/
void
nsDisplayListBuilder::MarkPreserve3DFramesForDisplayList(nsIFrame* aDirtyFrame, const nsRect& aDirtyRect)
{
- nsAutoTArray<nsIFrame::ChildList,4> childListArray;
+ AutoTArray<nsIFrame::ChildList,4> childListArray;
aDirtyFrame->GetChildLists(&childListArray);
nsIFrame::ChildListArrayIterator lists(childListArray);
for (; !lists.IsDone(); lists.Next()) {
nsFrameList::Enumerator childFrames(lists.CurrentList());
for (; !childFrames.AtEnd(); childFrames.Next()) {
nsIFrame *child = childFrames.get();
if (child->Combines3DTransformWithAncestors()) {
mFramesMarkedForDisplay.AppendElement(child);
@@ -1466,17 +1466,17 @@ nsDisplayList::ComputeVisibilityForSubli
nsRegion r;
r.And(*aVisibleRegion, GetBounds(aBuilder));
NS_ASSERTION(r.GetBounds().IsEqualInterior(aListVisibleBounds),
"bad aListVisibleBounds");
#endif
bool anyVisible = false;
- nsAutoTArray<nsDisplayItem*, 512> elements;
+ AutoTArray<nsDisplayItem*, 512> elements;
MoveListTo(this, &elements);
for (int32_t i = elements.Length() - 1; i >= 0; --i) {
nsDisplayItem* item = elements[i];
nsRect bounds = item->GetClippedBounds(aBuilder);