mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj
This commit is contained in:
parent
daf45d50c3
commit
9bed3781f9
@ -759,7 +759,7 @@ getAttributesCB(AtkObject *aAtkObj)
|
|||||||
if (!proxy)
|
if (!proxy)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
nsAutoTArray<Attribute, 10> attrs;
|
AutoTArray<Attribute, 10> attrs;
|
||||||
proxy->Attributes(&attrs);
|
proxy->Attributes(&attrs);
|
||||||
if (attrs.IsEmpty())
|
if (attrs.IsEmpty())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -1019,7 +1019,7 @@ refRelationSetCB(AtkObject *aAtkObj)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
size_t targetCount = targetSets[i].Length();
|
size_t targetCount = targetSets[i].Length();
|
||||||
nsAutoTArray<AtkObject*, 5> wrappers;
|
AutoTArray<AtkObject*, 5> wrappers;
|
||||||
for (size_t j = 0; j < targetCount; j++)
|
for (size_t j = 0; j < targetCount; j++)
|
||||||
wrappers.AppendElement(GetWrapperFor(targetSets[i][j]));
|
wrappers.AppendElement(GetWrapperFor(targetSets[i][j]));
|
||||||
|
|
||||||
@ -1664,7 +1664,7 @@ AccessibleWrap::GetColumnHeader(TableAccessible* aAccessible, int32_t aColIdx)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<Accessible*, 10> headerCells;
|
AutoTArray<Accessible*, 10> headerCells;
|
||||||
tableCell->ColHeaderCells(&headerCells);
|
tableCell->ColHeaderCells(&headerCells);
|
||||||
if (headerCells.IsEmpty()) {
|
if (headerCells.IsEmpty()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -1698,7 +1698,7 @@ AccessibleWrap::GetRowHeader(TableAccessible* aAccessible, int32_t aRowIdx)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<Accessible*, 10> headerCells;
|
AutoTArray<Accessible*, 10> headerCells;
|
||||||
tableCell->RowHeaderCells(&headerCells);
|
tableCell->RowHeaderCells(&headerCells);
|
||||||
if (headerCells.IsEmpty()) {
|
if (headerCells.IsEmpty()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -273,7 +273,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
|
|||||||
{
|
{
|
||||||
*aSelected = nullptr;
|
*aSelected = nullptr;
|
||||||
|
|
||||||
nsAutoTArray<uint32_t, 10> cols;
|
AutoTArray<uint32_t, 10> cols;
|
||||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||||
if (accWrap) {
|
if (accWrap) {
|
||||||
accWrap->AsTable()->SelectedColIndices(&cols);
|
accWrap->AsTable()->SelectedColIndices(&cols);
|
||||||
@ -300,7 +300,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
|
|||||||
static gint
|
static gint
|
||||||
getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
|
getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
|
||||||
{
|
{
|
||||||
nsAutoTArray<uint32_t, 10> rows;
|
AutoTArray<uint32_t, 10> rows;
|
||||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
||||||
if (accWrap) {
|
if (accWrap) {
|
||||||
accWrap->AsTable()->SelectedRowIndices(&rows);
|
accWrap->AsTable()->SelectedRowIndices(&rows);
|
||||||
|
@ -311,7 +311,7 @@ getRunAttributesCB(AtkText *aText, gint aOffset,
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<Attribute, 10> attrs;
|
AutoTArray<Attribute, 10> attrs;
|
||||||
proxy->TextAttributes(false, aOffset, &attrs, &startOffset, &endOffset);
|
proxy->TextAttributes(false, aOffset, &attrs, &startOffset, &endOffset);
|
||||||
*aStartOffset = startOffset;
|
*aStartOffset = startOffset;
|
||||||
*aEndOffset = endOffset;
|
*aEndOffset = endOffset;
|
||||||
@ -337,7 +337,7 @@ getDefaultAttributesCB(AtkText *aText)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<Attribute, 10> attrs;
|
AutoTArray<Attribute, 10> attrs;
|
||||||
proxy->DefaultTextAttributes(&attrs);
|
proxy->DefaultTextAttributes(&attrs);
|
||||||
return ConvertToAtkTextAttributeSet(attrs);
|
return ConvertToAtkTextAttributeSet(attrs);
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ protected:
|
|||||||
DocAccessible* mDocument;
|
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.
|
* SwapElements() on it.
|
||||||
*/
|
*/
|
||||||
nsTArray<RefPtr<AccEvent> > mEvents;
|
nsTArray<RefPtr<AccEvent> > mEvents;
|
||||||
|
@ -282,7 +282,7 @@ private:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A pending accessible tree update notifications for content insertions.
|
* 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;
|
nsTArray<RefPtr<ContentInsertion> > mContentInsertions;
|
||||||
|
|
||||||
@ -316,7 +316,7 @@ private:
|
|||||||
nsTHashtable<nsCOMPtrHashKey<nsIContent> > mTextHash;
|
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.
|
* use SwapElements() on it.
|
||||||
*/
|
*/
|
||||||
nsTArray<RefPtr<Notification> > mNotifications;
|
nsTArray<RefPtr<Notification> > mNotifications;
|
||||||
|
@ -17,7 +17,7 @@ inline Accessible*
|
|||||||
TextRange::Container() const
|
TextRange::Container() const
|
||||||
{
|
{
|
||||||
uint32_t pos1 = 0, pos2 = 0;
|
uint32_t pos1 = 0, pos2 = 0;
|
||||||
nsAutoTArray<Accessible*, 30> parents1, parents2;
|
AutoTArray<Accessible*, 30> parents1, parents2;
|
||||||
return CommonParent(mStartContainer, mEndContainer,
|
return CommonParent(mStartContainer, mEndContainer,
|
||||||
&parents1, &pos1, &parents2, &pos2);
|
&parents1, &pos1, &parents2, &pos2);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ TextPoint::operator <(const TextPoint& aPoint) const
|
|||||||
// Build the chain of parents
|
// Build the chain of parents
|
||||||
Accessible* p1 = mContainer;
|
Accessible* p1 = mContainer;
|
||||||
Accessible* p2 = aPoint.mContainer;
|
Accessible* p2 = aPoint.mContainer;
|
||||||
nsAutoTArray<Accessible*, 30> parents1, parents2;
|
AutoTArray<Accessible*, 30> parents1, parents2;
|
||||||
do {
|
do {
|
||||||
parents1.AppendElement(p1);
|
parents1.AppendElement(p1);
|
||||||
p1 = p1->Parent();
|
p1 = p1->Parent();
|
||||||
@ -76,7 +76,7 @@ TextRange::EmbeddedChildren(nsTArray<Accessible*>* aChildren) const
|
|||||||
Accessible* p2 = mEndContainer->GetChildAtOffset(mEndOffset);
|
Accessible* p2 = mEndContainer->GetChildAtOffset(mEndOffset);
|
||||||
|
|
||||||
uint32_t pos1 = 0, pos2 = 0;
|
uint32_t pos1 = 0, pos2 = 0;
|
||||||
nsAutoTArray<Accessible*, 30> parents1, parents2;
|
AutoTArray<Accessible*, 30> parents1, parents2;
|
||||||
Accessible* container =
|
Accessible* container =
|
||||||
CommonParent(p1, p2, &parents1, &pos1, &parents2, &pos2);
|
CommonParent(p1, p2, &parents1, &pos1, &parents2, &pos2);
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ bool
|
|||||||
TextRange::Crop(Accessible* aContainer)
|
TextRange::Crop(Accessible* aContainer)
|
||||||
{
|
{
|
||||||
uint32_t boundaryPos = 0, containerPos = 0;
|
uint32_t boundaryPos = 0, containerPos = 0;
|
||||||
nsAutoTArray<Accessible*, 30> boundaryParents, containerParents;
|
AutoTArray<Accessible*, 30> boundaryParents, containerParents;
|
||||||
|
|
||||||
// Crop the start boundary.
|
// Crop the start boundary.
|
||||||
Accessible* container = nullptr;
|
Accessible* container = nullptr;
|
||||||
|
@ -87,7 +87,7 @@ private:
|
|||||||
DocAccessible* mDoc;
|
DocAccessible* mDoc;
|
||||||
Accessible* mContext;
|
Accessible* mContext;
|
||||||
nsIContent* mAnchorNode;
|
nsIContent* mAnchorNode;
|
||||||
nsAutoTArray<ChildrenIterator, 20> mStateStack;
|
AutoTArray<ChildrenIterator, 20> mStateStack;
|
||||||
int32_t mChildFilter;
|
int32_t mChildFilter;
|
||||||
uint32_t mFlags;
|
uint32_t mFlags;
|
||||||
};
|
};
|
||||||
|
@ -1048,7 +1048,7 @@ DocAccessibleChild::RecvColHeaderCells(const uint64_t& aID,
|
|||||||
{
|
{
|
||||||
TableCellAccessible* acc = IdToTableCellAccessible(aID);
|
TableCellAccessible* acc = IdToTableCellAccessible(aID);
|
||||||
if (acc) {
|
if (acc) {
|
||||||
nsAutoTArray<Accessible*, 10> headerCells;
|
AutoTArray<Accessible*, 10> headerCells;
|
||||||
acc->ColHeaderCells(&headerCells);
|
acc->ColHeaderCells(&headerCells);
|
||||||
aCells->SetCapacity(headerCells.Length());
|
aCells->SetCapacity(headerCells.Length());
|
||||||
for (uint32_t i = 0; i < headerCells.Length(); ++i) {
|
for (uint32_t i = 0; i < headerCells.Length(); ++i) {
|
||||||
@ -1066,7 +1066,7 @@ DocAccessibleChild::RecvRowHeaderCells(const uint64_t& aID,
|
|||||||
{
|
{
|
||||||
TableCellAccessible* acc = IdToTableCellAccessible(aID);
|
TableCellAccessible* acc = IdToTableCellAccessible(aID);
|
||||||
if (acc) {
|
if (acc) {
|
||||||
nsAutoTArray<Accessible*, 10> headerCells;
|
AutoTArray<Accessible*, 10> headerCells;
|
||||||
acc->RowHeaderCells(&headerCells);
|
acc->RowHeaderCells(&headerCells);
|
||||||
aCells->SetCapacity(headerCells.Length());
|
aCells->SetCapacity(headerCells.Length());
|
||||||
for (uint32_t i = 0; i < headerCells.Length(); ++i) {
|
for (uint32_t i = 0; i < headerCells.Length(); ++i) {
|
||||||
@ -1368,7 +1368,7 @@ DocAccessibleChild::RecvTableSelectedCells(const uint64_t& aID,
|
|||||||
{
|
{
|
||||||
TableAccessible* acc = IdToTableAccessible(aID);
|
TableAccessible* acc = IdToTableAccessible(aID);
|
||||||
if (acc) {
|
if (acc) {
|
||||||
nsAutoTArray<Accessible*, 30> cells;
|
AutoTArray<Accessible*, 30> cells;
|
||||||
acc->SelectedCells(&cells);
|
acc->SelectedCells(&cells);
|
||||||
aCellIDs->SetCapacity(cells.Length());
|
aCellIDs->SetCapacity(cells.Length());
|
||||||
for (uint32_t i = 0; i < cells.Length(); ++i) {
|
for (uint32_t i = 0; i < cells.Length(); ++i) {
|
||||||
@ -1529,7 +1529,7 @@ DocAccessibleChild::RecvSelectedItems(const uint64_t& aID,
|
|||||||
{
|
{
|
||||||
Accessible* acc = IdToAccessibleSelect(aID);
|
Accessible* acc = IdToAccessibleSelect(aID);
|
||||||
if (acc) {
|
if (acc) {
|
||||||
nsAutoTArray<Accessible*, 10> selectedItems;
|
AutoTArray<Accessible*, 10> selectedItems;
|
||||||
acc->SelectedItems(&selectedItems);
|
acc->SelectedItems(&selectedItems);
|
||||||
aSelectedItemIDs->SetCapacity(selectedItems.Length());
|
aSelectedItemIDs->SetCapacity(selectedItems.Length());
|
||||||
for (size_t i = 0; i < selectedItems.Length(); ++i) {
|
for (size_t i = 0; i < selectedItems.Length(); ++i) {
|
||||||
|
@ -778,7 +778,7 @@ ProxyAccessible::TableSelectedRowCount()
|
|||||||
void
|
void
|
||||||
ProxyAccessible::TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs)
|
ProxyAccessible::TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs)
|
||||||
{
|
{
|
||||||
nsAutoTArray<uint64_t, 30> cellIDs;
|
AutoTArray<uint64_t, 30> cellIDs;
|
||||||
Unused << mDoc->SendTableSelectedCells(mID, &cellIDs);
|
Unused << mDoc->SendTableSelectedCells(mID, &cellIDs);
|
||||||
aCellIDs->SetCapacity(cellIDs.Length());
|
aCellIDs->SetCapacity(cellIDs.Length());
|
||||||
for (uint32_t i = 0; i < cellIDs.Length(); ++i) {
|
for (uint32_t i = 0; i < cellIDs.Length(); ++i) {
|
||||||
@ -857,7 +857,7 @@ ProxyAccessible::AtkTableRowHeader(int32_t aRow)
|
|||||||
void
|
void
|
||||||
ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems)
|
ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems)
|
||||||
{
|
{
|
||||||
nsAutoTArray<uint64_t, 10> itemIDs;
|
AutoTArray<uint64_t, 10> itemIDs;
|
||||||
Unused << mDoc->SendSelectedItems(mID, &itemIDs);
|
Unused << mDoc->SendSelectedItems(mID, &itemIDs);
|
||||||
aSelectedItems->SetCapacity(itemIDs.Length());
|
aSelectedItems->SetCapacity(itemIDs.Length());
|
||||||
for (size_t i = 0; i < itemIDs.Length(); ++i) {
|
for (size_t i = 0; i < itemIDs.Length(); ++i) {
|
||||||
|
@ -420,7 +420,7 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
|||||||
nsCOMPtr<nsIPersistentProperties> attributes = accWrap->Attributes();
|
nsCOMPtr<nsIPersistentProperties> attributes = accWrap->Attributes();
|
||||||
nsAccUtils::GetAccAttr(attributes, nsGkAtoms::linethickness_, thickness);
|
nsAccUtils::GetAccAttr(attributes, nsGkAtoms::linethickness_, thickness);
|
||||||
} else {
|
} else {
|
||||||
nsAutoTArray<Attribute, 10> attrs;
|
AutoTArray<Attribute, 10> attrs;
|
||||||
proxy->Attributes(&attrs);
|
proxy->Attributes(&attrs);
|
||||||
for (size_t i = 0 ; i < attrs.Length() ; i++) {
|
for (size_t i = 0 ; i < attrs.Length() ; i++) {
|
||||||
if (attrs.ElementAt(i).Name() == "thickness") {
|
if (attrs.ElementAt(i).Name() == "thickness") {
|
||||||
@ -684,11 +684,11 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
|||||||
|
|
||||||
// get the array of children.
|
// get the array of children.
|
||||||
if (accWrap) {
|
if (accWrap) {
|
||||||
nsAutoTArray<Accessible*, 10> childrenArray;
|
AutoTArray<Accessible*, 10> childrenArray;
|
||||||
accWrap->GetUnignoredChildren(&childrenArray);
|
accWrap->GetUnignoredChildren(&childrenArray);
|
||||||
mChildren = ConvertToNSArray(childrenArray);
|
mChildren = ConvertToNSArray(childrenArray);
|
||||||
} else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
|
} else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
|
||||||
nsAutoTArray<ProxyAccessible*, 10> childrenArray;
|
AutoTArray<ProxyAccessible*, 10> childrenArray;
|
||||||
GetProxyUnignoredChildren(proxy, &childrenArray);
|
GetProxyUnignoredChildren(proxy, &childrenArray);
|
||||||
mChildren = ConvertToNSArray(childrenArray);
|
mChildren = ConvertToNSArray(childrenArray);
|
||||||
}
|
}
|
||||||
|
@ -207,12 +207,12 @@
|
|||||||
return [NSValue valueWithRange:NSMakeRange(cell->ColIdx(),
|
return [NSValue valueWithRange:NSMakeRange(cell->ColIdx(),
|
||||||
cell->ColExtent())];
|
cell->ColExtent())];
|
||||||
if ([attribute isEqualToString:NSAccessibilityRowHeaderUIElementsAttribute]) {
|
if ([attribute isEqualToString:NSAccessibilityRowHeaderUIElementsAttribute]) {
|
||||||
nsAutoTArray<Accessible*, 10> headerCells;
|
AutoTArray<Accessible*, 10> headerCells;
|
||||||
cell->RowHeaderCells(&headerCells);
|
cell->RowHeaderCells(&headerCells);
|
||||||
return ConvertToNSArray(headerCells);
|
return ConvertToNSArray(headerCells);
|
||||||
}
|
}
|
||||||
if ([attribute isEqualToString:NSAccessibilityColumnHeaderUIElementsAttribute]) {
|
if ([attribute isEqualToString:NSAccessibilityColumnHeaderUIElementsAttribute]) {
|
||||||
nsAutoTArray<Accessible*, 10> headerCells;
|
AutoTArray<Accessible*, 10> headerCells;
|
||||||
cell->ColHeaderCells(&headerCells);
|
cell->ColHeaderCells(&headerCells);
|
||||||
return ConvertToNSArray(headerCells);
|
return ConvertToNSArray(headerCells);
|
||||||
}
|
}
|
||||||
|
@ -768,7 +768,7 @@ ia2Accessible::get_selectionRanges(IA2Range** aRanges,
|
|||||||
if (acc->IsDefunct())
|
if (acc->IsDefunct())
|
||||||
return CO_E_OBJNOTCONNECTED;
|
return CO_E_OBJNOTCONNECTED;
|
||||||
|
|
||||||
nsAutoTArray<TextRange, 1> ranges;
|
AutoTArray<TextRange, 1> ranges;
|
||||||
acc->Document()->SelectionRanges(&ranges);
|
acc->Document()->SelectionRanges(&ranges);
|
||||||
uint32_t len = ranges.Length();
|
uint32_t len = ranges.Length();
|
||||||
for (uint32_t idx = 0; idx < len; idx++) {
|
for (uint32_t idx = 0; idx < len; idx++) {
|
||||||
|
@ -371,7 +371,7 @@ ia2AccessibleTable::get_selectedChildren(long aMaxChildren, long** aChildren,
|
|||||||
if (!mTable)
|
if (!mTable)
|
||||||
return CO_E_OBJNOTCONNECTED;
|
return CO_E_OBJNOTCONNECTED;
|
||||||
|
|
||||||
nsAutoTArray<uint32_t, 30> cellIndices;
|
AutoTArray<uint32_t, 30> cellIndices;
|
||||||
mTable->SelectedCellIndices(&cellIndices);
|
mTable->SelectedCellIndices(&cellIndices);
|
||||||
|
|
||||||
uint32_t maxCells = cellIndices.Length();
|
uint32_t maxCells = cellIndices.Length();
|
||||||
@ -663,7 +663,7 @@ ia2AccessibleTable::get_selectedCells(IUnknown*** aCells, long* aNSelectedCells)
|
|||||||
if (!mTable)
|
if (!mTable)
|
||||||
return CO_E_OBJNOTCONNECTED;
|
return CO_E_OBJNOTCONNECTED;
|
||||||
|
|
||||||
nsAutoTArray<Accessible*, 30> cells;
|
AutoTArray<Accessible*, 30> cells;
|
||||||
mTable->SelectedCells(&cells);
|
mTable->SelectedCells(&cells);
|
||||||
if (cells.IsEmpty())
|
if (cells.IsEmpty())
|
||||||
return S_FALSE;
|
return S_FALSE;
|
||||||
@ -699,7 +699,7 @@ ia2AccessibleTable::get_selectedColumns(long** aColumns, long* aNColumns)
|
|||||||
if (!mTable)
|
if (!mTable)
|
||||||
return CO_E_OBJNOTCONNECTED;
|
return CO_E_OBJNOTCONNECTED;
|
||||||
|
|
||||||
nsAutoTArray<uint32_t, 30> colIndices;
|
AutoTArray<uint32_t, 30> colIndices;
|
||||||
mTable->SelectedColIndices(&colIndices);
|
mTable->SelectedColIndices(&colIndices);
|
||||||
|
|
||||||
uint32_t maxCols = colIndices.Length();
|
uint32_t maxCols = colIndices.Length();
|
||||||
@ -729,7 +729,7 @@ ia2AccessibleTable::get_selectedRows(long** aRows, long* aNRows)
|
|||||||
if (!mTable)
|
if (!mTable)
|
||||||
return CO_E_OBJNOTCONNECTED;
|
return CO_E_OBJNOTCONNECTED;
|
||||||
|
|
||||||
nsAutoTArray<uint32_t, 30> rowIndices;
|
AutoTArray<uint32_t, 30> rowIndices;
|
||||||
mTable->SelectedRowIndices(&rowIndices);
|
mTable->SelectedRowIndices(&rowIndices);
|
||||||
|
|
||||||
uint32_t maxRows = rowIndices.Length();
|
uint32_t maxRows = rowIndices.Length();
|
||||||
|
@ -100,7 +100,7 @@ ia2AccessibleTableCell::get_columnHeaderCells(IUnknown*** aCellAccessibles,
|
|||||||
if (!mTableCell)
|
if (!mTableCell)
|
||||||
return CO_E_OBJNOTCONNECTED;
|
return CO_E_OBJNOTCONNECTED;
|
||||||
|
|
||||||
nsAutoTArray<Accessible*, 10> cells;
|
AutoTArray<Accessible*, 10> cells;
|
||||||
mTableCell->ColHeaderCells(&cells);
|
mTableCell->ColHeaderCells(&cells);
|
||||||
|
|
||||||
*aNColumnHeaderCells = cells.Length();
|
*aNColumnHeaderCells = cells.Length();
|
||||||
@ -172,7 +172,7 @@ ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles,
|
|||||||
if (!mTableCell)
|
if (!mTableCell)
|
||||||
return CO_E_OBJNOTCONNECTED;
|
return CO_E_OBJNOTCONNECTED;
|
||||||
|
|
||||||
nsAutoTArray<Accessible*, 10> cells;
|
AutoTArray<Accessible*, 10> cells;
|
||||||
mTableCell->RowHeaderCells(&cells);
|
mTableCell->RowHeaderCells(&cells);
|
||||||
|
|
||||||
*aNRowHeaderCells = cells.Length();
|
*aNRowHeaderCells = cells.Length();
|
||||||
|
@ -61,7 +61,7 @@ ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset,
|
|||||||
int32_t startOffset = 0, endOffset = 0;
|
int32_t startOffset = 0, endOffset = 0;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
|
if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
|
||||||
nsAutoTArray<Attribute, 10> attrs;
|
AutoTArray<Attribute, 10> attrs;
|
||||||
proxy->TextAttributes(true, aOffset, &attrs, &startOffset, &endOffset);
|
proxy->TextAttributes(true, aOffset, &attrs, &startOffset, &endOffset);
|
||||||
hr = AccessibleWrap::ConvertToIA2Attributes(&attrs, aTextAttributes);
|
hr = AccessibleWrap::ConvertToIA2Attributes(&attrs, aTextAttributes);
|
||||||
} else {
|
} else {
|
||||||
|
@ -834,7 +834,7 @@ AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren)
|
|||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
|
|
||||||
if (IsSelect()) {
|
if (IsSelect()) {
|
||||||
nsAutoTArray<Accessible*, 10> selectedItems;
|
AutoTArray<Accessible*, 10> selectedItems;
|
||||||
if (IsProxy()) {
|
if (IsProxy()) {
|
||||||
nsTArray<ProxyAccessible*> proxies;
|
nsTArray<ProxyAccessible*> proxies;
|
||||||
Proxy()->SelectedItems(&proxies);
|
Proxy()->SelectedItems(&proxies);
|
||||||
|
@ -371,7 +371,7 @@ xpcAccessibleHyperText::GetSelectionRanges(nsIArray** aRanges)
|
|||||||
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
|
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoTArray<TextRange, 1> ranges;
|
AutoTArray<TextRange, 1> ranges;
|
||||||
Intl()->SelectionRanges(&ranges);
|
Intl()->SelectionRanges(&ranges);
|
||||||
uint32_t len = ranges.Length();
|
uint32_t len = ranges.Length();
|
||||||
for (uint32_t idx = 0; idx < len; idx++)
|
for (uint32_t idx = 0; idx < len; idx++)
|
||||||
|
@ -21,7 +21,7 @@ xpcAccessibleSelectable::GetSelectedItems(nsIArray** aSelectedItems)
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
NS_PRECONDITION(Intl()->IsSelect(), "Called on non selectable widget!");
|
NS_PRECONDITION(Intl()->IsSelect(), "Called on non selectable widget!");
|
||||||
|
|
||||||
nsAutoTArray<Accessible*, 10> items;
|
AutoTArray<Accessible*, 10> items;
|
||||||
Intl()->SelectedItems(&items);
|
Intl()->SelectedItems(&items);
|
||||||
|
|
||||||
uint32_t itemCount = items.Length();
|
uint32_t itemCount = items.Length();
|
||||||
|
@ -273,7 +273,7 @@ xpcAccessibleTable::GetSelectedCells(nsIArray** aSelectedCells)
|
|||||||
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
|
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray;
|
AutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray;
|
||||||
Intl()->SelectedCells(&cellsArray);
|
Intl()->SelectedCells(&cellsArray);
|
||||||
|
|
||||||
uint32_t totalCount = cellsArray.Length();
|
uint32_t totalCount = cellsArray.Length();
|
||||||
@ -299,7 +299,7 @@ xpcAccessibleTable::GetSelectedCellIndices(uint32_t* aCellsArraySize,
|
|||||||
if (!Intl())
|
if (!Intl())
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> cellsArray;
|
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> cellsArray;
|
||||||
Intl()->SelectedCellIndices(&cellsArray);
|
Intl()->SelectedCellIndices(&cellsArray);
|
||||||
|
|
||||||
*aCellsArraySize = cellsArray.Length();
|
*aCellsArraySize = cellsArray.Length();
|
||||||
@ -324,7 +324,7 @@ xpcAccessibleTable::GetSelectedColumnIndices(uint32_t* aColsArraySize,
|
|||||||
if (!Intl())
|
if (!Intl())
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> colsArray;
|
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> colsArray;
|
||||||
Intl()->SelectedColIndices(&colsArray);
|
Intl()->SelectedColIndices(&colsArray);
|
||||||
|
|
||||||
*aColsArraySize = colsArray.Length();
|
*aColsArraySize = colsArray.Length();
|
||||||
@ -349,7 +349,7 @@ xpcAccessibleTable::GetSelectedRowIndices(uint32_t* aRowsArraySize,
|
|||||||
if (!Intl())
|
if (!Intl())
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> rowsArray;
|
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> rowsArray;
|
||||||
Intl()->SelectedRowIndices(&rowsArray);
|
Intl()->SelectedRowIndices(&rowsArray);
|
||||||
|
|
||||||
*aRowsArraySize = rowsArray.Length();
|
*aRowsArraySize = rowsArray.Length();
|
||||||
|
@ -108,7 +108,7 @@ xpcAccessibleTableCell::GetColumnHeaderCells(nsIArray** aHeaderCells)
|
|||||||
if (!Intl())
|
if (!Intl())
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
nsAutoTArray<Accessible*, 10> headerCells;
|
AutoTArray<Accessible*, 10> headerCells;
|
||||||
Intl()->ColHeaderCells(&headerCells);
|
Intl()->ColHeaderCells(&headerCells);
|
||||||
|
|
||||||
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||||
@ -132,7 +132,7 @@ xpcAccessibleTableCell::GetRowHeaderCells(nsIArray** aHeaderCells)
|
|||||||
if (!Intl())
|
if (!Intl())
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
nsAutoTArray<Accessible*, 10> headerCells;
|
AutoTArray<Accessible*, 10> headerCells;
|
||||||
Intl()->RowHeaderCells(&headerCells);
|
Intl()->RowHeaderCells(&headerCells);
|
||||||
|
|
||||||
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||||
|
@ -1688,7 +1688,7 @@ nsDocShell::FirePageHideNotification(bool aIsUnload)
|
|||||||
mTiming->NotifyUnloadEventEnd();
|
mTiming->NotifyUnloadEventEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<nsCOMPtr<nsIDocShell>, 8> kids;
|
AutoTArray<nsCOMPtr<nsIDocShell>, 8> kids;
|
||||||
uint32_t n = mChildList.Length();
|
uint32_t n = mChildList.Length();
|
||||||
kids.SetCapacity(n);
|
kids.SetCapacity(n);
|
||||||
for (uint32_t i = 0; i < n; i++) {
|
for (uint32_t i = 0; i < n; i++) {
|
||||||
@ -4396,7 +4396,7 @@ nsDocShell::RemoveFromSessionHistory()
|
|||||||
|
|
||||||
int32_t index = 0;
|
int32_t index = 0;
|
||||||
sessionHistory->GetIndex(&index);
|
sessionHistory->GetIndex(&index);
|
||||||
nsAutoTArray<uint64_t, 16> ids;
|
AutoTArray<uint64_t, 16> ids;
|
||||||
ids.AppendElement(mHistoryID);
|
ids.AppendElement(mHistoryID);
|
||||||
internalHistory->RemoveEntries(ids, index);
|
internalHistory->RemoveEntries(ids, index);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -4487,7 +4487,7 @@ nsDocShell::ClearFrameHistory(nsISHEntry* aEntry)
|
|||||||
|
|
||||||
int32_t count = 0;
|
int32_t count = 0;
|
||||||
shcontainer->GetChildCount(&count);
|
shcontainer->GetChildCount(&count);
|
||||||
nsAutoTArray<uint64_t, 16> ids;
|
AutoTArray<uint64_t, 16> ids;
|
||||||
for (int32_t i = 0; i < count; ++i) {
|
for (int32_t i = 0; i < count; ++i) {
|
||||||
nsCOMPtr<nsISHEntry> child;
|
nsCOMPtr<nsISHEntry> child;
|
||||||
shcontainer->GetChildAt(i, getter_AddRefs(child));
|
shcontainer->GetChildAt(i, getter_AddRefs(child));
|
||||||
|
@ -1405,7 +1405,7 @@ nsSHistory::RemoveDynEntries(int32_t aOldIndex, int32_t aNewIndex)
|
|||||||
nsCOMPtr<nsISHEntry> originalSH;
|
nsCOMPtr<nsISHEntry> originalSH;
|
||||||
GetEntryAtIndex(aOldIndex, false, getter_AddRefs(originalSH));
|
GetEntryAtIndex(aOldIndex, false, getter_AddRefs(originalSH));
|
||||||
nsCOMPtr<nsISHContainer> originalContainer = do_QueryInterface(originalSH);
|
nsCOMPtr<nsISHContainer> originalContainer = do_QueryInterface(originalSH);
|
||||||
nsAutoTArray<uint64_t, 16> toBeRemovedEntries;
|
AutoTArray<uint64_t, 16> toBeRemovedEntries;
|
||||||
if (originalContainer) {
|
if (originalContainer) {
|
||||||
nsTArray<uint64_t> originalDynDocShellIDs;
|
nsTArray<uint64_t> originalDynDocShellIDs;
|
||||||
GetDynamicChildren(originalContainer, originalDynDocShellIDs, true);
|
GetDynamicChildren(originalContainer, originalDynDocShellIDs, true);
|
||||||
|
@ -578,7 +578,7 @@ EffectCompositor::GetOverriddenProperties(nsStyleContext* aStyleContext,
|
|||||||
nsCSSPropertySet&
|
nsCSSPropertySet&
|
||||||
aPropertiesOverridden)
|
aPropertiesOverridden)
|
||||||
{
|
{
|
||||||
nsAutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
|
AutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
|
||||||
{
|
{
|
||||||
nsCSSPropertySet propertiesToTrackAsSet;
|
nsCSSPropertySet propertiesToTrackAsSet;
|
||||||
for (KeyframeEffectReadOnly* effect : aEffectSet) {
|
for (KeyframeEffectReadOnly* effect : aEffectSet) {
|
||||||
|
@ -1355,7 +1355,7 @@ BuildAnimationPropertyListFromKeyframeSequence(
|
|||||||
{
|
{
|
||||||
// Convert the object in aIterator to sequence<Keyframe>, producing
|
// Convert the object in aIterator to sequence<Keyframe>, producing
|
||||||
// an array of OffsetIndexedKeyframe objects.
|
// an array of OffsetIndexedKeyframe objects.
|
||||||
nsAutoTArray<OffsetIndexedKeyframe,4> keyframes;
|
AutoTArray<OffsetIndexedKeyframe,4> keyframes;
|
||||||
if (!ConvertKeyframeSequence(aCx, aIterator, keyframes)) {
|
if (!ConvertKeyframeSequence(aCx, aIterator, keyframes)) {
|
||||||
aRv.Throw(NS_ERROR_FAILURE);
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
return;
|
return;
|
||||||
|
@ -267,7 +267,7 @@ template <typename T> void GetDataFromMatrix(const DOMMatrixReadOnly* aMatrix, T
|
|||||||
void
|
void
|
||||||
DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle<JSObject*> aResult, ErrorResult& aRv) const
|
DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle<JSObject*> aResult, ErrorResult& aRv) const
|
||||||
{
|
{
|
||||||
nsAutoTArray<float, 16> arr;
|
AutoTArray<float, 16> arr;
|
||||||
arr.SetLength(16);
|
arr.SetLength(16);
|
||||||
GetDataFromMatrix(this, arr.Elements());
|
GetDataFromMatrix(this, arr.Elements());
|
||||||
JS::Rooted<JS::Value> value(aCx);
|
JS::Rooted<JS::Value> value(aCx);
|
||||||
@ -281,7 +281,7 @@ DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle<JSObject*> a
|
|||||||
void
|
void
|
||||||
DOMMatrixReadOnly::ToFloat64Array(JSContext* aCx, JS::MutableHandle<JSObject*> aResult, ErrorResult& aRv) const
|
DOMMatrixReadOnly::ToFloat64Array(JSContext* aCx, JS::MutableHandle<JSObject*> aResult, ErrorResult& aRv) const
|
||||||
{
|
{
|
||||||
nsAutoTArray<double, 16> arr;
|
AutoTArray<double, 16> arr;
|
||||||
arr.SetLength(16);
|
arr.SetLength(16);
|
||||||
GetDataFromMatrix(this, arr.Elements());
|
GetDataFromMatrix(this, arr.Elements());
|
||||||
JS::Rooted<JS::Value> value(aCx);
|
JS::Rooted<JS::Value> value(aCx);
|
||||||
|
@ -259,7 +259,7 @@ Blob::ToFile()
|
|||||||
already_AddRefed<File>
|
already_AddRefed<File>
|
||||||
Blob::ToFile(const nsAString& aName, ErrorResult& aRv) const
|
Blob::ToFile(const nsAString& aName, ErrorResult& aRv) const
|
||||||
{
|
{
|
||||||
nsAutoTArray<RefPtr<BlobImpl>, 1> blobImpls;
|
AutoTArray<RefPtr<BlobImpl>, 1> blobImpls;
|
||||||
blobImpls.AppendElement(mImpl);
|
blobImpls.AppendElement(mImpl);
|
||||||
|
|
||||||
nsAutoString contentType;
|
nsAutoString contentType;
|
||||||
|
@ -308,7 +308,7 @@ nsIContent::GetBaseURI(bool aTryUseXHRDocBaseURI) const
|
|||||||
// faster for the far more common case of there not being any such
|
// faster for the far more common case of there not being any such
|
||||||
// attributes.
|
// attributes.
|
||||||
// Also check for SVG elements which require special handling
|
// Also check for SVG elements which require special handling
|
||||||
nsAutoTArray<nsString, 5> baseAttrs;
|
AutoTArray<nsString, 5> baseAttrs;
|
||||||
nsString attr;
|
nsString attr;
|
||||||
const nsIContent *elem = this;
|
const nsIContent *elem = this;
|
||||||
do {
|
do {
|
||||||
@ -1328,7 +1328,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsAutoTArray<nsCOMPtr<nsIContent>,
|
AutoTArray<nsCOMPtr<nsIContent>,
|
||||||
SUBTREE_UNBINDINGS_PER_RUNNABLE> mSubtreeRoots;
|
SUBTREE_UNBINDINGS_PER_RUNNABLE> mSubtreeRoots;
|
||||||
RefPtr<ContentUnbinder> mNext;
|
RefPtr<ContentUnbinder> mNext;
|
||||||
ContentUnbinder* mLast;
|
ContentUnbinder* mLast;
|
||||||
@ -1528,11 +1528,11 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode)
|
|||||||
|
|
||||||
// nodesToUnpurple contains nodes which will be removed
|
// nodesToUnpurple contains nodes which will be removed
|
||||||
// from the purple buffer if the DOM tree is black.
|
// 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
|
// grayNodes need script traverse, so they aren't removed from
|
||||||
// the purple buffer, but are marked to be in black subtree so that
|
// the purple buffer, but are marked to be in black subtree so that
|
||||||
// traverse is faster.
|
// traverse is faster.
|
||||||
nsAutoTArray<nsINode*, 1020> grayNodes;
|
AutoTArray<nsINode*, 1020> grayNodes;
|
||||||
|
|
||||||
bool foundBlack = root->IsBlack();
|
bool foundBlack = root->IsBlack();
|
||||||
if (root != currentDoc) {
|
if (root != currentDoc) {
|
||||||
@ -1598,8 +1598,8 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode)
|
|||||||
return !NeedsScriptTraverse(aNode);
|
return !NeedsScriptTraverse(aNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<nsINode*, 1020>* gPurpleRoots = nullptr;
|
AutoTArray<nsINode*, 1020>* gPurpleRoots = nullptr;
|
||||||
nsAutoTArray<nsIContent*, 1020>* gNodesToUnbind = nullptr;
|
AutoTArray<nsIContent*, 1020>* gNodesToUnbind = nullptr;
|
||||||
|
|
||||||
void ClearCycleCollectorCleanupData()
|
void ClearCycleCollectorCleanupData()
|
||||||
{
|
{
|
||||||
@ -1702,7 +1702,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
|
|||||||
|
|
||||||
// nodesToClear contains nodes which are either purple or
|
// nodesToClear contains nodes which are either purple or
|
||||||
// gray.
|
// gray.
|
||||||
nsAutoTArray<nsIContent*, 1020> nodesToClear;
|
AutoTArray<nsIContent*, 1020> nodesToClear;
|
||||||
|
|
||||||
bool foundBlack = root->IsBlack();
|
bool foundBlack = root->IsBlack();
|
||||||
bool domOnlyCycle = false;
|
bool domOnlyCycle = false;
|
||||||
@ -1751,7 +1751,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
|
|||||||
root->SetIsPurpleRoot(true);
|
root->SetIsPurpleRoot(true);
|
||||||
if (domOnlyCycle) {
|
if (domOnlyCycle) {
|
||||||
if (!gNodesToUnbind) {
|
if (!gNodesToUnbind) {
|
||||||
gNodesToUnbind = new nsAutoTArray<nsIContent*, 1020>();
|
gNodesToUnbind = new AutoTArray<nsIContent*, 1020>();
|
||||||
}
|
}
|
||||||
gNodesToUnbind->AppendElement(static_cast<nsIContent*>(root));
|
gNodesToUnbind->AppendElement(static_cast<nsIContent*>(root));
|
||||||
for (uint32_t i = 0; i < nodesToClear.Length(); ++i) {
|
for (uint32_t i = 0; i < nodesToClear.Length(); ++i) {
|
||||||
@ -1763,7 +1763,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (!gPurpleRoots) {
|
if (!gPurpleRoots) {
|
||||||
gPurpleRoots = new nsAutoTArray<nsINode*, 1020>();
|
gPurpleRoots = new AutoTArray<nsINode*, 1020>();
|
||||||
}
|
}
|
||||||
gPurpleRoots->AppendElement(root);
|
gPurpleRoots->AppendElement(root);
|
||||||
}
|
}
|
||||||
|
@ -871,7 +871,7 @@ Navigator::RemoveIdleObserver(MozIdleObserver& aIdleObserver, ErrorResult& aRv)
|
|||||||
bool
|
bool
|
||||||
Navigator::Vibrate(uint32_t aDuration)
|
Navigator::Vibrate(uint32_t aDuration)
|
||||||
{
|
{
|
||||||
nsAutoTArray<uint32_t, 1> pattern;
|
AutoTArray<uint32_t, 1> pattern;
|
||||||
pattern.AppendElement(aDuration);
|
pattern.AppendElement(aDuration);
|
||||||
return Vibrate(pattern);
|
return Vibrate(pattern);
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ protected:
|
|||||||
nsCOMPtr<nsINode> mCommonParent;
|
nsCOMPtr<nsINode> mCommonParent;
|
||||||
|
|
||||||
// used by nsContentIterator to cache indices
|
// 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
|
// used by nsSubtreeIterator to cache indices. Why put them in the base
|
||||||
// class? Because otherwise I have to duplicate the routines GetNextSibling
|
// 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
|
// We can be at ANY node in the sequence. Need to regenerate the array of
|
||||||
// indexes back to the root or common parent!
|
// indexes back to the root or common parent!
|
||||||
nsAutoTArray<nsINode*, 8> oldParentStack;
|
AutoTArray<nsINode*, 8> oldParentStack;
|
||||||
nsAutoTArray<int32_t, 8> newIndexes;
|
AutoTArray<int32_t, 8> newIndexes;
|
||||||
|
|
||||||
// Get a list of the parents up to the root, then compare the new node with
|
// 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
|
// entries in that array until we find a match (lowest common ancestor). If
|
||||||
@ -1213,8 +1213,8 @@ protected:
|
|||||||
RefPtr<nsRange> mRange;
|
RefPtr<nsRange> mRange;
|
||||||
|
|
||||||
// these arrays all typically are used and have elements
|
// these arrays all typically are used and have elements
|
||||||
nsAutoTArray<nsIContent*, 8> mEndNodes;
|
AutoTArray<nsIContent*, 8> mEndNodes;
|
||||||
nsAutoTArray<int32_t, 8> mEndOffsets;
|
AutoTArray<int32_t, 8> mEndOffsets;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_ADDREF_INHERITED(nsContentSubtreeIterator, nsContentIterator)
|
NS_IMPL_ADDREF_INHERITED(nsContentSubtreeIterator, nsContentIterator)
|
||||||
|
@ -548,7 +548,7 @@ nsContentList::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
|
|||||||
|
|
||||||
BringSelfUpToDate(true);
|
BringSelfUpToDate(true);
|
||||||
|
|
||||||
nsAutoTArray<nsIAtom*, 8> atoms;
|
AutoTArray<nsIAtom*, 8> atoms;
|
||||||
for (uint32_t i = 0; i < mElements.Length(); ++i) {
|
for (uint32_t i = 0; i < mElements.Length(); ++i) {
|
||||||
nsIContent *content = mElements.ElementAt(i);
|
nsIContent *content = mElements.ElementAt(i);
|
||||||
if (content->HasID()) {
|
if (content->HasID()) {
|
||||||
|
@ -2286,7 +2286,7 @@ nsContentUtils::GetCommonAncestor(nsINode* aNode1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build the chain of parents
|
// Build the chain of parents
|
||||||
nsAutoTArray<nsINode*, 30> parents1, parents2;
|
AutoTArray<nsINode*, 30> parents1, parents2;
|
||||||
do {
|
do {
|
||||||
parents1.AppendElement(aNode1);
|
parents1.AppendElement(aNode1);
|
||||||
aNode1 = aNode1->GetParentNode();
|
aNode1 = aNode1->GetParentNode();
|
||||||
@ -2335,7 +2335,7 @@ nsContentUtils::ComparePoints(nsINode* aParent1, int32_t aOffset1,
|
|||||||
0;
|
0;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<nsINode*, 32> parents1, parents2;
|
AutoTArray<nsINode*, 32> parents1, parents2;
|
||||||
nsINode* node1 = aParent1;
|
nsINode* node1 = aParent1;
|
||||||
nsINode* node2 = aParent2;
|
nsINode* node2 = aParent2;
|
||||||
do {
|
do {
|
||||||
@ -4287,7 +4287,7 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
|
|||||||
return frag.forget();
|
return frag.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<nsString, 32> tagStack;
|
AutoTArray<nsString, 32> tagStack;
|
||||||
nsAutoString uriStr, nameStr;
|
nsAutoString uriStr, nameStr;
|
||||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aContextNode);
|
nsCOMPtr<nsIContent> content = do_QueryInterface(aContextNode);
|
||||||
// just in case we have a text node
|
// just in case we have a text node
|
||||||
@ -6853,7 +6853,7 @@ nsContentUtils::FireMutationEventsForDirectParsing(nsIDocument* aDoc,
|
|||||||
int32_t newChildCount = aDest->GetChildCount();
|
int32_t newChildCount = aDest->GetChildCount();
|
||||||
if (newChildCount && nsContentUtils::
|
if (newChildCount && nsContentUtils::
|
||||||
HasMutationListeners(aDoc, NS_EVENT_BITS_MUTATION_NODEINSERTED)) {
|
HasMutationListeners(aDoc, NS_EVENT_BITS_MUTATION_NODEINSERTED)) {
|
||||||
nsAutoTArray<nsCOMPtr<nsIContent>, 50> childNodes;
|
AutoTArray<nsCOMPtr<nsIContent>, 50> childNodes;
|
||||||
NS_ASSERTION(newChildCount - aOldChildCount >= 0,
|
NS_ASSERTION(newChildCount - aOldChildCount >= 0,
|
||||||
"What, some unexpected dom mutation has happened?");
|
"What, some unexpected dom mutation has happened?");
|
||||||
childNodes.SetCapacity(newChildCount - aOldChildCount);
|
childNodes.SetCapacity(newChildCount - aOldChildCount);
|
||||||
@ -7920,7 +7920,7 @@ nsContentUtils::FirePageHideEvent(nsIDocShellTreeItem* aItem,
|
|||||||
|
|
||||||
int32_t childCount = 0;
|
int32_t childCount = 0;
|
||||||
aItem->GetChildCount(&childCount);
|
aItem->GetChildCount(&childCount);
|
||||||
nsAutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
|
AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
|
||||||
kids.AppendElements(childCount);
|
kids.AppendElements(childCount);
|
||||||
for (int32_t i = 0; i < childCount; ++i) {
|
for (int32_t i = 0; i < childCount; ++i) {
|
||||||
aItem->GetChildAt(i, getter_AddRefs(kids[i]));
|
aItem->GetChildAt(i, getter_AddRefs(kids[i]));
|
||||||
@ -7945,7 +7945,7 @@ nsContentUtils::FirePageShowEvent(nsIDocShellTreeItem* aItem,
|
|||||||
{
|
{
|
||||||
int32_t childCount = 0;
|
int32_t childCount = 0;
|
||||||
aItem->GetChildCount(&childCount);
|
aItem->GetChildCount(&childCount);
|
||||||
nsAutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
|
AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
|
||||||
kids.AppendElements(childCount);
|
kids.AppendElements(childCount);
|
||||||
for (int32_t i = 0; i < childCount; ++i) {
|
for (int32_t i = 0; i < childCount; ++i) {
|
||||||
aItem->GetChildAt(i, getter_AddRefs(kids[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;
|
nsAutoPtr<StringBuilder> mNext;
|
||||||
StringBuilder* mLast;
|
StringBuilder* mLast;
|
||||||
// mLength is used only in the first StringBuilder object in the linked list.
|
// mLength is used only in the first StringBuilder object in the linked list.
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
using mozilla::dom::TreeOrderComparator;
|
using mozilla::dom::TreeOrderComparator;
|
||||||
using mozilla::dom::Animation;
|
using mozilla::dom::Animation;
|
||||||
|
|
||||||
nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
|
AutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
|
||||||
nsDOMMutationObserver::sScheduledMutationObservers = nullptr;
|
nsDOMMutationObserver::sScheduledMutationObservers = nullptr;
|
||||||
|
|
||||||
nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr;
|
nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr;
|
||||||
@ -30,7 +30,7 @@ nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr;
|
|||||||
uint32_t nsDOMMutationObserver::sMutationLevel = 0;
|
uint32_t nsDOMMutationObserver::sMutationLevel = 0;
|
||||||
uint64_t nsDOMMutationObserver::sCount = 0;
|
uint64_t nsDOMMutationObserver::sCount = 0;
|
||||||
|
|
||||||
nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
|
AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
|
||||||
nsDOMMutationObserver::sCurrentlyHandlingObservers = nullptr;
|
nsDOMMutationObserver::sCurrentlyHandlingObservers = nullptr;
|
||||||
|
|
||||||
nsINodeList*
|
nsINodeList*
|
||||||
@ -585,7 +585,7 @@ void
|
|||||||
nsDOMMutationObserver::RescheduleForRun()
|
nsDOMMutationObserver::RescheduleForRun()
|
||||||
{
|
{
|
||||||
if (!sScheduledMutationObservers) {
|
if (!sScheduledMutationObservers) {
|
||||||
sScheduledMutationObservers = new nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
|
sScheduledMutationObservers = new AutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool didInsert = false;
|
bool didInsert = false;
|
||||||
@ -882,7 +882,7 @@ nsDOMMutationObserver::HandleMutationsInternal()
|
|||||||
nsTArray<RefPtr<nsDOMMutationObserver> >* suppressedObservers = nullptr;
|
nsTArray<RefPtr<nsDOMMutationObserver> >* suppressedObservers = nullptr;
|
||||||
|
|
||||||
while (sScheduledMutationObservers) {
|
while (sScheduledMutationObservers) {
|
||||||
nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>* observers =
|
AutoTArray<RefPtr<nsDOMMutationObserver>, 4>* observers =
|
||||||
sScheduledMutationObservers;
|
sScheduledMutationObservers;
|
||||||
sScheduledMutationObservers = nullptr;
|
sScheduledMutationObservers = nullptr;
|
||||||
for (uint32_t i = 0; i < observers->Length(); ++i) {
|
for (uint32_t i = 0; i < observers->Length(); ++i) {
|
||||||
@ -995,7 +995,7 @@ nsDOMMutationObserver::AddCurrentlyHandlingObserver(nsDOMMutationObserver* aObse
|
|||||||
|
|
||||||
if (!sCurrentlyHandlingObservers) {
|
if (!sCurrentlyHandlingObservers) {
|
||||||
sCurrentlyHandlingObservers =
|
sCurrentlyHandlingObservers =
|
||||||
new nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
|
new AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (sCurrentlyHandlingObservers->Length() < aMutationLevel) {
|
while (sCurrentlyHandlingObservers->Length() < aMutationLevel) {
|
||||||
|
@ -605,7 +605,7 @@ protected:
|
|||||||
nsClassHashtable<nsISupportsHashKey,
|
nsClassHashtable<nsISupportsHashKey,
|
||||||
nsCOMArray<nsMutationReceiver> > mTransientReceivers;
|
nsCOMArray<nsMutationReceiver> > mTransientReceivers;
|
||||||
// MutationRecords which are being constructed.
|
// 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
|
// MutationRecords which will be handed to the callback at the end of
|
||||||
// the microtask.
|
// the microtask.
|
||||||
RefPtr<nsDOMMutationRecord> mFirstPendingMutation;
|
RefPtr<nsDOMMutationRecord> mFirstPendingMutation;
|
||||||
@ -621,11 +621,11 @@ protected:
|
|||||||
uint64_t mId;
|
uint64_t mId;
|
||||||
|
|
||||||
static uint64_t sCount;
|
static uint64_t sCount;
|
||||||
static nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>* sScheduledMutationObservers;
|
static AutoTArray<RefPtr<nsDOMMutationObserver>, 4>* sScheduledMutationObservers;
|
||||||
static nsDOMMutationObserver* sCurrentObserver;
|
static nsDOMMutationObserver* sCurrentObserver;
|
||||||
|
|
||||||
static uint32_t sMutationLevel;
|
static uint32_t sMutationLevel;
|
||||||
static nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
|
static AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
|
||||||
sCurrentlyHandlingObservers;
|
sCurrentlyHandlingObservers;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -740,7 +740,7 @@ private:
|
|||||||
|
|
||||||
static nsAutoMutationBatch* sCurrentBatch;
|
static nsAutoMutationBatch* sCurrentBatch;
|
||||||
nsAutoMutationBatch* mPreviousBatch;
|
nsAutoMutationBatch* mPreviousBatch;
|
||||||
nsAutoTArray<BatchObserver, 2> mObservers;
|
AutoTArray<BatchObserver, 2> mObservers;
|
||||||
nsTArray<nsCOMPtr<nsIContent> > mRemovedNodes;
|
nsTArray<nsCOMPtr<nsIContent> > mRemovedNodes;
|
||||||
nsTArray<nsCOMPtr<nsIContent> > mAddedNodes;
|
nsTArray<nsCOMPtr<nsIContent> > mAddedNodes;
|
||||||
nsINode* mBatchTarget;
|
nsINode* mBatchTarget;
|
||||||
@ -907,7 +907,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
static nsAutoAnimationMutationBatch* sCurrentBatch;
|
static nsAutoAnimationMutationBatch* sCurrentBatch;
|
||||||
nsAutoTArray<nsDOMMutationObserver*, 2> mObservers;
|
AutoTArray<nsDOMMutationObserver*, 2> mObservers;
|
||||||
typedef nsTArray<Entry> EntryArray;
|
typedef nsTArray<Entry> EntryArray;
|
||||||
nsClassHashtable<nsPtrHashKey<nsINode>, EntryArray> mEntryTable;
|
nsClassHashtable<nsPtrHashKey<nsINode>, EntryArray> mEntryTable;
|
||||||
// List of nodes referred to by mEntryTable so we can sort them
|
// List of nodes referred to by mEntryTable so we can sort them
|
||||||
|
@ -134,7 +134,7 @@ nsDOMTokenList::AddInternal(const nsAttrValue* aAttr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool oneWasAdded = false;
|
bool oneWasAdded = false;
|
||||||
nsAutoTArray<nsString, 10> addedClasses;
|
AutoTArray<nsString, 10> addedClasses;
|
||||||
|
|
||||||
for (uint32_t i = 0, l = aTokens.Length(); i < l; ++i) {
|
for (uint32_t i = 0, l = aTokens.Length(); i < l; ++i) {
|
||||||
const nsString& aToken = aTokens[i];
|
const nsString& aToken = aTokens[i];
|
||||||
@ -175,7 +175,7 @@ nsDOMTokenList::Add(const nsTArray<nsString>& aTokens, ErrorResult& aError)
|
|||||||
void
|
void
|
||||||
nsDOMTokenList::Add(const nsAString& aToken, mozilla::ErrorResult& aError)
|
nsDOMTokenList::Add(const nsAString& aToken, mozilla::ErrorResult& aError)
|
||||||
{
|
{
|
||||||
nsAutoTArray<nsString, 1> tokens;
|
AutoTArray<nsString, 1> tokens;
|
||||||
tokens.AppendElement(aToken);
|
tokens.AppendElement(aToken);
|
||||||
Add(tokens, aError);
|
Add(tokens, aError);
|
||||||
}
|
}
|
||||||
@ -261,7 +261,7 @@ nsDOMTokenList::Remove(const nsTArray<nsString>& aTokens, ErrorResult& aError)
|
|||||||
void
|
void
|
||||||
nsDOMTokenList::Remove(const nsAString& aToken, mozilla::ErrorResult& aError)
|
nsDOMTokenList::Remove(const nsAString& aToken, mozilla::ErrorResult& aError)
|
||||||
{
|
{
|
||||||
nsAutoTArray<nsString, 1> tokens;
|
AutoTArray<nsString, 1> tokens;
|
||||||
tokens.AppendElement(aToken);
|
tokens.AppendElement(aToken);
|
||||||
Remove(tokens, aError);
|
Remove(tokens, aError);
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ nsDOMTokenList::Toggle(const nsAString& aToken,
|
|||||||
const bool forceOff = aForce.WasPassed() && !aForce.Value();
|
const bool forceOff = aForce.WasPassed() && !aForce.Value();
|
||||||
|
|
||||||
bool isPresent = attr && attr->Contains(aToken);
|
bool isPresent = attr && attr->Contains(aToken);
|
||||||
nsAutoTArray<nsString, 1> tokens;
|
AutoTArray<nsString, 1> tokens;
|
||||||
(*tokens.AppendElement()).Rebind(aToken.Data(), aToken.Length());
|
(*tokens.AppendElement()).Rebind(aToken.Data(), aToken.Length());
|
||||||
|
|
||||||
if (isPresent) {
|
if (isPresent) {
|
||||||
|
@ -3294,7 +3294,7 @@ nsDocument::ElementFromPointHelper(float aX, float aY,
|
|||||||
bool aIgnoreRootScrollFrame,
|
bool aIgnoreRootScrollFrame,
|
||||||
bool aFlushLayout)
|
bool aFlushLayout)
|
||||||
{
|
{
|
||||||
nsAutoTArray<RefPtr<Element>, 1> elementArray;
|
AutoTArray<RefPtr<Element>, 1> elementArray;
|
||||||
ElementsFromPointHelper(aX, aY,
|
ElementsFromPointHelper(aX, aY,
|
||||||
((aIgnoreRootScrollFrame ? nsIDocument::IGNORE_ROOT_SCROLL_FRAME : 0) |
|
((aIgnoreRootScrollFrame ? nsIDocument::IGNORE_ROOT_SCROLL_FRAME : 0) |
|
||||||
(aFlushLayout ? nsIDocument::FLUSH_LAYOUT : 0) |
|
(aFlushLayout ? nsIDocument::FLUSH_LAYOUT : 0) |
|
||||||
@ -3416,7 +3416,7 @@ nsDocument::NodesFromRectHelper(float aX, float aY,
|
|||||||
if (!rootFrame)
|
if (!rootFrame)
|
||||||
return NS_OK; // return nothing to premature XUL callers as a reminder to wait
|
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::GetFramesForArea(rootFrame, rect, outFrames,
|
||||||
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC |
|
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC |
|
||||||
(aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
|
(aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
|
||||||
@ -11238,7 +11238,7 @@ nsDocument::RestorePreviousFullScreenState()
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIDocument> fullScreenDoc = GetFullscreenLeaf(this);
|
nsCOMPtr<nsIDocument> fullScreenDoc = GetFullscreenLeaf(this);
|
||||||
nsAutoTArray<nsDocument*, 8> exitDocs;
|
AutoTArray<nsDocument*, 8> exitDocs;
|
||||||
|
|
||||||
nsIDocument* doc = fullScreenDoc;
|
nsIDocument* doc = fullScreenDoc;
|
||||||
// Collect all subdocuments.
|
// Collect all subdocuments.
|
||||||
@ -11855,7 +11855,7 @@ nsDocument::ApplyFullscreen(const FullscreenRequest& aRequest)
|
|||||||
// order, but we traverse the doctree in a leaf-to-root order, so we save
|
// 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
|
// references to the documents we must dispatch to so that we get the order
|
||||||
// as specified.
|
// as specified.
|
||||||
nsAutoTArray<nsIDocument*, 8> changed;
|
AutoTArray<nsIDocument*, 8> changed;
|
||||||
|
|
||||||
// Remember the root document, so that if a full-screen document is hidden
|
// 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.
|
// we can reset full-screen state in the remaining visible full-screen documents.
|
||||||
|
@ -162,11 +162,11 @@ protected:
|
|||||||
uint32_t mEndDepth;
|
uint32_t mEndDepth;
|
||||||
int32_t mStartRootIndex;
|
int32_t mStartRootIndex;
|
||||||
int32_t mEndRootIndex;
|
int32_t mEndRootIndex;
|
||||||
nsAutoTArray<nsINode*, 8> mCommonAncestors;
|
AutoTArray<nsINode*, 8> mCommonAncestors;
|
||||||
nsAutoTArray<nsIContent*, 8> mStartNodes;
|
AutoTArray<nsIContent*, 8> mStartNodes;
|
||||||
nsAutoTArray<int32_t, 8> mStartOffsets;
|
AutoTArray<int32_t, 8> mStartOffsets;
|
||||||
nsAutoTArray<nsIContent*, 8> mEndNodes;
|
AutoTArray<nsIContent*, 8> mEndNodes;
|
||||||
nsAutoTArray<int32_t, 8> mEndOffsets;
|
AutoTArray<int32_t, 8> mEndOffsets;
|
||||||
bool mHaltRangeHint;
|
bool mHaltRangeHint;
|
||||||
// Used when context has already been serialized for
|
// Used when context has already been serialized for
|
||||||
// table cell selections (where parent is <tr>)
|
// table cell selections (where parent is <tr>)
|
||||||
|
@ -1370,7 +1370,7 @@ nsFocusManager::GetCommonAncestor(nsPIDOMWindowOuter* aWindow1,
|
|||||||
nsCOMPtr<nsIDocShellTreeItem> dsti2 = aWindow2->GetDocShell();
|
nsCOMPtr<nsIDocShellTreeItem> dsti2 = aWindow2->GetDocShell();
|
||||||
NS_ENSURE_TRUE(dsti2, nullptr);
|
NS_ENSURE_TRUE(dsti2, nullptr);
|
||||||
|
|
||||||
nsAutoTArray<nsIDocShellTreeItem*, 30> parents1, parents2;
|
AutoTArray<nsIDocShellTreeItem*, 30> parents1, parents2;
|
||||||
do {
|
do {
|
||||||
parents1.AppendElement(dsti1);
|
parents1.AppendElement(dsti1);
|
||||||
nsCOMPtr<nsIDocShellTreeItem> parentDsti1;
|
nsCOMPtr<nsIDocShellTreeItem> parentDsti1;
|
||||||
|
@ -399,7 +399,7 @@ protected:
|
|||||||
bool InitChildGlobalInternal(nsISupports* aScope, const nsACString& aID);
|
bool InitChildGlobalInternal(nsISupports* aScope, const nsACString& aID);
|
||||||
nsCOMPtr<nsIXPConnectJSObjectHolder> mGlobal;
|
nsCOMPtr<nsIXPConnectJSObjectHolder> mGlobal;
|
||||||
nsCOMPtr<nsIPrincipal> mPrincipal;
|
nsCOMPtr<nsIPrincipal> mPrincipal;
|
||||||
nsAutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;
|
AutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;
|
||||||
|
|
||||||
static nsDataHashtable<nsStringHashKey, nsMessageManagerScriptHolder*>* sCachedScripts;
|
static nsDataHashtable<nsStringHashKey, nsMessageManagerScriptHolder*>* sCachedScripts;
|
||||||
static nsScriptCacheCleaner* sScriptCacheCleaner;
|
static nsScriptCacheCleaner* sScriptCacheCleaner;
|
||||||
|
@ -1830,7 +1830,7 @@ public:
|
|||||||
return mObservers;
|
return mObservers;
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
nsAutoTArray< nsCOMPtr<nsIObserver>, 8 > mObservers;
|
AutoTArray< nsCOMPtr<nsIObserver>, 8 > mObservers;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -595,7 +595,7 @@ void
|
|||||||
nsINode::Normalize()
|
nsINode::Normalize()
|
||||||
{
|
{
|
||||||
// First collect list of nodes to be removed
|
// First collect list of nodes to be removed
|
||||||
nsAutoTArray<nsCOMPtr<nsIContent>, 50> nodes;
|
AutoTArray<nsCOMPtr<nsIContent>, 50> nodes;
|
||||||
|
|
||||||
bool canMerge = false;
|
bool canMerge = false;
|
||||||
for (nsIContent* node = this->GetFirstChild();
|
for (nsIContent* node = this->GetFirstChild();
|
||||||
@ -864,7 +864,7 @@ nsINode::CompareDocumentPosition(nsINode& aOtherNode) const
|
|||||||
return static_cast<uint16_t>(nsIDOMNode::DOCUMENT_POSITION_FOLLOWING);
|
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;
|
const nsINode *node1 = &aOtherNode, *node2 = this;
|
||||||
|
|
||||||
@ -1992,7 +1992,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
|||||||
nodeToInsertBefore = nodeToInsertBefore->GetNextSibling();
|
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
|
// Remove the new child from the old parent if one exists
|
||||||
nsIContent* newContent = aNewChild->AsContent();
|
nsIContent* newContent = aNewChild->AsContent();
|
||||||
@ -2702,7 +2702,7 @@ nsINode::QuerySelectorAll(const nsAString& aSelector, ErrorResult& aResult)
|
|||||||
|
|
||||||
nsCSSSelectorList* selectorList = ParseSelectorList(aSelector, aResult);
|
nsCSSSelectorList* selectorList = ParseSelectorList(aSelector, aResult);
|
||||||
if (selectorList) {
|
if (selectorList) {
|
||||||
FindMatchingElements<false, nsAutoTArray<Element*, 128>>(this,
|
FindMatchingElements<false, AutoTArray<Element*, 128>>(this,
|
||||||
selectorList,
|
selectorList,
|
||||||
*contentList,
|
*contentList,
|
||||||
aResult);
|
aResult);
|
||||||
|
@ -59,7 +59,7 @@ nsresult
|
|||||||
nsLineBreaker::FlushCurrentWord()
|
nsLineBreaker::FlushCurrentWord()
|
||||||
{
|
{
|
||||||
uint32_t length = mCurrentWord.Length();
|
uint32_t length = mCurrentWord.Length();
|
||||||
nsAutoTArray<uint8_t,4000> breakState;
|
AutoTArray<uint8_t,4000> breakState;
|
||||||
if (!breakState.AppendElements(length))
|
if (!breakState.AppendElements(length))
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const char16_t* aText,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<uint8_t,4000> breakState;
|
AutoTArray<uint8_t,4000> breakState;
|
||||||
if (aSink) {
|
if (aSink) {
|
||||||
if (!breakState.AppendElements(aLength))
|
if (!breakState.AppendElements(aLength))
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
@ -368,7 +368,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const uint8_t* aText, u
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<uint8_t,4000> breakState;
|
AutoTArray<uint8_t,4000> breakState;
|
||||||
if (aSink) {
|
if (aSink) {
|
||||||
if (!breakState.AppendElements(aLength))
|
if (!breakState.AppendElements(aLength))
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
@ -206,9 +206,9 @@ private:
|
|||||||
const char16_t *aTextLimit,
|
const char16_t *aTextLimit,
|
||||||
uint8_t *aBreakState);
|
uint8_t *aBreakState);
|
||||||
|
|
||||||
nsAutoTArray<char16_t,100> mCurrentWord;
|
AutoTArray<char16_t,100> mCurrentWord;
|
||||||
// All the items that contribute to mCurrentWord
|
// All the items that contribute to mCurrentWord
|
||||||
nsAutoTArray<TextItem,2> mTextItems;
|
AutoTArray<TextItem,2> mTextItems;
|
||||||
nsIAtom* mCurrentWordLanguage;
|
nsIAtom* mCurrentWordLanguage;
|
||||||
bool mCurrentWordContainsMixedLang;
|
bool mCurrentWordContainsMixedLang;
|
||||||
bool mCurrentWordContainsComplexChar;
|
bool mCurrentWordContainsComplexChar;
|
||||||
|
@ -958,7 +958,7 @@ DOMHighResTimeStamp
|
|||||||
PerformanceBase::ResolveTimestampFromName(const nsAString& aName,
|
PerformanceBase::ResolveTimestampFromName(const nsAString& aName,
|
||||||
ErrorResult& aRv)
|
ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
nsAutoTArray<RefPtr<PerformanceEntry>, 1> arr;
|
AutoTArray<RefPtr<PerformanceEntry>, 1> arr;
|
||||||
DOMHighResTimeStamp ts;
|
DOMHighResTimeStamp ts;
|
||||||
Optional<nsAString> typeParam;
|
Optional<nsAString> typeParam;
|
||||||
nsAutoString str;
|
nsAutoString str;
|
||||||
|
@ -199,10 +199,10 @@ private:
|
|||||||
RefPtr<mozilla::dom::Element> mElement;
|
RefPtr<mozilla::dom::Element> mElement;
|
||||||
|
|
||||||
// For handling table rows
|
// For handling table rows
|
||||||
nsAutoTArray<bool, 8> mHasWrittenCellsForRow;
|
AutoTArray<bool, 8> mHasWrittenCellsForRow;
|
||||||
|
|
||||||
// Values gotten in OpenContainer that is (also) needed in CloseContainer
|
// Values gotten in OpenContainer that is (also) needed in CloseContainer
|
||||||
nsAutoTArray<bool, 8> mIsInCiteBlockquote;
|
AutoTArray<bool, 8> mIsInCiteBlockquote;
|
||||||
|
|
||||||
// The output data
|
// The output data
|
||||||
nsAString* mOutputString;
|
nsAString* mOutputString;
|
||||||
|
@ -152,7 +152,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Stack to store one olState struct per <OL>.
|
// Stack to store one olState struct per <OL>.
|
||||||
nsAutoTArray<olState, 8> mOLStateStack;
|
AutoTArray<olState, 8> mOLStateStack;
|
||||||
|
|
||||||
bool HasNoChildren(nsIContent* aContent);
|
bool HasNoChildren(nsIContent* aContent);
|
||||||
};
|
};
|
||||||
|
@ -4474,8 +4474,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||||||
# reallocation behavior for arrays. In particular, if we use auto
|
# reallocation behavior for arrays. In particular, if we use auto
|
||||||
# arrays for sequences and have a sequence of elements which are
|
# arrays for sequences and have a sequence of elements which are
|
||||||
# themselves sequences or have sequences as members, we have a problem.
|
# themselves sequences or have sequences as members, we have a problem.
|
||||||
# In that case, resizing the outermost nsAutoTarray to the right size
|
# In that case, resizing the outermost AutoTArray to the right size
|
||||||
# will memmove its elements, but nsAutoTArrays are not memmovable and
|
# will memmove its elements, but AutoTArrays are not memmovable and
|
||||||
# hence will end up with pointers to bogus memory, which is bad. To
|
# hence will end up with pointers to bogus memory, which is bad. To
|
||||||
# deal with this, we typically map WebIDL sequences to our Sequence
|
# deal with this, we typically map WebIDL sequences to our Sequence
|
||||||
# type, which is in fact memmovable. The one exception is when we're
|
# type, which is in fact memmovable. The one exception is when we're
|
||||||
@ -8389,7 +8389,7 @@ class CGEnumerateHook(CGAbstractBindingMethod):
|
|||||||
|
|
||||||
def generate_code(self):
|
def generate_code(self):
|
||||||
return CGGeneric(dedent("""
|
return CGGeneric(dedent("""
|
||||||
nsAutoTArray<nsString, 8> names;
|
AutoTArray<nsString, 8> names;
|
||||||
ErrorResult rv;
|
ErrorResult rv;
|
||||||
self->GetOwnPropertyNames(cx, names, rv);
|
self->GetOwnPropertyNames(cx, names, rv);
|
||||||
if (rv.MaybeSetPendingException(cx)) {
|
if (rv.MaybeSetPendingException(cx)) {
|
||||||
@ -10456,7 +10456,7 @@ class CGEnumerateOwnPropertiesViaGetOwnPropertyNames(CGAbstractBindingMethod):
|
|||||||
|
|
||||||
def generate_code(self):
|
def generate_code(self):
|
||||||
return CGGeneric(dedent("""
|
return CGGeneric(dedent("""
|
||||||
nsAutoTArray<nsString, 8> names;
|
AutoTArray<nsString, 8> names;
|
||||||
ErrorResult rv;
|
ErrorResult rv;
|
||||||
self->GetOwnPropertyNames(cx, names, rv);
|
self->GetOwnPropertyNames(cx, names, rv);
|
||||||
if (rv.MaybeSetPendingException(cx)) {
|
if (rv.MaybeSetPendingException(cx)) {
|
||||||
|
@ -94,7 +94,7 @@ GetAllBluetoothActors(InfallibleTArray<BluetoothParent*>& aActors)
|
|||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(aActors.IsEmpty());
|
MOZ_ASSERT(aActors.IsEmpty());
|
||||||
|
|
||||||
nsAutoTArray<ContentParent*, 20> contentActors;
|
AutoTArray<ContentParent*, 20> contentActors;
|
||||||
ContentParent::GetAll(contentActors);
|
ContentParent::GetAll(contentActors);
|
||||||
|
|
||||||
for (uint32_t contentIndex = 0;
|
for (uint32_t contentIndex = 0;
|
||||||
|
6
dom/cache/AutoUtils.cpp
vendored
6
dom/cache/AutoUtils.cpp
vendored
@ -47,7 +47,7 @@ CleanupChildFds(CacheReadStream& aReadStream, CleanupAction aAction)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<FileDescriptor, 4> fds;
|
AutoTArray<FileDescriptor, 4> fds;
|
||||||
|
|
||||||
FileDescriptorSetChild* fdSetActor =
|
FileDescriptorSetChild* fdSetActor =
|
||||||
static_cast<FileDescriptorSetChild*>(aReadStream.fds().get_PFileDescriptorSetChild());
|
static_cast<FileDescriptorSetChild*>(aReadStream.fds().get_PFileDescriptorSetChild());
|
||||||
@ -107,7 +107,7 @@ CleanupParentFds(CacheReadStream& aReadStream, CleanupAction aAction)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<FileDescriptor, 4> fds;
|
AutoTArray<FileDescriptor, 4> fds;
|
||||||
|
|
||||||
FileDescriptorSetParent* fdSetActor =
|
FileDescriptorSetParent* fdSetActor =
|
||||||
static_cast<FileDescriptorSetParent*>(aReadStream.fds().get_PFileDescriptorSetParent());
|
static_cast<FileDescriptorSetParent*>(aReadStream.fds().get_PFileDescriptorSetParent());
|
||||||
@ -306,7 +306,7 @@ MatchInPutList(InternalRequest* aRequest,
|
|||||||
RefPtr<InternalHeaders> cachedResponseHeaders =
|
RefPtr<InternalHeaders> cachedResponseHeaders =
|
||||||
TypeUtils::ToInternalHeaders(cachedResponse.headers());
|
TypeUtils::ToInternalHeaders(cachedResponse.headers());
|
||||||
|
|
||||||
nsAutoTArray<nsCString, 16> varyHeaders;
|
AutoTArray<nsCString, 16> varyHeaders;
|
||||||
ErrorResult rv;
|
ErrorResult rv;
|
||||||
cachedResponseHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv);
|
cachedResponseHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv);
|
||||||
MOZ_ALWAYS_TRUE(!rv.Failed());
|
MOZ_ALWAYS_TRUE(!rv.Failed());
|
||||||
|
4
dom/cache/Cache.cpp
vendored
4
dom/cache/Cache.cpp
vendored
@ -114,7 +114,7 @@ public:
|
|||||||
// an Array of Response objects. The following code unwraps these
|
// an Array of Response objects. The following code unwraps these
|
||||||
// JS values back to an nsTArray<RefPtr<Response>>.
|
// JS values back to an nsTArray<RefPtr<Response>>.
|
||||||
|
|
||||||
nsAutoTArray<RefPtr<Response>, 256> responseList;
|
AutoTArray<RefPtr<Response>, 256> responseList;
|
||||||
responseList.SetCapacity(mRequestList.Length());
|
responseList.SetCapacity(mRequestList.Length());
|
||||||
|
|
||||||
bool isArray;
|
bool isArray;
|
||||||
@ -571,7 +571,7 @@ Cache::AddAll(const GlobalObject& aGlobal,
|
|||||||
return promise.forget();
|
return promise.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<RefPtr<Promise>, 256> fetchList;
|
AutoTArray<RefPtr<Promise>, 256> fetchList;
|
||||||
fetchList.SetCapacity(aRequestList.Length());
|
fetchList.SetCapacity(aRequestList.Length());
|
||||||
|
|
||||||
// Begin fetching each request in parallel. For now, if an error occurs just
|
// Begin fetching each request in parallel. For now, if an error occurs just
|
||||||
|
4
dom/cache/CacheOpChild.cpp
vendored
4
dom/cache/CacheOpChild.cpp
vendored
@ -219,7 +219,7 @@ CacheOpChild::HandleResponse(const CacheResponseOrVoid& aResponseOrVoid)
|
|||||||
void
|
void
|
||||||
CacheOpChild::HandleResponseList(const nsTArray<CacheResponse>& aResponseList)
|
CacheOpChild::HandleResponseList(const nsTArray<CacheResponse>& aResponseList)
|
||||||
{
|
{
|
||||||
nsAutoTArray<RefPtr<Response>, 256> responses;
|
AutoTArray<RefPtr<Response>, 256> responses;
|
||||||
responses.SetCapacity(aResponseList.Length());
|
responses.SetCapacity(aResponseList.Length());
|
||||||
|
|
||||||
for (uint32_t i = 0; i < aResponseList.Length(); ++i) {
|
for (uint32_t i = 0; i < aResponseList.Length(); ++i) {
|
||||||
@ -233,7 +233,7 @@ CacheOpChild::HandleResponseList(const nsTArray<CacheResponse>& aResponseList)
|
|||||||
void
|
void
|
||||||
CacheOpChild::HandleRequestList(const nsTArray<CacheRequest>& aRequestList)
|
CacheOpChild::HandleRequestList(const nsTArray<CacheRequest>& aRequestList)
|
||||||
{
|
{
|
||||||
nsAutoTArray<RefPtr<Request>, 256> requests;
|
AutoTArray<RefPtr<Request>, 256> requests;
|
||||||
requests.SetCapacity(aRequestList.Length());
|
requests.SetCapacity(aRequestList.Length());
|
||||||
|
|
||||||
for (uint32_t i = 0; i < aRequestList.Length(); ++i) {
|
for (uint32_t i = 0; i < aRequestList.Length(); ++i) {
|
||||||
|
6
dom/cache/CacheOpParent.cpp
vendored
6
dom/cache/CacheOpParent.cpp
vendored
@ -79,8 +79,8 @@ CacheOpParent::Execute(Manager* aManager)
|
|||||||
const CachePutAllArgs& args = mOpArgs.get_CachePutAllArgs();
|
const CachePutAllArgs& args = mOpArgs.get_CachePutAllArgs();
|
||||||
const nsTArray<CacheRequestResponse>& list = args.requestResponseList();
|
const nsTArray<CacheRequestResponse>& list = args.requestResponseList();
|
||||||
|
|
||||||
nsAutoTArray<nsCOMPtr<nsIInputStream>, 256> requestStreamList;
|
AutoTArray<nsCOMPtr<nsIInputStream>, 256> requestStreamList;
|
||||||
nsAutoTArray<nsCOMPtr<nsIInputStream>, 256> responseStreamList;
|
AutoTArray<nsCOMPtr<nsIInputStream>, 256> responseStreamList;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < list.Length(); ++i) {
|
for (uint32_t i = 0; i < list.Length(); ++i) {
|
||||||
requestStreamList.AppendElement(
|
requestStreamList.AppendElement(
|
||||||
@ -221,7 +221,7 @@ CacheOpParent::DeserializeCacheStream(const CacheReadStreamOrVoid& aStreamOrVoid
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Option 3: A stream was serialized using normal methods.
|
// Option 3: A stream was serialized using normal methods.
|
||||||
nsAutoTArray<FileDescriptor, 4> fds;
|
AutoTArray<FileDescriptor, 4> fds;
|
||||||
if (readStream.fds().type() ==
|
if (readStream.fds().type() ==
|
||||||
OptionalFileDescriptorSet::TPFileDescriptorSetChild) {
|
OptionalFileDescriptorSet::TPFileDescriptorSetChild) {
|
||||||
|
|
||||||
|
22
dom/cache/DBSchema.cpp
vendored
22
dom/cache/DBSchema.cpp
vendored
@ -588,11 +588,11 @@ DeleteCacheId(mozIStorageConnection* aConn, CacheId aCacheId,
|
|||||||
// Delete the bodies explicitly as we need to read out the body IDs
|
// 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
|
// anyway. These body IDs must be deleted one-by-one as content may
|
||||||
// still be referencing them invidivually.
|
// still be referencing them invidivually.
|
||||||
nsAutoTArray<EntryId, 256> matches;
|
AutoTArray<EntryId, 256> matches;
|
||||||
nsresult rv = QueryAll(aConn, aCacheId, matches);
|
nsresult rv = QueryAll(aConn, aCacheId, matches);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
|
|
||||||
nsAutoTArray<IdCount, 16> deletedSecurityIdList;
|
AutoTArray<IdCount, 16> deletedSecurityIdList;
|
||||||
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
|
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
|
||||||
deletedSecurityIdList);
|
deletedSecurityIdList);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
@ -720,7 +720,7 @@ CacheMatch(mozIStorageConnection* aConn, CacheId aCacheId,
|
|||||||
|
|
||||||
*aFoundResponseOut = false;
|
*aFoundResponseOut = false;
|
||||||
|
|
||||||
nsAutoTArray<EntryId, 1> matches;
|
AutoTArray<EntryId, 1> matches;
|
||||||
nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches, 1);
|
nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches, 1);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
|
|
||||||
@ -747,7 +747,7 @@ CacheMatchAll(mozIStorageConnection* aConn, CacheId aCacheId,
|
|||||||
MOZ_ASSERT(aConn);
|
MOZ_ASSERT(aConn);
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
nsAutoTArray<EntryId, 256> matches;
|
AutoTArray<EntryId, 256> matches;
|
||||||
if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) {
|
if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) {
|
||||||
rv = QueryAll(aConn, aCacheId, matches);
|
rv = QueryAll(aConn, aCacheId, matches);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
@ -781,11 +781,11 @@ CachePut(mozIStorageConnection* aConn, CacheId aCacheId,
|
|||||||
|
|
||||||
CacheQueryParams params(false, false, false, false,
|
CacheQueryParams params(false, false, false, false,
|
||||||
NS_LITERAL_STRING(""));
|
NS_LITERAL_STRING(""));
|
||||||
nsAutoTArray<EntryId, 256> matches;
|
AutoTArray<EntryId, 256> matches;
|
||||||
nsresult rv = QueryCache(aConn, aCacheId, aRequest, params, matches);
|
nsresult rv = QueryCache(aConn, aCacheId, aRequest, params, matches);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
|
|
||||||
nsAutoTArray<IdCount, 16> deletedSecurityIdList;
|
AutoTArray<IdCount, 16> deletedSecurityIdList;
|
||||||
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
|
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
|
||||||
deletedSecurityIdList);
|
deletedSecurityIdList);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
@ -814,7 +814,7 @@ CacheDelete(mozIStorageConnection* aConn, CacheId aCacheId,
|
|||||||
|
|
||||||
*aSuccessOut = false;
|
*aSuccessOut = false;
|
||||||
|
|
||||||
nsAutoTArray<EntryId, 256> matches;
|
AutoTArray<EntryId, 256> matches;
|
||||||
nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches);
|
nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
|
|
||||||
@ -822,7 +822,7 @@ CacheDelete(mozIStorageConnection* aConn, CacheId aCacheId,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<IdCount, 16> deletedSecurityIdList;
|
AutoTArray<IdCount, 16> deletedSecurityIdList;
|
||||||
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
|
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
|
||||||
deletedSecurityIdList);
|
deletedSecurityIdList);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
@ -845,7 +845,7 @@ CacheKeys(mozIStorageConnection* aConn, CacheId aCacheId,
|
|||||||
MOZ_ASSERT(aConn);
|
MOZ_ASSERT(aConn);
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
nsAutoTArray<EntryId, 256> matches;
|
AutoTArray<EntryId, 256> matches;
|
||||||
if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) {
|
if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) {
|
||||||
rv = QueryAll(aConn, aCacheId, matches);
|
rv = QueryAll(aConn, aCacheId, matches);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
@ -912,7 +912,7 @@ StorageMatch(mozIStorageConnection* aConn,
|
|||||||
rv = state->BindInt32ByName(NS_LITERAL_CSTRING("namespace"), aNamespace);
|
rv = state->BindInt32ByName(NS_LITERAL_CSTRING("namespace"), aNamespace);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
|
|
||||||
nsAutoTArray<CacheId, 32> cacheIdList;
|
AutoTArray<CacheId, 32> cacheIdList;
|
||||||
|
|
||||||
bool hasMoreData = false;
|
bool hasMoreData = false;
|
||||||
while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {
|
while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {
|
||||||
@ -1218,7 +1218,7 @@ MatchByVaryHeader(mozIStorageConnection* aConn,
|
|||||||
rv = state->BindInt32ByName(NS_LITERAL_CSTRING("entry_id"), entryId);
|
rv = state->BindInt32ByName(NS_LITERAL_CSTRING("entry_id"), entryId);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
|
|
||||||
nsAutoTArray<nsCString, 8> varyValues;
|
AutoTArray<nsCString, 8> varyValues;
|
||||||
|
|
||||||
bool hasMoreData = false;
|
bool hasMoreData = false;
|
||||||
while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {
|
while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {
|
||||||
|
10
dom/cache/Manager.cpp
vendored
10
dom/cache/Manager.cpp
vendored
@ -74,12 +74,12 @@ public:
|
|||||||
mozIStorageConnection::TRANSACTION_IMMEDIATE);
|
mozIStorageConnection::TRANSACTION_IMMEDIATE);
|
||||||
|
|
||||||
// Clean up orphaned Cache objects
|
// Clean up orphaned Cache objects
|
||||||
nsAutoTArray<CacheId, 8> orphanedCacheIdList;
|
AutoTArray<CacheId, 8> orphanedCacheIdList;
|
||||||
nsresult rv = db::FindOrphanedCacheIds(aConn, orphanedCacheIdList);
|
nsresult rv = db::FindOrphanedCacheIds(aConn, orphanedCacheIdList);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
|
|
||||||
for (uint32_t i = 0; i < orphanedCacheIdList.Length(); ++i) {
|
for (uint32_t i = 0; i < orphanedCacheIdList.Length(); ++i) {
|
||||||
nsAutoTArray<nsID, 16> deletedBodyIdList;
|
AutoTArray<nsID, 16> deletedBodyIdList;
|
||||||
rv = db::DeleteCacheId(aConn, orphanedCacheIdList[i], deletedBodyIdList);
|
rv = db::DeleteCacheId(aConn, orphanedCacheIdList[i], deletedBodyIdList);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clean up orphaned body objects
|
// Clean up orphaned body objects
|
||||||
nsAutoTArray<nsID, 64> knownBodyIdList;
|
AutoTArray<nsID, 64> knownBodyIdList;
|
||||||
rv = db::GetKnownBodyIds(aConn, knownBodyIdList);
|
rv = db::GetKnownBodyIds(aConn, knownBodyIdList);
|
||||||
|
|
||||||
rv = BodyDeleteOrphanedFiles(aDBDir, knownBodyIdList);
|
rv = BodyDeleteOrphanedFiles(aDBDir, knownBodyIdList);
|
||||||
@ -1373,7 +1373,7 @@ Manager::Listener::OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult,
|
|||||||
const SavedResponse& aSavedResponse,
|
const SavedResponse& aSavedResponse,
|
||||||
StreamList* aStreamList)
|
StreamList* aStreamList)
|
||||||
{
|
{
|
||||||
nsAutoTArray<SavedResponse, 1> responseList;
|
AutoTArray<SavedResponse, 1> responseList;
|
||||||
responseList.AppendElement(aSavedResponse);
|
responseList.AppendElement(aSavedResponse);
|
||||||
OnOpComplete(Move(aRv), aResult, INVALID_CACHE_ID, responseList,
|
OnOpComplete(Move(aRv), aResult, INVALID_CACHE_ID, responseList,
|
||||||
nsTArray<SavedRequest>(), aStreamList);
|
nsTArray<SavedRequest>(), aStreamList);
|
||||||
@ -1902,7 +1902,7 @@ Manager::NoteOrphanedBodyIdList(const nsTArray<nsID>& aDeletedBodyIdList)
|
|||||||
{
|
{
|
||||||
NS_ASSERT_OWNINGTHREAD(Manager);
|
NS_ASSERT_OWNINGTHREAD(Manager);
|
||||||
|
|
||||||
nsAutoTArray<nsID, 64> deleteNowList;
|
AutoTArray<nsID, 64> deleteNowList;
|
||||||
deleteNowList.SetCapacity(aDeletedBodyIdList.Length());
|
deleteNowList.SetCapacity(aDeletedBodyIdList.Length());
|
||||||
|
|
||||||
for (uint32_t i = 0; i < aDeletedBodyIdList.Length(); ++i) {
|
for (uint32_t i = 0; i < aDeletedBodyIdList.Length(); ++i) {
|
||||||
|
4
dom/cache/ReadStream.cpp
vendored
4
dom/cache/ReadStream.cpp
vendored
@ -222,7 +222,7 @@ ReadStream::Inner::Serialize(CacheReadStream* aReadStreamOut)
|
|||||||
aReadStreamOut->id() = mId;
|
aReadStreamOut->id() = mId;
|
||||||
mControl->SerializeControl(aReadStreamOut);
|
mControl->SerializeControl(aReadStreamOut);
|
||||||
|
|
||||||
nsAutoTArray<FileDescriptor, 4> fds;
|
AutoTArray<FileDescriptor, 4> fds;
|
||||||
SerializeInputStream(mStream, aReadStreamOut->params(), fds);
|
SerializeInputStream(mStream, aReadStreamOut->params(), fds);
|
||||||
|
|
||||||
mControl->SerializeFds(aReadStreamOut, fds);
|
mControl->SerializeFds(aReadStreamOut, fds);
|
||||||
@ -451,7 +451,7 @@ ReadStream::Create(const CacheReadStream& aReadStream)
|
|||||||
}
|
}
|
||||||
MOZ_ASSERT(control);
|
MOZ_ASSERT(control);
|
||||||
|
|
||||||
nsAutoTArray<FileDescriptor, 4> fds;
|
AutoTArray<FileDescriptor, 4> fds;
|
||||||
control->DeserializeFds(aReadStream, fds);
|
control->DeserializeFds(aReadStream, fds);
|
||||||
|
|
||||||
nsCOMPtr<nsIInputStream> stream =
|
nsCOMPtr<nsIInputStream> stream =
|
||||||
|
6
dom/cache/TypeUtils.cpp
vendored
6
dom/cache/TypeUtils.cpp
vendored
@ -44,7 +44,7 @@ namespace {
|
|||||||
static bool
|
static bool
|
||||||
HasVaryStar(mozilla::dom::InternalHeaders* aHeaders)
|
HasVaryStar(mozilla::dom::InternalHeaders* aHeaders)
|
||||||
{
|
{
|
||||||
nsAutoTArray<nsCString, 16> varyHeaders;
|
AutoTArray<nsCString, 16> varyHeaders;
|
||||||
ErrorResult rv;
|
ErrorResult rv;
|
||||||
aHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv);
|
aHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv);
|
||||||
MOZ_ALWAYS_TRUE(!rv.Failed());
|
MOZ_ALWAYS_TRUE(!rv.Failed());
|
||||||
@ -67,7 +67,7 @@ HasVaryStar(mozilla::dom::InternalHeaders* aHeaders)
|
|||||||
void
|
void
|
||||||
SerializeNormalStream(nsIInputStream* aStream, CacheReadStream& aReadStreamOut)
|
SerializeNormalStream(nsIInputStream* aStream, CacheReadStream& aReadStreamOut)
|
||||||
{
|
{
|
||||||
nsAutoTArray<FileDescriptor, 4> fds;
|
AutoTArray<FileDescriptor, 4> fds;
|
||||||
SerializeInputStream(aStream, aReadStreamOut.params(), fds);
|
SerializeInputStream(aStream, aReadStreamOut.params(), fds);
|
||||||
|
|
||||||
PFileDescriptorSetChild* fdSet = nullptr;
|
PFileDescriptorSetChild* fdSet = nullptr;
|
||||||
@ -94,7 +94,7 @@ ToHeadersEntryList(nsTArray<HeadersEntry>& aOut, InternalHeaders* aHeaders)
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(aHeaders);
|
MOZ_ASSERT(aHeaders);
|
||||||
|
|
||||||
nsAutoTArray<InternalHeaders::Entry, 16> entryList;
|
AutoTArray<InternalHeaders::Entry, 16> entryList;
|
||||||
aHeaders->GetEntries(entryList);
|
aHeaders->GetEntries(entryList);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < entryList.Length(); ++i) {
|
for (uint32_t i = 0; i < entryList.Length(); ++i) {
|
||||||
|
@ -247,7 +247,7 @@ nsGonkCameraControl::Initialize()
|
|||||||
DOM_CAMERA_LOGI(" - flash: NOT supported\n");
|
DOM_CAMERA_LOGI(" - flash: NOT supported\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<Size, 16> sizes;
|
AutoTArray<Size, 16> sizes;
|
||||||
mParams.Get(CAMERA_PARAM_SUPPORTED_VIDEOSIZES, sizes);
|
mParams.Get(CAMERA_PARAM_SUPPORTED_VIDEOSIZES, sizes);
|
||||||
if (sizes.Length() > 0) {
|
if (sizes.Length() > 0) {
|
||||||
mSeparateVideoAndPreviewSizesSupported = true;
|
mSeparateVideoAndPreviewSizesSupported = true;
|
||||||
@ -264,7 +264,7 @@ nsGonkCameraControl::Initialize()
|
|||||||
mLastRecorderSize = mCurrentConfiguration.mPreviewSize;
|
mLastRecorderSize = mCurrentConfiguration.mPreviewSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<nsString, 8> modes;
|
AutoTArray<nsString, 8> modes;
|
||||||
mParams.Get(CAMERA_PARAM_SUPPORTED_METERINGMODES, modes);
|
mParams.Get(CAMERA_PARAM_SUPPORTED_METERINGMODES, modes);
|
||||||
if (!modes.IsEmpty()) {
|
if (!modes.IsEmpty()) {
|
||||||
nsString mode;
|
nsString mode;
|
||||||
@ -302,7 +302,7 @@ nsGonkCameraControl::~nsGonkCameraControl()
|
|||||||
nsresult
|
nsresult
|
||||||
nsGonkCameraControl::ValidateConfiguration(const Configuration& aConfig, Configuration& aValidatedConfig)
|
nsGonkCameraControl::ValidateConfiguration(const Configuration& aConfig, Configuration& aValidatedConfig)
|
||||||
{
|
{
|
||||||
nsAutoTArray<Size, 16> supportedSizes;
|
AutoTArray<Size, 16> supportedSizes;
|
||||||
Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
|
Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
|
||||||
|
|
||||||
nsresult rv = GetSupportedSize(aConfig.mPictureSize, supportedSizes,
|
nsresult rv = GetSupportedSize(aConfig.mPictureSize, supportedSizes,
|
||||||
@ -923,7 +923,7 @@ nsGonkCameraControl::SetThumbnailSizeImpl(const Size& aSize)
|
|||||||
uint32_t smallestDeltaIndex = UINT32_MAX;
|
uint32_t smallestDeltaIndex = UINT32_MAX;
|
||||||
int targetArea = aSize.width * aSize.height;
|
int targetArea = aSize.width * aSize.height;
|
||||||
|
|
||||||
nsAutoTArray<Size, 8> supportedSizes;
|
AutoTArray<Size, 8> supportedSizes;
|
||||||
Get(CAMERA_PARAM_SUPPORTED_JPEG_THUMBNAIL_SIZES, supportedSizes);
|
Get(CAMERA_PARAM_SUPPORTED_JPEG_THUMBNAIL_SIZES, supportedSizes);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < supportedSizes.Length(); ++i) {
|
for (uint32_t i = 0; i < supportedSizes.Length(); ++i) {
|
||||||
@ -1028,7 +1028,7 @@ nsGonkCameraControl::SetPictureSizeImpl(const Size& aSize)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<Size, 8> supportedSizes;
|
AutoTArray<Size, 8> supportedSizes;
|
||||||
Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
|
Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
|
||||||
|
|
||||||
Size best;
|
Size best;
|
||||||
@ -1727,7 +1727,7 @@ nsGonkCameraControl::SelectCaptureAndPreviewSize(const Size& aPreviewSize,
|
|||||||
aPreviewSize.width, aPreviewSize.height,
|
aPreviewSize.width, aPreviewSize.height,
|
||||||
aMaxSize.width, aMaxSize.height);
|
aMaxSize.width, aMaxSize.height);
|
||||||
|
|
||||||
nsAutoTArray<Size, 16> sizes;
|
AutoTArray<Size, 16> sizes;
|
||||||
nsresult rv = Get(CAMERA_PARAM_SUPPORTED_PREVIEWSIZES, sizes);
|
nsresult rv = Get(CAMERA_PARAM_SUPPORTED_PREVIEWSIZES, sizes);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
return rv;
|
return rv;
|
||||||
|
@ -1034,7 +1034,7 @@ protected:
|
|||||||
bool fontExplicitLanguage;
|
bool fontExplicitLanguage;
|
||||||
};
|
};
|
||||||
|
|
||||||
nsAutoTArray<ContextState, 3> mStyleStack;
|
AutoTArray<ContextState, 3> mStyleStack;
|
||||||
|
|
||||||
inline ContextState& CurrentState() {
|
inline ContextState& CurrentState() {
|
||||||
return mStyleStack[mStyleStack.Length() - 1];
|
return mStyleStack[mStyleStack.Length() - 1];
|
||||||
|
@ -239,7 +239,7 @@ ImageBitmapRenderingContext::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
|
|||||||
imageLayer->SetContainer(imageContainer);
|
imageLayer->SetContainer(imageContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<ImageContainer::NonOwningImage, 1> imageList;
|
AutoTArray<ImageContainer::NonOwningImage, 1> imageList;
|
||||||
RefPtr<layers::Image> image = ClipToIntrinsicSize();
|
RefPtr<layers::Image> image = ClipToIntrinsicSize();
|
||||||
imageList.AppendElement(ImageContainer::NonOwningImage(image));
|
imageList.AppendElement(ImageContainer::NonOwningImage(image));
|
||||||
imageContainer->SetCurrentImages(imageList);
|
imageContainer->SetCurrentImages(imageList);
|
||||||
|
@ -731,7 +731,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
|||||||
if (modifierMask &&
|
if (modifierMask &&
|
||||||
(modifierMask == Prefs::ChromeAccessModifierMask() ||
|
(modifierMask == Prefs::ChromeAccessModifierMask() ||
|
||||||
modifierMask == Prefs::ContentAccessModifierMask())) {
|
modifierMask == Prefs::ContentAccessModifierMask())) {
|
||||||
nsAutoTArray<uint32_t, 10> accessCharCodes;
|
AutoTArray<uint32_t, 10> accessCharCodes;
|
||||||
nsContentUtils::GetAccessKeyCandidates(keyEvent, accessCharCodes);
|
nsContentUtils::GetAccessKeyCandidates(keyEvent, accessCharCodes);
|
||||||
|
|
||||||
if (HandleAccessKey(aPresContext, accessCharCodes,
|
if (HandleAccessKey(aPresContext, accessCharCodes,
|
||||||
@ -1291,7 +1291,7 @@ EventStateManager::HandleCrossProcessEvent(WidgetEvent* aEvent,
|
|||||||
// event to.
|
// event to.
|
||||||
//
|
//
|
||||||
// NB: the elements of |targets| must be unique, for correctness.
|
// 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 (aEvent->mClass != eTouchEventClass || aEvent->mMessage == eTouchStart) {
|
||||||
// If this event only has one target, and it's remote, add it to
|
// If this event only has one target, and it's remote, add it to
|
||||||
// the array.
|
// the array.
|
||||||
|
@ -429,7 +429,7 @@ private:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class TextCompositionArray final :
|
class TextCompositionArray final :
|
||||||
public nsAutoTArray<RefPtr<TextComposition>, 2>
|
public AutoTArray<RefPtr<TextComposition>, 2>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Looking for per native IME context.
|
// Looking for per native IME context.
|
||||||
|
@ -338,7 +338,7 @@ FetchDriver::HttpFetch()
|
|||||||
// nsCORSListenerProxy. We just inform it which unsafe headers are included
|
// nsCORSListenerProxy. We just inform it which unsafe headers are included
|
||||||
// in the request.
|
// in the request.
|
||||||
if (mRequest->Mode() == RequestMode::Cors) {
|
if (mRequest->Mode() == RequestMode::Cors) {
|
||||||
nsAutoTArray<nsCString, 5> unsafeHeaders;
|
AutoTArray<nsCString, 5> unsafeHeaders;
|
||||||
mRequest->Headers()->GetUnsafeHeaders(unsafeHeaders);
|
mRequest->Headers()->GetUnsafeHeaders(unsafeHeaders);
|
||||||
nsCOMPtr<nsILoadInfo> loadInfo = chan->GetLoadInfo();
|
nsCOMPtr<nsILoadInfo> loadInfo = chan->GetLoadInfo();
|
||||||
loadInfo->SetCorsPreflightInfo(unsafeHeaders, false);
|
loadInfo->SetCorsPreflightInfo(unsafeHeaders, false);
|
||||||
@ -709,7 +709,7 @@ FetchDriver::SetRequestHeaders(nsIHttpChannel* aChannel) const
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(aChannel);
|
MOZ_ASSERT(aChannel);
|
||||||
|
|
||||||
nsAutoTArray<InternalHeaders::Entry, 5> headers;
|
AutoTArray<InternalHeaders::Entry, 5> headers;
|
||||||
mRequest->Headers()->GetEntries(headers);
|
mRequest->Headers()->GetEntries(headers);
|
||||||
bool hasAccept = false;
|
bool hasAccept = false;
|
||||||
for (uint32_t i = 0; i < headers.Length(); ++i) {
|
for (uint32_t i = 0; i < headers.Length(); ++i) {
|
||||||
|
@ -309,7 +309,7 @@ InternalHeaders::CORSHeaders(InternalHeaders* aHeaders)
|
|||||||
aHeaders->Get(NS_LITERAL_CSTRING("Access-Control-Expose-Headers"), acExposedNames, result);
|
aHeaders->Get(NS_LITERAL_CSTRING("Access-Control-Expose-Headers"), acExposedNames, result);
|
||||||
MOZ_ASSERT(!result.Failed());
|
MOZ_ASSERT(!result.Failed());
|
||||||
|
|
||||||
nsAutoTArray<nsCString, 5> exposeNamesArray;
|
AutoTArray<nsCString, 5> exposeNamesArray;
|
||||||
nsCCharSeparatedTokenizer exposeTokens(acExposedNames, ',');
|
nsCCharSeparatedTokenizer exposeTokens(acExposedNames, ',');
|
||||||
while (exposeTokens.hasMoreTokens()) {
|
while (exposeTokens.hasMoreTokens()) {
|
||||||
const nsDependentCSubstring& token = exposeTokens.nextToken();
|
const nsDependentCSubstring& token = exposeTokens.nextToken();
|
||||||
|
@ -77,7 +77,7 @@ private:
|
|||||||
struct udev_monitor* mMonitor;
|
struct udev_monitor* mMonitor;
|
||||||
guint mMonitorSourceID;
|
guint mMonitorSourceID;
|
||||||
// Information about currently connected gamepads.
|
// Information about currently connected gamepads.
|
||||||
nsAutoTArray<Gamepad,4> mGamepads;
|
AutoTArray<Gamepad,4> mGamepads;
|
||||||
};
|
};
|
||||||
|
|
||||||
// singleton instance
|
// singleton instance
|
||||||
|
@ -173,7 +173,7 @@ HTMLAllCollection::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames
|
|||||||
|
|
||||||
// XXXbz this is very similar to nsContentList::GetSupportedNames,
|
// XXXbz this is very similar to nsContentList::GetSupportedNames,
|
||||||
// but has to check IsAllNamedElement for the name case.
|
// 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) {
|
for (uint32_t i = 0; i < Length(); ++i) {
|
||||||
nsIContent *content = Item(i);
|
nsIContent *content = Item(i);
|
||||||
if (content->HasID()) {
|
if (content->HasID()) {
|
||||||
|
@ -287,7 +287,7 @@ HTMLOptionsCollection::GetSupportedNames(unsigned aFlags,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<nsIAtom*, 8> atoms;
|
AutoTArray<nsIAtom*, 8> atoms;
|
||||||
for (uint32_t i = 0; i < mElements.Length(); ++i) {
|
for (uint32_t i = 0; i < mElements.Length(); ++i) {
|
||||||
HTMLOptionElement* content = mElements.ElementAt(i);
|
HTMLOptionElement* content = mElements.ElementAt(i);
|
||||||
if (content) {
|
if (content) {
|
||||||
|
@ -112,7 +112,7 @@ void
|
|||||||
TimeRanges::Normalize(double aTolerance)
|
TimeRanges::Normalize(double aTolerance)
|
||||||
{
|
{
|
||||||
if (mRanges.Length() >= 2) {
|
if (mRanges.Length() >= 2) {
|
||||||
nsAutoTArray<TimeRange,4> normalized;
|
AutoTArray<TimeRange,4> normalized;
|
||||||
|
|
||||||
mRanges.Sort(CompareTimeRanges());
|
mRanges.Sort(CompareTimeRanges());
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ TimeRanges::Union(const TimeRanges* aOtherRanges, double aTolerance)
|
|||||||
void
|
void
|
||||||
TimeRanges::Intersection(const TimeRanges* aOtherRanges)
|
TimeRanges::Intersection(const TimeRanges* aOtherRanges)
|
||||||
{
|
{
|
||||||
nsAutoTArray<TimeRange,4> intersection;
|
AutoTArray<TimeRange,4> intersection;
|
||||||
|
|
||||||
const nsTArray<TimeRange>& otherRanges = aOtherRanges->mRanges;
|
const nsTArray<TimeRange>& otherRanges = aOtherRanges->mRanges;
|
||||||
for (index_type i = 0, j = 0; i < mRanges.Length() && j < otherRanges.Length();) {
|
for (index_type i = 0, j = 0; i < mRanges.Length() && j < otherRanges.Length();) {
|
||||||
|
@ -93,7 +93,7 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
nsAutoTArray<TimeRange,4> mRanges;
|
AutoTArray<TimeRange,4> mRanges;
|
||||||
|
|
||||||
nsCOMPtr<nsISupports> mParent;
|
nsCOMPtr<nsISupports> mParent;
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ protected:
|
|||||||
RefPtr<nsGenericHTMLElement> mBody;
|
RefPtr<nsGenericHTMLElement> mBody;
|
||||||
RefPtr<nsGenericHTMLElement> mHead;
|
RefPtr<nsGenericHTMLElement> mHead;
|
||||||
|
|
||||||
nsAutoTArray<SinkContext*, 8> mContextStack;
|
AutoTArray<SinkContext*, 8> mContextStack;
|
||||||
SinkContext* mCurrentContext;
|
SinkContext* mCurrentContext;
|
||||||
SinkContext* mHeadContext;
|
SinkContext* mHeadContext;
|
||||||
|
|
||||||
|
@ -16352,10 +16352,10 @@ QuotaClient::InitOrigin(PersistenceType aPersistenceType,
|
|||||||
// are database files then we need to cleanup stored files (if it's needed)
|
// are database files then we need to cleanup stored files (if it's needed)
|
||||||
// and also get the usage.
|
// and also get the usage.
|
||||||
|
|
||||||
nsAutoTArray<nsString, 20> subdirsToProcess;
|
AutoTArray<nsString, 20> subdirsToProcess;
|
||||||
nsTArray<nsCOMPtr<nsIFile>> unknownFiles;
|
nsTArray<nsCOMPtr<nsIFile>> unknownFiles;
|
||||||
nsTHashtable<nsStringHashKey> validSubdirs(20);
|
nsTHashtable<nsStringHashKey> validSubdirs(20);
|
||||||
nsAutoTArray<FileManagerInitInfo, 20> initInfos;
|
AutoTArray<FileManagerInitInfo, 20> initInfos;
|
||||||
|
|
||||||
nsCOMPtr<nsISimpleEnumerator> entries;
|
nsCOMPtr<nsISimpleEnumerator> entries;
|
||||||
rv = directory->GetDirectoryEntries(getter_AddRefs(entries));
|
rv = directory->GetDirectoryEntries(getter_AddRefs(entries));
|
||||||
@ -18217,7 +18217,7 @@ DatabaseOperationBase::GetStructuredCloneReadInfoFromBlob(
|
|||||||
aInfo->mData.SwapElements(uncompressed);
|
aInfo->mData.SwapElements(uncompressed);
|
||||||
|
|
||||||
if (!aFileIds.IsVoid()) {
|
if (!aFileIds.IsVoid()) {
|
||||||
nsAutoTArray<int64_t, 10> array;
|
AutoTArray<int64_t, 10> array;
|
||||||
nsresult rv = ConvertFileIdsToArray(aFileIds, array);
|
nsresult rv = ConvertFileIdsToArray(aFileIds, array);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
return rv;
|
return rv;
|
||||||
@ -23344,7 +23344,7 @@ UpdateIndexDataValuesFunction::OnFunctionCall(mozIStorageValueArray* aValues,
|
|||||||
const IndexMetadata& metadata = mOp->mMetadata;
|
const IndexMetadata& metadata = mOp->mMetadata;
|
||||||
const int64_t& objectStoreId = mOp->mObjectStoreId;
|
const int64_t& objectStoreId = mOp->mObjectStoreId;
|
||||||
|
|
||||||
nsAutoTArray<IndexUpdateInfo, 32> updateInfos;
|
AutoTArray<IndexUpdateInfo, 32> updateInfos;
|
||||||
rv = IDBObjectStore::AppendIndexUpdateInfo(metadata.id(),
|
rv = IDBObjectStore::AppendIndexUpdateInfo(metadata.id(),
|
||||||
metadata.keyPath(),
|
metadata.keyPath(),
|
||||||
metadata.unique(),
|
metadata.unique(),
|
||||||
|
@ -667,7 +667,7 @@ IDBDatabase::Transaction(const StringOrStringSequence& aStoreNames,
|
|||||||
return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
|
return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<nsString, 1> stackSequence;
|
AutoTArray<nsString, 1> stackSequence;
|
||||||
|
|
||||||
if (aStoreNames.IsString()) {
|
if (aStoreNames.IsString()) {
|
||||||
stackSequence.AppendElement(aStoreNames.GetAsString());
|
stackSequence.AppendElement(aStoreNames.GetAsString());
|
||||||
@ -848,8 +848,8 @@ IDBDatabase::AbortTransactions(bool aShouldWarn)
|
|||||||
|
|
||||||
class MOZ_STACK_CLASS Helper final
|
class MOZ_STACK_CLASS Helper final
|
||||||
{
|
{
|
||||||
typedef nsAutoTArray<RefPtr<IDBTransaction>, 20> StrongTransactionArray;
|
typedef AutoTArray<RefPtr<IDBTransaction>, 20> StrongTransactionArray;
|
||||||
typedef nsAutoTArray<IDBTransaction*, 20> WeakTransactionArray;
|
typedef AutoTArray<IDBTransaction*, 20> WeakTransactionArray;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void
|
static void
|
||||||
|
@ -470,7 +470,7 @@ Key::EncodeLocaleString(const nsDependentString& aString, uint8_t aTypeOffset,
|
|||||||
}
|
}
|
||||||
MOZ_ASSERT(collator);
|
MOZ_ASSERT(collator);
|
||||||
|
|
||||||
nsAutoTArray<uint8_t, 128> keyBuffer;
|
AutoTArray<uint8_t, 128> keyBuffer;
|
||||||
int32_t sortKeyLength = ucol_getSortKey(collator, ustr, length,
|
int32_t sortKeyLength = ucol_getSortKey(collator, ustr, length,
|
||||||
keyBuffer.Elements(),
|
keyBuffer.Elements(),
|
||||||
keyBuffer.Length());
|
keyBuffer.Length());
|
||||||
|
@ -607,7 +607,7 @@ ContentParentsMemoryReporter::CollectReports(nsIMemoryReporterCallback* cb,
|
|||||||
nsISupports* aClosure,
|
nsISupports* aClosure,
|
||||||
bool aAnonymize)
|
bool aAnonymize)
|
||||||
{
|
{
|
||||||
nsAutoTArray<ContentParent*, 16> cps;
|
AutoTArray<ContentParent*, 16> cps;
|
||||||
ContentParent::GetAllEvenIfDead(cps);
|
ContentParent::GetAllEvenIfDead(cps);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < cps.Length(); i++) {
|
for (uint32_t i = 0; i < cps.Length(); i++) {
|
||||||
@ -911,7 +911,7 @@ ContentParent::JoinAllSubprocesses()
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
nsAutoTArray<ContentParent*, 8> processes;
|
AutoTArray<ContentParent*, 8> processes;
|
||||||
GetAll(processes);
|
GetAll(processes);
|
||||||
if (processes.IsEmpty()) {
|
if (processes.IsEmpty()) {
|
||||||
printf_stderr("There are no live subprocesses.");
|
printf_stderr("There are no live subprocesses.");
|
||||||
@ -5145,7 +5145,7 @@ ContentParent::IgnoreIPCPrincipal()
|
|||||||
void
|
void
|
||||||
ContentParent::NotifyUpdatedDictionaries()
|
ContentParent::NotifyUpdatedDictionaries()
|
||||||
{
|
{
|
||||||
nsAutoTArray<ContentParent*, 8> processes;
|
AutoTArray<ContentParent*, 8> processes;
|
||||||
GetAll(processes);
|
GetAll(processes);
|
||||||
|
|
||||||
nsCOMPtr<nsISpellChecker> spellChecker(do_GetService(NS_SPELLCHECKER_CONTRACTID));
|
nsCOMPtr<nsISpellChecker> spellChecker(do_GetService(NS_SPELLCHECKER_CONTRACTID));
|
||||||
|
@ -71,8 +71,8 @@ private:
|
|||||||
CancelableTask* mPreallocateAppProcessTask;
|
CancelableTask* mPreallocateAppProcessTask;
|
||||||
|
|
||||||
// The array containing the preallocated processes. 4 as the inline storage size
|
// The array containing the preallocated processes. 4 as the inline storage size
|
||||||
// should be enough so we don't need to grow the nsAutoTArray.
|
// should be enough so we don't need to grow the AutoTArray.
|
||||||
nsAutoTArray<RefPtr<ContentParent>, 4> mSpareProcesses;
|
AutoTArray<RefPtr<ContentParent>, 4> mSpareProcesses;
|
||||||
|
|
||||||
// Nuwa process is ready for creating new process.
|
// Nuwa process is ready for creating new process.
|
||||||
bool mIsNuwaReady;
|
bool mIsNuwaReady;
|
||||||
|
@ -706,7 +706,7 @@ private:
|
|||||||
// Whether we have already received a FileDescriptor for the app package.
|
// Whether we have already received a FileDescriptor for the app package.
|
||||||
bool mAppPackageFileDescriptorRecved;
|
bool mAppPackageFileDescriptorRecved;
|
||||||
// At present only 1 of these is really expected.
|
// At present only 1 of these is really expected.
|
||||||
nsAutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
|
AutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
|
||||||
mCachedFileDescriptorInfos;
|
mCachedFileDescriptorInfos;
|
||||||
nscolor mLastBackgroundColor;
|
nscolor mLastBackgroundColor;
|
||||||
bool mDidFakeShow;
|
bool mDidFakeShow;
|
||||||
@ -734,7 +734,7 @@ private:
|
|||||||
CSSSize mUnscaledInnerSize;
|
CSSSize mUnscaledInnerSize;
|
||||||
bool mDidSetRealShowInfo;
|
bool mDidSetRealShowInfo;
|
||||||
|
|
||||||
nsAutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
|
AutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
|
||||||
|
|
||||||
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
||||||
};
|
};
|
||||||
|
@ -102,8 +102,8 @@ AudioCaptureStream::MixerCallback(AudioDataValue* aMixedBuffer,
|
|||||||
AudioSampleFormat aFormat, uint32_t aChannels,
|
AudioSampleFormat aFormat, uint32_t aChannels,
|
||||||
uint32_t aFrames, uint32_t aSampleRate)
|
uint32_t aFrames, uint32_t aSampleRate)
|
||||||
{
|
{
|
||||||
nsAutoTArray<nsTArray<AudioDataValue>, MONO> output;
|
AutoTArray<nsTArray<AudioDataValue>, MONO> output;
|
||||||
nsAutoTArray<const AudioDataValue*, MONO> bufferPtrs;
|
AutoTArray<const AudioDataValue*, MONO> bufferPtrs;
|
||||||
output.SetLength(MONO);
|
output.SetLength(MONO);
|
||||||
bufferPtrs.SetLength(MONO);
|
bufferPtrs.SetLength(MONO);
|
||||||
|
|
||||||
|
@ -85,9 +85,9 @@ void
|
|||||||
AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels,
|
AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels,
|
||||||
uint32_t aSampleRate)
|
uint32_t aSampleRate)
|
||||||
{
|
{
|
||||||
nsAutoTArray<AudioDataValue, SilentChannel::AUDIO_PROCESSING_FRAMES* GUESS_AUDIO_CHANNELS>
|
AutoTArray<AudioDataValue, SilentChannel::AUDIO_PROCESSING_FRAMES* GUESS_AUDIO_CHANNELS>
|
||||||
buf;
|
buf;
|
||||||
nsAutoTArray<const AudioDataValue*, GUESS_AUDIO_CHANNELS> channelData;
|
AutoTArray<const AudioDataValue*, GUESS_AUDIO_CHANNELS> channelData;
|
||||||
uint32_t offsetSamples = 0;
|
uint32_t offsetSamples = 0;
|
||||||
uint32_t duration = GetDuration();
|
uint32_t duration = GetDuration();
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels,
|
|||||||
MOZ_ASSERT(channelData.Length() == aOutputChannels);
|
MOZ_ASSERT(channelData.Length() == aOutputChannels);
|
||||||
} else if (channelData.Length() > aOutputChannels) {
|
} else if (channelData.Length() > aOutputChannels) {
|
||||||
// Down mix.
|
// Down mix.
|
||||||
nsAutoTArray<AudioDataValue*, GUESS_AUDIO_CHANNELS> outChannelPtrs;
|
AutoTArray<AudioDataValue*, GUESS_AUDIO_CHANNELS> outChannelPtrs;
|
||||||
outChannelPtrs.SetLength(aOutputChannels);
|
outChannelPtrs.SetLength(aOutputChannels);
|
||||||
uint32_t offsetSamples = 0;
|
uint32_t offsetSamples = 0;
|
||||||
for (uint32_t channel = 0; channel < aOutputChannels; channel++) {
|
for (uint32_t channel = 0; channel < aOutputChannels; channel++) {
|
||||||
@ -166,7 +166,7 @@ AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels,
|
|||||||
void
|
void
|
||||||
AudioSegment::WriteTo(uint64_t aID, AudioMixer& aMixer, uint32_t aOutputChannels, uint32_t aSampleRate)
|
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.
|
// Offset in the buffer that will be written to the mixer, in samples.
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
|
|
||||||
|
@ -118,8 +118,8 @@ DownmixAndInterleave(const nsTArray<const SrcT*>& aChannelData,
|
|||||||
InterleaveAndConvertBuffer(aChannelData.Elements(),
|
InterleaveAndConvertBuffer(aChannelData.Elements(),
|
||||||
aDuration, aVolume, aOutputChannels, aOutput);
|
aDuration, aVolume, aOutputChannels, aOutput);
|
||||||
} else {
|
} else {
|
||||||
nsAutoTArray<SrcT*,GUESS_AUDIO_CHANNELS> outputChannelData;
|
AutoTArray<SrcT*,GUESS_AUDIO_CHANNELS> outputChannelData;
|
||||||
nsAutoTArray<SrcT, SilentChannel::AUDIO_PROCESSING_FRAMES * GUESS_AUDIO_CHANNELS> outputBuffers;
|
AutoTArray<SrcT, SilentChannel::AUDIO_PROCESSING_FRAMES * GUESS_AUDIO_CHANNELS> outputBuffers;
|
||||||
outputChannelData.SetLength(aOutputChannels);
|
outputChannelData.SetLength(aOutputChannels);
|
||||||
outputBuffers.SetLength(aDuration * aOutputChannels);
|
outputBuffers.SetLength(aDuration * aOutputChannels);
|
||||||
for (uint32_t i = 0; i < aOutputChannels; i++) {
|
for (uint32_t i = 0; i < aOutputChannels; i++) {
|
||||||
@ -254,8 +254,8 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (ChunkIterator ci(*this); !ci.IsEnded(); ci.Next()) {
|
for (ChunkIterator ci(*this); !ci.IsEnded(); ci.Next()) {
|
||||||
nsAutoTArray<nsTArray<T>, GUESS_AUDIO_CHANNELS> output;
|
AutoTArray<nsTArray<T>, GUESS_AUDIO_CHANNELS> output;
|
||||||
nsAutoTArray<const T*, GUESS_AUDIO_CHANNELS> bufferPtrs;
|
AutoTArray<const T*, GUESS_AUDIO_CHANNELS> bufferPtrs;
|
||||||
AudioChunk& c = *ci;
|
AudioChunk& c = *ci;
|
||||||
// If this chunk is null, don't bother resampling, just alter its duration
|
// If this chunk is null, don't bother resampling, just alter its duration
|
||||||
if (c.IsNull()) {
|
if (c.IsNull()) {
|
||||||
@ -395,7 +395,7 @@ void WriteChunk(AudioChunk& aChunk,
|
|||||||
uint32_t aOutputChannels,
|
uint32_t aOutputChannels,
|
||||||
AudioDataValue* aOutputBuffer)
|
AudioDataValue* aOutputBuffer)
|
||||||
{
|
{
|
||||||
nsAutoTArray<const SrcT*,GUESS_AUDIO_CHANNELS> channelData;
|
AutoTArray<const SrcT*,GUESS_AUDIO_CHANNELS> channelData;
|
||||||
|
|
||||||
channelData = aChunk.ChannelData<SrcT>();
|
channelData = aChunk.ChannelData<SrcT>();
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
nsAutoTArray<Chunk, 7> mChunks;
|
AutoTArray<Chunk, 7> mChunks;
|
||||||
int64_t mBaseOffset;
|
int64_t mBaseOffset;
|
||||||
double mBasePosition;
|
double mBasePosition;
|
||||||
};
|
};
|
||||||
@ -287,7 +287,7 @@ WriteDumpFile(FILE* aDumpFile, AudioStream* aStream, uint32_t aFrames,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NS_ASSERTION(AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_FLOAT32, "bad format");
|
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);
|
buf.SetLength(samples*2);
|
||||||
float* input = static_cast<float*>(aBuffer);
|
float* input = static_cast<float*>(aBuffer);
|
||||||
uint8_t* output = buf.Elements();
|
uint8_t* output = buf.Elements();
|
||||||
@ -616,7 +616,7 @@ AudioStream::GetTimeStretched(AudioBufferWriter& aWriter)
|
|||||||
mTimeStretcher->putSamples(c->Data(), c->Frames());
|
mTimeStretcher->putSamples(c->Data(), c->Frames());
|
||||||
} else {
|
} else {
|
||||||
// Write silence if downmixing fails.
|
// Write silence if downmixing fails.
|
||||||
nsAutoTArray<AudioDataValue, 1000> buf;
|
AutoTArray<AudioDataValue, 1000> buf;
|
||||||
buf.SetLength(mOutChannels * c->Frames());
|
buf.SetLength(mOutChannels * c->Frames());
|
||||||
memset(buf.Elements(), 0, buf.Length() * sizeof(AudioDataValue));
|
memset(buf.Elements(), 0, buf.Length() * sizeof(AudioDataValue));
|
||||||
mTimeStretcher->putSamples(buf.Elements(), c->Frames());
|
mTimeStretcher->putSamples(buf.Elements(), c->Frames());
|
||||||
|
@ -583,10 +583,10 @@ protected:
|
|||||||
RefPtr<MediaInputPort> mPlaybackPort;
|
RefPtr<MediaInputPort> mPlaybackPort;
|
||||||
|
|
||||||
// MediaStreamTracks corresponding to tracks in our mOwnedStream.
|
// MediaStreamTracks corresponding to tracks in our mOwnedStream.
|
||||||
nsAutoTArray<RefPtr<TrackPort>, 2> mOwnedTracks;
|
AutoTArray<RefPtr<TrackPort>, 2> mOwnedTracks;
|
||||||
|
|
||||||
// MediaStreamTracks corresponding to tracks in our mPlaybackStream.
|
// MediaStreamTracks corresponding to tracks in our mPlaybackStream.
|
||||||
nsAutoTArray<RefPtr<TrackPort>, 2> mTracks;
|
AutoTArray<RefPtr<TrackPort>, 2> mTracks;
|
||||||
|
|
||||||
RefPtr<OwnedStreamListener> mOwnedListener;
|
RefPtr<OwnedStreamListener> mOwnedListener;
|
||||||
RefPtr<PlaybackStreamListener> mPlaybackListener;
|
RefPtr<PlaybackStreamListener> mPlaybackListener;
|
||||||
|
@ -202,7 +202,7 @@ private:
|
|||||||
// main thread).
|
// main thread).
|
||||||
nsCOMPtr<nsIThread> mThread;
|
nsCOMPtr<nsIThread> mThread;
|
||||||
// Queue of pending block indexes that need to be written or moved.
|
// Queue of pending block indexes that need to be written or moved.
|
||||||
//nsAutoTArray<int32_t, 8> mChangeIndexList;
|
//AutoTArray<int32_t, 8> mChangeIndexList;
|
||||||
Int32Queue mChangeIndexList;
|
Int32Queue mChangeIndexList;
|
||||||
// True if we've dispatched an event to commit all pending block changes
|
// True if we've dispatched an event to commit all pending block changes
|
||||||
// to file on mThread.
|
// to file on mThread.
|
||||||
|
@ -1098,7 +1098,7 @@ AudioCallbackDriver::EnqueueStreamAndPromiseForOperation(MediaStream* aStream,
|
|||||||
|
|
||||||
void AudioCallbackDriver::CompleteAudioContextOperations(AsyncCubebOperation aOperation)
|
void AudioCallbackDriver::CompleteAudioContextOperations(AsyncCubebOperation aOperation)
|
||||||
{
|
{
|
||||||
nsAutoTArray<StreamAndPromiseForOperation, 1> array;
|
AutoTArray<StreamAndPromiseForOperation, 1> array;
|
||||||
|
|
||||||
// We can't lock for the whole function because AudioContextOperationCompleted
|
// We can't lock for the whole function because AudioContextOperationCompleted
|
||||||
// will grab the monitor
|
// will grab the monitor
|
||||||
|
@ -519,7 +519,7 @@ private:
|
|||||||
* shutdown of the audio stream. */
|
* shutdown of the audio stream. */
|
||||||
nsCOMPtr<nsIThread> mInitShutdownThread;
|
nsCOMPtr<nsIThread> mInitShutdownThread;
|
||||||
/* This must be accessed with the graph monitor held. */
|
/* 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. */
|
/* This is set during initialization, and can be read safely afterwards. */
|
||||||
dom::AudioChannel mAudioChannel;
|
dom::AudioChannel mAudioChannel;
|
||||||
/* Used to queue us to add the mixer callback on first run. */
|
/* Used to queue us to add the mixer callback on first run. */
|
||||||
|
@ -255,7 +255,7 @@ class IntervalSet
|
|||||||
public:
|
public:
|
||||||
typedef IntervalSet<T> SelfType;
|
typedef IntervalSet<T> SelfType;
|
||||||
typedef Interval<T> ElemType;
|
typedef Interval<T> ElemType;
|
||||||
typedef nsAutoTArray<ElemType,4> ContainerType;
|
typedef AutoTArray<ElemType,4> ContainerType;
|
||||||
typedef typename ContainerType::index_type IndexType;
|
typedef typename ContainerType::index_type IndexType;
|
||||||
|
|
||||||
IntervalSet()
|
IntervalSet()
|
||||||
|
@ -794,7 +794,7 @@ MediaCache::FindReusableBlock(TimeStamp aNow,
|
|||||||
// predicted time of next use". We can exploit the fact that the block
|
// 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
|
// linked lists are ordered by increasing time of next use. This is
|
||||||
// actually the whole point of having the linked lists.
|
// 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) {
|
for (uint32_t i = 0; i < mStreams.Length(); ++i) {
|
||||||
MediaCacheStream* stream = mStreams[i];
|
MediaCacheStream* stream = mStreams[i];
|
||||||
if (stream->mPinCount > 0) {
|
if (stream->mPinCount > 0) {
|
||||||
@ -1040,7 +1040,7 @@ MediaCache::Update()
|
|||||||
// decisions while holding the cache lock but implement those decisions
|
// decisions while holding the cache lock but implement those decisions
|
||||||
// without holding the cache lock, since we need to call out to
|
// without holding the cache lock, since we need to call out to
|
||||||
// stream, decoder and element code.
|
// stream, decoder and element code.
|
||||||
nsAutoTArray<StreamAction,10> actions;
|
AutoTArray<StreamAction,10> actions;
|
||||||
|
|
||||||
{
|
{
|
||||||
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
||||||
|
@ -606,7 +606,7 @@ MediaStreamGraphImpl::CreateOrDestroyAudioStreams(MediaStream* aStream)
|
|||||||
|
|
||||||
STREAM_LOG(LogLevel::Debug, ("Updating AudioOutputStreams for MediaStream %p", 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) {
|
for (uint32_t i = 0; i < aStream->mAudioOutputStreams.Length(); ++i) {
|
||||||
audioOutputStreamsFound.AppendElement(false);
|
audioOutputStreamsFound.AppendElement(false);
|
||||||
}
|
}
|
||||||
@ -791,7 +791,7 @@ MediaStreamGraphImpl::PlayVideo(MediaStream* aStream)
|
|||||||
TimeStamp currentTimeStamp = CurrentDriver()->GetCurrentTimeStamp();
|
TimeStamp currentTimeStamp = CurrentDriver()->GetCurrentTimeStamp();
|
||||||
|
|
||||||
// Collect any new frames produced in this iteration.
|
// Collect any new frames produced in this iteration.
|
||||||
nsAutoTArray<ImageContainer::NonOwningImage,4> newImages;
|
AutoTArray<ImageContainer::NonOwningImage,4> newImages;
|
||||||
RefPtr<Image> blackImage;
|
RefPtr<Image> blackImage;
|
||||||
|
|
||||||
MOZ_ASSERT(mProcessedTime >= aStream->mBufferStartTime, "frame position before buffer?");
|
MOZ_ASSERT(mProcessedTime >= aStream->mBufferStartTime, "frame position before buffer?");
|
||||||
@ -861,14 +861,14 @@ MediaStreamGraphImpl::PlayVideo(MediaStream* aStream)
|
|||||||
if (!aStream->mLastPlayedVideoFrame.GetImage())
|
if (!aStream->mLastPlayedVideoFrame.GetImage())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nsAutoTArray<ImageContainer::NonOwningImage,4> images;
|
AutoTArray<ImageContainer::NonOwningImage,4> images;
|
||||||
bool haveMultipleImages = false;
|
bool haveMultipleImages = false;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < aStream->mVideoOutputs.Length(); ++i) {
|
for (uint32_t i = 0; i < aStream->mVideoOutputs.Length(); ++i) {
|
||||||
VideoFrameContainer* output = aStream->mVideoOutputs[i];
|
VideoFrameContainer* output = aStream->mVideoOutputs[i];
|
||||||
|
|
||||||
// Find previous frames that may still be valid.
|
// Find previous frames that may still be valid.
|
||||||
nsAutoTArray<ImageContainer::OwningImage,4> previousImages;
|
AutoTArray<ImageContainer::OwningImage,4> previousImages;
|
||||||
output->GetImageContainer()->GetCurrentImages(&previousImages);
|
output->GetImageContainer()->GetCurrentImages(&previousImages);
|
||||||
uint32_t j = previousImages.Length();
|
uint32_t j = previousImages.Length();
|
||||||
if (j) {
|
if (j) {
|
||||||
|
@ -67,8 +67,8 @@ TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) :
|
|||||||
if (IsFinishedOnGraphThread()) {
|
if (IsFinishedOnGraphThread()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nsAutoTArray<bool,8> mappedTracksFinished;
|
AutoTArray<bool,8> mappedTracksFinished;
|
||||||
nsAutoTArray<bool,8> mappedTracksWithMatchingInputTracks;
|
AutoTArray<bool,8> mappedTracksWithMatchingInputTracks;
|
||||||
for (uint32_t i = 0; i < mTrackMap.Length(); ++i) {
|
for (uint32_t i = 0; i < mTrackMap.Length(); ++i) {
|
||||||
mappedTracksFinished.AppendElement(true);
|
mappedTracksFinished.AppendElement(true);
|
||||||
mappedTracksWithMatchingInputTracks.AppendElement(false);
|
mappedTracksWithMatchingInputTracks.AppendElement(false);
|
||||||
|
@ -35,7 +35,7 @@ void VideoFrameContainer::SetCurrentFrame(const gfx::IntSize& aIntrinsicSize,
|
|||||||
{
|
{
|
||||||
if (aImage) {
|
if (aImage) {
|
||||||
MutexAutoLock lock(mMutex);
|
MutexAutoLock lock(mMutex);
|
||||||
nsAutoTArray<ImageContainer::NonOwningImage,1> imageList;
|
AutoTArray<ImageContainer::NonOwningImage,1> imageList;
|
||||||
imageList.AppendElement(
|
imageList.AppendElement(
|
||||||
ImageContainer::NonOwningImage(aImage, aTargetTime, ++mFrameID));
|
ImageContainer::NonOwningImage(aImage, aTargetTime, ++mFrameID));
|
||||||
SetCurrentFramesLocked(aIntrinsicSize, imageList);
|
SetCurrentFramesLocked(aIntrinsicSize, imageList);
|
||||||
|
@ -313,7 +313,7 @@ OpusTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Start encoding data.
|
// Start encoding data.
|
||||||
nsAutoTArray<AudioDataValue, 9600> pcm;
|
AutoTArray<AudioDataValue, 9600> pcm;
|
||||||
pcm.SetLength(GetPacketDuration() * mChannels);
|
pcm.SetLength(GetPacketDuration() * mChannels);
|
||||||
AudioSegment::ChunkIterator iter(mSourceSegment);
|
AudioSegment::ChunkIterator iter(mSourceSegment);
|
||||||
int frameCopied = 0;
|
int frameCopied = 0;
|
||||||
@ -344,7 +344,7 @@ OpusTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData)
|
|||||||
audiodata->SetFrameType(EncodedFrame::OPUS_AUDIO_FRAME);
|
audiodata->SetFrameType(EncodedFrame::OPUS_AUDIO_FRAME);
|
||||||
int framesInPCM = frameCopied;
|
int framesInPCM = frameCopied;
|
||||||
if (mResampler) {
|
if (mResampler) {
|
||||||
nsAutoTArray<AudioDataValue, 9600> resamplingDest;
|
AutoTArray<AudioDataValue, 9600> resamplingDest;
|
||||||
// We want to consume all the input data, so we slightly oversize the
|
// 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
|
// resampled data buffer so we can fit the output data in. We cannot really
|
||||||
// predict the output frame count at each call.
|
// predict the output frame count at each call.
|
||||||
|
@ -140,7 +140,7 @@ AudioTrackEncoder::InterleaveTrackData(AudioChunk& aChunk,
|
|||||||
{
|
{
|
||||||
switch(aChunk.mBufferFormat) {
|
switch(aChunk.mBufferFormat) {
|
||||||
case AUDIO_FORMAT_S16: {
|
case AUDIO_FORMAT_S16: {
|
||||||
nsAutoTArray<const int16_t*, 2> array;
|
AutoTArray<const int16_t*, 2> array;
|
||||||
array.SetLength(aOutputChannels);
|
array.SetLength(aOutputChannels);
|
||||||
for (uint32_t i = 0; i < array.Length(); i++) {
|
for (uint32_t i = 0; i < array.Length(); i++) {
|
||||||
array[i] = static_cast<const int16_t*>(aChunk.mChannelData[i]);
|
array[i] = static_cast<const int16_t*>(aChunk.mChannelData[i]);
|
||||||
@ -149,7 +149,7 @@ AudioTrackEncoder::InterleaveTrackData(AudioChunk& aChunk,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AUDIO_FORMAT_FLOAT32: {
|
case AUDIO_FORMAT_FLOAT32: {
|
||||||
nsAutoTArray<const float*, 2> array;
|
AutoTArray<const float*, 2> array;
|
||||||
array.SetLength(aOutputChannels);
|
array.SetLength(aOutputChannels);
|
||||||
for (uint32_t i = 0; i < array.Length(); i++) {
|
for (uint32_t i = 0; i < array.Length(); i++) {
|
||||||
array[i] = static_cast<const float*>(aChunk.mChannelData[i]);
|
array[i] = static_cast<const float*>(aChunk.mChannelData[i]);
|
||||||
|
@ -202,8 +202,8 @@ VorbisTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData)
|
|||||||
vorbis_analysis_buffer(&mVorbisDsp, (int)sourceSegment->GetDuration());
|
vorbis_analysis_buffer(&mVorbisDsp, (int)sourceSegment->GetDuration());
|
||||||
|
|
||||||
int framesCopied = 0;
|
int framesCopied = 0;
|
||||||
nsAutoTArray<AudioDataValue, 9600> interleavedPcm;
|
AutoTArray<AudioDataValue, 9600> interleavedPcm;
|
||||||
nsAutoTArray<AudioDataValue, 9600> nonInterleavedPcm;
|
AutoTArray<AudioDataValue, 9600> nonInterleavedPcm;
|
||||||
interleavedPcm.SetLength(sourceSegment->GetDuration() * mChannels);
|
interleavedPcm.SetLength(sourceSegment->GetDuration() * mChannels);
|
||||||
nonInterleavedPcm.SetLength(sourceSegment->GetDuration() * mChannels);
|
nonInterleavedPcm.SetLength(sourceSegment->GetDuration() * mChannels);
|
||||||
while (!iter.IsEnded()) {
|
while (!iter.IsEnded()) {
|
||||||
|
@ -157,7 +157,7 @@ GMPDecryptorChild::KeyStatusChanged(const char* aSessionId,
|
|||||||
uint32_t aKeyIdLength,
|
uint32_t aKeyIdLength,
|
||||||
GMPMediaKeyStatus aStatus)
|
GMPMediaKeyStatus aStatus)
|
||||||
{
|
{
|
||||||
nsAutoTArray<uint8_t, 16> kid;
|
AutoTArray<uint8_t, 16> kid;
|
||||||
kid.AppendElements(aKeyId, aKeyIdLength);
|
kid.AppendElements(aKeyId, aKeyIdLength);
|
||||||
CALL_ON_GMP_THREAD(SendKeyStatusChanged,
|
CALL_ON_GMP_THREAD(SendKeyStatusChanged,
|
||||||
nsCString(aSessionId, aSessionIdLength), kid,
|
nsCString(aSessionId, aSessionIdLength), kid,
|
||||||
|
@ -183,7 +183,7 @@ TEST(VorbisTrackEncoder, EncodedFrame)
|
|||||||
for (int i = 0; i < rate; i++) {
|
for (int i = 0; i < rate; i++) {
|
||||||
data[i] = ((i%8)*4000) - (7*4000)/2;
|
data[i] = ((i%8)*4000) - (7*4000)/2;
|
||||||
}
|
}
|
||||||
nsAutoTArray<const AudioDataValue*,1> channelData;
|
AutoTArray<const AudioDataValue*,1> channelData;
|
||||||
channelData.AppendElement(data);
|
channelData.AppendElement(data);
|
||||||
AudioSegment segment;
|
AudioSegment segment;
|
||||||
segment.AppendFrames(samples.forget(), channelData, 44100);
|
segment.AppendFrames(samples.forget(), channelData, 44100);
|
||||||
|
@ -500,7 +500,7 @@ SendStreamAudio(DecodedStreamData* aStream, int64_t aStartTime,
|
|||||||
audio->EnsureAudioBuffer();
|
audio->EnsureAudioBuffer();
|
||||||
RefPtr<SharedBuffer> buffer = audio->mAudioBuffer;
|
RefPtr<SharedBuffer> buffer = audio->mAudioBuffer;
|
||||||
AudioDataValue* bufferData = static_cast<AudioDataValue*>(buffer->Data());
|
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) {
|
for (uint32_t i = 0; i < audio->mChannels; ++i) {
|
||||||
channels.AppendElement(bufferData + i * audio->mFrames);
|
channels.AppendElement(bufferData + i * audio->mFrames);
|
||||||
}
|
}
|
||||||
@ -522,7 +522,7 @@ DecodedStream::SendAudio(double aVolume, bool aIsSameOrigin)
|
|||||||
|
|
||||||
AudioSegment output;
|
AudioSegment output;
|
||||||
uint32_t rate = mInfo.mAudio.mRate;
|
uint32_t rate = mInfo.mAudio.mRate;
|
||||||
nsAutoTArray<RefPtr<MediaData>,10> audio;
|
AutoTArray<RefPtr<MediaData>,10> audio;
|
||||||
TrackID audioTrackId = mInfo.mAudio.mTrackId;
|
TrackID audioTrackId = mInfo.mAudio.mTrackId;
|
||||||
SourceMediaStream* sourceStream = mData->mStream;
|
SourceMediaStream* sourceStream = mData->mStream;
|
||||||
|
|
||||||
@ -587,7 +587,7 @@ DecodedStream::SendVideo(bool aIsSameOrigin)
|
|||||||
|
|
||||||
VideoSegment output;
|
VideoSegment output;
|
||||||
TrackID videoTrackId = mInfo.mVideo.mTrackId;
|
TrackID videoTrackId = mInfo.mVideo.mTrackId;
|
||||||
nsAutoTArray<RefPtr<MediaData>, 10> video;
|
AutoTArray<RefPtr<MediaData>, 10> video;
|
||||||
SourceMediaStream* sourceStream = mData->mStream;
|
SourceMediaStream* sourceStream = mData->mStream;
|
||||||
|
|
||||||
// It's OK to hold references to the VideoData because VideoData
|
// It's OK to hold references to the VideoData because VideoData
|
||||||
|
@ -314,13 +314,13 @@ VideoSink::RenderVideoFrames(int32_t aMaxFrames,
|
|||||||
{
|
{
|
||||||
AssertOwnerThread();
|
AssertOwnerThread();
|
||||||
|
|
||||||
nsAutoTArray<RefPtr<MediaData>,16> frames;
|
AutoTArray<RefPtr<MediaData>,16> frames;
|
||||||
VideoQueue().GetFirstElements(aMaxFrames, &frames);
|
VideoQueue().GetFirstElements(aMaxFrames, &frames);
|
||||||
if (frames.IsEmpty() || !mContainer) {
|
if (frames.IsEmpty() || !mContainer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoTArray<ImageContainer::NonOwningImage,16> images;
|
AutoTArray<ImageContainer::NonOwningImage,16> images;
|
||||||
TimeStamp lastFrameTime;
|
TimeStamp lastFrameTime;
|
||||||
MediaSink::PlaybackParams params = mAudioSink->GetPlaybackParams();
|
MediaSink::PlaybackParams params = mAudioSink->GetPlaybackParams();
|
||||||
for (uint32_t i = 0; i < frames.Length(); ++i) {
|
for (uint32_t i = 0; i < frames.Length(); ++i) {
|
||||||
|
@ -296,7 +296,7 @@ void OggReader::SetupTargetSkeleton(SkeletonState* aSkeletonState)
|
|||||||
} else if (ReadHeaders(aSkeletonState) && aSkeletonState->HasIndex()) {
|
} else if (ReadHeaders(aSkeletonState) && aSkeletonState->HasIndex()) {
|
||||||
// Extract the duration info out of the index, so we don't need to seek to
|
// Extract the duration info out of the index, so we don't need to seek to
|
||||||
// the end of resource to get it.
|
// the end of resource to get it.
|
||||||
nsAutoTArray<uint32_t, 2> tracks;
|
AutoTArray<uint32_t, 2> tracks;
|
||||||
BuildSerialList(tracks);
|
BuildSerialList(tracks);
|
||||||
int64_t duration = 0;
|
int64_t duration = 0;
|
||||||
if (NS_SUCCEEDED(aSkeletonState->GetDuration(tracks, duration))) {
|
if (NS_SUCCEEDED(aSkeletonState->GetDuration(tracks, duration))) {
|
||||||
@ -395,7 +395,7 @@ nsresult OggReader::ReadMetadata(MediaInfo* aInfo,
|
|||||||
*aTags = nullptr;
|
*aTags = nullptr;
|
||||||
|
|
||||||
ogg_page page;
|
ogg_page page;
|
||||||
nsAutoTArray<OggCodecState*,4> bitstreams;
|
AutoTArray<OggCodecState*,4> bitstreams;
|
||||||
nsTArray<uint32_t> serials;
|
nsTArray<uint32_t> serials;
|
||||||
bool readAllBOS = false;
|
bool readAllBOS = false;
|
||||||
while (!readAllBOS) {
|
while (!readAllBOS) {
|
||||||
@ -1254,7 +1254,7 @@ OggReader::IndexedSeekResult OggReader::SeekToKeyframeUsingIndex(int64_t aTarget
|
|||||||
return SEEK_INDEX_FAIL;
|
return SEEK_INDEX_FAIL;
|
||||||
}
|
}
|
||||||
// We have an index from the Skeleton track, try to use it to seek.
|
// 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);
|
BuildSerialList(tracks);
|
||||||
SkeletonState::nsSeekTarget keyframe;
|
SkeletonState::nsSeekTarget keyframe;
|
||||||
if (NS_FAILED(mSkeletonState->IndexedSeekTarget(aTarget,
|
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
|
// No index or other non-fatal index-related failure. Try to seek
|
||||||
// using a bisection search. Determine the already downloaded data
|
// using a bisection search. Determine the already downloaded data
|
||||||
// in the media cache, so we can try to seek in the cached data first.
|
// 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);
|
res = GetSeekRanges(ranges);
|
||||||
NS_ENSURE_SUCCESS(res,res);
|
NS_ENSURE_SUCCESS(res,res);
|
||||||
|
|
||||||
|
@ -751,7 +751,7 @@ public:
|
|||||||
UpdateAfterSendChunk(chunkSamples, bytesCopied, aSamplesRead);
|
UpdateAfterSendChunk(chunkSamples, bytesCopied, aSamplesRead);
|
||||||
} else {
|
} else {
|
||||||
// Interleave data to a temporary buffer.
|
// Interleave data to a temporary buffer.
|
||||||
nsAutoTArray<AudioDataValue, 9600> pcm;
|
AutoTArray<AudioDataValue, 9600> pcm;
|
||||||
pcm.SetLength(bytesToCopy);
|
pcm.SetLength(bytesToCopy);
|
||||||
AudioDataValue* interleavedSource = pcm.Elements();
|
AudioDataValue* interleavedSource = pcm.Elements();
|
||||||
AudioTrackEncoder::InterleaveTrackData(aChunk, chunkSamples,
|
AudioTrackEncoder::InterleaveTrackData(aChunk, chunkSamples,
|
||||||
@ -853,7 +853,7 @@ private:
|
|||||||
* mOMXAEncoder.mChannels * sizeof(AudioDataValue);
|
* mOMXAEncoder.mChannels * sizeof(AudioDataValue);
|
||||||
uint32_t dstSamplesCopied = aSamplesNum;
|
uint32_t dstSamplesCopied = aSamplesNum;
|
||||||
if (mOMXAEncoder.mResampler) {
|
if (mOMXAEncoder.mResampler) {
|
||||||
nsAutoTArray<AudioDataValue, 9600> pcm;
|
AutoTArray<AudioDataValue, 9600> pcm;
|
||||||
pcm.SetLength(bytesToCopy);
|
pcm.SetLength(bytesToCopy);
|
||||||
AudioTrackEncoder::InterleaveTrackData(aSource, aSamplesNum,
|
AudioTrackEncoder::InterleaveTrackData(aSource, aSamplesNum,
|
||||||
mOMXAEncoder.mChannels,
|
mOMXAEncoder.mChannels,
|
||||||
|
@ -71,8 +71,8 @@ VorbisDataDecoder::Init()
|
|||||||
PodZero(&mVorbisDsp);
|
PodZero(&mVorbisDsp);
|
||||||
PodZero(&mVorbisBlock);
|
PodZero(&mVorbisBlock);
|
||||||
|
|
||||||
nsAutoTArray<unsigned char*,4> headers;
|
AutoTArray<unsigned char*,4> headers;
|
||||||
nsAutoTArray<size_t,4> headerLens;
|
AutoTArray<size_t,4> headerLens;
|
||||||
if (!XiphExtradataToHeaders(headers, headerLens,
|
if (!XiphExtradataToHeaders(headers, headerLens,
|
||||||
mInfo.mCodecSpecificConfig->Elements(),
|
mInfo.mCodecSpecificConfig->Elements(),
|
||||||
mInfo.mCodecSpecificConfig->Length())) {
|
mInfo.mCodecSpecificConfig->Length())) {
|
||||||
|
@ -123,7 +123,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsAutoTArray<DurationElement, 16> mMap;
|
AutoTArray<DurationElement, 16> mMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
DurationMap mDurationMap;
|
DurationMap mDurationMap;
|
||||||
|
@ -321,7 +321,7 @@ private:
|
|||||||
static uint32_t counter = 0;
|
static uint32_t counter = 0;
|
||||||
return ++counter;
|
return ++counter;
|
||||||
};
|
};
|
||||||
nsAutoTArray<Element, 3> mElements;
|
AutoTArray<Element, 3> mElements;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* media::Refcountable - Add threadsafe ref-counting to something that isn't.
|
/* 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
Loading…
Reference in New Issue
Block a user