Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray

CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
This commit is contained in:
Phil Ringnalda 2016-01-31 10:10:57 -08:00
parent 55258dc397
commit 863943dfb7
350 changed files with 1009 additions and 891 deletions

View File

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

View File

@ -273,7 +273,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
{
*aSelected = nullptr;
AutoTArray<uint32_t, 10> cols;
nsAutoTArray<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)
{
AutoTArray<uint32_t, 10> rows;
nsAutoTArray<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;
}
AutoTArray<Attribute, 10> attrs;
nsAutoTArray<Attribute, 10> attrs;
proxy->TextAttributes(false, aOffset, &attrs, &startOffset, &endOffset);
*aStartOffset = startOffset;
*aEndOffset = endOffset;
@ -337,7 +337,7 @@ getDefaultAttributesCB(AtkText *aText)
return nullptr;
}
AutoTArray<Attribute, 10> attrs;
nsAutoTArray<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 AutoTArray; we use
* Pending events array. Don't make this an nsAutoTArray; 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 AutoTArray; we use SwapElements() on it.
* Don't make this an nsAutoTArray; 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 AutoTArray; we
* Other notifications like DOM events. Don't make this an nsAutoTArray; 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;
AutoTArray<Accessible*, 30> parents1, parents2;
nsAutoTArray<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;
AutoTArray<Accessible*, 30> parents1, parents2;
nsAutoTArray<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;
AutoTArray<Accessible*, 30> parents1, parents2;
nsAutoTArray<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;
AutoTArray<Accessible*, 30> boundaryParents, containerParents;
nsAutoTArray<Accessible*, 30> boundaryParents, containerParents;
// Crop the start boundary.
Accessible* container = nullptr;

View File

@ -87,7 +87,7 @@ private:
DocAccessible* mDoc;
Accessible* mContext;
nsIContent* mAnchorNode;
AutoTArray<ChildrenIterator, 20> mStateStack;
nsAutoTArray<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) {
AutoTArray<Accessible*, 10> headerCells;
nsAutoTArray<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) {
AutoTArray<Accessible*, 10> headerCells;
nsAutoTArray<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) {
AutoTArray<Accessible*, 30> cells;
nsAutoTArray<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) {
AutoTArray<Accessible*, 10> selectedItems;
nsAutoTArray<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)
{
AutoTArray<uint64_t, 30> cellIDs;
nsAutoTArray<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)
{
AutoTArray<uint64_t, 10> itemIDs;
nsAutoTArray<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 {
AutoTArray<Attribute, 10> attrs;
nsAutoTArray<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) {
AutoTArray<Accessible*, 10> childrenArray;
nsAutoTArray<Accessible*, 10> childrenArray;
accWrap->GetUnignoredChildren(&childrenArray);
mChildren = ConvertToNSArray(childrenArray);
} else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
AutoTArray<ProxyAccessible*, 10> childrenArray;
nsAutoTArray<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]) {
AutoTArray<Accessible*, 10> headerCells;
nsAutoTArray<Accessible*, 10> headerCells;
cell->RowHeaderCells(&headerCells);
return ConvertToNSArray(headerCells);
}
if ([attribute isEqualToString:NSAccessibilityColumnHeaderUIElementsAttribute]) {
AutoTArray<Accessible*, 10> headerCells;
nsAutoTArray<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;
AutoTArray<TextRange, 1> ranges;
nsAutoTArray<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;
AutoTArray<uint32_t, 30> cellIndices;
nsAutoTArray<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;
AutoTArray<Accessible*, 30> cells;
nsAutoTArray<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;
AutoTArray<uint32_t, 30> colIndices;
nsAutoTArray<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;
AutoTArray<uint32_t, 30> rowIndices;
nsAutoTArray<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;
AutoTArray<Accessible*, 10> cells;
nsAutoTArray<Accessible*, 10> cells;
mTableCell->ColHeaderCells(&cells);
*aNColumnHeaderCells = cells.Length();
@ -172,7 +172,7 @@ ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles,
if (!mTableCell)
return CO_E_OBJNOTCONNECTED;
AutoTArray<Accessible*, 10> cells;
nsAutoTArray<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)) {
AutoTArray<Attribute, 10> attrs;
nsAutoTArray<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()) {
AutoTArray<Accessible*, 10> selectedItems;
nsAutoTArray<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);
AutoTArray<TextRange, 1> ranges;
nsAutoTArray<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!");
AutoTArray<Accessible*, 10> items;
nsAutoTArray<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);
AutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray;
nsAutoTArray<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;
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> cellsArray;
nsAutoTArray<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;
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> colsArray;
nsAutoTArray<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;
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> rowsArray;
nsAutoTArray<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;
AutoTArray<Accessible*, 10> headerCells;
nsAutoTArray<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;
AutoTArray<Accessible*, 10> headerCells;
nsAutoTArray<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();
}
AutoTArray<nsCOMPtr<nsIDocShell>, 8> kids;
nsAutoTArray<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);
AutoTArray<uint64_t, 16> ids;
nsAutoTArray<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);
AutoTArray<uint64_t, 16> ids;
nsAutoTArray<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);
AutoTArray<uint64_t, 16> toBeRemovedEntries;
nsAutoTArray<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)
{
AutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
nsAutoTArray<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.
AutoTArray<OffsetIndexedKeyframe,4> keyframes;
nsAutoTArray<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
{
AutoTArray<float, 16> arr;
nsAutoTArray<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
{
AutoTArray<double, 16> arr;
nsAutoTArray<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
{
AutoTArray<RefPtr<BlobImpl>, 1> blobImpls;
nsAutoTArray<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
AutoTArray<nsString, 5> baseAttrs;
nsAutoTArray<nsString, 5> baseAttrs;
nsString attr;
const nsIContent *elem = this;
do {
@ -1328,7 +1328,7 @@ public:
}
private:
AutoTArray<nsCOMPtr<nsIContent>,
nsAutoTArray<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.
AutoTArray<nsIContent*, 1020> nodesToUnpurple;
nsAutoTArray<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.
AutoTArray<nsINode*, 1020> grayNodes;
nsAutoTArray<nsINode*, 1020> grayNodes;
bool foundBlack = root->IsBlack();
if (root != currentDoc) {
@ -1598,8 +1598,8 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode)
return !NeedsScriptTraverse(aNode);
}
AutoTArray<nsINode*, 1020>* gPurpleRoots = nullptr;
AutoTArray<nsIContent*, 1020>* gNodesToUnbind = nullptr;
nsAutoTArray<nsINode*, 1020>* gPurpleRoots = nullptr;
nsAutoTArray<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.
AutoTArray<nsIContent*, 1020> nodesToClear;
nsAutoTArray<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 AutoTArray<nsIContent*, 1020>();
gNodesToUnbind = new nsAutoTArray<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 AutoTArray<nsINode*, 1020>();
gPurpleRoots = new nsAutoTArray<nsINode*, 1020>();
}
gPurpleRoots->AppendElement(root);
}

View File

@ -866,7 +866,7 @@ Navigator::RemoveIdleObserver(MozIdleObserver& aIdleObserver, ErrorResult& aRv)
bool
Navigator::Vibrate(uint32_t aDuration)
{
AutoTArray<uint32_t, 1> pattern;
nsAutoTArray<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
AutoTArray<int32_t, 8> mIndexes;
nsAutoTArray<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!
AutoTArray<nsINode*, 8> oldParentStack;
AutoTArray<int32_t, 8> newIndexes;
nsAutoTArray<nsINode*, 8> oldParentStack;
nsAutoTArray<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
AutoTArray<nsIContent*, 8> mEndNodes;
AutoTArray<int32_t, 8> mEndOffsets;
nsAutoTArray<nsIContent*, 8> mEndNodes;
nsAutoTArray<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);
AutoTArray<nsIAtom*, 8> atoms;
nsAutoTArray<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
AutoTArray<nsINode*, 30> parents1, parents2;
nsAutoTArray<nsINode*, 30> parents1, parents2;
do {
parents1.AppendElement(aNode1);
aNode1 = aNode1->GetParentNode();
@ -2335,7 +2335,7 @@ nsContentUtils::ComparePoints(nsINode* aParent1, int32_t aOffset1,
0;
}
AutoTArray<nsINode*, 32> parents1, parents2;
nsAutoTArray<nsINode*, 32> parents1, parents2;
nsINode* node1 = aParent1;
nsINode* node2 = aParent2;
do {
@ -4287,7 +4287,7 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
return frag.forget();
}
AutoTArray<nsString, 32> tagStack;
nsAutoTArray<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)) {
AutoTArray<nsCOMPtr<nsIContent>, 50> childNodes;
nsAutoTArray<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);
AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
nsAutoTArray<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);
AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
nsAutoTArray<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:
}
}
AutoTArray<Unit, STRING_BUFFER_UNITS> mUnits;
nsAutoTArray<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;
AutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
nsAutoTArray<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;
AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
nsDOMMutationObserver::sCurrentlyHandlingObservers = nullptr;
nsINodeList*
@ -585,7 +585,7 @@ void
nsDOMMutationObserver::RescheduleForRun()
{
if (!sScheduledMutationObservers) {
sScheduledMutationObservers = new AutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
sScheduledMutationObservers = new nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
}
bool didInsert = false;
@ -882,7 +882,7 @@ nsDOMMutationObserver::HandleMutationsInternal()
nsTArray<RefPtr<nsDOMMutationObserver> >* suppressedObservers = nullptr;
while (sScheduledMutationObservers) {
AutoTArray<RefPtr<nsDOMMutationObserver>, 4>* observers =
nsAutoTArray<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 AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
new nsAutoTArray<nsAutoTArray<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.
AutoTArray<nsDOMMutationRecord*, 4> mCurrentMutations;
nsAutoTArray<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 AutoTArray<RefPtr<nsDOMMutationObserver>, 4>* sScheduledMutationObservers;
static nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>* sScheduledMutationObservers;
static nsDOMMutationObserver* sCurrentObserver;
static uint32_t sMutationLevel;
static AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
static nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
sCurrentlyHandlingObservers;
};
@ -740,7 +740,7 @@ private:
static nsAutoMutationBatch* sCurrentBatch;
nsAutoMutationBatch* mPreviousBatch;
AutoTArray<BatchObserver, 2> mObservers;
nsAutoTArray<BatchObserver, 2> mObservers;
nsTArray<nsCOMPtr<nsIContent> > mRemovedNodes;
nsTArray<nsCOMPtr<nsIContent> > mAddedNodes;
nsINode* mBatchTarget;
@ -907,7 +907,7 @@ private:
};
static nsAutoAnimationMutationBatch* sCurrentBatch;
AutoTArray<nsDOMMutationObserver*, 2> mObservers;
nsAutoTArray<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;
AutoTArray<nsString, 10> addedClasses;
nsAutoTArray<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)
{
AutoTArray<nsString, 1> tokens;
nsAutoTArray<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)
{
AutoTArray<nsString, 1> tokens;
nsAutoTArray<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);
AutoTArray<nsString, 1> tokens;
nsAutoTArray<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
AutoTArray<nsIFrame*,8> outFrames;
nsAutoTArray<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);
AutoTArray<nsDocument*, 8> exitDocs;
nsAutoTArray<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.
AutoTArray<nsIDocument*, 8> changed;
nsAutoTArray<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;
AutoTArray<nsINode*, 8> mCommonAncestors;
AutoTArray<nsIContent*, 8> mStartNodes;
AutoTArray<int32_t, 8> mStartOffsets;
AutoTArray<nsIContent*, 8> mEndNodes;
AutoTArray<int32_t, 8> mEndOffsets;
nsAutoTArray<nsINode*, 8> mCommonAncestors;
nsAutoTArray<nsIContent*, 8> mStartNodes;
nsAutoTArray<int32_t, 8> mStartOffsets;
nsAutoTArray<nsIContent*, 8> mEndNodes;
nsAutoTArray<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);
AutoTArray<nsIDocShellTreeItem*, 30> parents1, parents2;
nsAutoTArray<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;
AutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;
nsAutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;
static nsDataHashtable<nsStringHashKey, nsMessageManagerScriptHolder*>* sCachedScripts;
static nsScriptCacheCleaner* sScriptCacheCleaner;

View File

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

View File

@ -595,7 +595,7 @@ void
nsINode::Normalize()
{
// First collect list of nodes to be removed
AutoTArray<nsCOMPtr<nsIContent>, 50> nodes;
nsAutoTArray<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);
}
AutoTArray<const nsINode*, 32> parents1, parents2;
nsAutoTArray<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<AutoTArray<nsCOMPtr<nsIContent>, 50> > fragChildren;
Maybe<nsAutoTArray<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, AutoTArray<Element*, 128>>(this,
FindMatchingElements<false, nsAutoTArray<Element*, 128>>(this,
selectorList,
*contentList,
aResult);

View File

@ -59,7 +59,7 @@ nsresult
nsLineBreaker::FlushCurrentWord()
{
uint32_t length = mCurrentWord.Length();
AutoTArray<uint8_t,4000> breakState;
nsAutoTArray<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;
}
AutoTArray<uint8_t,4000> breakState;
nsAutoTArray<uint8_t,4000> breakState;
if (aSink) {
if (!breakState.AppendElements(aLength))
return NS_ERROR_OUT_OF_MEMORY;
@ -313,7 +313,7 @@ nsLineBreaker::FindHyphenationPoints(nsHyphenator *aHyphenator,
uint8_t *aBreakState)
{
nsDependentSubstring string(aTextStart, aTextLimit);
AutoTArray<bool,200> hyphens;
AutoFallibleTArray<bool,200> hyphens;
if (NS_SUCCEEDED(aHyphenator->Hyphenate(string, hyphens))) {
for (uint32_t i = 0; i + 1 < string.Length(); ++i) {
if (hyphens[i]) {
@ -368,7 +368,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const uint8_t* aText, u
return rv;
}
AutoTArray<uint8_t,4000> breakState;
nsAutoTArray<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);
AutoTArray<char16_t,100> mCurrentWord;
nsAutoTArray<char16_t,100> mCurrentWord;
// All the items that contribute to mCurrentWord
AutoTArray<TextItem,2> mTextItems;
nsAutoTArray<TextItem,2> mTextItems;
nsIAtom* mCurrentWordLanguage;
bool mCurrentWordContainsMixedLang;
bool mCurrentWordContainsComplexChar;

View File

@ -992,7 +992,7 @@ DOMHighResTimeStamp
PerformanceBase::ResolveTimestampFromName(const nsAString& aName,
ErrorResult& aRv)
{
AutoTArray<RefPtr<PerformanceEntry>, 1> arr;
nsAutoTArray<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
AutoTArray<bool, 8> mHasWrittenCellsForRow;
nsAutoTArray<bool, 8> mHasWrittenCellsForRow;
// Values gotten in OpenContainer that is (also) needed in CloseContainer
AutoTArray<bool, 8> mIsInCiteBlockquote;
nsAutoTArray<bool, 8> mIsInCiteBlockquote;
// The output data
nsAString* mOutputString;

View File

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

View File

@ -2070,10 +2070,10 @@ void DoTraceSequence(JSTracer* trc, InfallibleTArray<T>& seq);
namespace binding_detail {
template<typename T>
class AutoSequence : public AutoTArray<T, 16>
class AutoSequence : public AutoFallibleTArray<T, 16>
{
public:
AutoSequence() : AutoTArray<T, 16>()
AutoSequence() : AutoFallibleTArray<T, 16>()
{}
// Allow converting to const sequences as needed

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 AutoTArray to the right size
# will memmove its elements, but AutoTArrays are not memmovable and
# In that case, resizing the outermost nsAutoTarray to the right size
# will memmove its elements, but nsAutoTArrays 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("""
AutoTArray<nsString, 8> names;
nsAutoTArray<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("""
AutoTArray<nsString, 8> names;
nsAutoTArray<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());
AutoTArray<ContentParent*, 20> contentActors;
nsAutoTArray<ContentParent*, 20> contentActors;
ContentParent::GetAll(contentActors);
for (uint32_t contentIndex = 0;
@ -102,7 +102,7 @@ GetAllBluetoothActors(InfallibleTArray<BluetoothParent*>& aActors)
contentIndex++) {
MOZ_ASSERT(contentActors[contentIndex]);
AutoTArray<PBluetoothParent*, 5> bluetoothActors;
AutoInfallibleTArray<PBluetoothParent*, 5> bluetoothActors;
contentActors[contentIndex]->ManagedPBluetoothParent(bluetoothActors);
for (uint32_t bluetoothIndex = 0;
@ -490,7 +490,7 @@ BluetoothService::SetEnabled(bool aEnabled)
{
MOZ_ASSERT(NS_IsMainThread());
AutoTArray<BluetoothParent*, 10> childActors;
AutoInfallibleTArray<BluetoothParent*, 10> childActors;
GetAllBluetoothActors(childActors);
for (uint32_t index = 0; index < childActors.Length(); index++) {
@ -574,7 +574,7 @@ BluetoothService::HandleShutdown()
Cleanup();
AutoTArray<BluetoothParent*, 10> childActors;
AutoInfallibleTArray<BluetoothParent*, 10> childActors;
GetAllBluetoothActors(childActors);
if (!childActors.IsEmpty()) {

View File

@ -47,7 +47,7 @@ CleanupChildFds(CacheReadStream& aReadStream, CleanupAction aAction)
return;
}
AutoTArray<FileDescriptor, 4> fds;
nsAutoTArray<FileDescriptor, 4> fds;
FileDescriptorSetChild* fdSetActor =
static_cast<FileDescriptorSetChild*>(aReadStream.fds().get_PFileDescriptorSetChild());
@ -107,7 +107,7 @@ CleanupParentFds(CacheReadStream& aReadStream, CleanupAction aAction)
return;
}
AutoTArray<FileDescriptor, 4> fds;
nsAutoTArray<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());
AutoTArray<nsCString, 16> varyHeaders;
nsAutoTArray<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>>.
AutoTArray<RefPtr<Response>, 256> responseList;
nsAutoTArray<RefPtr<Response>, 256> responseList;
responseList.SetCapacity(mRequestList.Length());
bool isArray;
@ -571,7 +571,7 @@ Cache::AddAll(const GlobalObject& aGlobal,
return promise.forget();
}
AutoTArray<RefPtr<Promise>, 256> fetchList;
nsAutoTArray<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)
{
AutoTArray<RefPtr<Response>, 256> responses;
nsAutoTArray<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)
{
AutoTArray<RefPtr<Request>, 256> requests;
nsAutoTArray<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();
AutoTArray<nsCOMPtr<nsIInputStream>, 256> requestStreamList;
AutoTArray<nsCOMPtr<nsIInputStream>, 256> responseStreamList;
nsAutoTArray<nsCOMPtr<nsIInputStream>, 256> requestStreamList;
nsAutoTArray<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.
AutoTArray<FileDescriptor, 4> fds;
nsAutoTArray<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.
AutoTArray<EntryId, 256> matches;
nsAutoTArray<EntryId, 256> matches;
nsresult rv = QueryAll(aConn, aCacheId, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
AutoTArray<IdCount, 16> deletedSecurityIdList;
nsAutoTArray<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;
AutoTArray<EntryId, 1> matches;
nsAutoTArray<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;
AutoTArray<EntryId, 256> matches;
nsAutoTArray<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(""));
AutoTArray<EntryId, 256> matches;
nsAutoTArray<EntryId, 256> matches;
nsresult rv = QueryCache(aConn, aCacheId, aRequest, params, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
AutoTArray<IdCount, 16> deletedSecurityIdList;
nsAutoTArray<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;
AutoTArray<EntryId, 256> matches;
nsAutoTArray<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;
}
AutoTArray<IdCount, 16> deletedSecurityIdList;
nsAutoTArray<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;
AutoTArray<EntryId, 256> matches;
nsAutoTArray<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; }
AutoTArray<CacheId, 32> cacheIdList;
nsAutoTArray<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; }
AutoTArray<nsCString, 8> varyValues;
nsAutoTArray<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
AutoTArray<CacheId, 8> orphanedCacheIdList;
nsAutoTArray<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) {
AutoTArray<nsID, 16> deletedBodyIdList;
nsAutoTArray<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
AutoTArray<nsID, 64> knownBodyIdList;
nsAutoTArray<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)
{
AutoTArray<SavedResponse, 1> responseList;
nsAutoTArray<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);
AutoTArray<nsID, 64> deleteNowList;
nsAutoTArray<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);
AutoTArray<FileDescriptor, 4> fds;
nsAutoTArray<FileDescriptor, 4> fds;
SerializeInputStream(mStream, aReadStreamOut->params(), fds);
mControl->SerializeFds(aReadStreamOut, fds);
@ -451,7 +451,7 @@ ReadStream::Create(const CacheReadStream& aReadStream)
}
MOZ_ASSERT(control);
AutoTArray<FileDescriptor, 4> fds;
nsAutoTArray<FileDescriptor, 4> fds;
control->DeserializeFds(aReadStream, fds);
nsCOMPtr<nsIInputStream> stream =

View File

@ -44,7 +44,7 @@ namespace {
static bool
HasVaryStar(mozilla::dom::InternalHeaders* aHeaders)
{
AutoTArray<nsCString, 16> varyHeaders;
nsAutoTArray<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)
{
AutoTArray<FileDescriptor, 4> fds;
nsAutoTArray<FileDescriptor, 4> fds;
SerializeInputStream(aStream, aReadStreamOut.params(), fds);
PFileDescriptorSetChild* fdSet = nullptr;
@ -94,7 +94,7 @@ ToHeadersEntryList(nsTArray<HeadersEntry>& aOut, InternalHeaders* aHeaders)
{
MOZ_ASSERT(aHeaders);
AutoTArray<InternalHeaders::Entry, 16> entryList;
nsAutoTArray<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");
}
AutoTArray<Size, 16> sizes;
nsAutoTArray<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;
}
AutoTArray<nsString, 8> modes;
nsAutoTArray<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)
{
AutoTArray<Size, 16> supportedSizes;
nsAutoTArray<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;
AutoTArray<Size, 8> supportedSizes;
nsAutoTArray<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;
}
AutoTArray<Size, 8> supportedSizes;
nsAutoTArray<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);
AutoTArray<Size, 16> sizes;
nsAutoTArray<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;
};
AutoTArray<ContextState, 3> mStyleStack;
nsAutoTArray<ContextState, 3> mStyleStack;
inline ContextState& CurrentState() {
return mStyleStack[mStyleStack.Length() - 1];

View File

@ -239,7 +239,7 @@ ImageBitmapRenderingContext::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
imageLayer->SetContainer(imageContainer);
}
AutoTArray<ImageContainer::NonOwningImage, 1> imageList;
nsAutoTArray<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())) {
AutoTArray<uint32_t, 10> accessCharCodes;
nsAutoTArray<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.
AutoTArray<nsCOMPtr<nsIContent>, 1> targets;
nsAutoTArray<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 AutoTArray<RefPtr<TextComposition>, 2>
public nsAutoTArray<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) {
AutoTArray<nsCString, 5> unsafeHeaders;
nsAutoTArray<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);
AutoTArray<InternalHeaders::Entry, 5> headers;
nsAutoTArray<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());
AutoTArray<nsCString, 5> exposeNamesArray;
nsAutoTArray<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.
AutoTArray<Gamepad,4> mGamepads;
nsAutoTArray<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.
AutoTArray<nsIAtom*, 8> atoms;
nsAutoTArray<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;
}
AutoTArray<nsIAtom*, 8> atoms;
nsAutoTArray<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) {
AutoTArray<TimeRange,4> normalized;
nsAutoTArray<TimeRange,4> normalized;
mRanges.Sort(CompareTimeRanges());
@ -147,7 +147,7 @@ TimeRanges::Union(const TimeRanges* aOtherRanges, double aTolerance)
void
TimeRanges::Intersection(const TimeRanges* aOtherRanges)
{
AutoTArray<TimeRange,4> intersection;
nsAutoTArray<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:
}
};
AutoTArray<TimeRange,4> mRanges;
nsAutoTArray<TimeRange,4> mRanges;
nsCOMPtr<nsISupports> mParent;

View File

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

View File

@ -838,9 +838,10 @@ MakeCompressedIndexDataValues(
}
nsresult
ReadCompressedIndexDataValuesFromBlob(const uint8_t* aBlobData,
uint32_t aBlobDataLength,
nsTArray<IndexDataValue>& aIndexValues)
ReadCompressedIndexDataValuesFromBlob(
const uint8_t* aBlobData,
uint32_t aBlobDataLength,
FallibleTArray<IndexDataValue>& aIndexValues)
{
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(!IsOnBackgroundThread());
@ -915,9 +916,10 @@ ReadCompressedIndexDataValuesFromBlob(const uint8_t* aBlobData,
// static
template <typename T>
nsresult
ReadCompressedIndexDataValuesFromSource(T* aSource,
uint32_t aColumnIndex,
nsTArray<IndexDataValue>& aIndexValues)
ReadCompressedIndexDataValuesFromSource(
T* aSource,
uint32_t aColumnIndex,
FallibleTArray<IndexDataValue>& aIndexValues)
{
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(!IsOnBackgroundThread());
@ -961,7 +963,7 @@ ReadCompressedIndexDataValuesFromSource(T* aSource,
nsresult
ReadCompressedIndexDataValues(mozIStorageStatement* aStatement,
uint32_t aColumnIndex,
nsTArray<IndexDataValue>& aIndexValues)
FallibleTArray<IndexDataValue>& aIndexValues)
{
return ReadCompressedIndexDataValuesFromSource(aStatement,
aColumnIndex,
@ -971,7 +973,7 @@ ReadCompressedIndexDataValues(mozIStorageStatement* aStatement,
nsresult
ReadCompressedIndexDataValues(mozIStorageValueArray* aValues,
uint32_t aColumnIndex,
nsTArray<IndexDataValue>& aIndexValues)
FallibleTArray<IndexDataValue>& aIndexValues)
{
return ReadCompressedIndexDataValuesFromSource(aValues,
aColumnIndex,
@ -2766,7 +2768,7 @@ InsertIndexDataValuesFunction::OnFunctionCall(mozIStorageValueArray* aValues,
// Read out the previous value. It may be NULL, in which case we'll just end
// up with an empty array.
AutoTArray<IndexDataValue, 32> indexValues;
AutoFallibleTArray<IndexDataValue, 32> indexValues;
nsresult rv = ReadCompressedIndexDataValues(aValues, 0, indexValues);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
@ -3864,7 +3866,7 @@ private:
nsresult
ReadOldCompressedIDVFromBlob(const uint8_t* aBlobData,
uint32_t aBlobDataLength,
nsTArray<IndexDataValue>& aIndexValues);
FallibleTArray<IndexDataValue>& aIndexValues);
NS_IMETHOD
OnFunctionCall(mozIStorageValueArray* aArguments,
@ -3877,7 +3879,7 @@ nsresult
UpgradeIndexDataValuesFunction::ReadOldCompressedIDVFromBlob(
const uint8_t* aBlobData,
uint32_t aBlobDataLength,
nsTArray<IndexDataValue>& aIndexValues)
FallibleTArray<IndexDataValue>& aIndexValues)
{
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(!IsOnBackgroundThread());
@ -3989,7 +3991,7 @@ UpgradeIndexDataValuesFunction::OnFunctionCall(mozIStorageValueArray* aArguments
return rv;
}
AutoTArray<IndexDataValue, 32> oldIdv;
AutoFallibleTArray<IndexDataValue, 32> oldIdv;
rv = ReadOldCompressedIDVFromBlob(oldBlob, oldBlobLength, oldIdv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
@ -5860,9 +5862,10 @@ protected:
Maybe<UniqueIndexTable>& aMaybeUniqueIndexTable);
static nsresult
IndexDataValuesFromUpdateInfos(const nsTArray<IndexUpdateInfo>& aUpdateInfos,
const UniqueIndexTable& aUniqueIndexTable,
nsTArray<IndexDataValue>& aIndexValues);
IndexDataValuesFromUpdateInfos(
const nsTArray<IndexUpdateInfo>& aUpdateInfos,
const UniqueIndexTable& aUniqueIndexTable,
FallibleTArray<IndexDataValue>& aIndexValues);
static nsresult
InsertIndexTableRows(DatabaseConnection* aConnection,
@ -7909,7 +7912,7 @@ private:
nsresult
RemoveReferencesToIndex(DatabaseConnection* aConnection,
const Key& aObjectDataKey,
nsTArray<IndexDataValue>& aIndexValues);
FallibleTArray<IndexDataValue>& aIndexValues);
virtual nsresult
DoDatabaseWork(DatabaseConnection* aConnection) override;
@ -8047,7 +8050,7 @@ class ObjectStoreGetRequestOp final
const uint32_t mObjectStoreId;
RefPtr<Database> mDatabase;
const OptionalKeyRange mOptionalKeyRange;
AutoTArray<StructuredCloneReadInfo, 1> mResponse;
AutoFallibleTArray<StructuredCloneReadInfo, 1> mResponse;
PBackgroundParent* mBackgroundParent;
const uint32_t mLimit;
const bool mGetAll;
@ -8208,7 +8211,7 @@ class IndexGetRequestOp final
RefPtr<Database> mDatabase;
const OptionalKeyRange mOptionalKeyRange;
AutoTArray<StructuredCloneReadInfo, 1> mResponse;
AutoFallibleTArray<StructuredCloneReadInfo, 1> mResponse;
PBackgroundParent* mBackgroundParent;
const uint32_t mLimit;
const bool mGetAll;
@ -8235,7 +8238,7 @@ class IndexGetKeyRequestOp final
friend class TransactionBase;
const OptionalKeyRange mOptionalKeyRange;
AutoTArray<Key, 1> mResponse;
AutoFallibleTArray<Key, 1> mResponse;
const uint32_t mLimit;
const bool mGetAll;
@ -16349,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.
AutoTArray<nsString, 20> subdirsToProcess;
nsAutoTArray<nsString, 20> subdirsToProcess;
nsTArray<nsCOMPtr<nsIFile>> unknownFiles;
nsTHashtable<nsStringHashKey> validSubdirs(20);
AutoTArray<FileManagerInitInfo, 20> initInfos;
nsAutoTArray<FileManagerInitInfo, 20> initInfos;
nsCOMPtr<nsISimpleEnumerator> entries;
rv = directory->GetDirectoryEntries(getter_AddRefs(entries));
@ -18199,7 +18202,7 @@ DatabaseOperationBase::GetStructuredCloneReadInfoFromBlob(
return NS_ERROR_FILE_CORRUPTED;
}
AutoTArray<uint8_t, 512> uncompressed;
AutoFallibleTArray<uint8_t, 512> uncompressed;
if (NS_WARN_IF(!uncompressed.SetLength(uncompressedLength, fallible))) {
return NS_ERROR_OUT_OF_MEMORY;
}
@ -18214,7 +18217,7 @@ DatabaseOperationBase::GetStructuredCloneReadInfoFromBlob(
aInfo->mData.SwapElements(uncompressed);
if (!aFileIds.IsVoid()) {
AutoTArray<int64_t, 10> array;
nsAutoTArray<int64_t, 10> array;
nsresult rv = ConvertFileIdsToArray(aFileIds, array);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
@ -18400,7 +18403,7 @@ nsresult
DatabaseOperationBase::IndexDataValuesFromUpdateInfos(
const nsTArray<IndexUpdateInfo>& aUpdateInfos,
const UniqueIndexTable& aUniqueIndexTable,
nsTArray<IndexDataValue>& aIndexValues)
FallibleTArray<IndexDataValue>& aIndexValues)
{
MOZ_ASSERT(aIndexValues.IsEmpty());
MOZ_ASSERT_IF(!aUpdateInfos.IsEmpty(), aUniqueIndexTable.Count());
@ -18720,7 +18723,7 @@ DatabaseOperationBase::DeleteObjectStoreDataTableRowsWithIndexes(
}
DatabaseConnection::CachedStatement deleteStmt;
AutoTArray<IndexDataValue, 32> indexValues;
AutoFallibleTArray<IndexDataValue, 32> indexValues;
DebugOnly<uint32_t> resultCountDEBUG = 0;
@ -23341,7 +23344,7 @@ UpdateIndexDataValuesFunction::OnFunctionCall(mozIStorageValueArray* aValues,
const IndexMetadata& metadata = mOp->mMetadata;
const int64_t& objectStoreId = mOp->mObjectStoreId;
AutoTArray<IndexUpdateInfo, 32> updateInfos;
nsAutoTArray<IndexUpdateInfo, 32> updateInfos;
rv = IDBObjectStore::AppendIndexUpdateInfo(metadata.id(),
metadata.keyPath(),
metadata.unique(),
@ -23407,7 +23410,7 @@ UpdateIndexDataValuesFunction::OnFunctionCall(mozIStorageValueArray* aValues,
return rv;
}
AutoTArray<IndexDataValue, 32> indexValues;
AutoFallibleTArray<IndexDataValue, 32> indexValues;
rv = ReadCompressedIndexDataValues(aValues, 1, indexValues);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
@ -23506,9 +23509,10 @@ DeleteIndexOp::DeleteIndexOp(VersionChangeTransaction* aTransaction,
}
nsresult
DeleteIndexOp::RemoveReferencesToIndex(DatabaseConnection* aConnection,
const Key& aObjectStoreKey,
nsTArray<IndexDataValue>& aIndexValues)
DeleteIndexOp::RemoveReferencesToIndex(
DatabaseConnection* aConnection,
const Key& aObjectStoreKey,
FallibleTArray<IndexDataValue>& aIndexValues)
{
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(!IsOnBackgroundThread());
@ -23763,7 +23767,7 @@ DeleteIndexOp::DoDatabaseWork(DatabaseConnection* aConnection)
DatabaseConnection::CachedStatement nullIndexDataValuesStmt;
Key lastObjectStoreKey;
AutoTArray<IndexDataValue, 32> lastIndexValues;
AutoFallibleTArray<IndexDataValue, 32> lastIndexValues;
bool hasResult;
while (NS_SUCCEEDED(rv = selectStmt->ExecuteStep(&hasResult)) && hasResult) {
@ -24107,7 +24111,7 @@ ObjectStoreAddOrPutRequestOp::RemoveOldIndexDataValues(
}
if (hasResult) {
AutoTArray<IndexDataValue, 32> existingIndexValues;
AutoFallibleTArray<IndexDataValue, 32> existingIndexValues;
rv = ReadCompressedIndexDataValues(indexValuesStmt,
0,
existingIndexValues);
@ -24635,7 +24639,7 @@ ObjectStoreAddOrPutRequestOp::DoDatabaseWork(DatabaseConnection* aConnection)
MOZ_ASSERT(mUniqueIndexTable.isSome());
// Write the index_data_values column.
AutoTArray<IndexDataValue, 32> indexValues;
AutoFallibleTArray<IndexDataValue, 32> indexValues;
rv = IndexDataValuesFromUpdateInfos(mParams.indexUpdateInfos(),
mUniqueIndexTable.ref(),
indexValues);

View File

@ -667,7 +667,7 @@ IDBDatabase::Transaction(const StringOrStringSequence& aStoreNames,
return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
}
AutoTArray<nsString, 1> stackSequence;
nsAutoTArray<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 AutoTArray<RefPtr<IDBTransaction>, 20> StrongTransactionArray;
typedef AutoTArray<IDBTransaction*, 20> WeakTransactionArray;
typedef nsAutoTArray<RefPtr<IDBTransaction>, 20> StrongTransactionArray;
typedef nsAutoTArray<IDBTransaction*, 20> WeakTransactionArray;
public:
static void

View File

@ -470,7 +470,7 @@ Key::EncodeLocaleString(const nsDependentString& aString, uint8_t aTypeOffset,
}
MOZ_ASSERT(collator);
AutoTArray<uint8_t, 128> keyBuffer;
nsAutoTArray<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)
{
AutoTArray<ContentParent*, 16> cps;
nsAutoTArray<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());
AutoTArray<ContentParent*, 8> processes;
nsAutoTArray<ContentParent*, 8> processes;
GetAll(processes);
if (processes.IsEmpty()) {
printf_stderr("There are no live subprocesses.");
@ -5145,7 +5145,7 @@ ContentParent::IgnoreIPCPrincipal()
void
ContentParent::NotifyUpdatedDictionaries()
{
AutoTArray<ContentParent*, 8> processes;
nsAutoTArray<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 AutoTArray.
AutoTArray<RefPtr<ContentParent>, 4> mSpareProcesses;
// should be enough so we don't need to grow the nsAutoTArray.
nsAutoTArray<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.
AutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
nsAutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
mCachedFileDescriptorInfos;
nscolor mLastBackgroundColor;
bool mDidFakeShow;
@ -734,7 +734,7 @@ private:
CSSSize mUnscaledInnerSize;
bool mDidSetRealShowInfo;
AutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
nsAutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
};

View File

@ -1496,9 +1496,9 @@ bool
TabParent::RecvRequestNativeKeyBindings(const WidgetKeyboardEvent& aEvent,
MaybeNativeKeyBinding* aBindings)
{
AutoTArray<mozilla::CommandInt, 4> singleLine;
AutoTArray<mozilla::CommandInt, 4> multiLine;
AutoTArray<mozilla::CommandInt, 4> richText;
AutoInfallibleTArray<mozilla::CommandInt, 4> singleLine;
AutoInfallibleTArray<mozilla::CommandInt, 4> multiLine;
AutoInfallibleTArray<mozilla::CommandInt, 4> richText;
*aBindings = mozilla::void_t();
@ -1710,9 +1710,9 @@ bool TabParent::SendRealKeyEvent(WidgetKeyboardEvent& event)
if (event.mMessage == eKeyPress) {
nsCOMPtr<nsIWidget> widget = GetWidget();
AutoTArray<mozilla::CommandInt, 4> singleLine;
AutoTArray<mozilla::CommandInt, 4> multiLine;
AutoTArray<mozilla::CommandInt, 4> richText;
AutoInfallibleTArray<mozilla::CommandInt, 4> singleLine;
AutoInfallibleTArray<mozilla::CommandInt, 4> multiLine;
AutoInfallibleTArray<mozilla::CommandInt, 4> richText;
widget->ExecuteNativeKeyBinding(nsIWidget::NativeKeyBindingsForSingleLineEditor,
event, DoCommandCallback, &singleLine);

View File

@ -102,8 +102,8 @@ AudioCaptureStream::MixerCallback(AudioDataValue* aMixedBuffer,
AudioSampleFormat aFormat, uint32_t aChannels,
uint32_t aFrames, uint32_t aSampleRate)
{
AutoTArray<nsTArray<AudioDataValue>, MONO> output;
AutoTArray<const AudioDataValue*, MONO> bufferPtrs;
nsAutoTArray<nsTArray<AudioDataValue>, MONO> output;
nsAutoTArray<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)
{
AutoTArray<AudioDataValue, SilentChannel::AUDIO_PROCESSING_FRAMES* GUESS_AUDIO_CHANNELS>
nsAutoTArray<AudioDataValue, SilentChannel::AUDIO_PROCESSING_FRAMES* GUESS_AUDIO_CHANNELS>
buf;
AutoTArray<const AudioDataValue*, GUESS_AUDIO_CHANNELS> channelData;
nsAutoTArray<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.
AutoTArray<AudioDataValue*, GUESS_AUDIO_CHANNELS> outChannelPtrs;
nsAutoTArray<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)
{
AutoTArray<AudioDataValue,SilentChannel::AUDIO_PROCESSING_FRAMES*GUESS_AUDIO_CHANNELS> buf;
nsAutoTArray<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 {
AutoTArray<SrcT*,GUESS_AUDIO_CHANNELS> outputChannelData;
AutoTArray<SrcT, SilentChannel::AUDIO_PROCESSING_FRAMES * GUESS_AUDIO_CHANNELS> outputBuffers;
nsAutoTArray<SrcT*,GUESS_AUDIO_CHANNELS> outputChannelData;
nsAutoTArray<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()) {
AutoTArray<nsTArray<T>, GUESS_AUDIO_CHANNELS> output;
AutoTArray<const T*, GUESS_AUDIO_CHANNELS> bufferPtrs;
nsAutoTArray<nsTArray<T>, GUESS_AUDIO_CHANNELS> output;
nsAutoTArray<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)
{
AutoTArray<const SrcT*,GUESS_AUDIO_CHANNELS> channelData;
nsAutoTArray<const SrcT*,GUESS_AUDIO_CHANNELS> channelData;
channelData = aChunk.ChannelData<SrcT>();

View File

@ -113,7 +113,7 @@ public:
}
}
private:
AutoTArray<Chunk, 7> mChunks;
nsAutoTArray<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");
AutoTArray<uint8_t, 1024*2> buf;
nsAutoTArray<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.
AutoTArray<AudioDataValue, 1000> buf;
nsAutoTArray<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.
AutoTArray<RefPtr<TrackPort>, 2> mOwnedTracks;
nsAutoTArray<RefPtr<TrackPort>, 2> mOwnedTracks;
// MediaStreamTracks corresponding to tracks in our mPlaybackStream.
AutoTArray<RefPtr<TrackPort>, 2> mTracks;
nsAutoTArray<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.
//AutoTArray<int32_t, 8> mChangeIndexList;
//nsAutoTArray<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)
{
AutoTArray<StreamAndPromiseForOperation, 1> array;
nsAutoTArray<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. */
AutoTArray<StreamAndPromiseForOperation, 1> mPromisesForOperation;
nsAutoTArray<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 AutoTArray<ElemType,4> ContainerType;
typedef nsAutoTArray<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.
AutoTArray<uint32_t,8> candidates;
nsAutoTArray<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.
AutoTArray<StreamAction,10> actions;
nsAutoTArray<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));
AutoTArray<bool,2> audioOutputStreamsFound;
nsAutoTArray<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.
AutoTArray<ImageContainer::NonOwningImage,4> newImages;
nsAutoTArray<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;
AutoTArray<ImageContainer::NonOwningImage,4> images;
nsAutoTArray<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.
AutoTArray<ImageContainer::OwningImage,4> previousImages;
nsAutoTArray<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;
}
AutoTArray<bool,8> mappedTracksFinished;
AutoTArray<bool,8> mappedTracksWithMatchingInputTracks;
nsAutoTArray<bool,8> mappedTracksFinished;
nsAutoTArray<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);
AutoTArray<ImageContainer::NonOwningImage,1> imageList;
nsAutoTArray<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.
AutoTArray<AudioDataValue, 9600> pcm;
nsAutoTArray<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) {
AutoTArray<AudioDataValue, 9600> resamplingDest;
nsAutoTArray<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: {
AutoTArray<const int16_t*, 2> array;
nsAutoTArray<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: {
AutoTArray<const float*, 2> array;
nsAutoTArray<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;
AutoTArray<AudioDataValue, 9600> interleavedPcm;
AutoTArray<AudioDataValue, 9600> nonInterleavedPcm;
nsAutoTArray<AudioDataValue, 9600> interleavedPcm;
nsAutoTArray<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)
{
AutoTArray<uint8_t, 16> kid;
nsAutoTArray<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;
}
AutoTArray<const AudioDataValue*,1> channelData;
nsAutoTArray<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());
AutoTArray<const AudioDataValue*, 2> channels;
nsAutoTArray<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;
AutoTArray<RefPtr<MediaData>,10> audio;
nsAutoTArray<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;
AutoTArray<RefPtr<MediaData>, 10> video;
nsAutoTArray<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();
AutoTArray<RefPtr<MediaData>,16> frames;
nsAutoTArray<RefPtr<MediaData>,16> frames;
VideoQueue().GetFirstElements(aMaxFrames, &frames);
if (frames.IsEmpty() || !mContainer) {
return;
}
AutoTArray<ImageContainer::NonOwningImage,16> images;
nsAutoTArray<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.
AutoTArray<uint32_t, 2> tracks;
nsAutoTArray<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;
AutoTArray<OggCodecState*,4> bitstreams;
nsAutoTArray<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.
AutoTArray<uint32_t, 2> tracks;
nsAutoTArray<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.
AutoTArray<SeekRange, 16> ranges;
nsAutoTArray<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.
AutoTArray<AudioDataValue, 9600> pcm;
nsAutoTArray<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) {
AutoTArray<AudioDataValue, 9600> pcm;
nsAutoTArray<AudioDataValue, 9600> pcm;
pcm.SetLength(bytesToCopy);
AudioTrackEncoder::InterleaveTrackData(aSource, aSamplesNum,
mOMXAEncoder.mChannels,

View File

@ -71,8 +71,8 @@ VorbisDataDecoder::Init()
PodZero(&mVorbisDsp);
PodZero(&mVorbisBlock);
AutoTArray<unsigned char*,4> headers;
AutoTArray<size_t,4> headerLens;
nsAutoTArray<unsigned char*,4> headers;
nsAutoTArray<size_t,4> headerLens;
if (!XiphExtradataToHeaders(headers, headerLens,
mInfo.mCodecSpecificConfig->Elements(),
mInfo.mCodecSpecificConfig->Length())) {

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