Bug 1235261 - Part 3: Switch remaining uses of AutoFallibleTArray to AutoTArray. r=froydnj

This is effectively a no-op because the affected array operations already use
`mozilla::fallible`.
This commit is contained in:
Birunthan Mohanathas 2016-02-02 17:36:30 +02:00
Родитель 9137955c65
Коммит 690e6fe38b
12 изменённых файлов: 36 добавлений и 36 удалений

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

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

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

@ -8047,7 +8047,7 @@ class ObjectStoreGetRequestOp final
const uint32_t mObjectStoreId;
RefPtr<Database> mDatabase;
const OptionalKeyRange mOptionalKeyRange;
AutoFallibleTArray<StructuredCloneReadInfo, 1> mResponse;
AutoTArray<StructuredCloneReadInfo, 1> mResponse;
PBackgroundParent* mBackgroundParent;
const uint32_t mLimit;
const bool mGetAll;
@ -8208,7 +8208,7 @@ class IndexGetRequestOp final
RefPtr<Database> mDatabase;
const OptionalKeyRange mOptionalKeyRange;
AutoFallibleTArray<StructuredCloneReadInfo, 1> mResponse;
AutoTArray<StructuredCloneReadInfo, 1> mResponse;
PBackgroundParent* mBackgroundParent;
const uint32_t mLimit;
const bool mGetAll;
@ -8235,7 +8235,7 @@ class IndexGetKeyRequestOp final
friend class TransactionBase;
const OptionalKeyRange mOptionalKeyRange;
AutoFallibleTArray<Key, 1> mResponse;
AutoTArray<Key, 1> mResponse;
const uint32_t mLimit;
const bool mGetAll;
@ -18199,7 +18199,7 @@ DatabaseOperationBase::GetStructuredCloneReadInfoFromBlob(
return NS_ERROR_FILE_CORRUPTED;
}
AutoFallibleTArray<uint8_t, 512> uncompressed;
AutoTArray<uint8_t, 512> uncompressed;
if (NS_WARN_IF(!uncompressed.SetLength(uncompressedLength, fallible))) {
return NS_ERROR_OUT_OF_MEMORY;
}

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

@ -349,10 +349,10 @@ MobileMessageCursorChild::DoNotifyResult(const nsTArray<MobileMessageData>& aDat
const uint32_t length = aDataArray.Length();
MOZ_ASSERT(length);
AutoFallibleTArray<nsISupports*, 1> autoArray;
AutoTArray<nsISupports*, 1> autoArray;
NS_ENSURE_TRUE_VOID(autoArray.SetCapacity(length, fallible));
AutoFallibleTArray<nsCOMPtr<nsISupports>, 1> messages;
AutoTArray<nsCOMPtr<nsISupports>, 1> messages;
NS_ENSURE_TRUE_VOID(messages.SetCapacity(length, fallible));
for (uint32_t i = 0; i < length; i++) {
@ -370,10 +370,10 @@ MobileMessageCursorChild::DoNotifyResult(const nsTArray<ThreadData>& aDataArray)
const uint32_t length = aDataArray.Length();
MOZ_ASSERT(length);
AutoFallibleTArray<nsISupports*, 1> autoArray;
AutoTArray<nsISupports*, 1> autoArray;
NS_ENSURE_TRUE_VOID(autoArray.SetCapacity(length, fallible));
AutoFallibleTArray<nsCOMPtr<nsISupports>, 1> threads;
AutoTArray<nsCOMPtr<nsISupports>, 1> threads;
NS_ENSURE_TRUE_VOID(threads.SetCapacity(length, fallible));
for (uint32_t i = 0; i < length; i++) {

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

@ -775,7 +775,7 @@ PluginScriptableObjectChild::AnswerInvoke(const PluginIdentifier& aId,
return true;
}
AutoFallibleTArray<NPVariant, 10> convertedArgs;
AutoTArray<NPVariant, 10> convertedArgs;
uint32_t argCount = aArgs.Length();
if (!convertedArgs.SetLength(argCount, mozilla::fallible)) {
@ -845,7 +845,7 @@ PluginScriptableObjectChild::AnswerInvokeDefault(InfallibleTArray<Variant>&& aAr
return true;
}
AutoFallibleTArray<NPVariant, 10> convertedArgs;
AutoTArray<NPVariant, 10> convertedArgs;
uint32_t argCount = aArgs.Length();
if (!convertedArgs.SetLength(argCount, mozilla::fallible)) {
@ -1096,7 +1096,7 @@ PluginScriptableObjectChild::AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
return true;
}
AutoFallibleTArray<NPVariant, 10> convertedArgs;
AutoTArray<NPVariant, 10> convertedArgs;
uint32_t argCount = aArgs.Length();
if (!convertedArgs.SetLength(argCount, mozilla::fallible)) {

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

@ -830,7 +830,7 @@ PluginScriptableObjectParent::AnswerInvoke(const PluginIdentifier& aId,
return true;
}
AutoFallibleTArray<NPVariant, 10> convertedArgs;
AutoTArray<NPVariant, 10> convertedArgs;
uint32_t argCount = aArgs.Length();
if (!convertedArgs.SetLength(argCount, fallible)) {
@ -913,7 +913,7 @@ PluginScriptableObjectParent::AnswerInvokeDefault(InfallibleTArray<Variant>&& aA
return true;
}
AutoFallibleTArray<NPVariant, 10> convertedArgs;
AutoTArray<NPVariant, 10> convertedArgs;
uint32_t argCount = aArgs.Length();
if (!convertedArgs.SetLength(argCount, fallible)) {
@ -1233,7 +1233,7 @@ PluginScriptableObjectParent::AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
return true;
}
AutoFallibleTArray<NPVariant, 10> convertedArgs;
AutoTArray<NPVariant, 10> convertedArgs;
uint32_t argCount = aArgs.Length();
if (!convertedArgs.SetLength(argCount, fallible)) {

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

@ -405,7 +405,7 @@ gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
// The charToGlyph array is indexed by char position within the stringRange of the glyph run.
static const int32_t NO_GLYPH = -1;
AutoFallibleTArray<int32_t,SMALL_GLYPH_RUN> charToGlyphArray;
AutoTArray<int32_t,SMALL_GLYPH_RUN> charToGlyphArray;
if (!charToGlyphArray.SetLength(stringRange.length, fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}

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

@ -304,7 +304,7 @@ gfxDWriteFontFamily::LocalizedName(nsAString &aLocalizedName)
idx = 0;
}
}
AutoFallibleTArray<WCHAR, 32> famName;
AutoTArray<WCHAR, 32> famName;
UINT32 length;
hr = names->GetStringLength(idx, &length);
@ -1065,7 +1065,7 @@ gfxDWriteFontList::GetFontsFromCollection(IDWriteFontCollection* aCollection)
englishIdx = 0;
}
AutoFallibleTArray<WCHAR, 32> enName;
AutoTArray<WCHAR, 32> enName;
UINT32 length;
hr = names->GetStringLength(englishIdx, &length);
@ -1110,7 +1110,7 @@ gfxDWriteFontList::GetFontsFromCollection(IDWriteFontCollection* aCollection)
for (nameIndex = 0; nameIndex < nameCount; nameIndex++) {
UINT32 nameLen;
AutoFallibleTArray<WCHAR, 32> localizedName;
AutoTArray<WCHAR, 32> localizedName;
// only add other names
if (nameIndex == englishIdx) {
@ -1331,7 +1331,7 @@ static HRESULT GetFamilyName(IDWriteFont *aFont, nsString& aFamilyName)
index = 0;
}
AutoFallibleTArray<WCHAR, 32> name;
AutoTArray<WCHAR, 32> name;
UINT32 length;
hr = familyNames->GetStringLength(index, &length);

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

@ -135,7 +135,7 @@ protected:
// One pattern is the common case and some subclasses rely on successful
// addition of the first element to the array.
AutoFallibleTArray<nsCountedRef<FcPattern>,1> mPatterns;
AutoTArray<nsCountedRef<FcPattern>,1> mPatterns;
static cairo_user_data_key_t sFontEntryKey;
};

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

@ -974,7 +974,7 @@ int CALLBACK GDIFontInfo::EnumerateFontsForFamily(
uint32_t kNAME =
NativeEndian::swapToBigEndian(TRUETYPE_TAG('n','a','m','e'));
uint32_t nameSize;
AutoFallibleTArray<uint8_t, 1024> nameData;
AutoTArray<uint8_t, 1024> nameData;
nameSize = ::GetFontData(hdc, kNAME, 0, nullptr, 0);
if (nameSize != GDI_ERROR &&
@ -1017,7 +1017,7 @@ int CALLBACK GDIFontInfo::EnumerateFontsForFamily(
uint32_t kCMAP =
NativeEndian::swapToBigEndian(TRUETYPE_TAG('c','m','a','p'));
uint32_t cmapSize;
AutoFallibleTArray<uint8_t, 1024> cmapData;
AutoTArray<uint8_t, 1024> cmapData;
cmapSize = ::GetFontData(hdc, kCMAP, 0, nullptr, 0);
if (cmapSize != GDI_ERROR &&

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

@ -206,10 +206,10 @@ gfxGraphiteShaper::SetGlyphsFromSegment(DrawTarget *aDrawTarget,
uint32_t glyphCount = gr_seg_n_slots(aSegment);
// identify clusters; graphite may have reordered/expanded/ligated glyphs.
AutoFallibleTArray<Cluster,SMALL_GLYPH_RUN> clusters;
AutoFallibleTArray<uint16_t,SMALL_GLYPH_RUN> gids;
AutoFallibleTArray<float,SMALL_GLYPH_RUN> xLocs;
AutoFallibleTArray<float,SMALL_GLYPH_RUN> yLocs;
AutoTArray<Cluster,SMALL_GLYPH_RUN> clusters;
AutoTArray<uint16_t,SMALL_GLYPH_RUN> gids;
AutoTArray<float,SMALL_GLYPH_RUN> xLocs;
AutoTArray<float,SMALL_GLYPH_RUN> yLocs;
if (!clusters.SetLength(aLength, fallible) ||
!gids.SetLength(glyphCount, fallible) ||

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

@ -1583,7 +1583,7 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(DrawTarget *aDrawTarget,
uint32_t wordLength = aLength;
static const int32_t NO_GLYPH = -1;
AutoFallibleTArray<int32_t,SMALL_GLYPH_RUN> charToGlyphArray;
AutoTArray<int32_t,SMALL_GLYPH_RUN> charToGlyphArray;
if (!charToGlyphArray.SetLength(wordLength, fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}

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

@ -1500,7 +1500,7 @@ void BuildTextRunsScanner::FlushFrames(bool aFlushLineBreaks, bool aSuppressTrai
mNextRunContextInfo |= nsTextFrameUtils::INCOMING_ARABICCHAR;
}
} else {
AutoFallibleTArray<uint8_t,BIG_TEXT_NODE_SIZE> buffer;
AutoTArray<uint8_t,BIG_TEXT_NODE_SIZE> buffer;
uint32_t bufferSize = mMaxTextLength*(mDoubleByteText ? 2 : 1);
if (bufferSize < mMaxTextLength || bufferSize == UINT32_MAX ||
!buffer.AppendElements(bufferSize, fallible)) {
@ -2093,7 +2093,7 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer)
if (mDoubleByteText) {
// Need to expand the text. First transform it into a temporary buffer,
// then expand.
AutoFallibleTArray<uint8_t,BIG_TEXT_NODE_SIZE> tempBuf;
AutoTArray<uint8_t,BIG_TEXT_NODE_SIZE> tempBuf;
uint8_t* bufStart = tempBuf.AppendElements(contentLength, fallible);
if (!bufStart) {
DestroyUserData(userDataToDestroy);
@ -2304,7 +2304,7 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer)
bool
BuildTextRunsScanner::SetupLineBreakerContext(gfxTextRun *aTextRun)
{
AutoFallibleTArray<uint8_t,BIG_TEXT_NODE_SIZE> buffer;
AutoTArray<uint8_t,BIG_TEXT_NODE_SIZE> buffer;
uint32_t bufferSize = mMaxTextLength*(mDoubleByteText ? 2 : 1);
if (bufferSize < mMaxTextLength || bufferSize == UINT32_MAX) {
return false;
@ -2381,7 +2381,7 @@ BuildTextRunsScanner::SetupLineBreakerContext(gfxTextRun *aTextRun)
if (mDoubleByteText) {
// Need to expand the text. First transform it into a temporary buffer,
// then expand.
AutoFallibleTArray<uint8_t,BIG_TEXT_NODE_SIZE> tempBuf;
AutoTArray<uint8_t,BIG_TEXT_NODE_SIZE> tempBuf;
uint8_t* bufStart = tempBuf.AppendElements(contentLength, fallible);
if (!bufStart) {
DestroyUserData(userDataToDestroy);
@ -5940,7 +5940,7 @@ nsTextFrame::PaintTextWithSelectionColors(gfxContext* aCtx,
nsTextFrame::DrawPathCallbacks* aCallbacks)
{
// Figure out which selections control the colors to use for each character.
AutoFallibleTArray<SelectionDetails*,BIG_TEXT_NODE_SIZE> prevailingSelectionsBuffer;
AutoTArray<SelectionDetails*,BIG_TEXT_NODE_SIZE> prevailingSelectionsBuffer;
SelectionDetails** prevailingSelections =
prevailingSelectionsBuffer.AppendElements(aContentLength, fallible);
if (!prevailingSelections) {
@ -6080,7 +6080,7 @@ nsTextFrame::PaintTextSelectionDecorations(gfxContext* aCtx,
return;
// Figure out which characters will be decorated for this selection.
AutoFallibleTArray<SelectionDetails*, BIG_TEXT_NODE_SIZE> selectedCharsBuffer;
AutoTArray<SelectionDetails*, BIG_TEXT_NODE_SIZE> selectedCharsBuffer;
SelectionDetails** selectedChars =
selectedCharsBuffer.AppendElements(aContentLength, fallible);
if (!selectedChars) {
@ -7844,7 +7844,7 @@ nsTextFrame::AddInlineMinISizeForFlow(nsRenderingContext *aRenderingContext,
uint32_t start =
FindStartAfterSkippingWhitespace(&provider, aData, textStyle, &iter, flowEndInTextRun);
AutoFallibleTArray<bool,BIG_TEXT_NODE_SIZE> hyphBuffer;
AutoTArray<bool,BIG_TEXT_NODE_SIZE> hyphBuffer;
bool *hyphBreakBefore = nullptr;
if (hyphenating) {
hyphBreakBefore = hyphBuffer.AppendElements(flowEndInTextRun - start,