Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj

This commit is contained in:
Birunthan Mohanathas 2016-01-31 17:12:12 +02:00
parent 808d59d0fe
commit f94b4ff6a2
330 changed files with 734 additions and 734 deletions

View File

@ -759,7 +759,7 @@ getAttributesCB(AtkObject *aAtkObj)
if (!proxy)
return nullptr;
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->Attributes(&attrs);
if (attrs.IsEmpty())
return nullptr;
@ -1019,7 +1019,7 @@ refRelationSetCB(AtkObject *aAtkObj)
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]));
@ -1664,7 +1664,7 @@ AccessibleWrap::GetColumnHeader(TableAccessible* aAccessible, int32_t aColIdx)
return nullptr;
}
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
tableCell->ColHeaderCells(&headerCells);
if (headerCells.IsEmpty()) {
return nullptr;
@ -1698,7 +1698,7 @@ AccessibleWrap::GetRowHeader(TableAccessible* aAccessible, int32_t aRowIdx)
return nullptr;
}
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
tableCell->RowHeaderCells(&headerCells);
if (headerCells.IsEmpty()) {
return nullptr;

View File

@ -273,7 +273,7 @@ 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);
@ -300,7 +300,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
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);

View File

@ -311,7 +311,7 @@ getRunAttributesCB(AtkText *aText, gint aOffset,
return nullptr;
}
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->TextAttributes(false, aOffset, &attrs, &startOffset, &endOffset);
*aStartOffset = startOffset;
*aEndOffset = endOffset;
@ -337,7 +337,7 @@ getDefaultAttributesCB(AtkText *aText)
return nullptr;
}
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->DefaultTextAttributes(&attrs);
return ConvertToAtkTextAttributeSet(attrs);
}

View File

@ -76,7 +76,7 @@ protected:
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;

View File

@ -275,7 +275,7 @@ private:
/**
* 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;
@ -309,7 +309,7 @@ private:
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;

View File

@ -17,7 +17,7 @@ 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);
}

View File

@ -24,7 +24,7 @@ TextPoint::operator <(const TextPoint& aPoint) const
// 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();
@ -76,7 +76,7 @@ TextRange::EmbeddedChildren(nsTArray<Accessible*>* aChildren) const
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);
@ -146,7 +146,7 @@ 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;

View File

@ -87,7 +87,7 @@ private:
DocAccessible* mDoc;
Accessible* mContext;
nsIContent* mAnchorNode;
nsAutoTArray<ChildrenIterator, 20> mStateStack;
AutoTArray<ChildrenIterator, 20> mStateStack;
int32_t mChildFilter;
uint32_t mFlags;
};

View File

@ -1048,7 +1048,7 @@ DocAccessibleChild::RecvColHeaderCells(const uint64_t& aID,
{
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) {
@ -1066,7 +1066,7 @@ DocAccessibleChild::RecvRowHeaderCells(const uint64_t& aID,
{
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) {
@ -1368,7 +1368,7 @@ DocAccessibleChild::RecvTableSelectedCells(const uint64_t& aID,
{
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) {
@ -1529,7 +1529,7 @@ DocAccessibleChild::RecvSelectedItems(const uint64_t& aID,
{
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) {

View File

@ -778,7 +778,7 @@ ProxyAccessible::TableSelectedRowCount()
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) {
@ -857,7 +857,7 @@ ProxyAccessible::AtkTableRowHeader(int32_t aRow)
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) {

View File

@ -420,7 +420,7 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
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") {
@ -684,11 +684,11 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
// 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);
}

View File

@ -207,12 +207,12 @@
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);
}

View File

@ -768,7 +768,7 @@ ia2Accessible::get_selectionRanges(IA2Range** aRanges,
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++) {

View File

@ -371,7 +371,7 @@ ia2AccessibleTable::get_selectedChildren(long aMaxChildren, long** aChildren,
if (!mTable)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<uint32_t, 30> cellIndices;
AutoTArray<uint32_t, 30> cellIndices;
mTable->SelectedCellIndices(&cellIndices);
uint32_t maxCells = cellIndices.Length();
@ -663,7 +663,7 @@ ia2AccessibleTable::get_selectedCells(IUnknown*** aCells, long* aNSelectedCells)
if (!mTable)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<Accessible*, 30> cells;
AutoTArray<Accessible*, 30> cells;
mTable->SelectedCells(&cells);
if (cells.IsEmpty())
return S_FALSE;
@ -699,7 +699,7 @@ ia2AccessibleTable::get_selectedColumns(long** aColumns, long* aNColumns)
if (!mTable)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<uint32_t, 30> colIndices;
AutoTArray<uint32_t, 30> colIndices;
mTable->SelectedColIndices(&colIndices);
uint32_t maxCols = colIndices.Length();
@ -729,7 +729,7 @@ ia2AccessibleTable::get_selectedRows(long** aRows, long* aNRows)
if (!mTable)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<uint32_t, 30> rowIndices;
AutoTArray<uint32_t, 30> rowIndices;
mTable->SelectedRowIndices(&rowIndices);
uint32_t maxRows = rowIndices.Length();

View File

@ -100,7 +100,7 @@ ia2AccessibleTableCell::get_columnHeaderCells(IUnknown*** aCellAccessibles,
if (!mTableCell)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<Accessible*, 10> cells;
AutoTArray<Accessible*, 10> cells;
mTableCell->ColHeaderCells(&cells);
*aNColumnHeaderCells = cells.Length();
@ -172,7 +172,7 @@ ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles,
if (!mTableCell)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<Accessible*, 10> cells;
AutoTArray<Accessible*, 10> cells;
mTableCell->RowHeaderCells(&cells);
*aNRowHeaderCells = cells.Length();

View File

@ -61,7 +61,7 @@ ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset,
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 {

View File

@ -834,7 +834,7 @@ AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren)
return E_NOTIMPL;
if (IsSelect()) {
nsAutoTArray<Accessible*, 10> selectedItems;
AutoTArray<Accessible*, 10> selectedItems;
if (IsProxy()) {
nsTArray<ProxyAccessible*> proxies;
Proxy()->SelectedItems(&proxies);

View File

@ -371,7 +371,7 @@ xpcAccessibleHyperText::GetSelectionRanges(nsIArray** aRanges)
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++)

View File

@ -21,7 +21,7 @@ xpcAccessibleSelectable::GetSelectedItems(nsIArray** aSelectedItems)
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();

View File

@ -273,7 +273,7 @@ xpcAccessibleTable::GetSelectedCells(nsIArray** aSelectedCells)
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();
@ -299,7 +299,7 @@ xpcAccessibleTable::GetSelectedCellIndices(uint32_t* aCellsArraySize,
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();
@ -324,7 +324,7 @@ xpcAccessibleTable::GetSelectedColumnIndices(uint32_t* aColsArraySize,
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();
@ -349,7 +349,7 @@ xpcAccessibleTable::GetSelectedRowIndices(uint32_t* aRowsArraySize,
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();

View File

@ -108,7 +108,7 @@ xpcAccessibleTableCell::GetColumnHeaderCells(nsIArray** aHeaderCells)
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);
@ -132,7 +132,7 @@ xpcAccessibleTableCell::GetRowHeaderCells(nsIArray** aHeaderCells)
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);

View File

@ -1688,7 +1688,7 @@ nsDocShell::FirePageHideNotification(bool aIsUnload)
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++) {
@ -4396,7 +4396,7 @@ nsDocShell::RemoveFromSessionHistory()
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;
@ -4487,7 +4487,7 @@ nsDocShell::ClearFrameHistory(nsISHEntry* aEntry)
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));

View File

@ -1405,7 +1405,7 @@ nsSHistory::RemoveDynEntries(int32_t aOldIndex, int32_t aNewIndex)
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);

View File

@ -578,7 +578,7 @@ EffectCompositor::GetOverriddenProperties(nsStyleContext* aStyleContext,
nsCSSPropertySet&
aPropertiesOverridden)
{
nsAutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
AutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
{
nsCSSPropertySet propertiesToTrackAsSet;
for (KeyframeEffectReadOnly* effect : aEffectSet) {

View File

@ -1405,7 +1405,7 @@ BuildAnimationPropertyListFromKeyframeSequence(
{
// 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;

View File

@ -267,7 +267,7 @@ template <typename T> void GetDataFromMatrix(const DOMMatrixReadOnly* aMatrix, T
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);
@ -281,7 +281,7 @@ DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle<JSObject*> a
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);

View File

@ -259,7 +259,7 @@ Blob::ToFile()
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;

View File

@ -308,7 +308,7 @@ nsIContent::GetBaseURI(bool aTryUseXHRDocBaseURI) const
// 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 {
@ -1328,7 +1328,7 @@ public:
}
private:
nsAutoTArray<nsCOMPtr<nsIContent>,
AutoTArray<nsCOMPtr<nsIContent>,
SUBTREE_UNBINDINGS_PER_RUNNABLE> mSubtreeRoots;
RefPtr<ContentUnbinder> mNext;
ContentUnbinder* mLast;
@ -1528,11 +1528,11 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode)
// 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) {
@ -1598,8 +1598,8 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode)
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()
{
@ -1702,7 +1702,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
// nodesToClear contains nodes which are either purple or
// gray.
nsAutoTArray<nsIContent*, 1020> nodesToClear;
AutoTArray<nsIContent*, 1020> nodesToClear;
bool foundBlack = root->IsBlack();
bool domOnlyCycle = false;
@ -1751,7 +1751,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
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) {
@ -1763,7 +1763,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
return true;
} else {
if (!gPurpleRoots) {
gPurpleRoots = new nsAutoTArray<nsINode*, 1020>();
gPurpleRoots = new AutoTArray<nsINode*, 1020>();
}
gPurpleRoots->AppendElement(root);
}

View File

@ -866,7 +866,7 @@ Navigator::RemoveIdleObserver(MozIdleObserver& aIdleObserver, ErrorResult& aRv)
bool
Navigator::Vibrate(uint32_t aDuration)
{
nsAutoTArray<uint32_t, 1> pattern;
AutoTArray<uint32_t, 1> pattern;
pattern.AppendElement(aDuration);
return Vibrate(pattern);
}

View File

@ -155,7 +155,7 @@ protected:
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
@ -1058,8 +1058,8 @@ nsContentIterator::PositionAt(nsINode* aCurNode)
// 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
@ -1213,8 +1213,8 @@ protected:
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)

View File

@ -548,7 +548,7 @@ nsContentList::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
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()) {

View File

@ -2286,7 +2286,7 @@ nsContentUtils::GetCommonAncestor(nsINode* aNode1,
}
// Build the chain of parents
nsAutoTArray<nsINode*, 30> parents1, parents2;
AutoTArray<nsINode*, 30> parents1, parents2;
do {
parents1.AppendElement(aNode1);
aNode1 = aNode1->GetParentNode();
@ -2335,7 +2335,7 @@ nsContentUtils::ComparePoints(nsINode* aParent1, int32_t aOffset1,
0;
}
nsAutoTArray<nsINode*, 32> parents1, parents2;
AutoTArray<nsINode*, 32> parents1, parents2;
nsINode* node1 = aParent1;
nsINode* node2 = aParent2;
do {
@ -4287,7 +4287,7 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
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
@ -6853,7 +6853,7 @@ nsContentUtils::FireMutationEventsForDirectParsing(nsIDocument* aDoc,
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);
@ -7920,7 +7920,7 @@ nsContentUtils::FirePageHideEvent(nsIDocShellTreeItem* aItem,
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]));
@ -7945,7 +7945,7 @@ nsContentUtils::FirePageShowEvent(nsIDocShellTreeItem* aItem,
{
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]));
@ -8534,7 +8534,7 @@ private:
}
}
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.

View File

@ -22,7 +22,7 @@
using mozilla::dom::TreeOrderComparator;
using mozilla::dom::Animation;
nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
AutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
nsDOMMutationObserver::sScheduledMutationObservers = nullptr;
nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr;
@ -30,7 +30,7 @@ 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*
@ -585,7 +585,7 @@ void
nsDOMMutationObserver::RescheduleForRun()
{
if (!sScheduledMutationObservers) {
sScheduledMutationObservers = new nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
sScheduledMutationObservers = new AutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
}
bool didInsert = false;
@ -882,7 +882,7 @@ nsDOMMutationObserver::HandleMutationsInternal()
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) {
@ -995,7 +995,7 @@ nsDOMMutationObserver::AddCurrentlyHandlingObserver(nsDOMMutationObserver* aObse
if (!sCurrentlyHandlingObservers) {
sCurrentlyHandlingObservers =
new nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
new AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
}
while (sCurrentlyHandlingObservers->Length() < aMutationLevel) {

View File

@ -605,7 +605,7 @@ protected:
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;
@ -621,11 +621,11 @@ protected:
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;
};
@ -740,7 +740,7 @@ private:
static nsAutoMutationBatch* sCurrentBatch;
nsAutoMutationBatch* mPreviousBatch;
nsAutoTArray<BatchObserver, 2> mObservers;
AutoTArray<BatchObserver, 2> mObservers;
nsTArray<nsCOMPtr<nsIContent> > mRemovedNodes;
nsTArray<nsCOMPtr<nsIContent> > mAddedNodes;
nsINode* mBatchTarget;
@ -907,7 +907,7 @@ private:
};
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

View File

@ -134,7 +134,7 @@ nsDOMTokenList::AddInternal(const nsAttrValue* aAttr,
}
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];
@ -175,7 +175,7 @@ nsDOMTokenList::Add(const nsTArray<nsString>& aTokens, ErrorResult& aError)
void
nsDOMTokenList::Add(const nsAString& aToken, mozilla::ErrorResult& aError)
{
nsAutoTArray<nsString, 1> tokens;
AutoTArray<nsString, 1> tokens;
tokens.AppendElement(aToken);
Add(tokens, aError);
}
@ -261,7 +261,7 @@ nsDOMTokenList::Remove(const nsTArray<nsString>& aTokens, ErrorResult& aError)
void
nsDOMTokenList::Remove(const nsAString& aToken, mozilla::ErrorResult& aError)
{
nsAutoTArray<nsString, 1> tokens;
AutoTArray<nsString, 1> tokens;
tokens.AppendElement(aToken);
Remove(tokens, aError);
}
@ -281,7 +281,7 @@ nsDOMTokenList::Toggle(const nsAString& aToken,
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) {

View File

@ -3366,7 +3366,7 @@ nsDocument::NodesFromRectHelper(float aX, float aY,
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));
@ -11188,7 +11188,7 @@ nsDocument::RestorePreviousFullScreenState()
}
nsCOMPtr<nsIDocument> fullScreenDoc = GetFullscreenLeaf(this);
nsAutoTArray<nsDocument*, 8> exitDocs;
AutoTArray<nsDocument*, 8> exitDocs;
nsIDocument* doc = fullScreenDoc;
// Collect all subdocuments.
@ -11805,7 +11805,7 @@ nsDocument::ApplyFullscreen(const FullscreenRequest& aRequest)
// 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.

View File

@ -162,11 +162,11 @@ protected:
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>)

View File

@ -1370,7 +1370,7 @@ nsFocusManager::GetCommonAncestor(nsPIDOMWindowOuter* aWindow1,
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;

View File

@ -399,7 +399,7 @@ protected:
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;

View File

@ -1820,7 +1820,7 @@ public:
return mObservers;
}
protected:
nsAutoTArray< nsCOMPtr<nsIObserver>, 8 > mObservers;
AutoTArray< nsCOMPtr<nsIObserver>, 8 > mObservers;
};
/**

View File

@ -595,7 +595,7 @@ 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();
@ -864,7 +864,7 @@ nsINode::CompareDocumentPosition(nsINode& aOtherNode) const
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;
@ -1992,7 +1992,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
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();
@ -2702,7 +2702,7 @@ nsINode::QuerySelectorAll(const nsAString& aSelector, ErrorResult& aResult)
nsCSSSelectorList* selectorList = ParseSelectorList(aSelector, aResult);
if (selectorList) {
FindMatchingElements<false, nsAutoTArray<Element*, 128>>(this,
FindMatchingElements<false, AutoTArray<Element*, 128>>(this,
selectorList,
*contentList,
aResult);

View File

@ -59,7 +59,7 @@ 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;
@ -187,7 +187,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const char16_t* aText,
return rv;
}
nsAutoTArray<uint8_t,4000> breakState;
AutoTArray<uint8_t,4000> breakState;
if (aSink) {
if (!breakState.AppendElements(aLength))
return NS_ERROR_OUT_OF_MEMORY;
@ -368,7 +368,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const uint8_t* aText, u
return rv;
}
nsAutoTArray<uint8_t,4000> breakState;
AutoTArray<uint8_t,4000> breakState;
if (aSink) {
if (!breakState.AppendElements(aLength))
return NS_ERROR_OUT_OF_MEMORY;

View File

@ -206,9 +206,9 @@ private:
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;

View File

@ -992,7 +992,7 @@ 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;

View File

@ -199,10 +199,10 @@ private:
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;

View File

@ -152,7 +152,7 @@ protected:
};
// Stack to store one olState struct per <OL>.
nsAutoTArray<olState, 8> mOLStateStack;
AutoTArray<olState, 8> mOLStateStack;
bool HasNoChildren(nsIContent* aContent);
};

View File

@ -4474,8 +4474,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
# 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
@ -8389,7 +8389,7 @@ class CGEnumerateHook(CGAbstractBindingMethod):
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)) {
@ -10456,7 +10456,7 @@ class CGEnumerateOwnPropertiesViaGetOwnPropertyNames(CGAbstractBindingMethod):
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)) {

View File

@ -94,7 +94,7 @@ 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;

View File

@ -47,7 +47,7 @@ CleanupChildFds(CacheReadStream& aReadStream, CleanupAction aAction)
return;
}
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
FileDescriptorSetChild* fdSetActor =
static_cast<FileDescriptorSetChild*>(aReadStream.fds().get_PFileDescriptorSetChild());
@ -107,7 +107,7 @@ CleanupParentFds(CacheReadStream& aReadStream, CleanupAction aAction)
return;
}
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
FileDescriptorSetParent* fdSetActor =
static_cast<FileDescriptorSetParent*>(aReadStream.fds().get_PFileDescriptorSetParent());
@ -306,7 +306,7 @@ MatchInPutList(InternalRequest* aRequest,
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());

4
dom/cache/Cache.cpp vendored
View File

@ -114,7 +114,7 @@ public:
// 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;
@ -571,7 +571,7 @@ Cache::AddAll(const GlobalObject& aGlobal,
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

View File

@ -219,7 +219,7 @@ CacheOpChild::HandleResponse(const CacheResponseOrVoid& aResponseOrVoid)
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) {
@ -233,7 +233,7 @@ CacheOpChild::HandleResponseList(const nsTArray<CacheResponse>& aResponseList)
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) {

View File

@ -79,8 +79,8 @@ CacheOpParent::Execute(Manager* aManager)
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(
@ -221,7 +221,7 @@ CacheOpParent::DeserializeCacheStream(const CacheReadStreamOrVoid& aStreamOrVoid
}
// Option 3: A stream was serialized using normal methods.
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
if (readStream.fds().type() ==
OptionalFileDescriptorSet::TPFileDescriptorSetChild) {

View File

@ -588,11 +588,11 @@ DeleteCacheId(mozIStorageConnection* aConn, CacheId aCacheId,
// 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; }
@ -720,7 +720,7 @@ CacheMatch(mozIStorageConnection* aConn, CacheId aCacheId,
*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; }
@ -747,7 +747,7 @@ CacheMatchAll(mozIStorageConnection* aConn, CacheId aCacheId,
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; }
@ -781,11 +781,11 @@ CachePut(mozIStorageConnection* aConn, CacheId aCacheId,
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; }
@ -814,7 +814,7 @@ CacheDelete(mozIStorageConnection* aConn, CacheId aCacheId,
*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; }
@ -822,7 +822,7 @@ CacheDelete(mozIStorageConnection* aConn, CacheId aCacheId,
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; }
@ -845,7 +845,7 @@ CacheKeys(mozIStorageConnection* aConn, CacheId aCacheId,
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; }
@ -912,7 +912,7 @@ StorageMatch(mozIStorageConnection* aConn,
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) {
@ -1218,7 +1218,7 @@ MatchByVaryHeader(mozIStorageConnection* aConn,
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) {

10
dom/cache/Manager.cpp vendored
View File

@ -74,12 +74,12 @@ public:
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; }
@ -88,7 +88,7 @@ public:
}
// Clean up orphaned body objects
nsAutoTArray<nsID, 64> knownBodyIdList;
AutoTArray<nsID, 64> knownBodyIdList;
rv = db::GetKnownBodyIds(aConn, knownBodyIdList);
rv = BodyDeleteOrphanedFiles(aDBDir, knownBodyIdList);
@ -1373,7 +1373,7 @@ 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);
@ -1902,7 +1902,7 @@ 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) {

View File

@ -222,7 +222,7 @@ ReadStream::Inner::Serialize(CacheReadStream* aReadStreamOut)
aReadStreamOut->id() = mId;
mControl->SerializeControl(aReadStreamOut);
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
SerializeInputStream(mStream, aReadStreamOut->params(), fds);
mControl->SerializeFds(aReadStreamOut, fds);
@ -451,7 +451,7 @@ ReadStream::Create(const CacheReadStream& aReadStream)
}
MOZ_ASSERT(control);
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
control->DeserializeFds(aReadStream, fds);
nsCOMPtr<nsIInputStream> stream =

View File

@ -44,7 +44,7 @@ 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());
@ -67,7 +67,7 @@ HasVaryStar(mozilla::dom::InternalHeaders* aHeaders)
void
SerializeNormalStream(nsIInputStream* aStream, CacheReadStream& aReadStreamOut)
{
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
SerializeInputStream(aStream, aReadStreamOut.params(), fds);
PFileDescriptorSetChild* fdSet = nullptr;
@ -94,7 +94,7 @@ 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) {

View File

@ -247,7 +247,7 @@ nsGonkCameraControl::Initialize()
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;
@ -264,7 +264,7 @@ nsGonkCameraControl::Initialize()
mLastRecorderSize = mCurrentConfiguration.mPreviewSize;
}
nsAutoTArray<nsString, 8> modes;
AutoTArray<nsString, 8> modes;
mParams.Get(CAMERA_PARAM_SUPPORTED_METERINGMODES, modes);
if (!modes.IsEmpty()) {
nsString mode;
@ -302,7 +302,7 @@ nsGonkCameraControl::~nsGonkCameraControl()
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,
@ -923,7 +923,7 @@ nsGonkCameraControl::SetThumbnailSizeImpl(const Size& aSize)
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) {
@ -1028,7 +1028,7 @@ nsGonkCameraControl::SetPictureSizeImpl(const Size& aSize)
return NS_OK;
}
nsAutoTArray<Size, 8> supportedSizes;
AutoTArray<Size, 8> supportedSizes;
Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
Size best;
@ -1727,7 +1727,7 @@ nsGonkCameraControl::SelectCaptureAndPreviewSize(const Size& aPreviewSize,
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;

View File

@ -1034,7 +1034,7 @@ protected:
bool fontExplicitLanguage;
};
nsAutoTArray<ContextState, 3> mStyleStack;
AutoTArray<ContextState, 3> mStyleStack;
inline ContextState& CurrentState() {
return mStyleStack[mStyleStack.Length() - 1];

View File

@ -239,7 +239,7 @@ ImageBitmapRenderingContext::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
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);

View File

@ -731,7 +731,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
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,
@ -1291,7 +1291,7 @@ EventStateManager::HandleCrossProcessEvent(WidgetEvent* aEvent,
// 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.

View File

@ -429,7 +429,7 @@ private:
*/
class TextCompositionArray final :
public nsAutoTArray<RefPtr<TextComposition>, 2>
public AutoTArray<RefPtr<TextComposition>, 2>
{
public:
// Looking for per native IME context.

View File

@ -338,7 +338,7 @@ FetchDriver::HttpFetch()
// 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);
@ -709,7 +709,7 @@ 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) {

View File

@ -309,7 +309,7 @@ InternalHeaders::CORSHeaders(InternalHeaders* aHeaders)
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();

View File

@ -77,7 +77,7 @@ private:
struct udev_monitor* mMonitor;
guint mMonitorSourceID;
// Information about currently connected gamepads.
nsAutoTArray<Gamepad,4> mGamepads;
AutoTArray<Gamepad,4> mGamepads;
};
// singleton instance

View File

@ -173,7 +173,7 @@ HTMLAllCollection::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames
// 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()) {

View File

@ -287,7 +287,7 @@ HTMLOptionsCollection::GetSupportedNames(unsigned aFlags,
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) {

View File

@ -112,7 +112,7 @@ void
TimeRanges::Normalize(double aTolerance)
{
if (mRanges.Length() >= 2) {
nsAutoTArray<TimeRange,4> normalized;
AutoTArray<TimeRange,4> normalized;
mRanges.Sort(CompareTimeRanges());
@ -147,7 +147,7 @@ TimeRanges::Union(const TimeRanges* aOtherRanges, double 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();) {

View File

@ -93,7 +93,7 @@ private:
}
};
nsAutoTArray<TimeRange,4> mRanges;
AutoTArray<TimeRange,4> mRanges;
nsCOMPtr<nsISupports> mParent;

View File

@ -160,7 +160,7 @@ protected:
RefPtr<nsGenericHTMLElement> mBody;
RefPtr<nsGenericHTMLElement> mHead;
nsAutoTArray<SinkContext*, 8> mContextStack;
AutoTArray<SinkContext*, 8> mContextStack;
SinkContext* mCurrentContext;
SinkContext* mHeadContext;

View File

@ -16352,10 +16352,10 @@ QuotaClient::InitOrigin(PersistenceType aPersistenceType,
// 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));
@ -18217,7 +18217,7 @@ DatabaseOperationBase::GetStructuredCloneReadInfoFromBlob(
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;
@ -23344,7 +23344,7 @@ UpdateIndexDataValuesFunction::OnFunctionCall(mozIStorageValueArray* aValues,
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(),

View File

@ -667,7 +667,7 @@ IDBDatabase::Transaction(const StringOrStringSequence& aStoreNames,
return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
}
nsAutoTArray<nsString, 1> stackSequence;
AutoTArray<nsString, 1> stackSequence;
if (aStoreNames.IsString()) {
stackSequence.AppendElement(aStoreNames.GetAsString());
@ -848,8 +848,8 @@ IDBDatabase::AbortTransactions(bool aShouldWarn)
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

View File

@ -470,7 +470,7 @@ Key::EncodeLocaleString(const nsDependentString& aString, uint8_t aTypeOffset,
}
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());

View File

@ -607,7 +607,7 @@ 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++) {
@ -911,7 +911,7 @@ 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.");
@ -5145,7 +5145,7 @@ ContentParent::IgnoreIPCPrincipal()
void
ContentParent::NotifyUpdatedDictionaries()
{
nsAutoTArray<ContentParent*, 8> processes;
AutoTArray<ContentParent*, 8> processes;
GetAll(processes);
nsCOMPtr<nsISpellChecker> spellChecker(do_GetService(NS_SPELLCHECKER_CONTRACTID));

View File

@ -71,8 +71,8 @@ private:
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;

View File

@ -706,7 +706,7 @@ private:
// 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;
@ -734,7 +734,7 @@ private:
CSSSize mUnscaledInnerSize;
bool mDidSetRealShowInfo;
nsAutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
AutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
};

View File

@ -102,8 +102,8 @@ 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);

View File

@ -85,9 +85,9 @@ 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();
@ -132,7 +132,7 @@ AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels,
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++) {
@ -166,7 +166,7 @@ AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels,
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;

View File

@ -118,8 +118,8 @@ DownmixAndInterleave(const nsTArray<const SrcT*>& aChannelData,
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++) {
@ -254,8 +254,8 @@ public:
#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()) {
@ -395,7 +395,7 @@ 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>();

View File

@ -113,7 +113,7 @@ public:
}
}
private:
nsAutoTArray<Chunk, 7> mChunks;
AutoTArray<Chunk, 7> mChunks;
int64_t mBaseOffset;
double mBasePosition;
};
@ -287,7 +287,7 @@ WriteDumpFile(FILE* aDumpFile, AudioStream* aStream, uint32_t aFrames,
}
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();
@ -616,7 +616,7 @@ AudioStream::GetTimeStretched(AudioBufferWriter& aWriter)
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());

View File

@ -583,10 +583,10 @@ protected:
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;

View File

@ -202,7 +202,7 @@ private:
// 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.

View File

@ -1098,7 +1098,7 @@ AudioCallbackDriver::EnqueueStreamAndPromiseForOperation(MediaStream* aStream,
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

View File

@ -519,7 +519,7 @@ private:
* 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. */

View File

@ -255,7 +255,7 @@ 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()

View File

@ -794,7 +794,7 @@ MediaCache::FindReusableBlock(TimeStamp aNow,
// 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) {
@ -1040,7 +1040,7 @@ MediaCache::Update()
// 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);

View File

@ -606,7 +606,7 @@ MediaStreamGraphImpl::CreateOrDestroyAudioStreams(MediaStream* aStream)
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);
}
@ -791,7 +791,7 @@ MediaStreamGraphImpl::PlayVideo(MediaStream* aStream)
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?");
@ -861,14 +861,14 @@ MediaStreamGraphImpl::PlayVideo(MediaStream* aStream)
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) {

View File

@ -67,8 +67,8 @@ TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) :
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);

View File

@ -35,7 +35,7 @@ void VideoFrameContainer::SetCurrentFrame(const gfx::IntSize& aIntrinsicSize,
{
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);

View File

@ -313,7 +313,7 @@ OpusTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData)
}
// Start encoding data.
nsAutoTArray<AudioDataValue, 9600> pcm;
AutoTArray<AudioDataValue, 9600> pcm;
pcm.SetLength(GetPacketDuration() * mChannels);
AudioSegment::ChunkIterator iter(mSourceSegment);
int frameCopied = 0;
@ -344,7 +344,7 @@ OpusTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData)
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.

View File

@ -140,7 +140,7 @@ AudioTrackEncoder::InterleaveTrackData(AudioChunk& aChunk,
{
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]);
@ -149,7 +149,7 @@ AudioTrackEncoder::InterleaveTrackData(AudioChunk& aChunk,
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]);

View File

@ -202,8 +202,8 @@ VorbisTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData)
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()) {

View File

@ -157,7 +157,7 @@ GMPDecryptorChild::KeyStatusChanged(const char* aSessionId,
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,

View File

@ -183,7 +183,7 @@ TEST(VorbisTrackEncoder, EncodedFrame)
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);

View File

@ -500,7 +500,7 @@ SendStreamAudio(DecodedStreamData* aStream, int64_t aStartTime,
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);
}
@ -522,7 +522,7 @@ DecodedStream::SendAudio(double aVolume, bool aIsSameOrigin)
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;
@ -587,7 +587,7 @@ DecodedStream::SendVideo(bool aIsSameOrigin)
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

View File

@ -314,13 +314,13 @@ VideoSink::RenderVideoFrames(int32_t aMaxFrames,
{
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) {

View File

@ -296,7 +296,7 @@ void OggReader::SetupTargetSkeleton(SkeletonState* aSkeletonState)
} 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))) {
@ -395,7 +395,7 @@ nsresult OggReader::ReadMetadata(MediaInfo* aInfo,
*aTags = nullptr;
ogg_page page;
nsAutoTArray<OggCodecState*,4> bitstreams;
AutoTArray<OggCodecState*,4> bitstreams;
nsTArray<uint32_t> serials;
bool readAllBOS = false;
while (!readAllBOS) {
@ -1254,7 +1254,7 @@ OggReader::IndexedSeekResult OggReader::SeekToKeyframeUsingIndex(int64_t aTarget
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,
@ -1449,7 +1449,7 @@ nsresult OggReader::SeekInternal(int64_t aTarget, int64_t aEndTime)
// 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);

View File

@ -751,7 +751,7 @@ public:
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,
@ -853,7 +853,7 @@ private:
* 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,

View File

@ -71,8 +71,8 @@ VorbisDataDecoder::Init()
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())) {

View File

@ -123,7 +123,7 @@ private:
}
private:
nsAutoTArray<DurationElement, 16> mMap;
AutoTArray<DurationElement, 16> mMap;
};
DurationMap mDurationMap;

View File

@ -321,7 +321,7 @@ private:
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.

Some files were not shown because too many files have changed in this diff Show More