From 690e6fe38bacc77b90bc8c829c03c3595c98fbbb Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Tue, 2 Feb 2016 17:36:30 +0200 Subject: [PATCH] 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`. --- dom/bindings/BindingUtils.h | 4 ++-- dom/indexedDB/ActorsParent.cpp | 8 ++++---- dom/mobilemessage/ipc/SmsChild.cpp | 8 ++++---- dom/plugins/ipc/PluginScriptableObjectChild.cpp | 6 +++--- dom/plugins/ipc/PluginScriptableObjectParent.cpp | 6 +++--- gfx/thebes/gfxCoreTextShaper.cpp | 2 +- gfx/thebes/gfxDWriteFontList.cpp | 8 ++++---- gfx/thebes/gfxFontconfigFonts.cpp | 2 +- gfx/thebes/gfxGDIFontList.cpp | 4 ++-- gfx/thebes/gfxGraphiteShaper.cpp | 8 ++++---- gfx/thebes/gfxHarfBuzzShaper.cpp | 2 +- layout/generic/nsTextFrame.cpp | 14 +++++++------- 12 files changed, 36 insertions(+), 36 deletions(-) diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index 3ce76ae1c6af..3968d0246323 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -2070,10 +2070,10 @@ void DoTraceSequence(JSTracer* trc, InfallibleTArray& seq); namespace binding_detail { template -class AutoSequence : public AutoFallibleTArray +class AutoSequence : public AutoTArray { public: - AutoSequence() : AutoFallibleTArray() + AutoSequence() : AutoTArray() {} // Allow converting to const sequences as needed diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index e1517d22fa7c..b2d6f87d084c 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -8047,7 +8047,7 @@ class ObjectStoreGetRequestOp final const uint32_t mObjectStoreId; RefPtr mDatabase; const OptionalKeyRange mOptionalKeyRange; - AutoFallibleTArray mResponse; + AutoTArray mResponse; PBackgroundParent* mBackgroundParent; const uint32_t mLimit; const bool mGetAll; @@ -8208,7 +8208,7 @@ class IndexGetRequestOp final RefPtr mDatabase; const OptionalKeyRange mOptionalKeyRange; - AutoFallibleTArray mResponse; + AutoTArray mResponse; PBackgroundParent* mBackgroundParent; const uint32_t mLimit; const bool mGetAll; @@ -8235,7 +8235,7 @@ class IndexGetKeyRequestOp final friend class TransactionBase; const OptionalKeyRange mOptionalKeyRange; - AutoFallibleTArray mResponse; + AutoTArray mResponse; const uint32_t mLimit; const bool mGetAll; @@ -18199,7 +18199,7 @@ DatabaseOperationBase::GetStructuredCloneReadInfoFromBlob( return NS_ERROR_FILE_CORRUPTED; } - AutoFallibleTArray uncompressed; + AutoTArray uncompressed; if (NS_WARN_IF(!uncompressed.SetLength(uncompressedLength, fallible))) { return NS_ERROR_OUT_OF_MEMORY; } diff --git a/dom/mobilemessage/ipc/SmsChild.cpp b/dom/mobilemessage/ipc/SmsChild.cpp index d0594450c9c7..5bc2289fc21a 100644 --- a/dom/mobilemessage/ipc/SmsChild.cpp +++ b/dom/mobilemessage/ipc/SmsChild.cpp @@ -349,10 +349,10 @@ MobileMessageCursorChild::DoNotifyResult(const nsTArray& aDat const uint32_t length = aDataArray.Length(); MOZ_ASSERT(length); - AutoFallibleTArray autoArray; + AutoTArray autoArray; NS_ENSURE_TRUE_VOID(autoArray.SetCapacity(length, fallible)); - AutoFallibleTArray, 1> messages; + AutoTArray, 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& aDataArray) const uint32_t length = aDataArray.Length(); MOZ_ASSERT(length); - AutoFallibleTArray autoArray; + AutoTArray autoArray; NS_ENSURE_TRUE_VOID(autoArray.SetCapacity(length, fallible)); - AutoFallibleTArray, 1> threads; + AutoTArray, 1> threads; NS_ENSURE_TRUE_VOID(threads.SetCapacity(length, fallible)); for (uint32_t i = 0; i < length; i++) { diff --git a/dom/plugins/ipc/PluginScriptableObjectChild.cpp b/dom/plugins/ipc/PluginScriptableObjectChild.cpp index 29bc46fb9fd4..e4c5f9d10b69 100644 --- a/dom/plugins/ipc/PluginScriptableObjectChild.cpp +++ b/dom/plugins/ipc/PluginScriptableObjectChild.cpp @@ -775,7 +775,7 @@ PluginScriptableObjectChild::AnswerInvoke(const PluginIdentifier& aId, return true; } - AutoFallibleTArray convertedArgs; + AutoTArray convertedArgs; uint32_t argCount = aArgs.Length(); if (!convertedArgs.SetLength(argCount, mozilla::fallible)) { @@ -845,7 +845,7 @@ PluginScriptableObjectChild::AnswerInvokeDefault(InfallibleTArray&& aAr return true; } - AutoFallibleTArray convertedArgs; + AutoTArray convertedArgs; uint32_t argCount = aArgs.Length(); if (!convertedArgs.SetLength(argCount, mozilla::fallible)) { @@ -1096,7 +1096,7 @@ PluginScriptableObjectChild::AnswerConstruct(InfallibleTArray&& aArgs, return true; } - AutoFallibleTArray convertedArgs; + AutoTArray convertedArgs; uint32_t argCount = aArgs.Length(); if (!convertedArgs.SetLength(argCount, mozilla::fallible)) { diff --git a/dom/plugins/ipc/PluginScriptableObjectParent.cpp b/dom/plugins/ipc/PluginScriptableObjectParent.cpp index 5119df3b7463..f0aceab2971b 100644 --- a/dom/plugins/ipc/PluginScriptableObjectParent.cpp +++ b/dom/plugins/ipc/PluginScriptableObjectParent.cpp @@ -830,7 +830,7 @@ PluginScriptableObjectParent::AnswerInvoke(const PluginIdentifier& aId, return true; } - AutoFallibleTArray convertedArgs; + AutoTArray convertedArgs; uint32_t argCount = aArgs.Length(); if (!convertedArgs.SetLength(argCount, fallible)) { @@ -913,7 +913,7 @@ PluginScriptableObjectParent::AnswerInvokeDefault(InfallibleTArray&& aA return true; } - AutoFallibleTArray convertedArgs; + AutoTArray convertedArgs; uint32_t argCount = aArgs.Length(); if (!convertedArgs.SetLength(argCount, fallible)) { @@ -1233,7 +1233,7 @@ PluginScriptableObjectParent::AnswerConstruct(InfallibleTArray&& aArgs, return true; } - AutoFallibleTArray convertedArgs; + AutoTArray convertedArgs; uint32_t argCount = aArgs.Length(); if (!convertedArgs.SetLength(argCount, fallible)) { diff --git a/gfx/thebes/gfxCoreTextShaper.cpp b/gfx/thebes/gfxCoreTextShaper.cpp index d83f84f4610a..3d4606649750 100644 --- a/gfx/thebes/gfxCoreTextShaper.cpp +++ b/gfx/thebes/gfxCoreTextShaper.cpp @@ -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 charToGlyphArray; + AutoTArray charToGlyphArray; if (!charToGlyphArray.SetLength(stringRange.length, fallible)) { return NS_ERROR_OUT_OF_MEMORY; } diff --git a/gfx/thebes/gfxDWriteFontList.cpp b/gfx/thebes/gfxDWriteFontList.cpp index 305c696d6743..15d4da156daf 100644 --- a/gfx/thebes/gfxDWriteFontList.cpp +++ b/gfx/thebes/gfxDWriteFontList.cpp @@ -304,7 +304,7 @@ gfxDWriteFontFamily::LocalizedName(nsAString &aLocalizedName) idx = 0; } } - AutoFallibleTArray famName; + AutoTArray famName; UINT32 length; hr = names->GetStringLength(idx, &length); @@ -1065,7 +1065,7 @@ gfxDWriteFontList::GetFontsFromCollection(IDWriteFontCollection* aCollection) englishIdx = 0; } - AutoFallibleTArray enName; + AutoTArray 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 localizedName; + AutoTArray localizedName; // only add other names if (nameIndex == englishIdx) { @@ -1331,7 +1331,7 @@ static HRESULT GetFamilyName(IDWriteFont *aFont, nsString& aFamilyName) index = 0; } - AutoFallibleTArray name; + AutoTArray name; UINT32 length; hr = familyNames->GetStringLength(index, &length); diff --git a/gfx/thebes/gfxFontconfigFonts.cpp b/gfx/thebes/gfxFontconfigFonts.cpp index 31190800aeea..72d25bcc2e56 100644 --- a/gfx/thebes/gfxFontconfigFonts.cpp +++ b/gfx/thebes/gfxFontconfigFonts.cpp @@ -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,1> mPatterns; + AutoTArray,1> mPatterns; static cairo_user_data_key_t sFontEntryKey; }; diff --git a/gfx/thebes/gfxGDIFontList.cpp b/gfx/thebes/gfxGDIFontList.cpp index d297487819e7..8b7873c71c41 100644 --- a/gfx/thebes/gfxGDIFontList.cpp +++ b/gfx/thebes/gfxGDIFontList.cpp @@ -974,7 +974,7 @@ int CALLBACK GDIFontInfo::EnumerateFontsForFamily( uint32_t kNAME = NativeEndian::swapToBigEndian(TRUETYPE_TAG('n','a','m','e')); uint32_t nameSize; - AutoFallibleTArray nameData; + AutoTArray 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 cmapData; + AutoTArray cmapData; cmapSize = ::GetFontData(hdc, kCMAP, 0, nullptr, 0); if (cmapSize != GDI_ERROR && diff --git a/gfx/thebes/gfxGraphiteShaper.cpp b/gfx/thebes/gfxGraphiteShaper.cpp index 257655a6c204..91e9b749e4ea 100644 --- a/gfx/thebes/gfxGraphiteShaper.cpp +++ b/gfx/thebes/gfxGraphiteShaper.cpp @@ -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 clusters; - AutoFallibleTArray gids; - AutoFallibleTArray xLocs; - AutoFallibleTArray yLocs; + AutoTArray clusters; + AutoTArray gids; + AutoTArray xLocs; + AutoTArray yLocs; if (!clusters.SetLength(aLength, fallible) || !gids.SetLength(glyphCount, fallible) || diff --git a/gfx/thebes/gfxHarfBuzzShaper.cpp b/gfx/thebes/gfxHarfBuzzShaper.cpp index 675307098dee..3fd195c2f2ab 100644 --- a/gfx/thebes/gfxHarfBuzzShaper.cpp +++ b/gfx/thebes/gfxHarfBuzzShaper.cpp @@ -1583,7 +1583,7 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(DrawTarget *aDrawTarget, uint32_t wordLength = aLength; static const int32_t NO_GLYPH = -1; - AutoFallibleTArray charToGlyphArray; + AutoTArray charToGlyphArray; if (!charToGlyphArray.SetLength(wordLength, fallible)) { return NS_ERROR_OUT_OF_MEMORY; } diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index dbd10a555572..a49fc5c4b4b0 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -1500,7 +1500,7 @@ void BuildTextRunsScanner::FlushFrames(bool aFlushLineBreaks, bool aSuppressTrai mNextRunContextInfo |= nsTextFrameUtils::INCOMING_ARABICCHAR; } } else { - AutoFallibleTArray buffer; + AutoTArray 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 tempBuf; + AutoTArray 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 buffer; + AutoTArray 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 tempBuf; + AutoTArray 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 prevailingSelectionsBuffer; + AutoTArray 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 selectedCharsBuffer; + AutoTArray 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 hyphBuffer; + AutoTArray hyphBuffer; bool *hyphBreakBefore = nullptr; if (hyphenating) { hyphBreakBefore = hyphBuffer.AppendElements(flowEndInTextRun - start,