Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
authorPhil Ringnalda <philringnalda@gmail.com>
Sun, 31 Jan 2016 10:10:57 -0800
changeset 318791 d77374bc1315f8d5023363d2cea58ca810ba4cb7
parent 318790 d66c3f19a2104e88e6a1337277819e51c16d4d98
child 318792 a49bae84297ca35cd0ef58e941133037962b6bd5
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1235261
milestone47.0a1
backs outd66c3f19a2104e88e6a1337277819e51c16d4d98
467d945426bb58d16648f25002049d16af8a5569
32b61df131426410d33928fd8e425c2c59d09661
c50bb8ed41966cb782d9f56a90544b97ffccbcf8
0ff0fa6fe81fd3cbed9b5d63d9f5326f844efcc8
df70e89669da3970f0634fcf695d7ee8931024c2
064969357fc94da487ada47c08249995b28cc560
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray CLOSED TREE Backed out changeset d66c3f19a210 (bug 1235261) Backed out changeset 467d945426bb (bug 1235261) Backed out changeset 32b61df13142 (bug 1235261) Backed out changeset c50bb8ed4196 (bug 1235261) Backed out changeset 0ff0fa6fe81f (bug 1235261) Backed out changeset df70e89669da (bug 1235261) Backed out changeset 064969357fc9 (bug 1235261)
accessible/atk/AccessibleWrap.cpp
accessible/atk/nsMaiInterfaceTable.cpp
accessible/atk/nsMaiInterfaceText.cpp
accessible/base/EventQueue.h
accessible/base/NotificationController.h
accessible/base/TextRange-inl.h
accessible/base/TextRange.cpp
accessible/base/TreeWalker.h
accessible/ipc/DocAccessibleChild.cpp
accessible/ipc/ProxyAccessible.cpp
accessible/mac/mozAccessible.mm
accessible/mac/mozTableAccessible.mm
accessible/windows/ia2/ia2Accessible.cpp
accessible/windows/ia2/ia2AccessibleTable.cpp
accessible/windows/ia2/ia2AccessibleTableCell.cpp
accessible/windows/ia2/ia2AccessibleText.cpp
accessible/windows/msaa/AccessibleWrap.cpp
accessible/xpcom/xpcAccessibleHyperText.cpp
accessible/xpcom/xpcAccessibleSelectable.cpp
accessible/xpcom/xpcAccessibleTable.cpp
accessible/xpcom/xpcAccessibleTableCell.cpp
docshell/base/nsDocShell.cpp
docshell/shistory/nsSHistory.cpp
dom/animation/EffectCompositor.cpp
dom/animation/KeyframeEffect.cpp
dom/base/DOMMatrix.cpp
dom/base/File.cpp
dom/base/FragmentOrElement.cpp
dom/base/Navigator.cpp
dom/base/nsContentIterator.cpp
dom/base/nsContentList.cpp
dom/base/nsContentUtils.cpp
dom/base/nsDOMMutationObserver.cpp
dom/base/nsDOMMutationObserver.h
dom/base/nsDOMTokenList.cpp
dom/base/nsDocument.cpp
dom/base/nsDocumentEncoder.cpp
dom/base/nsFocusManager.cpp
dom/base/nsFrameMessageManager.h
dom/base/nsIDocument.h
dom/base/nsINode.cpp
dom/base/nsLineBreaker.cpp
dom/base/nsLineBreaker.h
dom/base/nsPerformance.cpp
dom/base/nsPlainTextSerializer.h
dom/base/nsXHTMLContentSerializer.h
dom/bindings/BindingUtils.h
dom/bindings/Codegen.py
dom/bluetooth/common/BluetoothService.cpp
dom/cache/AutoUtils.cpp
dom/cache/Cache.cpp
dom/cache/CacheOpChild.cpp
dom/cache/CacheOpParent.cpp
dom/cache/DBSchema.cpp
dom/cache/Manager.cpp
dom/cache/ReadStream.cpp
dom/cache/TypeUtils.cpp
dom/camera/GonkCameraControl.cpp
dom/canvas/CanvasRenderingContext2D.h
dom/canvas/ImageBitmapRenderingContext.cpp
dom/events/EventStateManager.cpp
dom/events/TextComposition.h
dom/fetch/FetchDriver.cpp
dom/fetch/InternalHeaders.cpp
dom/gamepad/linux/LinuxGamepad.cpp
dom/html/HTMLAllCollection.cpp
dom/html/HTMLOptionsCollection.cpp
dom/html/TimeRanges.cpp
dom/html/TimeRanges.h
dom/html/nsHTMLContentSink.cpp
dom/indexedDB/ActorsParent.cpp
dom/indexedDB/IDBDatabase.cpp
dom/indexedDB/Key.cpp
dom/ipc/ContentParent.cpp
dom/ipc/PreallocatedProcessManager.cpp
dom/ipc/TabChild.h
dom/ipc/TabParent.cpp
dom/media/AudioCaptureStream.cpp
dom/media/AudioSegment.cpp
dom/media/AudioSegment.h
dom/media/AudioStream.cpp
dom/media/DOMMediaStream.h
dom/media/FileBlockCache.h
dom/media/GraphDriver.cpp
dom/media/GraphDriver.h
dom/media/Intervals.h
dom/media/MediaCache.cpp
dom/media/MediaStreamGraph.cpp
dom/media/TrackUnionStream.cpp
dom/media/VideoFrameContainer.cpp
dom/media/encoder/OpusTrackEncoder.cpp
dom/media/encoder/TrackEncoder.cpp
dom/media/encoder/VorbisTrackEncoder.cpp
dom/media/gmp/GMPDecryptorChild.cpp
dom/media/gtest/TestVorbisTrackEncoder.cpp
dom/media/mediasink/DecodedStream.cpp
dom/media/mediasink/VideoSink.cpp
dom/media/ogg/OggReader.cpp
dom/media/omx/OMXCodecWrapper.cpp
dom/media/platforms/agnostic/VorbisDecoder.cpp
dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
dom/media/systemservices/MediaUtils.h
dom/media/webaudio/AudioBuffer.h
dom/media/webaudio/AudioNodeEngine.h
dom/media/webaudio/AudioNodeExternalInputStream.cpp
dom/media/webaudio/AudioNodeStream.cpp
dom/media/webaudio/AudioNodeStream.h
dom/media/webaudio/DelayBuffer.h
dom/media/webaudio/WebAudioUtils.cpp
dom/media/webaudio/blink/HRTFElevation.cpp
dom/media/webaudio/blink/Reverb.cpp
dom/media/webm/WebMDemuxer.cpp
dom/media/webrtc/MediaEngineDefault.cpp
dom/media/webrtc/MediaEngineWebRTCAudio.cpp
dom/media/webspeech/recognition/SpeechRecognition.cpp
dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm
dom/media/webspeech/synth/nsSpeechTask.cpp
dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
dom/messagechannel/MessagePort.cpp
dom/mobilemessage/ipc/SmsChild.cpp
dom/notification/Notification.cpp
dom/plugins/base/nsNPAPIPlugin.cpp
dom/plugins/base/nsPluginHost.cpp
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/plugins/base/nsPluginsDirUtils.h
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginModuleChild.h
dom/plugins/ipc/PluginScriptableObjectChild.cpp
dom/plugins/ipc/PluginScriptableObjectParent.cpp
dom/power/PowerManager.cpp
dom/power/PowerManagerService.cpp
dom/quota/ActorsParent.cpp
dom/quota/QuotaManager.h
dom/svg/SVGLengthList.h
dom/voicemail/Voicemail.h
dom/workers/Queue.h
dom/workers/RuntimeService.cpp
dom/workers/ServiceWorkerEvents.cpp
dom/workers/ServiceWorkerManager.cpp
dom/workers/ServiceWorkerManager.h
dom/workers/WorkerPrivate.cpp
dom/xbl/nsXBLEventHandler.cpp
dom/xbl/nsXBLService.cpp
dom/xbl/nsXBLWindowKeyHandler.cpp
dom/xslt/xpath/txMozillaXPathTreeWalker.cpp
dom/xslt/xslt/txExecutionState.h
dom/xul/templates/nsTreeRows.h
dom/xul/templates/nsXULContentBuilder.cpp
dom/xul/templates/nsXULTemplateBuilder.cpp
dom/xul/templates/nsXULTreeBuilder.cpp
editor/libeditor/nsEditor.cpp
embedding/components/commandhandler/nsCommandGroup.cpp
extensions/cookie/nsPermissionManager.h
gfx/2d/StackArray.h
gfx/gl/DecomposeIntoNoRepeatTriangles.h
gfx/gl/GLContextProviderGLX.cpp
gfx/layers/ImageContainer.cpp
gfx/layers/ImageContainer.h
gfx/layers/LayerTreeInvalidation.cpp
gfx/layers/Layers.cpp
gfx/layers/basic/BasicLayerManager.cpp
gfx/layers/client/CanvasClient.cpp
gfx/layers/client/ClientContainerLayer.h
gfx/layers/client/ClientLayerManager.cpp
gfx/layers/client/ClientLayerManager.h
gfx/layers/client/ContentClient.cpp
gfx/layers/client/ImageClient.cpp
gfx/layers/composite/AsyncCompositionManager.cpp
gfx/layers/composite/ContainerLayerComposite.cpp
gfx/layers/composite/FPSCounter.h
gfx/layers/composite/FrameUniformityData.h
gfx/layers/ipc/CompositableTransactionParent.cpp
gfx/layers/ipc/CompositorChild.cpp
gfx/layers/ipc/CompositorChild.h
gfx/layers/ipc/ImageBridgeChild.cpp
gfx/layers/ipc/ImageBridgeParent.cpp
gfx/layers/ipc/ImageContainerParent.h
gfx/layers/ipc/ShadowLayers.cpp
gfx/layers/opengl/CompositorOGL.h
gfx/src/nsRegion.cpp
gfx/thebes/gfxCoreTextShaper.cpp
gfx/thebes/gfxDWriteFontList.cpp
gfx/thebes/gfxDWriteFontList.h
gfx/thebes/gfxFT2FontList.cpp
gfx/thebes/gfxFT2FontList.h
gfx/thebes/gfxFcPlatformFontList.cpp
gfx/thebes/gfxFcPlatformFontList.h
gfx/thebes/gfxFont.cpp
gfx/thebes/gfxFont.h
gfx/thebes/gfxFontEntry.cpp
gfx/thebes/gfxFontEntry.h
gfx/thebes/gfxFontconfigFonts.cpp
gfx/thebes/gfxFontconfigFonts.h
gfx/thebes/gfxFontconfigUtils.cpp
gfx/thebes/gfxFontconfigUtils.h
gfx/thebes/gfxGDIFontList.cpp
gfx/thebes/gfxGDIFontList.h
gfx/thebes/gfxGraphiteShaper.cpp
gfx/thebes/gfxHarfBuzzShaper.cpp
gfx/thebes/gfxMacPlatformFontList.mm
gfx/thebes/gfxPlatformFontList.cpp
gfx/thebes/gfxTextRun.cpp
gfx/thebes/gfxTextRun.h
gfx/thebes/gfxWindowsPlatform.cpp
hal/WindowIdentifier.h
hal/gonk/GonkSensor.cpp
hal/sandbox/SandboxHal.cpp
image/RasterImage.cpp
image/decoders/icon/mac/nsIconChannelCocoa.mm
image/imgLoader.cpp
intl/hyphenation/glue/nsHyphenator.cpp
intl/hyphenation/glue/nsHyphenator.h
intl/locale/mac/nsDateTimeFormatMac.cpp
intl/locale/nsLocaleService.cpp
intl/lwbrk/nsJISx4051LineBreaker.cpp
intl/lwbrk/nsPangoBreaker.cpp
intl/lwbrk/nsUniscribeBreaker.cpp
ipc/glue/IPCMessageUtils.h
ipc/glue/WindowsMessageLoop.cpp
js/xpconnect/src/XPCWrappedNative.cpp
js/xpconnect/src/xpcprivate.h
layout/base/FrameLayerBuilder.cpp
layout/base/FrameLayerBuilder.h
layout/base/PositionedEventTargeting.cpp
layout/base/RestyleManager.h
layout/base/RestyleTracker.cpp
layout/base/RestyleTracker.h
layout/base/nsBidiPresUtils.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCounterManager.cpp
layout/base/nsDisplayList.cpp
layout/base/nsDisplayList.h
layout/base/nsIPresShell.h
layout/base/nsLayoutUtils.cpp
layout/base/nsPresContext.cpp
layout/base/nsPresShell.cpp
layout/base/nsRefreshDriver.cpp
layout/base/nsRefreshDriver.h
layout/generic/FrameChildList.h
layout/generic/MathMLTextRunFactory.cpp
layout/generic/RubyUtils.h
layout/generic/nsBlockFrame.cpp
layout/generic/nsContainerFrame.cpp
layout/generic/nsFlexContainerFrame.cpp
layout/generic/nsFontInflationData.cpp
layout/generic/nsFrame.cpp
layout/generic/nsFrameState.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGridContainerFrame.cpp
layout/generic/nsHTMLReflowState.cpp
layout/generic/nsIFrame.h
layout/generic/nsImageMap.h
layout/generic/nsPluginFrame.cpp
layout/generic/nsRubyBaseContainerFrame.cpp
layout/generic/nsSelection.cpp
layout/generic/nsTextFrame.cpp
layout/generic/nsTextFrame.h
layout/generic/nsTextRunTransformations.cpp
layout/inspector/inDOMUtils.cpp
layout/mathml/nsMathMLChar.cpp
layout/mathml/nsMathMLmmultiscriptsFrame.cpp
layout/style/CSSStyleSheet.cpp
layout/style/CSSStyleSheet.h
layout/style/CounterStyleManager.cpp
layout/style/Declaration.cpp
layout/style/Declaration.h
layout/style/FontFace.h
layout/style/FontFaceSet.cpp
layout/style/Loader.cpp
layout/style/Loader.h
layout/style/StyleAnimationValue.cpp
layout/style/StyleRule.cpp
layout/style/nsAnimationManager.cpp
layout/style/nsCSSParser.cpp
layout/style/nsCSSRuleProcessor.cpp
layout/style/nsCSSValue.cpp
layout/style/nsFontFaceUtils.cpp
layout/style/nsRuleNode.cpp
layout/style/nsRuleProcessorData.h
layout/style/nsStyleSet.cpp
layout/style/nsStyleStruct.h
layout/svg/SVGTextFrame.cpp
layout/svg/nsSVGEffects.cpp
layout/svg/nsSVGFilterInstance.cpp
layout/svg/nsSVGGradientFrame.cpp
layout/svg/nsSVGUtils.cpp
layout/tables/nsCellMap.cpp
layout/tables/nsCellMap.h
layout/tables/nsTableFrame.cpp
layout/tables/nsTableFrame.h
layout/tables/nsTableRowGroupFrame.cpp
layout/xul/nsMenuBarFrame.cpp
layout/xul/nsMenuBarListener.cpp
layout/xul/tree/nsTreeContentView.cpp
media/libstagefright/binding/Index.cpp
media/libstagefright/binding/include/mp4_demuxer/ByteReader.h
media/webrtc/signaling/src/media-conduit/AudioConduit.h
media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
media/webrtc/signaling/src/media-conduit/WebrtcOMXH264VideoCodec.cpp
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
media/webrtc/signaling/test/FakeMediaStreamsImpl.h
mobile/android/components/build/nsAndroidHistory.h
modules/libjar/nsJARProtocolHandler.h
modules/libpref/nsPrefBranch.cpp
netwerk/base/nsLoadGroup.cpp
netwerk/cache/nsCacheService.cpp
netwerk/cookie/nsCookieService.cpp
netwerk/sctp/datachannel/DataChannel.h
parser/html/nsHtml5DocumentBuilder.h
parser/html/nsParserUtils.cpp
python/lldbutils/lldbutils/general.py
rdf/base/nsCompositeDataSource.cpp
rdf/base/nsInMemoryDataSource.cpp
rdf/base/nsRDFContentSink.cpp
rdf/base/nsRDFXMLSerializer.cpp
storage/mozStorageSQLFunctions.cpp
toolkit/components/downloads/nsDownloadManager.cpp
toolkit/components/places/History.h
toolkit/profile/ProfileUnlockerWin.cpp
uriloader/base/nsDocLoader.h
uriloader/exthandler/mac/nsOSHelperAppService.mm
widget/TextEvents.h
widget/TextRange.h
widget/TouchEvents.h
widget/android/nsAppShell.cpp
widget/android/nsWindow.cpp
widget/cocoa/NativeKeyBindings.mm
widget/cocoa/nsChildView.mm
widget/gonk/HwcComposer2D.cpp
widget/gtk/nsWindow.cpp
widget/nsNativeTheme.h
widget/qt/nsWindow.cpp
widget/windows/KeyboardLayout.cpp
widget/windows/WinMouseScrollHandler.cpp
widget/windows/WinUtils.cpp
widget/windows/nsFilePicker.h
widget/windows/nsScreenManagerWin.h
widget/windows/nsWindow.cpp
xpcom/base/CycleCollectedJSRuntime.cpp
xpcom/glue/BlockingResourceBase.h
xpcom/glue/nsTArray-inl.h
xpcom/glue/nsTArray.h
xpcom/glue/nsTArrayForwardDeclare.h
xpcom/glue/nsTObserverArray.h
xpcom/glue/tests/gtest/TestGCPostBarriers.cpp
xpcom/io/nsLocalFileCommon.cpp
xpcom/string/nsTStringObsolete.cpp
xpcom/tests/TestTArray.cpp
xpcom/threads/LazyIdleThread.cpp
--- a/accessible/atk/AccessibleWrap.cpp
+++ b/accessible/atk/AccessibleWrap.cpp
@@ -754,17 +754,17 @@ getAttributesCB(AtkObject *aAtkObj)
   AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
   if (accWrap)
     return GetAttributeSet(accWrap);
 
   ProxyAccessible* proxy = GetProxy(aAtkObj);
   if (!proxy)
     return nullptr;
 
-  AutoTArray<Attribute, 10> attrs;
+  nsAutoTArray<Attribute, 10> attrs;
   proxy->Attributes(&attrs);
   if (attrs.IsEmpty())
     return nullptr;
 
   AtkAttributeSet* objAttributeSet = nullptr;
   for (uint32_t i = 0; i < attrs.Length(); i++) {
     AtkAttribute *objAttr = (AtkAttribute *)g_malloc(sizeof(AtkAttribute));
     objAttr->name = g_strdup(attrs[i].Name().get());
@@ -1014,17 +1014,17 @@ refRelationSetCB(AtkObject *aAtkObj)
     proxy->Relations(&types, &targetSets);
 
     size_t relationCount = types.Length();
     for (size_t i = 0; i < relationCount; i++) {
       if (typeMap[static_cast<uint32_t>(types[i])] == ATK_RELATION_NULL)
         continue;
 
       size_t targetCount = targetSets[i].Length();
-      AutoTArray<AtkObject*, 5> wrappers;
+      nsAutoTArray<AtkObject*, 5> wrappers;
       for (size_t j = 0; j < targetCount; j++)
         wrappers.AppendElement(GetWrapperFor(targetSets[i][j]));
 
       AtkRelationType atkType = typeMap[static_cast<uint32_t>(types[i])];
       AtkRelation* atkRelation =
         atk_relation_set_get_relation_by_type(relation_set, atkType);
       if (atkRelation)
         atk_relation_set_remove(relation_set, atkRelation);
@@ -1659,17 +1659,17 @@ AccessibleWrap::GetColumnHeader(TableAcc
   }
 
   // otherwise get column header for the data cell at the first row.
   TableCellAccessible* tableCell = cell->AsTableCell();
   if (!tableCell) {
     return nullptr;
   }
 
-  AutoTArray<Accessible*, 10> headerCells;
+  nsAutoTArray<Accessible*, 10> headerCells;
   tableCell->ColHeaderCells(&headerCells);
   if (headerCells.IsEmpty()) {
     return nullptr;
   }
 
   return headerCells[0];
 }
 
@@ -1693,16 +1693,16 @@ AccessibleWrap::GetRowHeader(TableAccess
   }
 
   // otherwise get row header for the data cell at the first column.
   TableCellAccessible* tableCell = cell->AsTableCell();
   if (!tableCell) {
     return nullptr;
   }
 
-  AutoTArray<Accessible*, 10> headerCells;
+  nsAutoTArray<Accessible*, 10> headerCells;
   tableCell->RowHeaderCells(&headerCells);
   if (headerCells.IsEmpty()) {
     return nullptr;
   }
 
   return headerCells[0];
 }
--- a/accessible/atk/nsMaiInterfaceTable.cpp
+++ b/accessible/atk/nsMaiInterfaceTable.cpp
@@ -268,17 +268,17 @@ getSummaryCB(AtkTable *aTable)
   return nullptr;
 }
 
 static gint
 getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
 {
   *aSelected = nullptr;
 
-  AutoTArray<uint32_t, 10> cols;
+  nsAutoTArray<uint32_t, 10> cols;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     accWrap->AsTable()->SelectedColIndices(&cols);
    } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     proxy->TableSelectedColumnIndices(&cols);
   } else {
     return 0;
   }
@@ -295,17 +295,17 @@ getSelectedColumnsCB(AtkTable *aTable, g
   memcpy(atkColumns, cols.Elements(), cols.Length() * sizeof(uint32_t));
   *aSelected = atkColumns;
   return cols.Length();
 }
 
 static gint
 getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
 {
-  AutoTArray<uint32_t, 10> rows;
+  nsAutoTArray<uint32_t, 10> rows;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     accWrap->AsTable()->SelectedRowIndices(&rows);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     proxy->TableSelectedRowIndices(&rows);
   } else {
     return 0;
   }
--- a/accessible/atk/nsMaiInterfaceText.cpp
+++ b/accessible/atk/nsMaiInterfaceText.cpp
@@ -306,17 +306,17 @@ getRunAttributesCB(AtkText *aText, gint 
     return ConvertToAtkTextAttributeSet(attributes);
   }
 
   ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText));
   if (!proxy) {
     return nullptr;
   }
 
-  AutoTArray<Attribute, 10> attrs;
+  nsAutoTArray<Attribute, 10> attrs;
   proxy->TextAttributes(false, aOffset, &attrs, &startOffset, &endOffset);
   *aStartOffset = startOffset;
   *aEndOffset = endOffset;
   return ConvertToAtkTextAttributeSet(attrs);
 }
 
 static AtkAttributeSet*
 getDefaultAttributesCB(AtkText *aText)
@@ -332,17 +332,17 @@ getDefaultAttributesCB(AtkText *aText)
     return ConvertToAtkTextAttributeSet(attributes);
   }
 
   ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText));
   if (!proxy) {
     return nullptr;
   }
 
-  AutoTArray<Attribute, 10> attrs;
+  nsAutoTArray<Attribute, 10> attrs;
   proxy->DefaultTextAttributes(&attrs);
   return ConvertToAtkTextAttributeSet(attrs);
 }
 
 static void
 getCharacterExtentsCB(AtkText *aText, gint aOffset,
                       gint *aX, gint *aY,
                       gint *aWidth, gint *aHeight,
--- a/accessible/base/EventQueue.h
+++ b/accessible/base/EventQueue.h
@@ -71,17 +71,17 @@ private:
 protected:
 
   /**
    * The document accessible reference owning this queue.
    */
   DocAccessible* mDocument;
 
   /**
-   * Pending events array. Don't make this an AutoTArray; we use
+   * Pending events array. Don't make this an nsAutoTArray; we use
    * SwapElements() on it.
    */
   nsTArray<RefPtr<AccEvent> > mEvents;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
--- a/accessible/base/NotificationController.h
+++ b/accessible/base/NotificationController.h
@@ -270,17 +270,17 @@ private:
     RefPtr<Accessible> mContainer;
 
     // Array of inserted contents.
     nsTArray<nsCOMPtr<nsIContent> > mInsertedContent;
   };
 
   /**
    * A pending accessible tree update notifications for content insertions.
-   * Don't make this an AutoTArray; we use SwapElements() on it.
+   * Don't make this an nsAutoTArray; we use SwapElements() on it.
    */
   nsTArray<RefPtr<ContentInsertion> > mContentInsertions;
 
   template<class T>
   class nsCOMPtrHashKey : public PLDHashEntryHdr
   {
   public:
     typedef T* KeyType;
@@ -304,17 +304,17 @@ private:
   };
 
   /**
    * A pending accessible tree update notifications for rendered text changes.
    */
   nsTHashtable<nsCOMPtrHashKey<nsIContent> > mTextHash;
 
   /**
-   * Other notifications like DOM events. Don't make this an AutoTArray; we
+   * Other notifications like DOM events. Don't make this an nsAutoTArray; we
    * use SwapElements() on it.
    */
   nsTArray<RefPtr<Notification> > mNotifications;
 
   /**
    * Holds all scheduled relocations.
    */
   nsTArray<RefPtr<Accessible> > mRelocations;
--- a/accessible/base/TextRange-inl.h
+++ b/accessible/base/TextRange-inl.h
@@ -12,17 +12,17 @@
 
 namespace mozilla {
 namespace a11y {
 
 inline Accessible*
 TextRange::Container() const
 {
   uint32_t pos1 = 0, pos2 = 0;
-  AutoTArray<Accessible*, 30> parents1, parents2;
+  nsAutoTArray<Accessible*, 30> parents1, parents2;
   return CommonParent(mStartContainer, mEndContainer,
                       &parents1, &pos1, &parents2, &pos2);
 }
 
 
 } // namespace a11y
 } // namespace mozilla
 
--- a/accessible/base/TextRange.cpp
+++ b/accessible/base/TextRange.cpp
@@ -19,17 +19,17 @@ bool
 TextPoint::operator <(const TextPoint& aPoint) const
 {
   if (mContainer == aPoint.mContainer)
     return mOffset < aPoint.mOffset;
 
   // Build the chain of parents
   Accessible* p1 = mContainer;
   Accessible* p2 = aPoint.mContainer;
-  AutoTArray<Accessible*, 30> parents1, parents2;
+  nsAutoTArray<Accessible*, 30> parents1, parents2;
   do {
     parents1.AppendElement(p1);
     p1 = p1->Parent();
   } while (p1);
   do {
     parents2.AppendElement(p2);
     p2 = p2->Parent();
   } while (p2);
@@ -71,17 +71,17 @@ TextRange::EmbeddedChildren(nsTArray<Acc
     }
     return;
   }
 
   Accessible* p1 = mStartContainer->GetChildAtOffset(mStartOffset);
   Accessible* p2 = mEndContainer->GetChildAtOffset(mEndOffset);
 
   uint32_t pos1 = 0, pos2 = 0;
-  AutoTArray<Accessible*, 30> parents1, parents2;
+  nsAutoTArray<Accessible*, 30> parents1, parents2;
   Accessible* container =
     CommonParent(p1, p2, &parents1, &pos1, &parents2, &pos2);
 
   // Traverse the tree up to the container and collect embedded objects.
   for (uint32_t idx = 0; idx < pos1 - 1; idx++) {
     Accessible* parent = parents1[idx + 1];
     Accessible* child = parents1[idx];
     uint32_t childCount = parent->ChildCount();
@@ -141,17 +141,17 @@ TextRange::Normalize(ETextUnit aUnit)
 {
 
 }
 
 bool
 TextRange::Crop(Accessible* aContainer)
 {
   uint32_t boundaryPos = 0, containerPos = 0;
-  AutoTArray<Accessible*, 30> boundaryParents, containerParents;
+  nsAutoTArray<Accessible*, 30> boundaryParents, containerParents;
 
   // Crop the start boundary.
   Accessible* container = nullptr;
   Accessible* boundary = mStartContainer->GetChildAtOffset(mStartOffset);
   if (boundary != aContainer) {
     CommonParent(boundary, aContainer, &boundaryParents, &boundaryPos,
                  &containerParents, &containerPos);
 
--- a/accessible/base/TreeWalker.h
+++ b/accessible/base/TreeWalker.h
@@ -82,17 +82,17 @@ private:
   /**
    * Pop state from stack.
    */
   ChildrenIterator* PopState();
 
   DocAccessible* mDoc;
   Accessible* mContext;
   nsIContent* mAnchorNode;
-  AutoTArray<ChildrenIterator, 20> mStateStack;
+  nsAutoTArray<ChildrenIterator, 20> mStateStack;
   int32_t mChildFilter;
   uint32_t mFlags;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif // mozilla_a11y_TreeWalker_h_
--- a/accessible/ipc/DocAccessibleChild.cpp
+++ b/accessible/ipc/DocAccessibleChild.cpp
@@ -1043,17 +1043,17 @@ DocAccessibleChild::RecvRowExtent(const 
 }
 
 bool
 DocAccessibleChild::RecvColHeaderCells(const uint64_t& aID,
                                        nsTArray<uint64_t>* aCells)
 {
   TableCellAccessible* acc = IdToTableCellAccessible(aID);
   if (acc) {
-    AutoTArray<Accessible*, 10> headerCells;
+    nsAutoTArray<Accessible*, 10> headerCells;
     acc->ColHeaderCells(&headerCells);
     aCells->SetCapacity(headerCells.Length());
     for (uint32_t i = 0; i < headerCells.Length(); ++i) {
       aCells->AppendElement(
         reinterpret_cast<uint64_t>(headerCells[i]->UniqueID()));
     }
   }
 
@@ -1061,17 +1061,17 @@ DocAccessibleChild::RecvColHeaderCells(c
 }
 
 bool
 DocAccessibleChild::RecvRowHeaderCells(const uint64_t& aID,
                                        nsTArray<uint64_t>* aCells)
 {
   TableCellAccessible* acc = IdToTableCellAccessible(aID);
   if (acc) {
-    AutoTArray<Accessible*, 10> headerCells;
+    nsAutoTArray<Accessible*, 10> headerCells;
     acc->RowHeaderCells(&headerCells);
     aCells->SetCapacity(headerCells.Length());
     for (uint32_t i = 0; i < headerCells.Length(); ++i) {
       aCells->AppendElement(
         reinterpret_cast<uint64_t>(headerCells[i]->UniqueID()));
     }
   }
 
@@ -1363,17 +1363,17 @@ DocAccessibleChild::RecvTableSelectedRow
 }
 
 bool
 DocAccessibleChild::RecvTableSelectedCells(const uint64_t& aID,
                                            nsTArray<uint64_t>* aCellIDs)
 {
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
-    AutoTArray<Accessible*, 30> cells;
+    nsAutoTArray<Accessible*, 30> cells;
     acc->SelectedCells(&cells);
     aCellIDs->SetCapacity(cells.Length());
     for (uint32_t i = 0; i < cells.Length(); ++i) {
       aCellIDs->AppendElement(
         reinterpret_cast<uint64_t>(cells[i]->UniqueID()));
     }
   }
 
@@ -1524,17 +1524,17 @@ DocAccessibleChild::RecvAtkTableRowHeade
 }
 
 bool
 DocAccessibleChild::RecvSelectedItems(const uint64_t& aID,
                                       nsTArray<uint64_t>* aSelectedItemIDs)
 {
   Accessible* acc = IdToAccessibleSelect(aID);
   if (acc) {
-    AutoTArray<Accessible*, 10> selectedItems;
+    nsAutoTArray<Accessible*, 10> selectedItems;
     acc->SelectedItems(&selectedItems);
     aSelectedItemIDs->SetCapacity(selectedItems.Length());
     for (size_t i = 0; i < selectedItems.Length(); ++i) {
       aSelectedItemIDs->AppendElement(
         reinterpret_cast<uint64_t>(selectedItems[i]->UniqueID()));
     }
   }
 
--- a/accessible/ipc/ProxyAccessible.cpp
+++ b/accessible/ipc/ProxyAccessible.cpp
@@ -773,17 +773,17 @@ ProxyAccessible::TableSelectedRowCount()
   uint32_t count = 0;
   Unused << mDoc->SendTableSelectedRowCount(mID, &count);
   return count;
 }
 
 void
 ProxyAccessible::TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs)
 {
-  AutoTArray<uint64_t, 30> cellIDs;
+  nsAutoTArray<uint64_t, 30> cellIDs;
   Unused << mDoc->SendTableSelectedCells(mID, &cellIDs);
   aCellIDs->SetCapacity(cellIDs.Length());
   for (uint32_t i = 0; i < cellIDs.Length(); ++i) {
     aCellIDs->AppendElement(mDoc->GetAccessible(cellIDs[i]));
   }
 }
 
 void
@@ -852,17 +852,17 @@ ProxyAccessible::AtkTableRowHeader(int32
   bool ok = false;
   Unused << mDoc->SendAtkTableRowHeader(mID, aRow, &headerID, &ok);
   return ok ? mDoc->GetAccessible(headerID) : nullptr;
 }
 
 void
 ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems)
 {
-  AutoTArray<uint64_t, 10> itemIDs;
+  nsAutoTArray<uint64_t, 10> itemIDs;
   Unused << mDoc->SendSelectedItems(mID, &itemIDs);
   aSelectedItems->SetCapacity(itemIDs.Length());
   for (size_t i = 0; i < itemIDs.Length(); ++i) {
     aSelectedItems->AppendElement(mDoc->GetAccessible(itemIDs[i]));
   }
 }
 
 uint32_t
--- a/accessible/mac/mozAccessible.mm
+++ b/accessible/mac/mozAccessible.mm
@@ -415,17 +415,17 @@ ConvertToNSArray(nsTArray<ProxyAccessibl
       // Per the MathML 3 spec, the latter happens iff the linethickness
       // attribute is of the form [zero-float][optional-unit]. In that case we
       // set line thickness to zero and in the other cases we set it to one.
       nsAutoString thickness;
       if (accWrap) {
         nsCOMPtr<nsIPersistentProperties> attributes = accWrap->Attributes();
         nsAccUtils::GetAccAttr(attributes, nsGkAtoms::linethickness_, thickness);
       } else {
-        AutoTArray<Attribute, 10> attrs;
+        nsAutoTArray<Attribute, 10> attrs;
         proxy->Attributes(&attrs);
         for (size_t i = 0 ; i < attrs.Length() ; i++) {
           if (attrs.ElementAt(i).Name() == "thickness") {
             thickness = attrs.ElementAt(i).Value();
             break;
           }
         }
       }
@@ -679,21 +679,21 @@ ConvertToNSArray(nsTArray<ProxyAccessibl
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   AccessibleWrap* accWrap = [self getGeckoAccessible];
   if (mChildren || (accWrap && !accWrap->AreChildrenCached()))
     return mChildren;
 
   // get the array of children.
   if (accWrap) {
-    AutoTArray<Accessible*, 10> childrenArray;
+    nsAutoTArray<Accessible*, 10> childrenArray;
     accWrap->GetUnignoredChildren(&childrenArray);
     mChildren = ConvertToNSArray(childrenArray);
   } else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
-    AutoTArray<ProxyAccessible*, 10> childrenArray;
+    nsAutoTArray<ProxyAccessible*, 10> childrenArray;
     GetProxyUnignoredChildren(proxy, &childrenArray);
     mChildren = ConvertToNSArray(childrenArray);
   }
 
 #ifdef DEBUG_hakan
   // make sure we're not returning any ignored accessibles.
   NSEnumerator *e = [mChildren objectEnumerator];
   mozAccessible *m = nil;
--- a/accessible/mac/mozTableAccessible.mm
+++ b/accessible/mac/mozTableAccessible.mm
@@ -202,22 +202,22 @@
     TableCellAccessible* cell = accWrap->AsTableCell();
     if ([attribute isEqualToString:NSAccessibilityRowIndexRangeAttribute])
       return [NSValue valueWithRange:NSMakeRange(cell->RowIdx(),
                                                  cell->RowExtent())];
     if ([attribute isEqualToString:NSAccessibilityColumnIndexRangeAttribute])
       return [NSValue valueWithRange:NSMakeRange(cell->ColIdx(),
                                                  cell->ColExtent())];
     if ([attribute isEqualToString:NSAccessibilityRowHeaderUIElementsAttribute]) {
-      AutoTArray<Accessible*, 10> headerCells;
+      nsAutoTArray<Accessible*, 10> headerCells;
       cell->RowHeaderCells(&headerCells);
       return ConvertToNSArray(headerCells);
     }
     if ([attribute isEqualToString:NSAccessibilityColumnHeaderUIElementsAttribute]) {
-      AutoTArray<Accessible*, 10> headerCells;
+      nsAutoTArray<Accessible*, 10> headerCells;
       cell->ColHeaderCells(&headerCells);
       return ConvertToNSArray(headerCells);
     }
   } else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
     if ([attribute isEqualToString:NSAccessibilityRowIndexRangeAttribute])
       return [NSValue valueWithRange:NSMakeRange(proxy->RowIdx(),
                                                  proxy->RowExtent())];
     if ([attribute isEqualToString:NSAccessibilityColumnIndexRangeAttribute])
--- a/accessible/windows/ia2/ia2Accessible.cpp
+++ b/accessible/windows/ia2/ia2Accessible.cpp
@@ -763,17 +763,17 @@ ia2Accessible::get_selectionRanges(IA2Ra
     return E_INVALIDARG;
 
   *aNRanges = 0;
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  AutoTArray<TextRange, 1> ranges;
+  nsAutoTArray<TextRange, 1> ranges;
   acc->Document()->SelectionRanges(&ranges);
   uint32_t len = ranges.Length();
   for (uint32_t idx = 0; idx < len; idx++) {
     if (!ranges[idx].Crop(acc)) {
       ranges.RemoveElementAt(idx);
     }
   }
 
--- a/accessible/windows/ia2/ia2AccessibleTable.cpp
+++ b/accessible/windows/ia2/ia2AccessibleTable.cpp
@@ -366,17 +366,17 @@ ia2AccessibleTable::get_selectedChildren
   if (!aChildren || !aNChildren)
     return E_INVALIDARG;
 
   *aChildren = nullptr;
   *aNChildren = 0;
   if (!mTable)
     return CO_E_OBJNOTCONNECTED;
 
-  AutoTArray<uint32_t, 30> cellIndices;
+  nsAutoTArray<uint32_t, 30> cellIndices;
   mTable->SelectedCellIndices(&cellIndices);
 
   uint32_t maxCells = cellIndices.Length();
   if (maxCells == 0)
     return S_FALSE;
 
   *aChildren = static_cast<LONG*>(moz_xmalloc(sizeof(LONG) * maxCells));
   *aNChildren = maxCells;
@@ -658,17 +658,17 @@ ia2AccessibleTable::get_selectedCells(IU
   if (!aCells || !aNSelectedCells)
     return E_INVALIDARG;
 
   *aCells = nullptr;
   *aNSelectedCells = 0;
   if (!mTable)
     return CO_E_OBJNOTCONNECTED;
 
-  AutoTArray<Accessible*, 30> cells;
+  nsAutoTArray<Accessible*, 30> cells;
   mTable->SelectedCells(&cells);
   if (cells.IsEmpty())
     return S_FALSE;
 
   *aCells =
     static_cast<IUnknown**>(::CoTaskMemAlloc(sizeof(IUnknown*) *
                                              cells.Length()));
   if (!*aCells)
@@ -694,17 +694,17 @@ ia2AccessibleTable::get_selectedColumns(
   if (!aColumns || !aNColumns)
     return E_INVALIDARG;
 
   *aColumns = nullptr;
   *aNColumns = 0;
   if (!mTable)
     return CO_E_OBJNOTCONNECTED;
 
-  AutoTArray<uint32_t, 30> colIndices;
+  nsAutoTArray<uint32_t, 30> colIndices;
   mTable->SelectedColIndices(&colIndices);
 
   uint32_t maxCols = colIndices.Length();
   if (maxCols == 0)
     return S_FALSE;
 
   *aColumns = static_cast<LONG*>(moz_xmalloc(sizeof(LONG) * maxCols));
   *aNColumns = maxCols;
@@ -724,17 +724,17 @@ ia2AccessibleTable::get_selectedRows(lon
   if (!aRows || !aNRows)
     return E_INVALIDARG;
 
   *aRows = nullptr;
   *aNRows = 0;
   if (!mTable)
     return CO_E_OBJNOTCONNECTED;
 
-  AutoTArray<uint32_t, 30> rowIndices;
+  nsAutoTArray<uint32_t, 30> rowIndices;
   mTable->SelectedRowIndices(&rowIndices);
 
   uint32_t maxRows = rowIndices.Length();
   if (maxRows == 0)
     return S_FALSE;
 
   *aRows = static_cast<LONG*>(moz_xmalloc(sizeof(LONG) * maxRows));
   *aNRows = maxRows;
--- a/accessible/windows/ia2/ia2AccessibleTableCell.cpp
+++ b/accessible/windows/ia2/ia2AccessibleTableCell.cpp
@@ -95,17 +95,17 @@ ia2AccessibleTableCell::get_columnHeader
   if (!aCellAccessibles || !aNColumnHeaderCells)
     return E_INVALIDARG;
 
   *aCellAccessibles = nullptr;
   *aNColumnHeaderCells = 0;
   if (!mTableCell)
     return CO_E_OBJNOTCONNECTED;
 
-  AutoTArray<Accessible*, 10> cells;
+  nsAutoTArray<Accessible*, 10> cells;
   mTableCell->ColHeaderCells(&cells);
 
   *aNColumnHeaderCells = cells.Length();
   *aCellAccessibles =
     static_cast<IUnknown**>(::CoTaskMemAlloc(sizeof(IUnknown*) *
                                              cells.Length()));
 
   if (!*aCellAccessibles)
@@ -167,17 +167,17 @@ ia2AccessibleTableCell::get_rowHeaderCel
   if (!aCellAccessibles || !aNRowHeaderCells)
     return E_INVALIDARG;
 
   *aCellAccessibles = nullptr;
   *aNRowHeaderCells = 0;
   if (!mTableCell)
     return CO_E_OBJNOTCONNECTED;
 
-  AutoTArray<Accessible*, 10> cells;
+  nsAutoTArray<Accessible*, 10> cells;
   mTableCell->RowHeaderCells(&cells);
 
   *aNRowHeaderCells = cells.Length();
   *aCellAccessibles =
     static_cast<IUnknown**>(::CoTaskMemAlloc(sizeof(IUnknown*) *
                                              cells.Length()));
   if (!*aCellAccessibles)
     return E_OUTOFMEMORY;
--- a/accessible/windows/ia2/ia2AccessibleText.cpp
+++ b/accessible/windows/ia2/ia2AccessibleText.cpp
@@ -56,17 +56,17 @@ ia2AccessibleText::get_attributes(long a
 
   *aStartOffset = 0;
   *aEndOffset = 0;
   *aTextAttributes = nullptr;
 
   int32_t startOffset = 0, endOffset = 0;
   HRESULT hr;
   if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
-    AutoTArray<Attribute, 10> attrs;
+    nsAutoTArray<Attribute, 10> attrs;
     proxy->TextAttributes(true, aOffset, &attrs, &startOffset, &endOffset);
     hr = AccessibleWrap::ConvertToIA2Attributes(&attrs, aTextAttributes);
   } else {
     HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
     if (textAcc->IsDefunct())
       return CO_E_OBJNOTCONNECTED;
 
     nsCOMPtr<nsIPersistentProperties> attributes =
--- a/accessible/windows/msaa/AccessibleWrap.cpp
+++ b/accessible/windows/msaa/AccessibleWrap.cpp
@@ -829,17 +829,17 @@ AccessibleWrap::get_accSelection(VARIANT
   if (IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   // TODO make this work with proxies.
   if (IsProxy())
     return E_NOTIMPL;
 
   if (IsSelect()) {
-    AutoTArray<Accessible*, 10> selectedItems;
+    nsAutoTArray<Accessible*, 10> selectedItems;
     if (IsProxy()) {
       nsTArray<ProxyAccessible*> proxies;
       Proxy()->SelectedItems(&proxies);
 
       uint32_t selectedCount = proxies.Length();
       for (uint32_t i = 0; i < selectedCount; i++) {
         selectedItems.AppendElement(WrapperFor(proxies[i]));
       }
--- a/accessible/xpcom/xpcAccessibleHyperText.cpp
+++ b/accessible/xpcom/xpcAccessibleHyperText.cpp
@@ -366,17 +366,17 @@ xpcAccessibleHyperText::GetSelectionRang
   if (!Intl())
     return NS_ERROR_FAILURE;
 
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMutableArray> xpcRanges =
     do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  AutoTArray<TextRange, 1> ranges;
+  nsAutoTArray<TextRange, 1> ranges;
   Intl()->SelectionRanges(&ranges);
   uint32_t len = ranges.Length();
   for (uint32_t idx = 0; idx < len; idx++)
     xpcRanges->AppendElement(new xpcAccessibleTextRange(Move(ranges[idx])),
                              false);
 
   xpcRanges.forget(aRanges);
   return NS_OK;
--- a/accessible/xpcom/xpcAccessibleSelectable.cpp
+++ b/accessible/xpcom/xpcAccessibleSelectable.cpp
@@ -16,17 +16,17 @@ xpcAccessibleSelectable::GetSelectedItem
 {
   NS_ENSURE_ARG_POINTER(aSelectedItems);
   *aSelectedItems = nullptr;
 
   if (!Intl())
     return NS_ERROR_FAILURE;
   NS_PRECONDITION(Intl()->IsSelect(), "Called on non selectable widget!");
 
-  AutoTArray<Accessible*, 10> items;
+  nsAutoTArray<Accessible*, 10> items;
   Intl()->SelectedItems(&items);
 
   uint32_t itemCount = items.Length();
   if (itemCount == 0)
     return NS_OK;
 
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMutableArray> xpcItems =
--- a/accessible/xpcom/xpcAccessibleTable.cpp
+++ b/accessible/xpcom/xpcAccessibleTable.cpp
@@ -268,17 +268,17 @@ xpcAccessibleTable::GetSelectedCells(nsI
   if (!Intl())
     return NS_ERROR_FAILURE;
 
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMutableArray> selCells =
     do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  AutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray;
+  nsAutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray;
   Intl()->SelectedCells(&cellsArray);
 
   uint32_t totalCount = cellsArray.Length();
   for (uint32_t idx = 0; idx < totalCount; idx++) {
     Accessible* cell = cellsArray.ElementAt(idx);
     selCells->AppendElement(static_cast<nsIAccessible*>(ToXPC(cell)), false);
   }
 
@@ -294,17 +294,17 @@ xpcAccessibleTable::GetSelectedCellIndic
   *aCellsArraySize = 0;
 
   NS_ENSURE_ARG_POINTER(aCellsArray);
   *aCellsArray = 0;
 
   if (!Intl())
     return NS_ERROR_FAILURE;
 
-  AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> cellsArray;
+  nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> cellsArray;
   Intl()->SelectedCellIndices(&cellsArray);
 
   *aCellsArraySize = cellsArray.Length();
   *aCellsArray = static_cast<int32_t*>
     (moz_xmalloc(*aCellsArraySize * sizeof(int32_t)));
   memcpy(*aCellsArray, cellsArray.Elements(),
     *aCellsArraySize * sizeof(int32_t));
 
@@ -319,17 +319,17 @@ xpcAccessibleTable::GetSelectedColumnInd
   *aColsArraySize = 0;
 
   NS_ENSURE_ARG_POINTER(aColsArray);
   *aColsArray = 0;
 
   if (!Intl())
     return NS_ERROR_FAILURE;
 
-  AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> colsArray;
+  nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> colsArray;
   Intl()->SelectedColIndices(&colsArray);
 
   *aColsArraySize = colsArray.Length();
   *aColsArray = static_cast<int32_t*>
     (moz_xmalloc(*aColsArraySize * sizeof(int32_t)));
   memcpy(*aColsArray, colsArray.Elements(),
     *aColsArraySize * sizeof(int32_t));
 
@@ -344,17 +344,17 @@ xpcAccessibleTable::GetSelectedRowIndice
   *aRowsArraySize = 0;
 
   NS_ENSURE_ARG_POINTER(aRowsArray);
   *aRowsArray = 0;
 
   if (!Intl())
     return NS_ERROR_FAILURE;
 
-  AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> rowsArray;
+  nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> rowsArray;
   Intl()->SelectedRowIndices(&rowsArray);
 
   *aRowsArraySize = rowsArray.Length();
   *aRowsArray = static_cast<int32_t*>
     (moz_xmalloc(*aRowsArraySize * sizeof(int32_t)));
   memcpy(*aRowsArray, rowsArray.Elements(),
     *aRowsArraySize * sizeof(int32_t));
 
--- a/accessible/xpcom/xpcAccessibleTableCell.cpp
+++ b/accessible/xpcom/xpcAccessibleTableCell.cpp
@@ -103,17 +103,17 @@ NS_IMETHODIMP
 xpcAccessibleTableCell::GetColumnHeaderCells(nsIArray** aHeaderCells)
 {
   NS_ENSURE_ARG_POINTER(aHeaderCells);
   *aHeaderCells = nullptr;
 
   if (!Intl())
     return NS_ERROR_FAILURE;
 
-  AutoTArray<Accessible*, 10> headerCells;
+  nsAutoTArray<Accessible*, 10> headerCells;
   Intl()->ColHeaderCells(&headerCells);
 
   nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
   NS_ENSURE_TRUE(cells, NS_ERROR_FAILURE);
 
   for (uint32_t idx = 0; idx < headerCells.Length(); idx++) {
     cells->AppendElement(static_cast<nsIAccessible*>(ToXPC(headerCells[idx])),
                          false);
@@ -127,17 +127,17 @@ NS_IMETHODIMP
 xpcAccessibleTableCell::GetRowHeaderCells(nsIArray** aHeaderCells)
 {
   NS_ENSURE_ARG_POINTER(aHeaderCells);
   *aHeaderCells = nullptr;
 
   if (!Intl())
     return NS_ERROR_FAILURE;
 
-  AutoTArray<Accessible*, 10> headerCells;
+  nsAutoTArray<Accessible*, 10> headerCells;
   Intl()->RowHeaderCells(&headerCells);
 
   nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
   NS_ENSURE_TRUE(cells, NS_ERROR_FAILURE);
 
   for (uint32_t idx = 0; idx < headerCells.Length(); idx++) {
     cells->AppendElement(static_cast<nsIAccessible*>(ToXPC(headerCells[idx])),
                          false);
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -1683,17 +1683,17 @@ nsDocShell::FirePageHideNotification(boo
     }
 
     mContentViewer->PageHide(aIsUnload);
 
     if (mTiming) {
       mTiming->NotifyUnloadEventEnd();
     }
 
-    AutoTArray<nsCOMPtr<nsIDocShell>, 8> kids;
+    nsAutoTArray<nsCOMPtr<nsIDocShell>, 8> kids;
     uint32_t n = mChildList.Length();
     kids.SetCapacity(n);
     for (uint32_t i = 0; i < n; i++) {
       kids.AppendElement(do_QueryInterface(ChildAt(i)));
     }
 
     n = kids.Length();
     for (uint32_t i = 0; i < n; ++i) {
@@ -4391,17 +4391,17 @@ nsDocShell::RemoveFromSessionHistory()
     }
   }
   if (!internalHistory) {
     return NS_OK;
   }
 
   int32_t index = 0;
   sessionHistory->GetIndex(&index);
-  AutoTArray<uint64_t, 16> ids;
+  nsAutoTArray<uint64_t, 16> ids;
   ids.AppendElement(mHistoryID);
   internalHistory->RemoveEntries(ids, index);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::SetCreatedDynamically(bool aDynamic)
 {
@@ -4482,17 +4482,17 @@ nsDocShell::ClearFrameHistory(nsISHEntry
   GetRootSessionHistory(getter_AddRefs(rootSH));
   nsCOMPtr<nsISHistoryInternal> history = do_QueryInterface(rootSH);
   if (!history || !shcontainer) {
     return;
   }
 
   int32_t count = 0;
   shcontainer->GetChildCount(&count);
-  AutoTArray<uint64_t, 16> ids;
+  nsAutoTArray<uint64_t, 16> ids;
   for (int32_t i = 0; i < count; ++i) {
     nsCOMPtr<nsISHEntry> child;
     shcontainer->GetChildAt(i, getter_AddRefs(child));
     if (child) {
       uint64_t id = 0;
       child->GetDocshellID(&id);
       ids.AppendElement(id);
     }
--- a/docshell/shistory/nsSHistory.cpp
+++ b/docshell/shistory/nsSHistory.cpp
@@ -1400,17 +1400,17 @@ nsSHistory::RemoveEntries(nsTArray<uint6
 void
 nsSHistory::RemoveDynEntries(int32_t aOldIndex, int32_t aNewIndex)
 {
   // Search for the entries which are in the current index,
   // but not in the new one.
   nsCOMPtr<nsISHEntry> originalSH;
   GetEntryAtIndex(aOldIndex, false, getter_AddRefs(originalSH));
   nsCOMPtr<nsISHContainer> originalContainer = do_QueryInterface(originalSH);
-  AutoTArray<uint64_t, 16> toBeRemovedEntries;
+  nsAutoTArray<uint64_t, 16> toBeRemovedEntries;
   if (originalContainer) {
     nsTArray<uint64_t> originalDynDocShellIDs;
     GetDynamicChildren(originalContainer, originalDynDocShellIDs, true);
     if (originalDynDocShellIDs.Length()) {
       nsCOMPtr<nsISHEntry> currentSH;
       GetEntryAtIndex(aNewIndex, false, getter_AddRefs(currentSH));
       nsCOMPtr<nsISHContainer> newContainer = do_QueryInterface(currentSH);
       if (newContainer) {
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -573,17 +573,17 @@ EffectCompositor::ComposeAnimationRule(d
 }
 
 /* static */ void
 EffectCompositor::GetOverriddenProperties(nsStyleContext* aStyleContext,
                                           EffectSet& aEffectSet,
                                           nsCSSPropertySet&
                                             aPropertiesOverridden)
 {
-  AutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
+  nsAutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
   {
     nsCSSPropertySet propertiesToTrackAsSet;
     for (KeyframeEffectReadOnly* effect : aEffectSet) {
       for (const AnimationProperty& property : effect->Properties()) {
         if (nsCSSProps::PropHasFlags(property.mProperty,
                                      CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR) &&
             !propertiesToTrackAsSet.HasProperty(property.mProperty)) {
           propertiesToTrackAsSet.AddProperty(property.mProperty);
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -1400,17 +1400,17 @@ BuildAnimationPropertyListFromKeyframeSe
     JSContext* aCx,
     Element* aTarget,
     JS::ForOfIterator& aIterator,
     nsTArray<AnimationProperty>& aResult,
     ErrorResult& aRv)
 {
   // Convert the object in aIterator to sequence<Keyframe>, producing
   // an array of OffsetIndexedKeyframe objects.
-  AutoTArray<OffsetIndexedKeyframe,4> keyframes;
+  nsAutoTArray<OffsetIndexedKeyframe,4> keyframes;
   if (!ConvertKeyframeSequence(aCx, aIterator, keyframes)) {
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
   // If the sequence<> had zero elements, we won't generate any
   // keyframes.
   if (keyframes.IsEmpty()) {
--- a/dom/base/DOMMatrix.cpp
+++ b/dom/base/DOMMatrix.cpp
@@ -262,31 +262,31 @@ template <typename T> void GetDataFromMa
   aData[13] = static_cast<T>(aMatrix->M42());
   aData[14] = static_cast<T>(aMatrix->M43());
   aData[15] = static_cast<T>(aMatrix->M44());
 }
 
 void
 DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle<JSObject*> aResult, ErrorResult& aRv) const
 {
-  AutoTArray<float, 16> arr;
+  nsAutoTArray<float, 16> arr;
   arr.SetLength(16);
   GetDataFromMatrix(this, arr.Elements());
   JS::Rooted<JS::Value> value(aCx);
   if (!ToJSValue(aCx, TypedArrayCreator<Float32Array>(arr), &value)) {
     aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
     return;
   }
   aResult.set(&value.toObject());
 }
 
 void
 DOMMatrixReadOnly::ToFloat64Array(JSContext* aCx, JS::MutableHandle<JSObject*> aResult, ErrorResult& aRv) const
 {
-  AutoTArray<double, 16> arr;
+  nsAutoTArray<double, 16> arr;
   arr.SetLength(16);
   GetDataFromMatrix(this, arr.Elements());
   JS::Rooted<JS::Value> value(aCx);
   if (!ToJSValue(aCx, TypedArrayCreator<Float64Array>(arr), &value)) {
     aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
     return;
   }
   aResult.set(&value.toObject());
--- a/dom/base/File.cpp
+++ b/dom/base/File.cpp
@@ -254,17 +254,17 @@ Blob::ToFile()
   }
 
   return file.forget();
 }
 
 already_AddRefed<File>
 Blob::ToFile(const nsAString& aName, ErrorResult& aRv) const
 {
-  AutoTArray<RefPtr<BlobImpl>, 1> blobImpls;
+  nsAutoTArray<RefPtr<BlobImpl>, 1> blobImpls;
   blobImpls.AppendElement(mImpl);
 
   nsAutoString contentType;
   mImpl->GetType(contentType);
 
   RefPtr<MultipartBlobImpl> impl =
     MultipartBlobImpl::Create(blobImpls, aName, contentType, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -303,17 +303,17 @@ nsIContent::GetBaseURI(bool aTryUseXHRDo
   // Start with document base
   nsCOMPtr<nsIURI> base = doc->GetBaseURI(aTryUseXHRDocBaseURI);
 
   // Collect array of xml:base attribute values up the parent chain. This
   // is slightly slower for the case when there are xml:base attributes, but
   // faster for the far more common case of there not being any such
   // attributes.
   // Also check for SVG elements which require special handling
-  AutoTArray<nsString, 5> baseAttrs;
+  nsAutoTArray<nsString, 5> baseAttrs;
   nsString attr;
   const nsIContent *elem = this;
   do {
     // First check for SVG specialness (why is this SVG specific?)
     if (elem->IsSVGElement()) {
       nsIContent* bindingParent = elem->GetBindingParent();
       if (bindingParent) {
         nsXBLBinding* binding = bindingParent->GetXBLBinding();
@@ -1323,17 +1323,17 @@ public:
         SUBTREE_UNBINDINGS_PER_RUNNABLE) {
       sContentUnbinder->mLast->mNext = new ContentUnbinder();
       sContentUnbinder->mLast = sContentUnbinder->mLast->mNext;
     }
     sContentUnbinder->mLast->mSubtreeRoots.AppendElement(aSubtreeRoot);
   }
 
 private:
-  AutoTArray<nsCOMPtr<nsIContent>,
+  nsAutoTArray<nsCOMPtr<nsIContent>,
                SUBTREE_UNBINDINGS_PER_RUNNABLE> mSubtreeRoots;
   RefPtr<ContentUnbinder>                     mNext;
   ContentUnbinder*                              mLast;
   static ContentUnbinder*                       sContentUnbinder;
 };
 
 ContentUnbinder* ContentUnbinder::sContentUnbinder = nullptr;
 
@@ -1523,21 +1523,21 @@ FragmentOrElement::CanSkipInCC(nsINode* 
   }
 
   if (!gCCBlackMarkedNodes) {
     gCCBlackMarkedNodes = new nsTHashtable<nsPtrHashKey<nsINode> >(1020);
   }
 
   // nodesToUnpurple contains nodes which will be removed
   // from the purple buffer if the DOM tree is black.
-  AutoTArray<nsIContent*, 1020> nodesToUnpurple;
+  nsAutoTArray<nsIContent*, 1020> nodesToUnpurple;
   // grayNodes need script traverse, so they aren't removed from
   // the purple buffer, but are marked to be in black subtree so that
   // traverse is faster.
-  AutoTArray<nsINode*, 1020> grayNodes;
+  nsAutoTArray<nsINode*, 1020> grayNodes;
 
   bool foundBlack = root->IsBlack();
   if (root != currentDoc) {
     currentDoc = nullptr;
     if (NeedsScriptTraverse(root)) {
       grayNodes.AppendElement(root);
     } else if (static_cast<nsIContent*>(root)->IsPurple()) {
       nodesToUnpurple.AppendElement(static_cast<nsIContent*>(root));
@@ -1593,18 +1593,18 @@ FragmentOrElement::CanSkipInCC(nsINode* 
     // Can't remove currently handled purple node.
     if (purple != aNode) {
       purple->RemovePurple();
     }
   }
   return !NeedsScriptTraverse(aNode);
 }
 
-AutoTArray<nsINode*, 1020>* gPurpleRoots = nullptr;
-AutoTArray<nsIContent*, 1020>* gNodesToUnbind = nullptr;
+nsAutoTArray<nsINode*, 1020>* gPurpleRoots = nullptr;
+nsAutoTArray<nsIContent*, 1020>* gNodesToUnbind = nullptr;
 
 void ClearCycleCollectorCleanupData()
 {
   if (gPurpleRoots) {
     uint32_t len = gPurpleRoots->Length();
     for (uint32_t i = 0; i < len; ++i) {
       nsINode* n = gPurpleRoots->ElementAt(i);
       n->SetIsPurpleRoot(false);
@@ -1697,17 +1697,17 @@ FragmentOrElement::CanSkip(nsINode* aNod
   // Subtree has been traversed already, and aNode has
   // been handled in a way that doesn't require revisiting it.
   if (root->IsPurpleRoot()) {
     return false;
   }
 
   // nodesToClear contains nodes which are either purple or
   // gray.
-  AutoTArray<nsIContent*, 1020> nodesToClear;
+  nsAutoTArray<nsIContent*, 1020> nodesToClear;
 
   bool foundBlack = root->IsBlack();
   bool domOnlyCycle = false;
   if (root != currentDoc) {
     currentDoc = nullptr;
     if (!foundBlack) {
       domOnlyCycle = static_cast<nsIContent*>(root)->OwnedOnlyByTheDOMTree();
     }
@@ -1746,29 +1746,29 @@ FragmentOrElement::CanSkip(nsINode* aNod
       }
     }
   }
 
   if (!currentDoc || !foundBlack) {
     root->SetIsPurpleRoot(true);
     if (domOnlyCycle) {
       if (!gNodesToUnbind) {
-        gNodesToUnbind = new AutoTArray<nsIContent*, 1020>();
+        gNodesToUnbind = new nsAutoTArray<nsIContent*, 1020>();
       }
       gNodesToUnbind->AppendElement(static_cast<nsIContent*>(root));
       for (uint32_t i = 0; i < nodesToClear.Length(); ++i) {
         nsIContent* n = nodesToClear[i];
         if ((n != aNode || aRemovingAllowed) && n->IsPurple()) {
           n->RemovePurple();
         }
       }
       return true;
     } else {
       if (!gPurpleRoots) {
-        gPurpleRoots = new AutoTArray<nsINode*, 1020>();
+        gPurpleRoots = new nsAutoTArray<nsINode*, 1020>();
       }
       gPurpleRoots->AppendElement(root);
     }
   }
 
   if (!foundBlack) {
     return false;
   }
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -861,17 +861,17 @@ Navigator::RemoveIdleObserver(MozIdleObs
   if (NS_FAILED(mWindow->UnregisterIdleObserver(obs))) {
     NS_WARNING("Failed to remove idle observer.");
   }
 }
 
 bool
 Navigator::Vibrate(uint32_t aDuration)
 {
-  AutoTArray<uint32_t, 1> pattern;
+  nsAutoTArray<uint32_t, 1> pattern;
   pattern.AppendElement(aDuration);
   return Vibrate(pattern);
 }
 
 bool
 Navigator::Vibrate(const nsTArray<uint32_t>& aPattern)
 {
   if (!mWindow) {
--- a/dom/base/nsContentIterator.cpp
+++ b/dom/base/nsContentIterator.cpp
@@ -150,17 +150,17 @@ protected:
   virtual void LastRelease();
 
   nsCOMPtr<nsINode> mCurNode;
   nsCOMPtr<nsINode> mFirst;
   nsCOMPtr<nsINode> mLast;
   nsCOMPtr<nsINode> mCommonParent;
 
   // used by nsContentIterator to cache indices
-  AutoTArray<int32_t, 8> mIndexes;
+  nsAutoTArray<int32_t, 8> mIndexes;
 
   // used by nsSubtreeIterator to cache indices.  Why put them in the base
   // class?  Because otherwise I have to duplicate the routines GetNextSibling
   // etc across both classes, with slight variations for caching.  Or
   // alternately, create a base class for the cache itself and have all the
   // cache manipulation go through a vptr.  I think this is the best space and
   // speed combo, even though it's ugly.
   int32_t mCachedIndex;
@@ -1053,18 +1053,18 @@ nsContentIterator::PositionAt(nsINode* a
                                           firstNode, firstOffset,
                                           lastNode, lastOffset)))) {
     mIsDone = true;
     return NS_ERROR_FAILURE;
   }
 
   // We can be at ANY node in the sequence.  Need to regenerate the array of
   // indexes back to the root or common parent!
-  AutoTArray<nsINode*, 8>     oldParentStack;
-  AutoTArray<int32_t, 8>      newIndexes;
+  nsAutoTArray<nsINode*, 8>     oldParentStack;
+  nsAutoTArray<int32_t, 8>      newIndexes;
 
   // Get a list of the parents up to the root, then compare the new node with
   // entries in that array until we find a match (lowest common ancestor).  If
   // no match, use IndexOf, take the parent, and repeat.  This avoids using
   // IndexOf() N times on possibly large arrays.  We still end up doing it a
   // fair bit.  It's better to use Clone() if possible.
 
   // we know the depth we're down (though we may not have started at the top).
@@ -1208,18 +1208,18 @@ protected:
   nsContentSubtreeIterator(const nsContentSubtreeIterator&);
   nsContentSubtreeIterator& operator=(const nsContentSubtreeIterator&);
 
   virtual void LastRelease() override;
 
   RefPtr<nsRange> mRange;
 
   // these arrays all typically are used and have elements
-  AutoTArray<nsIContent*, 8> mEndNodes;
-  AutoTArray<int32_t, 8>     mEndOffsets;
+  nsAutoTArray<nsIContent*, 8> mEndNodes;
+  nsAutoTArray<int32_t, 8>     mEndOffsets;
 };
 
 NS_IMPL_ADDREF_INHERITED(nsContentSubtreeIterator, nsContentIterator)
 NS_IMPL_RELEASE_INHERITED(nsContentSubtreeIterator, nsContentIterator)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsContentSubtreeIterator)
 NS_INTERFACE_MAP_END_INHERITING(nsContentIterator)
 
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -543,17 +543,17 @@ void
 nsContentList::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
 {
   if (!(aFlags & JSITER_HIDDEN)) {
     return;
   }
 
   BringSelfUpToDate(true);
 
-  AutoTArray<nsIAtom*, 8> atoms;
+  nsAutoTArray<nsIAtom*, 8> atoms;
   for (uint32_t i = 0; i < mElements.Length(); ++i) {
     nsIContent *content = mElements.ElementAt(i);
     if (content->HasID()) {
       nsIAtom* id = content->GetID();
       MOZ_ASSERT(id != nsGkAtoms::_empty,
                  "Empty ids don't get atomized");
       if (!atoms.Contains(id)) {
         atoms.AppendElement(id);
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -2281,17 +2281,17 @@ nsINode*
 nsContentUtils::GetCommonAncestor(nsINode* aNode1,
                                   nsINode* aNode2)
 {
   if (aNode1 == aNode2) {
     return aNode1;
   }
 
   // Build the chain of parents
-  AutoTArray<nsINode*, 30> parents1, parents2;
+  nsAutoTArray<nsINode*, 30> parents1, parents2;
   do {
     parents1.AppendElement(aNode1);
     aNode1 = aNode1->GetParentNode();
   } while (aNode1);
   do {
     parents2.AppendElement(aNode2);
     aNode2 = aNode2->GetParentNode();
   } while (aNode2);
@@ -2330,17 +2330,17 @@ nsContentUtils::ComparePoints(nsINode* a
                               bool* aDisconnected)
 {
   if (aParent1 == aParent2) {
     return aOffset1 < aOffset2 ? -1 :
            aOffset1 > aOffset2 ? 1 :
            0;
   }
 
-  AutoTArray<nsINode*, 32> parents1, parents2;
+  nsAutoTArray<nsINode*, 32> parents1, parents2;
   nsINode* node1 = aParent1;
   nsINode* node2 = aParent2;
   do {
     parents1.AppendElement(node1);
     node1 = node1->GetParentNode();
   } while (node1);
   do {
     parents2.AppendElement(node2);
@@ -4282,17 +4282,17 @@ nsContentUtils::CreateContextualFragment
                               (document->GetCompatibilityMode() ==
                                eCompatibility_NavQuirks),
                               aPreventScriptExecution);
     }
 
     return frag.forget();
   }
 
-  AutoTArray<nsString, 32> tagStack;
+  nsAutoTArray<nsString, 32> tagStack;
   nsAutoString uriStr, nameStr;
   nsCOMPtr<nsIContent> content = do_QueryInterface(aContextNode);
   // just in case we have a text node
   if (content && !content->IsElement())
     content = content->GetParent();
 
   while (content && content->IsElement()) {
     nsString& tagName = *tagStack.AppendElement();
@@ -6848,17 +6848,17 @@ void
 nsContentUtils::FireMutationEventsForDirectParsing(nsIDocument* aDoc,
                                                    nsIContent* aDest,
                                                    int32_t aOldChildCount)
 {
   // Fire mutation events. Optimize for the case when there are no listeners
   int32_t newChildCount = aDest->GetChildCount();
   if (newChildCount && nsContentUtils::
         HasMutationListeners(aDoc, NS_EVENT_BITS_MUTATION_NODEINSERTED)) {
-    AutoTArray<nsCOMPtr<nsIContent>, 50> childNodes;
+    nsAutoTArray<nsCOMPtr<nsIContent>, 50> childNodes;
     NS_ASSERTION(newChildCount - aOldChildCount >= 0,
                  "What, some unexpected dom mutation has happened?");
     childNodes.SetCapacity(newChildCount - aOldChildCount);
     for (nsIContent* child = aDest->GetFirstChild();
          child;
          child = child->GetNextSibling()) {
       childNodes.AppendElement(child);
     }
@@ -7915,17 +7915,17 @@ nsContentUtils::FirePageHideEvent(nsIDoc
                                   EventTarget* aChromeEventHandler)
 {
   nsCOMPtr<nsIDocument> doc = aItem->GetDocument();
   NS_ASSERTION(doc, "What happened here?");
   doc->OnPageHide(true, aChromeEventHandler);
 
   int32_t childCount = 0;
   aItem->GetChildCount(&childCount);
-  AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
+  nsAutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
   kids.AppendElements(childCount);
   for (int32_t i = 0; i < childCount; ++i) {
     aItem->GetChildAt(i, getter_AddRefs(kids[i]));
   }
 
   for (uint32_t i = 0; i < kids.Length(); ++i) {
     if (kids[i]) {
       FirePageHideEvent(kids[i], aChromeEventHandler);
@@ -7940,17 +7940,17 @@ nsContentUtils::FirePageHideEvent(nsIDoc
 /* static */
 void
 nsContentUtils::FirePageShowEvent(nsIDocShellTreeItem* aItem,
                                   EventTarget* aChromeEventHandler,
                                   bool aFireIfShowing)
 {
   int32_t childCount = 0;
   aItem->GetChildCount(&childCount);
-  AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
+  nsAutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
   kids.AppendElements(childCount);
   for (int32_t i = 0; i < childCount; ++i) {
     aItem->GetChildAt(i, getter_AddRefs(kids[i]));
   }
 
   for (uint32_t i = 0; i < kids.Length(); ++i) {
     if (kids[i]) {
       FirePageShowEvent(kids[i], aChromeEventHandler, aFireIfShowing);
@@ -8529,17 +8529,17 @@ private:
           default:
             aOut.Append(c);
             break;
         }
       }
     }
   }
 
-  AutoTArray<Unit, STRING_BUFFER_UNITS> mUnits;
+  nsAutoTArray<Unit, STRING_BUFFER_UNITS> mUnits;
   nsAutoPtr<StringBuilder>                mNext;
   StringBuilder*                          mLast;
   // mLength is used only in the first StringBuilder object in the linked list.
   uint32_t                                mLength;
 };
 
 } // namespace
 
--- a/dom/base/nsDOMMutationObserver.cpp
+++ b/dom/base/nsDOMMutationObserver.cpp
@@ -17,25 +17,25 @@
 #include "nsIScriptGlobalObject.h"
 #include "nsServiceManagerUtils.h"
 #include "nsTextFragment.h"
 #include "nsThreadUtils.h"
 
 using mozilla::dom::TreeOrderComparator;
 using mozilla::dom::Animation;
 
-AutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
+nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
   nsDOMMutationObserver::sScheduledMutationObservers = nullptr;
 
 nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr;
 
 uint32_t nsDOMMutationObserver::sMutationLevel = 0;
 uint64_t nsDOMMutationObserver::sCount = 0;
 
-AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
+nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
 nsDOMMutationObserver::sCurrentlyHandlingObservers = nullptr;
 
 nsINodeList*
 nsDOMMutationRecord::AddedNodes()
 {
   if (!mAddedNodes) {
     mAddedNodes = new nsSimpleContentList(mTarget);
   }
@@ -580,17 +580,17 @@ nsDOMMutationObserver::ScheduleForRun()
   mWaitingForRun = true;
   RescheduleForRun();
 }
 
 void
 nsDOMMutationObserver::RescheduleForRun()
 {
   if (!sScheduledMutationObservers) {
-    sScheduledMutationObservers = new AutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
+    sScheduledMutationObservers = new nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
   }
 
   bool didInsert = false;
   for (uint32_t i = 0; i < sScheduledMutationObservers->Length(); ++i) {
     if (static_cast<nsDOMMutationObserver*>((*sScheduledMutationObservers)[i])
           ->mId > mId) {
       sScheduledMutationObservers->InsertElementAt(i, this);
       didInsert = true;
@@ -877,17 +877,17 @@ nsDOMMutationObserver::HandleMutationsIn
     // This does *not* catch all cases, but should work for stuff running
     // in separate tabs.
     return;
   }
 
   nsTArray<RefPtr<nsDOMMutationObserver> >* suppressedObservers = nullptr;
 
   while (sScheduledMutationObservers) {
-    AutoTArray<RefPtr<nsDOMMutationObserver>, 4>* observers =
+    nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>* observers =
       sScheduledMutationObservers;
     sScheduledMutationObservers = nullptr;
     for (uint32_t i = 0; i < observers->Length(); ++i) {
       sCurrentObserver = static_cast<nsDOMMutationObserver*>((*observers)[i]);
       if (!sCurrentObserver->Suppressed()) {
         sCurrentObserver->HandleMutation();
       } else {
         if (!suppressedObservers) {
@@ -990,17 +990,17 @@ nsDOMMutationObserver::AddCurrentlyHandl
   if (aMutationLevel > 1) {
     // MutationObserver must be in the currently handling observer list
     // in all the nested levels.
     AddCurrentlyHandlingObserver(aObserver, aMutationLevel - 1);
   }
 
   if (!sCurrentlyHandlingObservers) {
     sCurrentlyHandlingObservers =
-      new AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
+      new nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
   }
 
   while (sCurrentlyHandlingObservers->Length() < aMutationLevel) {
     sCurrentlyHandlingObservers->InsertElementAt(
       sCurrentlyHandlingObservers->Length());
   }
 
   uint32_t index = aMutationLevel - 1;
--- a/dom/base/nsDOMMutationObserver.h
+++ b/dom/base/nsDOMMutationObserver.h
@@ -600,37 +600,37 @@ protected:
                                            uint32_t aMutationLevel);
 
   nsCOMPtr<nsPIDOMWindowInner>                       mOwner;
 
   nsCOMArray<nsMutationReceiver>                     mReceivers;
   nsClassHashtable<nsISupportsHashKey,
                    nsCOMArray<nsMutationReceiver> >  mTransientReceivers;
   // MutationRecords which are being constructed.
-  AutoTArray<nsDOMMutationRecord*, 4>              mCurrentMutations;
+  nsAutoTArray<nsDOMMutationRecord*, 4>              mCurrentMutations;
   // MutationRecords which will be handed to the callback at the end of
   // the microtask.
   RefPtr<nsDOMMutationRecord>                      mFirstPendingMutation;
   nsDOMMutationRecord*                               mLastPendingMutation;
   uint32_t                                           mPendingMutationCount;
 
   RefPtr<mozilla::dom::MutationCallback>           mCallback;
 
   bool                                               mWaitingForRun;
   bool                                               mIsChrome;
   bool                                               mMergeAttributeRecords;
 
   uint64_t                                           mId;
 
   static uint64_t                                    sCount;
-  static AutoTArray<RefPtr<nsDOMMutationObserver>, 4>* sScheduledMutationObservers;
+  static nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>* sScheduledMutationObservers;
   static nsDOMMutationObserver*                      sCurrentObserver;
 
   static uint32_t                                    sMutationLevel;
-  static AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
+  static nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
                                                      sCurrentlyHandlingObservers;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsDOMMutationObserver, NS_DOM_MUTATION_OBSERVER_IID)
 
 class nsAutoMutationBatch
 {
 public:
@@ -735,17 +735,17 @@ private:
   struct BatchObserver
   {
     nsDOMMutationObserver* mObserver;
     bool                   mWantsChildList;
   };
   
   static nsAutoMutationBatch* sCurrentBatch;
   nsAutoMutationBatch* mPreviousBatch;
-  AutoTArray<BatchObserver, 2> mObservers;
+  nsAutoTArray<BatchObserver, 2> mObservers;
   nsTArray<nsCOMPtr<nsIContent> > mRemovedNodes;
   nsTArray<nsCOMPtr<nsIContent> > mAddedNodes;
   nsINode* mBatchTarget;
   bool mRemovalDone;
   bool mFromFirstToLast;
   bool mAllowNestedBatches;
   nsCOMPtr<nsINode> mPrevSibling;
   nsCOMPtr<nsINode> mNextSibling;
@@ -902,17 +902,17 @@ private:
   struct Entry
   {
     RefPtr<mozilla::dom::Animation> mAnimation;
     State mState;
     bool mChanged;
   };
 
   static nsAutoAnimationMutationBatch* sCurrentBatch;
-  AutoTArray<nsDOMMutationObserver*, 2> mObservers;
+  nsAutoTArray<nsDOMMutationObserver*, 2> mObservers;
   typedef nsTArray<Entry> EntryArray;
   nsClassHashtable<nsPtrHashKey<nsINode>, EntryArray> mEntryTable;
   // List of nodes referred to by mEntryTable so we can sort them
   nsTArray<nsINode*> mBatchTargets;
 };
 
 inline
 nsDOMMutationObserver*
--- a/dom/base/nsDOMTokenList.cpp
+++ b/dom/base/nsDOMTokenList.cpp
@@ -129,17 +129,17 @@ nsDOMTokenList::AddInternal(const nsAttr
 
   nsAutoString resultStr;
 
   if (aAttr) {
     aAttr->ToString(resultStr);
   }
 
   bool oneWasAdded = false;
-  AutoTArray<nsString, 10> addedClasses;
+  nsAutoTArray<nsString, 10> addedClasses;
 
   for (uint32_t i = 0, l = aTokens.Length(); i < l; ++i) {
     const nsString& aToken = aTokens[i];
 
     if ((aAttr && aAttr->Contains(aToken)) ||
         addedClasses.Contains(aToken)) {
       continue;
     }
@@ -170,17 +170,17 @@ nsDOMTokenList::Add(const nsTArray<nsStr
 
   const nsAttrValue* attr = GetParsedAttr();
   AddInternal(attr, aTokens);
 }
 
 void
 nsDOMTokenList::Add(const nsAString& aToken, mozilla::ErrorResult& aError)
 {
-  AutoTArray<nsString, 1> tokens;
+  nsAutoTArray<nsString, 1> tokens;
   tokens.AppendElement(aToken);
   Add(tokens, aError);
 }
 
 void
 nsDOMTokenList::RemoveInternal(const nsAttrValue* aAttr,
                                const nsTArray<nsString>& aTokens)
 {
@@ -256,17 +256,17 @@ nsDOMTokenList::Remove(const nsTArray<ns
   }
 
   RemoveInternal(attr, aTokens);
 }
 
 void
 nsDOMTokenList::Remove(const nsAString& aToken, mozilla::ErrorResult& aError)
 {
-  AutoTArray<nsString, 1> tokens;
+  nsAutoTArray<nsString, 1> tokens;
   tokens.AppendElement(aToken);
   Remove(tokens, aError);
 }
 
 bool
 nsDOMTokenList::Toggle(const nsAString& aToken,
                        const Optional<bool>& aForce,
                        ErrorResult& aError)
@@ -276,17 +276,17 @@ nsDOMTokenList::Toggle(const nsAString& 
     return false;
   }
 
   const nsAttrValue* attr = GetParsedAttr();
   const bool forceOn = aForce.WasPassed() && aForce.Value();
   const bool forceOff = aForce.WasPassed() && !aForce.Value();
 
   bool isPresent = attr && attr->Contains(aToken);
-  AutoTArray<nsString, 1> tokens;
+  nsAutoTArray<nsString, 1> tokens;
   (*tokens.AppendElement()).Rebind(aToken.Data(), aToken.Length());
 
   if (isPresent) {
     if (!forceOn) {
       RemoveInternal(attr, tokens);
       isPresent = false;
     }
   } else {
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3361,17 +3361,17 @@ nsDocument::NodesFromRectHelper(float aX
   nsIPresShell *ps = GetShell();
   NS_ENSURE_STATE(ps);
   nsIFrame *rootFrame = ps->GetRootFrame();
 
   // XUL docs, unlike HTML, have no frame tree until everything's done loading
   if (!rootFrame)
     return NS_OK; // return nothing to premature XUL callers as a reminder to wait
 
-  AutoTArray<nsIFrame*,8> outFrames;
+  nsAutoTArray<nsIFrame*,8> outFrames;
   nsLayoutUtils::GetFramesForArea(rootFrame, rect, outFrames,
     nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC |
     (aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
 
   // Used to filter out repeated elements in sequence.
   nsIContent* lastAdded = nullptr;
 
   for (uint32_t i = 0; i < outFrames.Length(); i++) {
@@ -11183,17 +11183,17 @@ nsDocument::RestorePreviousFullScreenSta
   NS_ASSERTION(!IsFullScreenDoc() || !FullscreenRoots::IsEmpty(),
     "Should have at least 1 fullscreen root when fullscreen!");
 
   if (!IsFullScreenDoc() || !GetWindow() || FullscreenRoots::IsEmpty()) {
     return;
   }
 
   nsCOMPtr<nsIDocument> fullScreenDoc = GetFullscreenLeaf(this);
-  AutoTArray<nsDocument*, 8> exitDocs;
+  nsAutoTArray<nsDocument*, 8> exitDocs;
 
   nsIDocument* doc = fullScreenDoc;
   // Collect all subdocuments.
   for (; doc != this; doc = doc->GetParentDocument()) {
     exitDocs.AppendElement(static_cast<nsDocument*>(doc));
   }
   MOZ_ASSERT(doc == this, "Must have reached this doc");
   // Collect all ancestor documents which we are going to change.
@@ -11800,17 +11800,17 @@ nsDocument::ApplyFullscreen(const Fullsc
   // to detect if the origin which is fullscreen has changed.
   nsCOMPtr<nsIDocument> previousFullscreenDoc = GetFullscreenLeaf(this);
 
   // Stores a list of documents which we must dispatch "mozfullscreenchange"
   // too. We're required by the spec to dispatch the events in root-to-leaf
   // order, but we traverse the doctree in a leaf-to-root order, so we save
   // references to the documents we must dispatch to so that we get the order
   // as specified.
-  AutoTArray<nsIDocument*, 8> changed;
+  nsAutoTArray<nsIDocument*, 8> changed;
 
   // Remember the root document, so that if a full-screen document is hidden
   // we can reset full-screen state in the remaining visible full-screen documents.
   nsIDocument* fullScreenRootDoc = nsContentUtils::GetRootDocument(this);
 
   // If a document is already in fullscreen, then unlock the mouse pointer
   // before setting a new document to fullscreen
   UnlockPointer();
--- a/dom/base/nsDocumentEncoder.cpp
+++ b/dom/base/nsDocumentEncoder.cpp
@@ -157,21 +157,21 @@ protected:
   nsString          mMimeType;
   nsCString         mCharset;
   uint32_t          mFlags;
   uint32_t          mWrapColumn;
   uint32_t          mStartDepth;
   uint32_t          mEndDepth;
   int32_t           mStartRootIndex;
   int32_t           mEndRootIndex;
-  AutoTArray<nsINode*, 8>    mCommonAncestors;
-  AutoTArray<nsIContent*, 8> mStartNodes;
-  AutoTArray<int32_t, 8>     mStartOffsets;
-  AutoTArray<nsIContent*, 8> mEndNodes;
-  AutoTArray<int32_t, 8>     mEndOffsets;
+  nsAutoTArray<nsINode*, 8>    mCommonAncestors;
+  nsAutoTArray<nsIContent*, 8> mStartNodes;
+  nsAutoTArray<int32_t, 8>     mStartOffsets;
+  nsAutoTArray<nsIContent*, 8> mEndNodes;
+  nsAutoTArray<int32_t, 8>     mEndOffsets;
   bool              mHaltRangeHint;  
   // Used when context has already been serialized for
   // table cell selections (where parent is <tr>)
   bool              mDisableContextSerialize;
   bool              mIsCopying;  // Set to true only while copying
   bool              mNodeIsContainer;
   nsStringBuffer*   mCachedBuffer;
 };
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -1365,17 +1365,17 @@ nsFocusManager::GetCommonAncestor(nsPIDO
   NS_ENSURE_TRUE(aWindow1 && aWindow2, nullptr);
 
   nsCOMPtr<nsIDocShellTreeItem> dsti1 = aWindow1->GetDocShell();
   NS_ENSURE_TRUE(dsti1, nullptr);
 
   nsCOMPtr<nsIDocShellTreeItem> dsti2 = aWindow2->GetDocShell();
   NS_ENSURE_TRUE(dsti2, nullptr);
 
-  AutoTArray<nsIDocShellTreeItem*, 30> parents1, parents2;
+  nsAutoTArray<nsIDocShellTreeItem*, 30> parents1, parents2;
   do {
     parents1.AppendElement(dsti1);
     nsCOMPtr<nsIDocShellTreeItem> parentDsti1;
     dsti1->GetParent(getter_AddRefs(parentDsti1));
     dsti1.swap(parentDsti1);
   } while (dsti1);
   do {
     parents2.AppendElement(dsti2);
--- a/dom/base/nsFrameMessageManager.h
+++ b/dom/base/nsFrameMessageManager.h
@@ -394,17 +394,17 @@ protected:
                                     bool aRunInGlobalScope,
                                     bool aShouldCache,
                                     JS::MutableHandle<JSScript*> aScriptp);
   void TryCacheLoadAndCompileScript(const nsAString& aURL,
                                     bool aRunInGlobalScope);
   bool InitChildGlobalInternal(nsISupports* aScope, const nsACString& aID);
   nsCOMPtr<nsIXPConnectJSObjectHolder> mGlobal;
   nsCOMPtr<nsIPrincipal> mPrincipal;
-  AutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;
+  nsAutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;
 
   static nsDataHashtable<nsStringHashKey, nsMessageManagerScriptHolder*>* sCachedScripts;
   static nsScriptCacheCleaner* sScriptCacheCleaner;
 };
 
 class nsScriptCacheCleaner final : public nsIObserver
 {
   ~nsScriptCacheCleaner() {}
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -1815,17 +1815,17 @@ public:
       MOZ_ASSERT(aObserver, "Must have observer");
       mObservers.AppendElement(aObserver);
     }
 
     const nsTArray< nsCOMPtr<nsIObserver> > & Observers() {
       return mObservers;
     }
   protected:
-    AutoTArray< nsCOMPtr<nsIObserver>, 8 > mObservers;
+    nsAutoTArray< nsCOMPtr<nsIObserver>, 8 > mObservers;
   };
 
   /**
    * Request an external resource document for aURI.  This will return the
    * resource document if available.  If one is not available yet, it will
    * start loading as needed, and the pending load object will be returned in
    * aPendingLoad so that the caller can register an observer to wait for the
    * load.  If this function returns null and doesn't return a pending load,
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -590,17 +590,17 @@ nsINode::RemoveChild(nsIDOMNode* aOldChi
   }
   return rv.StealNSResult();
 }
 
 void
 nsINode::Normalize()
 {
   // First collect list of nodes to be removed
-  AutoTArray<nsCOMPtr<nsIContent>, 50> nodes;
+  nsAutoTArray<nsCOMPtr<nsIContent>, 50> nodes;
 
   bool canMerge = false;
   for (nsIContent* node = this->GetFirstChild();
        node;
        node = node->GetNextNode(this)) {
     if (node->NodeType() != nsIDOMNode::TEXT_NODE) {
       canMerge = false;
       continue;
@@ -859,17 +859,17 @@ nsINode::CompareDocumentPosition(nsINode
     MOZ_ASSERT(GetParentNode() == aOtherNode.GetParentNode());
     return static_cast<uint16_t>(nsIDOMNode::DOCUMENT_POSITION_PRECEDING);
   }
   if (GetNextSibling() == &aOtherNode) {
     MOZ_ASSERT(GetParentNode() == aOtherNode.GetParentNode());
     return static_cast<uint16_t>(nsIDOMNode::DOCUMENT_POSITION_FOLLOWING);
   }
 
-  AutoTArray<const nsINode*, 32> parents1, parents2;
+  nsAutoTArray<const nsINode*, 32> parents1, parents2;
 
   const nsINode *node1 = &aOtherNode, *node2 = this;
 
   // Check if either node is an attribute
   const Attr* attr1 = nullptr;
   if (node1->IsNodeOfType(nsINode::eATTRIBUTE)) {
     attr1 = static_cast<const Attr*>(node1);
     const Element* elem = attr1->GetElement();
@@ -1987,17 +1987,17 @@ nsINode::ReplaceOrInsertBefore(bool aRep
     nodeToInsertBefore = aRefChild;
   }
   if (nodeToInsertBefore == aNewChild) {
     // We're going to remove aNewChild from its parent, so use its next sibling
     // as the node to insert before.
     nodeToInsertBefore = nodeToInsertBefore->GetNextSibling();
   }
 
-  Maybe<AutoTArray<nsCOMPtr<nsIContent>, 50> > fragChildren;
+  Maybe<nsAutoTArray<nsCOMPtr<nsIContent>, 50> > fragChildren;
 
   // Remove the new child from the old parent if one exists
   nsIContent* newContent = aNewChild->AsContent();
   nsCOMPtr<nsINode> oldParent = newContent->GetParentNode();
   if (oldParent) {
     int32_t removeIndex = oldParent->IndexOf(newContent);
     if (removeIndex < 0) {
       // newContent is anonymous.  We can't deal with this, so just bail
@@ -2697,17 +2697,17 @@ nsINode::QuerySelector(const nsAString& 
 
 already_AddRefed<nsINodeList>
 nsINode::QuerySelectorAll(const nsAString& aSelector, ErrorResult& aResult)
 {
   RefPtr<nsSimpleContentList> contentList = new nsSimpleContentList(this);
 
   nsCSSSelectorList* selectorList = ParseSelectorList(aSelector, aResult);
   if (selectorList) {
-    FindMatchingElements<false, AutoTArray<Element*, 128>>(this,
+    FindMatchingElements<false, nsAutoTArray<Element*, 128>>(this,
                                                              selectorList,
                                                              *contentList,
                                                              aResult);
   } else {
     // Either we failed (and aResult already has the exception), or this
     // is a pseudo-element-only selector that matches nothing.
   }
 
--- a/dom/base/nsLineBreaker.cpp
+++ b/dom/base/nsLineBreaker.cpp
@@ -54,17 +54,17 @@ SetupCapitalization(const char16_t* aWor
     }
   }
 }
 
 nsresult
 nsLineBreaker::FlushCurrentWord()
 {
   uint32_t length = mCurrentWord.Length();
-  AutoTArray<uint8_t,4000> breakState;
+  nsAutoTArray<uint8_t,4000> breakState;
   if (!breakState.AppendElements(length))
     return NS_ERROR_OUT_OF_MEMORY;
   
   nsTArray<bool> capitalizationState;
 
   if (!mCurrentWordContainsComplexChar) {
     // For break-strict set everything internal to "break", otherwise
     // to "no break"!
@@ -182,17 +182,17 @@ nsLineBreaker::AppendText(nsIAtom* aHyph
       return NS_OK;
 
     // We encountered whitespace, so we're done with this word
     nsresult rv = FlushCurrentWord();
     if (NS_FAILED(rv))
       return rv;
   }
 
-  AutoTArray<uint8_t,4000> breakState;
+  nsAutoTArray<uint8_t,4000> breakState;
   if (aSink) {
     if (!breakState.AppendElements(aLength))
       return NS_ERROR_OUT_OF_MEMORY;
   }
 
   bool noCapitalizationNeeded = true;
   nsTArray<bool> capitalizationState;
   if (aSink && (aFlags & BREAK_NEED_CAPITALIZATION)) {
@@ -308,17 +308,17 @@ nsLineBreaker::AppendText(nsIAtom* aHyph
 
 void
 nsLineBreaker::FindHyphenationPoints(nsHyphenator *aHyphenator,
                                      const char16_t *aTextStart,
                                      const char16_t *aTextLimit,
                                      uint8_t *aBreakState)
 {
   nsDependentSubstring string(aTextStart, aTextLimit);
-  AutoTArray<bool,200> hyphens;
+  AutoFallibleTArray<bool,200> hyphens;
   if (NS_SUCCEEDED(aHyphenator->Hyphenate(string, hyphens))) {
     for (uint32_t i = 0; i + 1 < string.Length(); ++i) {
       if (hyphens[i]) {
         aBreakState[i + 1] =
           gfxTextRun::CompressedGlyph::FLAG_BREAK_TYPE_HYPHEN;
       }
     }
   }
@@ -363,17 +363,17 @@ nsLineBreaker::AppendText(nsIAtom* aHyph
     }
 
     // We encountered whitespace, so we're done with this word
     nsresult rv = FlushCurrentWord();
     if (NS_FAILED(rv))
       return rv;
   }
 
-  AutoTArray<uint8_t,4000> breakState;
+  nsAutoTArray<uint8_t,4000> breakState;
   if (aSink) {
     if (!breakState.AppendElements(aLength))
       return NS_ERROR_OUT_OF_MEMORY;
   }
 
   uint32_t start = offset;
   bool noBreaksNeeded = !aSink ||
     ((aFlags & NO_BREAKS_NEEDED_FLAGS) == NO_BREAKS_NEEDED_FLAGS &&
--- a/dom/base/nsLineBreaker.h
+++ b/dom/base/nsLineBreaker.h
@@ -201,19 +201,19 @@ private:
 
   void UpdateCurrentWordLanguage(nsIAtom *aHyphenationLanguage);
 
   void FindHyphenationPoints(nsHyphenator *aHyphenator,
                              const char16_t *aTextStart,
                              const char16_t *aTextLimit,
                              uint8_t *aBreakState);
 
-  AutoTArray<char16_t,100> mCurrentWord;
+  nsAutoTArray<char16_t,100> mCurrentWord;
   // All the items that contribute to mCurrentWord
-  AutoTArray<TextItem,2>    mTextItems;
+  nsAutoTArray<TextItem,2>    mTextItems;
   nsIAtom*                    mCurrentWordLanguage;
   bool                        mCurrentWordContainsMixedLang;
   bool                        mCurrentWordContainsComplexChar;
 
   // True if the previous character was breakable whitespace
   bool                        mAfterBreakableSpace;
   // True if a break must be allowed at the current position because
   // a run of breakable whitespace ends here
--- a/dom/base/nsPerformance.cpp
+++ b/dom/base/nsPerformance.cpp
@@ -987,17 +987,17 @@ PerformanceBase::ClearMarks(const Option
 {
   ClearUserEntries(aName, NS_LITERAL_STRING("mark"));
 }
 
 DOMHighResTimeStamp
 PerformanceBase::ResolveTimestampFromName(const nsAString& aName,
                                           ErrorResult& aRv)
 {
-  AutoTArray<RefPtr<PerformanceEntry>, 1> arr;
+  nsAutoTArray<RefPtr<PerformanceEntry>, 1> arr;
   DOMHighResTimeStamp ts;
   Optional<nsAString> typeParam;
   nsAutoString str;
   str.AssignLiteral("mark");
   typeParam = &str;
   GetEntriesByName(aName, typeParam, arr);
   if (!arr.IsEmpty()) {
     return arr.LastElement()->StartTime();
--- a/dom/base/nsPlainTextSerializer.h
+++ b/dom/base/nsPlainTextSerializer.h
@@ -194,20 +194,20 @@ private:
                                           Number of previous headers of
                                           the same depth and in the same
                                           section.
                                           mHeaderCounter[1] for <h1> etc. */
 
   RefPtr<mozilla::dom::Element> mElement;
 
   // For handling table rows
-  AutoTArray<bool, 8> mHasWrittenCellsForRow;
+  nsAutoTArray<bool, 8> mHasWrittenCellsForRow;
   
   // Values gotten in OpenContainer that is (also) needed in CloseContainer
-  AutoTArray<bool, 8> mIsInCiteBlockquote;
+  nsAutoTArray<bool, 8> mIsInCiteBlockquote;
 
   // The output data
   nsAString*            mOutputString;
 
   // The tag stack: the stack of tags we're operating on, so we can nest.
   // The stack only ever points to static atoms, so they don't need to be
   // refcounted.
   nsIAtom**        mTagStack;
--- a/dom/base/nsXHTMLContentSerializer.h
+++ b/dom/base/nsXHTMLContentSerializer.h
@@ -147,17 +147,17 @@ protected:
     int32_t startVal;
 
     // is true only before the serialization of the first li of an ol
     // should be false for other li in the list
     bool isFirstListItem;
   };
 
   // Stack to store one olState struct per <OL>.
-  AutoTArray<olState, 8> mOLStateStack;
+  nsAutoTArray<olState, 8> mOLStateStack;
 
   bool HasNoChildren(nsIContent* aContent);
 };
 
 nsresult
 NS_NewXHTMLContentSerializer(nsIContentSerializer** aSerializer);
 
 #endif
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -2065,20 +2065,20 @@ template<typename T>
 void DoTraceSequence(JSTracer* trc, FallibleTArray<T>& seq);
 template<typename T>
 void DoTraceSequence(JSTracer* trc, InfallibleTArray<T>& seq);
 
 // Class for simple sequence arguments, only used internally by codegen.
 namespace binding_detail {
 
 template<typename T>
-class AutoSequence : public AutoTArray<T, 16>
+class AutoSequence : public AutoFallibleTArray<T, 16>
 {
 public:
-  AutoSequence() : AutoTArray<T, 16>()
+  AutoSequence() : AutoFallibleTArray<T, 16>()
   {}
 
   // Allow converting to const sequences as needed
   operator const Sequence<T>&() const {
     return *reinterpret_cast<const Sequence<T>*>(this);
   }
 };
 
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -4469,18 +4469,18 @@ def getJSToNativeConversionInfo(type, de
             elementType = type.inner.inner
         else:
             elementType = type.inner
 
         # We want to use auto arrays if we can, but we have to be careful with
         # reallocation behavior for arrays.  In particular, if we use auto
         # arrays for sequences and have a sequence of elements which are
         # themselves sequences or have sequences as members, we have a problem.
-        # In that case, resizing the outermost AutoTArray to the right size
-        # will memmove its elements, but AutoTArrays are not memmovable and
+        # In that case, resizing the outermost nsAutoTarray to the right size
+        # will memmove its elements, but nsAutoTArrays are not memmovable and
         # hence will end up with pointers to bogus memory, which is bad.  To
         # deal with this, we typically map WebIDL sequences to our Sequence
         # type, which is in fact memmovable.  The one exception is when we're
         # passing in a sequence directly as an argument without any sort of
         # optional or nullable complexity going on.  In that situation, we can
         # use an AutoSequence instead.  We have to keep using Sequence in the
         # nullable and optional cases because we don't want to leak the
         # AutoSequence type to consumers, which would be unavoidable with
@@ -8384,17 +8384,17 @@ class CGEnumerateHook(CGAbstractBindingM
                 Argument('JS::Handle<JSObject*>', 'obj')]
         # Our "self" is actually the "obj" argument in this case, not the thisval.
         CGAbstractBindingMethod.__init__(
             self, descriptor, ENUMERATE_HOOK_NAME,
             args, getThisObj="", callArgs="")
 
     def generate_code(self):
         return CGGeneric(dedent("""
-            AutoTArray<nsString, 8> names;
+            nsAutoTArray<nsString, 8> names;
             ErrorResult rv;
             self->GetOwnPropertyNames(cx, names, rv);
             if (rv.MaybeSetPendingException(cx)) {
               return false;
             }
             bool dummy;
             for (uint32_t i = 0; i < names.Length(); ++i) {
               if (!JS_HasUCProperty(cx, obj, names[i].get(), names[i].Length(), &dummy)) {
@@ -10451,17 +10451,17 @@ class CGEnumerateOwnPropertiesViaGetOwnP
                 Argument('JS::AutoIdVector&', 'props')]
         CGAbstractBindingMethod.__init__(self, descriptor,
                                          "EnumerateOwnPropertiesViaGetOwnPropertyNames",
                                          args, getThisObj="",
                                          callArgs="")
 
     def generate_code(self):
         return CGGeneric(dedent("""
-            AutoTArray<nsString, 8> names;
+            nsAutoTArray<nsString, 8> names;
             ErrorResult rv;
             self->GetOwnPropertyNames(cx, names, rv);
             if (rv.MaybeSetPendingException(cx)) {
               return false;
             }
             // OK to pass null as "proxy" because it's ignored if
             // shadowPrototypeProperties is true
             return AppendNamedPropertyIds(cx, nullptr, names, true, props);
--- a/dom/bluetooth/common/BluetoothService.cpp
+++ b/dom/bluetooth/common/BluetoothService.cpp
@@ -89,25 +89,25 @@ ShutdownTimeExceeded(nsITimer* aTimer, v
 }
 
 void
 GetAllBluetoothActors(InfallibleTArray<BluetoothParent*>& aActors)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aActors.IsEmpty());
 
-  AutoTArray<ContentParent*, 20> contentActors;
+  nsAutoTArray<ContentParent*, 20> contentActors;
   ContentParent::GetAll(contentActors);
 
   for (uint32_t contentIndex = 0;
        contentIndex < contentActors.Length();
        contentIndex++) {
     MOZ_ASSERT(contentActors[contentIndex]);
 
-    AutoTArray<PBluetoothParent*, 5> bluetoothActors;
+    AutoInfallibleTArray<PBluetoothParent*, 5> bluetoothActors;
     contentActors[contentIndex]->ManagedPBluetoothParent(bluetoothActors);
 
     for (uint32_t bluetoothIndex = 0;
          bluetoothIndex < bluetoothActors.Length();
          bluetoothIndex++) {
       MOZ_ASSERT(bluetoothActors[bluetoothIndex]);
 
       BluetoothParent* actor =
@@ -485,17 +485,17 @@ BluetoothService::StartStopBluetooth(boo
   return rv;
 }
 
 void
 BluetoothService::SetEnabled(bool aEnabled)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  AutoTArray<BluetoothParent*, 10> childActors;
+  AutoInfallibleTArray<BluetoothParent*, 10> childActors;
   GetAllBluetoothActors(childActors);
 
   for (uint32_t index = 0; index < childActors.Length(); index++) {
     Unused << childActors[index]->SendEnabled(aEnabled);
   }
 
   /**
    * mEnabled: real status of bluetooth
@@ -569,17 +569,17 @@ BluetoothService::HandleShutdown()
   MOZ_ASSERT(NS_IsMainThread());
 
   // This is a two phase shutdown. First we notify all child processes that
   // bluetooth is going away, and then we wait for them to acknowledge. Then we
   // close down all the bluetooth machinery.
 
   Cleanup();
 
-  AutoTArray<BluetoothParent*, 10> childActors;
+  AutoInfallibleTArray<BluetoothParent*, 10> childActors;
   GetAllBluetoothActors(childActors);
 
   if (!childActors.IsEmpty()) {
     // Notify child processes that they should stop using bluetooth now.
     for (uint32_t index = 0; index < childActors.Length(); index++) {
       childActors[index]->BeginShutdown();
     }
 
--- a/dom/cache/AutoUtils.cpp
+++ b/dom/cache/AutoUtils.cpp
@@ -42,17 +42,17 @@ enum CleanupAction
 void
 CleanupChildFds(CacheReadStream& aReadStream, CleanupAction aAction)
 {
   if (aReadStream.fds().type() !=
       OptionalFileDescriptorSet::TPFileDescriptorSetChild) {
     return;
   }
 
-  AutoTArray<FileDescriptor, 4> fds;
+  nsAutoTArray<FileDescriptor, 4> fds;
 
   FileDescriptorSetChild* fdSetActor =
     static_cast<FileDescriptorSetChild*>(aReadStream.fds().get_PFileDescriptorSetChild());
   MOZ_ASSERT(fdSetActor);
 
   if (aAction == Delete) {
     Unused << fdSetActor->Send__delete__(fdSetActor);
   }
@@ -102,17 +102,17 @@ CleanupChild(CacheReadStreamOrVoid& aRea
 void
 CleanupParentFds(CacheReadStream& aReadStream, CleanupAction aAction)
 {
   if (aReadStream.fds().type() !=
       OptionalFileDescriptorSet::TPFileDescriptorSetParent) {
     return;
   }
 
-  AutoTArray<FileDescriptor, 4> fds;
+  nsAutoTArray<FileDescriptor, 4> fds;
 
   FileDescriptorSetParent* fdSetActor =
     static_cast<FileDescriptorSetParent*>(aReadStream.fds().get_PFileDescriptorSetParent());
   MOZ_ASSERT(fdSetActor);
 
   if (aAction == Delete) {
     Unused << fdSetActor->Send__delete__(fdSetActor);
   }
@@ -301,17 +301,17 @@ MatchInPutList(InternalRequest* aRequest
     }
 
     RefPtr<InternalHeaders> cachedRequestHeaders =
       TypeUtils::ToInternalHeaders(cachedRequest.headers());
 
     RefPtr<InternalHeaders> cachedResponseHeaders =
       TypeUtils::ToInternalHeaders(cachedResponse.headers());
 
-    AutoTArray<nsCString, 16> varyHeaders;
+    nsAutoTArray<nsCString, 16> varyHeaders;
     ErrorResult rv;
     cachedResponseHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv);
     MOZ_ALWAYS_TRUE(!rv.Failed());
 
     // Assume the vary headers match until we find a conflict
     bool varyHeadersMatch = true;
 
     for (uint32_t j = 0; j < varyHeaders.Length(); ++j) {
--- a/dom/cache/Cache.cpp
+++ b/dom/cache/Cache.cpp
@@ -109,17 +109,17 @@ public:
     // Stop holding the worker alive when we leave this method.
     RefPtr<Feature> feature;
     feature.swap(mFeature);
 
     // Promise::All() passed an array of fetch() Promises should give us
     // an Array of Response objects.  The following code unwraps these
     // JS values back to an nsTArray<RefPtr<Response>>.
 
-    AutoTArray<RefPtr<Response>, 256> responseList;
+    nsAutoTArray<RefPtr<Response>, 256> responseList;
     responseList.SetCapacity(mRequestList.Length());
 
     bool isArray;
     if (NS_WARN_IF(!JS_IsArrayObject(aCx, aValue, &isArray) || !isArray)) {
       Fail();
       return;
     }
 
@@ -566,17 +566,17 @@ Cache::AddAll(const GlobalObject& aGloba
     if (NS_WARN_IF(!promise)) {
       return nullptr;
     }
 
     promise->MaybeResolve(JS::UndefinedHandleValue);
     return promise.forget();
   }
 
-  AutoTArray<RefPtr<Promise>, 256> fetchList;
+  nsAutoTArray<RefPtr<Promise>, 256> fetchList;
   fetchList.SetCapacity(aRequestList.Length());
 
   // Begin fetching each request in parallel.  For now, if an error occurs just
   // abandon our previous fetch calls.  In theory we could cancel them in the
   // future once fetch supports it.
 
   for (uint32_t i = 0; i < aRequestList.Length(); ++i) {
     RequestOrUSVString requestOrString;
--- a/dom/cache/CacheOpChild.cpp
+++ b/dom/cache/CacheOpChild.cpp
@@ -214,31 +214,31 @@ CacheOpChild::HandleResponse(const Cache
   RefPtr<Response> response = ToResponse(cacheResponse);
 
   mPromise->MaybeResolve(response);
 }
 
 void
 CacheOpChild::HandleResponseList(const nsTArray<CacheResponse>& aResponseList)
 {
-  AutoTArray<RefPtr<Response>, 256> responses;
+  nsAutoTArray<RefPtr<Response>, 256> responses;
   responses.SetCapacity(aResponseList.Length());
 
   for (uint32_t i = 0; i < aResponseList.Length(); ++i) {
     AddFeatureToStreamChild(aResponseList[i], GetFeature());
     responses.AppendElement(ToResponse(aResponseList[i]));
   }
 
   mPromise->MaybeResolve(responses);
 }
 
 void
 CacheOpChild::HandleRequestList(const nsTArray<CacheRequest>& aRequestList)
 {
-  AutoTArray<RefPtr<Request>, 256> requests;
+  nsAutoTArray<RefPtr<Request>, 256> requests;
   requests.SetCapacity(aRequestList.Length());
 
   for (uint32_t i = 0; i < aRequestList.Length(); ++i) {
     AddFeatureToStreamChild(aRequestList[i], GetFeature());
     requests.AppendElement(ToRequest(aRequestList[i]));
   }
 
   mPromise->MaybeResolve(requests);
--- a/dom/cache/CacheOpParent.cpp
+++ b/dom/cache/CacheOpParent.cpp
@@ -74,18 +74,18 @@ CacheOpParent::Execute(Manager* aManager
 
   // Handle put op
   if (mOpArgs.type() == CacheOpArgs::TCachePutAllArgs) {
     MOZ_ASSERT(mCacheId != INVALID_CACHE_ID);
 
     const CachePutAllArgs& args = mOpArgs.get_CachePutAllArgs();
     const nsTArray<CacheRequestResponse>& list = args.requestResponseList();
 
-    AutoTArray<nsCOMPtr<nsIInputStream>, 256> requestStreamList;
-    AutoTArray<nsCOMPtr<nsIInputStream>, 256> responseStreamList;
+    nsAutoTArray<nsCOMPtr<nsIInputStream>, 256> requestStreamList;
+    nsAutoTArray<nsCOMPtr<nsIInputStream>, 256> responseStreamList;
 
     for (uint32_t i = 0; i < list.Length(); ++i) {
       requestStreamList.AppendElement(
         DeserializeCacheStream(list[i].request().body()));
       responseStreamList.AppendElement(
         DeserializeCacheStream(list[i].response().body()));
     }
 
@@ -216,17 +216,17 @@ CacheOpParent::DeserializeCacheStream(co
   // Option 2: One of our own ReadStreams was passed back to us with a stream
   //           control actor.
   stream = ReadStream::Create(readStream);
   if (stream) {
     return stream.forget();
   }
 
   // Option 3: A stream was serialized using normal methods.
-  AutoTArray<FileDescriptor, 4> fds;
+  nsAutoTArray<FileDescriptor, 4> fds;
   if (readStream.fds().type() ==
       OptionalFileDescriptorSet::TPFileDescriptorSetChild) {
 
     FileDescriptorSetParent* fdSetActor =
       static_cast<FileDescriptorSetParent*>(readStream.fds().get_PFileDescriptorSetParent());
     MOZ_ASSERT(fdSetActor);
 
     fdSetActor->ForgetFileDescriptors(fds);
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -583,21 +583,21 @@ DeleteCacheId(mozIStorageConnection* aCo
               nsTArray<nsID>& aDeletedBodyIdListOut)
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(aConn);
 
   // Delete the bodies explicitly as we need to read out the body IDs
   // anyway.  These body IDs must be deleted one-by-one as content may
   // still be referencing them invidivually.
-  AutoTArray<EntryId, 256> matches;
+  nsAutoTArray<EntryId, 256> matches;
   nsresult rv = QueryAll(aConn, aCacheId, matches);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
-  AutoTArray<IdCount, 16> deletedSecurityIdList;
+  nsAutoTArray<IdCount, 16> deletedSecurityIdList;
   rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
                      deletedSecurityIdList);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   rv = DeleteSecurityInfoList(aConn, deletedSecurityIdList);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   // Delete the remainder of the cache using cascade semantics.
@@ -715,17 +715,17 @@ CacheMatch(mozIStorageConnection* aConn,
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(aConn);
   MOZ_ASSERT(aFoundResponseOut);
   MOZ_ASSERT(aSavedResponseOut);
 
   *aFoundResponseOut = false;
 
-  AutoTArray<EntryId, 1> matches;
+  nsAutoTArray<EntryId, 1> matches;
   nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches, 1);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   if (matches.IsEmpty()) {
     return rv;
   }
 
   rv = ReadResponse(aConn, matches[0], aSavedResponseOut);
@@ -742,17 +742,17 @@ CacheMatchAll(mozIStorageConnection* aCo
               const CacheRequestOrVoid& aRequestOrVoid,
               const CacheQueryParams& aParams,
               nsTArray<SavedResponse>& aSavedResponsesOut)
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(aConn);
   nsresult rv;
 
-  AutoTArray<EntryId, 256> matches;
+  nsAutoTArray<EntryId, 256> matches;
   if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) {
     rv = QueryAll(aConn, aCacheId, matches);
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
   } else {
     rv = QueryCache(aConn, aCacheId, aRequestOrVoid, aParams, matches);
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
   }
 
@@ -776,21 +776,21 @@ CachePut(mozIStorageConnection* aConn, C
          const nsID* aResponseBodyId,
          nsTArray<nsID>& aDeletedBodyIdListOut)
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(aConn);
 
   CacheQueryParams params(false, false, false, false,
                            NS_LITERAL_STRING(""));
-  AutoTArray<EntryId, 256> matches;
+  nsAutoTArray<EntryId, 256> matches;
   nsresult rv = QueryCache(aConn, aCacheId, aRequest, params, matches);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
-  AutoTArray<IdCount, 16> deletedSecurityIdList;
+  nsAutoTArray<IdCount, 16> deletedSecurityIdList;
   rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
                      deletedSecurityIdList);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   rv = InsertEntry(aConn, aCacheId, aRequest, aRequestBodyId, aResponse,
                    aResponseBodyId);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
@@ -809,25 +809,25 @@ CacheDelete(mozIStorageConnection* aConn
             nsTArray<nsID>& aDeletedBodyIdListOut, bool* aSuccessOut)
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(aConn);
   MOZ_ASSERT(aSuccessOut);
 
   *aSuccessOut = false;
 
-  AutoTArray<EntryId, 256> matches;
+  nsAutoTArray<EntryId, 256> matches;
   nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   if (matches.IsEmpty()) {
     return rv;
   }
 
-  AutoTArray<IdCount, 16> deletedSecurityIdList;
+  nsAutoTArray<IdCount, 16> deletedSecurityIdList;
   rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
                      deletedSecurityIdList);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   rv = DeleteSecurityInfoList(aConn, deletedSecurityIdList);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   *aSuccessOut = true;
@@ -840,17 +840,17 @@ CacheKeys(mozIStorageConnection* aConn, 
           const CacheRequestOrVoid& aRequestOrVoid,
           const CacheQueryParams& aParams,
           nsTArray<SavedRequest>& aSavedRequestsOut)
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(aConn);
   nsresult rv;
 
-  AutoTArray<EntryId, 256> matches;
+  nsAutoTArray<EntryId, 256> matches;
   if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) {
     rv = QueryAll(aConn, aCacheId, matches);
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
   } else {
     rv = QueryCache(aConn, aCacheId, aRequestOrVoid, aParams, matches);
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
   }
 
@@ -907,17 +907,17 @@ StorageMatch(mozIStorageConnection* aCon
   rv = aConn->CreateStatement(NS_LITERAL_CSTRING(
     "SELECT cache_id FROM storage WHERE namespace=:namespace ORDER BY rowid;"
   ), getter_AddRefs(state));
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   rv = state->BindInt32ByName(NS_LITERAL_CSTRING("namespace"), aNamespace);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
-  AutoTArray<CacheId, 32> cacheIdList;
+  nsAutoTArray<CacheId, 32> cacheIdList;
 
   bool hasMoreData = false;
   while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {
     CacheId cacheId = INVALID_CACHE_ID;
     rv = state->GetInt64(0, &cacheId);
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
     cacheIdList.AppendElement(cacheId);
   }
@@ -1213,17 +1213,17 @@ MatchByVaryHeader(mozIStorageConnection*
     "SELECT value FROM response_headers "
     "WHERE name='vary' AND entry_id=:entry_id;"
   ), getter_AddRefs(state));
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   rv = state->BindInt32ByName(NS_LITERAL_CSTRING("entry_id"), entryId);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
-  AutoTArray<nsCString, 8> varyValues;
+  nsAutoTArray<nsCString, 8> varyValues;
 
   bool hasMoreData = false;
   while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {
     nsAutoCString value;
     rv = state->GetUTF8String(0, value);
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
     varyValues.AppendElement(value);
   }
--- a/dom/cache/Manager.cpp
+++ b/dom/cache/Manager.cpp
@@ -69,31 +69,31 @@ public:
     // Note, this must be done after any schema version updates to
     // ensure our DBSchema methods work correctly.
     if (MarkerFileExists(aQuotaInfo)) {
       NS_WARNING("Cache not shutdown cleanly! Cleaning up stale data...");
       mozStorageTransaction trans(aConn, false,
                                   mozIStorageConnection::TRANSACTION_IMMEDIATE);
 
       // Clean up orphaned Cache objects
-      AutoTArray<CacheId, 8> orphanedCacheIdList;
+      nsAutoTArray<CacheId, 8> orphanedCacheIdList;
       nsresult rv = db::FindOrphanedCacheIds(aConn, orphanedCacheIdList);
       if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
       for (uint32_t i = 0; i < orphanedCacheIdList.Length(); ++i) {
-        AutoTArray<nsID, 16> deletedBodyIdList;
+        nsAutoTArray<nsID, 16> deletedBodyIdList;
         rv = db::DeleteCacheId(aConn, orphanedCacheIdList[i], deletedBodyIdList);
         if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
         rv = BodyDeleteFiles(aDBDir, deletedBodyIdList);
         if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
       }
 
       // Clean up orphaned body objects
-      AutoTArray<nsID, 64> knownBodyIdList;
+      nsAutoTArray<nsID, 64> knownBodyIdList;
       rv = db::GetKnownBodyIds(aConn, knownBodyIdList);
 
       rv = BodyDeleteOrphanedFiles(aDBDir, knownBodyIdList);
       if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
     }
 
     return rv;
   }
@@ -1368,17 +1368,17 @@ Manager::Listener::OnOpComplete(ErrorRes
                nsTArray<SavedRequest>(), nullptr);
 }
 
 void
 Manager::Listener::OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult,
                                 const SavedResponse& aSavedResponse,
                                 StreamList* aStreamList)
 {
-  AutoTArray<SavedResponse, 1> responseList;
+  nsAutoTArray<SavedResponse, 1> responseList;
   responseList.AppendElement(aSavedResponse);
   OnOpComplete(Move(aRv), aResult, INVALID_CACHE_ID, responseList,
                nsTArray<SavedRequest>(), aStreamList);
 }
 
 void
 Manager::Listener::OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult,
                                 const nsTArray<SavedResponse>& aSavedResponseList,
@@ -1897,17 +1897,17 @@ Manager::SetBodyIdOrphanedIfRefed(const 
   return false;
 }
 
 void
 Manager::NoteOrphanedBodyIdList(const nsTArray<nsID>& aDeletedBodyIdList)
 {
   NS_ASSERT_OWNINGTHREAD(Manager);
 
-  AutoTArray<nsID, 64> deleteNowList;
+  nsAutoTArray<nsID, 64> deleteNowList;
   deleteNowList.SetCapacity(aDeletedBodyIdList.Length());
 
   for (uint32_t i = 0; i < aDeletedBodyIdList.Length(); ++i) {
     if (!SetBodyIdOrphanedIfRefed(aDeletedBodyIdList[i])) {
       deleteNowList.AppendElement(aDeletedBodyIdList[i]);
     }
   }
 
--- a/dom/cache/ReadStream.cpp
+++ b/dom/cache/ReadStream.cpp
@@ -217,17 +217,17 @@ ReadStream::Inner::Serialize(CacheReadSt
   // If we are sending a ReadStream, then we never want to set the
   // pushStream actors at the same time.
   aReadStreamOut->pushStreamChild() = nullptr;
   aReadStreamOut->pushStreamParent() = nullptr;
 
   aReadStreamOut->id() = mId;
   mControl->SerializeControl(aReadStreamOut);
 
-  AutoTArray<FileDescriptor, 4> fds;
+  nsAutoTArray<FileDescriptor, 4> fds;
   SerializeInputStream(mStream, aReadStreamOut->params(), fds);
 
   mControl->SerializeFds(aReadStreamOut, fds);
 
   // We're passing ownership across the IPC barrier with the control, so
   // do not signal that the stream is closed here.
   Forget();
 }
@@ -446,17 +446,17 @@ ReadStream::Create(const CacheReadStream
     auto actor = static_cast<CacheStreamControlChild*>(aReadStream.controlChild());
     control = actor;
   } else {
     auto actor = static_cast<CacheStreamControlParent*>(aReadStream.controlParent());
     control = actor;
   }
   MOZ_ASSERT(control);
 
-  AutoTArray<FileDescriptor, 4> fds;
+  nsAutoTArray<FileDescriptor, 4> fds;
   control->DeserializeFds(aReadStream, fds);
 
   nsCOMPtr<nsIInputStream> stream =
     DeserializeInputStream(aReadStream.params(), fds);
   MOZ_ASSERT(stream);
 
   // Currently we expect all cache read streams to be blocking file streams.
 #ifdef DEBUG
--- a/dom/cache/TypeUtils.cpp
+++ b/dom/cache/TypeUtils.cpp
@@ -39,17 +39,17 @@ using mozilla::ipc::FileDescriptor;
 using mozilla::ipc::PBackgroundChild;
 using mozilla::ipc::PFileDescriptorSetChild;
 
 namespace {
 
 static bool
 HasVaryStar(mozilla::dom::InternalHeaders* aHeaders)
 {
-  AutoTArray<nsCString, 16> varyHeaders;
+  nsAutoTArray<nsCString, 16> varyHeaders;
   ErrorResult rv;
   aHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv);
   MOZ_ALWAYS_TRUE(!rv.Failed());
 
   for (uint32_t i = 0; i < varyHeaders.Length(); ++i) {
     nsAutoCString varyValue(varyHeaders[i]);
     char* rawBuffer = varyValue.BeginWriting();
     char* token = nsCRT::strtok(rawBuffer, NS_HTTP_HEADER_SEPS, &rawBuffer);
@@ -62,17 +62,17 @@ HasVaryStar(mozilla::dom::InternalHeader
     }
   }
   return false;
 }
 
 void
 SerializeNormalStream(nsIInputStream* aStream, CacheReadStream& aReadStreamOut)
 {
-  AutoTArray<FileDescriptor, 4> fds;
+  nsAutoTArray<FileDescriptor, 4> fds;
   SerializeInputStream(aStream, aReadStreamOut.params(), fds);
 
   PFileDescriptorSetChild* fdSet = nullptr;
   if (!fds.IsEmpty()) {
     // We should not be serializing until we have an actor ready
     PBackgroundChild* manager = BackgroundChild::GetForCurrentThread();
     MOZ_ASSERT(manager);
 
@@ -89,17 +89,17 @@ SerializeNormalStream(nsIInputStream* aS
   }
 }
 
 void
 ToHeadersEntryList(nsTArray<HeadersEntry>& aOut, InternalHeaders* aHeaders)
 {
   MOZ_ASSERT(aHeaders);
 
-  AutoTArray<InternalHeaders::Entry, 16> entryList;
+  nsAutoTArray<InternalHeaders::Entry, 16> entryList;
   aHeaders->GetEntries(entryList);
 
   for (uint32_t i = 0; i < entryList.Length(); ++i) {
     InternalHeaders::Entry& entry = entryList[i];
     aOut.AppendElement(HeadersEntry(entry.mName, entry.mValue));
   }
 }
 
--- a/dom/camera/GonkCameraControl.cpp
+++ b/dom/camera/GonkCameraControl.cpp
@@ -242,34 +242,34 @@ nsGonkCameraControl::Initialize()
     mLuminanceSupported ? "" : "NOT ");
   if (mFlashSupported) {
     DOM_CAMERA_LOGI(" - flash:                         supported, default mode '%s'\n",
       NS_ConvertUTF16toUTF8(flashMode).get());
   } else {
     DOM_CAMERA_LOGI(" - flash:                         NOT supported\n");
   }
 
-  AutoTArray<Size, 16> sizes;
+  nsAutoTArray<Size, 16> sizes;
   mParams.Get(CAMERA_PARAM_SUPPORTED_VIDEOSIZES, sizes);
   if (sizes.Length() > 0) {
     mSeparateVideoAndPreviewSizesSupported = true;
     DOM_CAMERA_LOGI(" - support for separate preview and video sizes\n");
     mParams.Get(CAMERA_PARAM_VIDEOSIZE, mLastRecorderSize);
     DOM_CAMERA_LOGI(" - default video recorder size:   %u x %u\n",
       mLastRecorderSize.width, mLastRecorderSize.height);
 
     Size preferred;
     mParams.Get(CAMERA_PARAM_PREFERRED_PREVIEWSIZE_FOR_VIDEO, preferred);
     DOM_CAMERA_LOGI(" - preferred video preview size:  %u x %u\n",
       preferred.width, preferred.height);
   } else {
     mLastRecorderSize = mCurrentConfiguration.mPreviewSize;
   }
 
-  AutoTArray<nsString, 8> modes;
+  nsAutoTArray<nsString, 8> modes;
   mParams.Get(CAMERA_PARAM_SUPPORTED_METERINGMODES, modes);
   if (!modes.IsEmpty()) {
     nsString mode;
     const char* kCenterWeighted = "center-weighted";
 
     mParams.Get(CAMERA_PARAM_METERINGMODE, mode);
     if (!mode.EqualsASCII(kCenterWeighted)) {
       nsTArray<nsString>::index_type i = modes.Length();
@@ -297,17 +297,17 @@ nsGonkCameraControl::~nsGonkCameraContro
 
   StopImpl();
   DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
 }
 
 nsresult
 nsGonkCameraControl::ValidateConfiguration(const Configuration& aConfig, Configuration& aValidatedConfig)
 {
-  AutoTArray<Size, 16> supportedSizes;
+  nsAutoTArray<Size, 16> supportedSizes;
   Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
 
   nsresult rv = GetSupportedSize(aConfig.mPictureSize, supportedSizes,
                                  aValidatedConfig.mPictureSize);
   if (NS_FAILED(rv)) {
     DOM_CAMERA_LOGW("Unable to find a picture size close to %ux%u\n",
       aConfig.mPictureSize.width, aConfig.mPictureSize.height);
     return NS_ERROR_INVALID_ARG;
@@ -918,17 +918,17 @@ nsGonkCameraControl::SetThumbnailSizeImp
    * Some drivers will fail to take a picture if the thumbnail does not have
    * the same aspect ratio as the set picture size, so we need to enforce that
    * too.
    */
   int smallestDelta = INT_MAX;
   uint32_t smallestDeltaIndex = UINT32_MAX;
   int targetArea = aSize.width * aSize.height;
 
-  AutoTArray<Size, 8> supportedSizes;
+  nsAutoTArray<Size, 8> supportedSizes;
   Get(CAMERA_PARAM_SUPPORTED_JPEG_THUMBNAIL_SIZES, supportedSizes);
 
   for (uint32_t i = 0; i < supportedSizes.Length(); ++i) {
     int area = supportedSizes[i].width * supportedSizes[i].height;
     int delta = abs(area - targetArea);
 
     if (area != 0 &&
         delta < smallestDelta &&
@@ -1023,17 +1023,17 @@ nsGonkCameraControl::SetPictureSizeImpl(
   }
 
   if (aSize.width == mCurrentConfiguration.mPictureSize.width &&
       aSize.height == mCurrentConfiguration.mPictureSize.height) {
     DOM_CAMERA_LOGI("Requested picture size %ux%u unchanged\n", aSize.width, aSize.height);
     return NS_OK;
   }
 
-  AutoTArray<Size, 8> supportedSizes;
+  nsAutoTArray<Size, 8> supportedSizes;
   Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
 
   Size best;
   nsresult rv = GetSupportedSize(aSize, supportedSizes, best);
   if (NS_FAILED(rv)) {
     DOM_CAMERA_LOGW("Unable to find a picture size close to %ux%u\n",
       aSize.width, aSize.height);
     return NS_ERROR_INVALID_ARG;
@@ -1722,17 +1722,17 @@ nsGonkCameraControl::SelectCaptureAndPre
 
   // At this point, we know the capture size has been validated and replaced
   // if necessary with the best matching supported value.
   DOM_CAMERA_LOGI("Select capture size %ux%u, preview size %ux%u, maximum size %ux%u\n",
                   aCaptureSize.width, aCaptureSize.height,
                   aPreviewSize.width, aPreviewSize.height,
                   aMaxSize.width, aMaxSize.height);
 
-  AutoTArray<Size, 16> sizes;
+  nsAutoTArray<Size, 16> sizes;
   nsresult rv = Get(CAMERA_PARAM_SUPPORTED_PREVIEWSIZES, sizes);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   // May optionally apply a ceiling to the preview size. Any supported preview
   // size with an area larger than the maximum will be ignored regardless of
   // aspect ratio or delta to requested preview size.
--- a/dom/canvas/CanvasRenderingContext2D.h
+++ b/dom/canvas/CanvasRenderingContext2D.h
@@ -1029,17 +1029,17 @@ protected:
     RefPtr<nsSVGFilterChainObserver> filterChainObserver;
     mozilla::gfx::FilterDescription filter;
     nsTArray<RefPtr<mozilla::gfx::SourceSurface>> filterAdditionalImages;
 
     bool imageSmoothingEnabled;
     bool fontExplicitLanguage;
   };
 
-  AutoTArray<ContextState, 3> mStyleStack;
+  nsAutoTArray<ContextState, 3> mStyleStack;
 
   inline ContextState& CurrentState() {
     return mStyleStack[mStyleStack.Length() - 1];
   }
 
   inline const ContextState& CurrentState() const {
     return mStyleStack[mStyleStack.Length() - 1];
   }
--- a/dom/canvas/ImageBitmapRenderingContext.cpp
+++ b/dom/canvas/ImageBitmapRenderingContext.cpp
@@ -234,17 +234,17 @@ ImageBitmapRenderingContext::GetCanvasLa
   }
 
   RefPtr<ImageContainer> imageContainer = imageLayer->GetContainer();
   if (!imageContainer) {
     imageContainer = aManager->CreateImageContainer();
     imageLayer->SetContainer(imageContainer);
   }
 
-  AutoTArray<ImageContainer::NonOwningImage, 1> imageList;
+  nsAutoTArray<ImageContainer::NonOwningImage, 1> imageList;
   RefPtr<layers::Image> image = ClipToIntrinsicSize();
   imageList.AppendElement(ImageContainer::NonOwningImage(image));
   imageContainer->SetCurrentImages(imageList);
 
   return imageLayer.forget();
 }
 
 void
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -726,17 +726,17 @@ EventStateManager::PreHandleEvent(nsPres
         modifierMask |= NS_MODIFIER_META;
       if (keyEvent->IsOS())
         modifierMask |= NS_MODIFIER_OS;
 
       // Prevent keyboard scrolling while an accesskey modifier is in use.
       if (modifierMask &&
           (modifierMask == Prefs::ChromeAccessModifierMask() ||
            modifierMask == Prefs::ContentAccessModifierMask())) {
-        AutoTArray<uint32_t, 10> accessCharCodes;
+        nsAutoTArray<uint32_t, 10> accessCharCodes;
         nsContentUtils::GetAccessKeyCandidates(keyEvent, accessCharCodes);
 
         if (HandleAccessKey(aPresContext, accessCharCodes,
                             keyEvent->mFlags.mIsTrusted, modifierMask)) {
           *aStatus = nsEventStatus_eConsumeNoDefault;
         }
       }
     }
@@ -1286,17 +1286,17 @@ EventStateManager::HandleCrossProcessEve
       !CrossProcessSafeEvent(*aEvent)) {
     return false;
   }
 
   // Collect the remote event targets we're going to forward this
   // event to.
   //
   // NB: the elements of |targets| must be unique, for correctness.
-  AutoTArray<nsCOMPtr<nsIContent>, 1> targets;
+  nsAutoTArray<nsCOMPtr<nsIContent>, 1> targets;
   if (aEvent->mClass != eTouchEventClass || aEvent->mMessage == eTouchStart) {
     // If this event only has one target, and it's remote, add it to
     // the array.
     nsIFrame* frame = GetEventTarget();
     nsIContent* target = frame ? frame->GetContent() : nullptr;
     if (IsRemoteTarget(target)) {
       targets.AppendElement(target);
     }
--- a/dom/events/TextComposition.h
+++ b/dom/events/TextComposition.h
@@ -424,17 +424,17 @@ private:
  * there.  Even if user switches native IME context, it's very rare that
  * second or more composition is started.
  * It's assumed that this is used by IMEStateManager for storing all active
  * compositions in the process.  If the instance is it, each TextComposition
  * in the array can be destroyed by calling some methods of itself.
  */
 
 class TextCompositionArray final :
-  public AutoTArray<RefPtr<TextComposition>, 2>
+  public nsAutoTArray<RefPtr<TextComposition>, 2>
 {
 public:
   // Looking for per native IME context.
   index_type IndexOf(const widget::NativeIMEContext& aNativeIMEContext);
   index_type IndexOf(nsIWidget* aWidget);
 
   TextComposition* GetCompositionFor(nsIWidget* aWidget);
   TextComposition* GetCompositionFor(
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -333,17 +333,17 @@ FetchDriver::HttpFetch()
   }
 
   // If preflight is required, start a "CORS preflight fetch"
   // https://fetch.spec.whatwg.org/#cors-preflight-fetch-0. All the
   // implementation is handled by the http channel calling into
   // nsCORSListenerProxy. We just inform it which unsafe headers are included
   // in the request.
   if (mRequest->Mode() == RequestMode::Cors) {
-    AutoTArray<nsCString, 5> unsafeHeaders;
+    nsAutoTArray<nsCString, 5> unsafeHeaders;
     mRequest->Headers()->GetUnsafeHeaders(unsafeHeaders);
     nsCOMPtr<nsILoadInfo> loadInfo = chan->GetLoadInfo();
     loadInfo->SetCorsPreflightInfo(unsafeHeaders, false);
   }
 
   rv = chan->AsyncOpen2(this);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -704,17 +704,17 @@ FetchDriver::SetDocument(nsIDocument* aD
   mDocument = aDocument;
 }
 
 void
 FetchDriver::SetRequestHeaders(nsIHttpChannel* aChannel) const
 {
   MOZ_ASSERT(aChannel);
 
-  AutoTArray<InternalHeaders::Entry, 5> headers;
+  nsAutoTArray<InternalHeaders::Entry, 5> headers;
   mRequest->Headers()->GetEntries(headers);
   bool hasAccept = false;
   for (uint32_t i = 0; i < headers.Length(); ++i) {
     if (!hasAccept && headers[i].mName.EqualsLiteral("accept")) {
       hasAccept = true;
     }
     if (headers[i].mValue.IsEmpty()) {
       aChannel->SetEmptyRequestHeader(headers[i].mName);
--- a/dom/fetch/InternalHeaders.cpp
+++ b/dom/fetch/InternalHeaders.cpp
@@ -304,17 +304,17 @@ InternalHeaders::CORSHeaders(InternalHea
 {
   RefPtr<InternalHeaders> cors = new InternalHeaders(aHeaders->mGuard);
   ErrorResult result;
 
   nsAutoCString acExposedNames;
   aHeaders->Get(NS_LITERAL_CSTRING("Access-Control-Expose-Headers"), acExposedNames, result);
   MOZ_ASSERT(!result.Failed());
 
-  AutoTArray<nsCString, 5> exposeNamesArray;
+  nsAutoTArray<nsCString, 5> exposeNamesArray;
   nsCCharSeparatedTokenizer exposeTokens(acExposedNames, ',');
   while (exposeTokens.hasMoreTokens()) {
     const nsDependentCSubstring& token = exposeTokens.nextToken();
     if (token.IsEmpty()) {
       continue;
     }
 
     if (!NS_IsValidHTTPToken(token)) {
--- a/dom/gamepad/linux/LinuxGamepad.cpp
+++ b/dom/gamepad/linux/LinuxGamepad.cpp
@@ -72,17 +72,17 @@ private:
   static gboolean OnUdevMonitor(GIOChannel *source,
                                 GIOCondition condition,
                                 gpointer data);
 
   udev_lib mUdev;
   struct udev_monitor* mMonitor;
   guint mMonitorSourceID;
   // Information about currently connected gamepads.
-  AutoTArray<Gamepad,4> mGamepads;
+  nsAutoTArray<Gamepad,4> mGamepads;
 };
 
 // singleton instance
 LinuxGamepadService* gService = nullptr;
 
 void
 LinuxGamepadService::AddDevice(struct udev_device* dev)
 {
--- a/dom/html/HTMLAllCollection.cpp
+++ b/dom/html/HTMLAllCollection.cpp
@@ -168,17 +168,17 @@ void
 HTMLAllCollection::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
 {
   if (!(aFlags & JSITER_HIDDEN)) {
     return;
   }
 
   // XXXbz this is very similar to nsContentList::GetSupportedNames,
   // but has to check IsAllNamedElement for the name case.
-  AutoTArray<nsIAtom*, 8> atoms;
+  nsAutoTArray<nsIAtom*, 8> atoms;
   for (uint32_t i = 0; i < Length(); ++i) {
     nsIContent *content = Item(i);
     if (content->HasID()) {
       nsIAtom* id = content->GetID();
       MOZ_ASSERT(id != nsGkAtoms::_empty,
                  "Empty ids don't get atomized");
       if (!atoms.Contains(id)) {
         atoms.AppendElement(id);
--- a/dom/html/HTMLOptionsCollection.cpp
+++ b/dom/html/HTMLOptionsCollection.cpp
@@ -282,17 +282,17 @@ HTMLOptionsCollection::NamedItem(const n
 void
 HTMLOptionsCollection::GetSupportedNames(unsigned aFlags,
                                          nsTArray<nsString>& aNames)
 {
   if (!(aFlags & JSITER_HIDDEN)) {
     return;
   }
 
-  AutoTArray<nsIAtom*, 8> atoms;
+  nsAutoTArray<nsIAtom*, 8> atoms;
   for (uint32_t i = 0; i < mElements.Length(); ++i) {
     HTMLOptionElement* content = mElements.ElementAt(i);
     if (content) {
       // Note: HasName means the names is exposed on the document,
       // which is false for options, so we don't check it here.
       const nsAttrValue* val = content->GetParsedAttr(nsGkAtoms::name);
       if (val && val->Type() == nsAttrValue::eAtom) {
         nsIAtom* name = val->GetAtomValue();
--- a/dom/html/TimeRanges.cpp
+++ b/dom/html/TimeRanges.cpp
@@ -107,17 +107,17 @@ TimeRanges::GetEndTime()
   }
   return mRanges[mRanges.Length() - 1].mEnd;
 }
 
 void
 TimeRanges::Normalize(double aTolerance)
 {
   if (mRanges.Length() >= 2) {
-    AutoTArray<TimeRange,4> normalized;
+    nsAutoTArray<TimeRange,4> normalized;
 
     mRanges.Sort(CompareTimeRanges());
 
     // This merges the intervals.
     TimeRange current(mRanges[0]);
     for (uint32_t i = 1; i < mRanges.Length(); i++) {
       if (current.mStart <= mRanges[i].mStart &&
           current.mEnd >= mRanges[i].mEnd) {
@@ -142,17 +142,17 @@ TimeRanges::Union(const TimeRanges* aOth
 {
   mRanges.AppendElements(aOtherRanges->mRanges);
   Normalize(aTolerance);
 }
 
 void
 TimeRanges::Intersection(const TimeRanges* aOtherRanges)
 {
-  AutoTArray<TimeRange,4> intersection;
+  nsAutoTArray<TimeRange,4> intersection;
 
   const nsTArray<TimeRange>& otherRanges = aOtherRanges->mRanges;
   for (index_type i = 0, j = 0; i < mRanges.Length() && j < otherRanges.Length();) {
     double start = std::max(mRanges[i].mStart, otherRanges[j].mStart);
     double end = std::min(mRanges[i].mEnd, otherRanges[j].mEnd);
     if (start < end) {
       intersection.AppendElement(TimeRange(start, end));
     }
--- a/dom/html/TimeRanges.h
+++ b/dom/html/TimeRanges.h
@@ -88,17 +88,17 @@ private:
       return aTr1.mStart == aTr2.mStart && aTr1.mEnd == aTr2.mEnd;
     }
 
     bool LessThan(const TimeRange& aTr1, const TimeRange& aTr2) const {
       return aTr1.mStart < aTr2.mStart;
     }
   };
 
-  AutoTArray<TimeRange,4> mRanges;
+  nsAutoTArray<TimeRange,4> mRanges;
 
   nsCOMPtr<nsISupports> mParent;
 
 public:
   typedef nsTArray<TimeRange>::index_type index_type;
   static const index_type NoIndex = index_type(-1);
 
   index_type Find(double aTime, double aTolerance = 0);
--- a/dom/html/nsHTMLContentSink.cpp
+++ b/dom/html/nsHTMLContentSink.cpp
@@ -155,17 +155,17 @@ protected:
 
   // The maximum length of a text run
   int32_t mMaxTextRun;
 
   RefPtr<nsGenericHTMLElement> mRoot;
   RefPtr<nsGenericHTMLElement> mBody;
   RefPtr<nsGenericHTMLElement> mHead;
 
-  AutoTArray<SinkContext*, 8> mContextStack;
+  nsAutoTArray<SinkContext*, 8> mContextStack;
   SinkContext* mCurrentContext;
   SinkContext* mHeadContext;
 
   // Boolean indicating whether we've seen a <head> tag that might have had
   // attributes once already.
   bool mHaveSeenHead;
 
   // Boolean indicating whether we've notified insertion of our root content
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -833,19 +833,20 @@ MakeCompressedIndexDataValues(
 
   aCompressedIndexDataValues.swap(blobData);
   *aCompressedIndexDataValuesLength = uint32_t(blobDataLength);
 
   return NS_OK;
 }
 
 nsresult
-ReadCompressedIndexDataValuesFromBlob(const uint8_t* aBlobData,
-                                      uint32_t aBlobDataLength,
-                                      nsTArray<IndexDataValue>& aIndexValues)
+ReadCompressedIndexDataValuesFromBlob(
+                                   const uint8_t* aBlobData,
+                                   uint32_t aBlobDataLength,
+                                   FallibleTArray<IndexDataValue>& aIndexValues)
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(!IsOnBackgroundThread());
   MOZ_ASSERT(aBlobData);
   MOZ_ASSERT(aBlobDataLength);
   MOZ_ASSERT(aIndexValues.IsEmpty());
 
   PROFILER_LABEL("IndexedDB",
@@ -910,19 +911,20 @@ ReadCompressedIndexDataValuesFromBlob(co
   MOZ_ASSERT(blobDataIter == blobDataEnd);
 
   return NS_OK;
 }
 
 // static
 template <typename T>
 nsresult
-ReadCompressedIndexDataValuesFromSource(T* aSource,
-                                        uint32_t aColumnIndex,
-                                        nsTArray<IndexDataValue>& aIndexValues)
+ReadCompressedIndexDataValuesFromSource(
+                                   T* aSource,
+                                   uint32_t aColumnIndex,
+                                   FallibleTArray<IndexDataValue>& aIndexValues)
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(!IsOnBackgroundThread());
   MOZ_ASSERT(aSource);
   MOZ_ASSERT(aIndexValues.IsEmpty());
 
   int32_t columnType;
   nsresult rv = aSource->GetTypeOfIndex(aColumnIndex, &columnType);
@@ -956,27 +958,27 @@ ReadCompressedIndexDataValuesFromSource(
   }
 
   return NS_OK;
 }
 
 nsresult
 ReadCompressedIndexDataValues(mozIStorageStatement* aStatement,
                               uint32_t aColumnIndex,
-                              nsTArray<IndexDataValue>& aIndexValues)
+                              FallibleTArray<IndexDataValue>& aIndexValues)
 {
   return ReadCompressedIndexDataValuesFromSource(aStatement,
                                                  aColumnIndex,
                                                  aIndexValues);
 }
 
 nsresult
 ReadCompressedIndexDataValues(mozIStorageValueArray* aValues,
                               uint32_t aColumnIndex,
-                              nsTArray<IndexDataValue>& aIndexValues)
+                              FallibleTArray<IndexDataValue>& aIndexValues)
 {
   return ReadCompressedIndexDataValuesFromSource(aValues,
                                                  aColumnIndex,
                                                  aIndexValues);
 }
 
 nsresult
 CreateFileTables(mozIStorageConnection* aConnection)
@@ -2761,17 +2763,17 @@ InsertIndexDataValuesFunction::OnFunctio
 
     MOZ_ALWAYS_TRUE(NS_SUCCEEDED(aValues->GetTypeOfIndex(3, &valueType)));
     MOZ_ASSERT(valueType == mozIStorageValueArray::VALUE_TYPE_BLOB);
   }
 #endif
 
   // Read out the previous value. It may be NULL, in which case we'll just end
   // up with an empty array.
-  AutoTArray<IndexDataValue, 32> indexValues;
+  AutoFallibleTArray<IndexDataValue, 32> indexValues;
   nsresult rv = ReadCompressedIndexDataValues(aValues, 0, indexValues);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   int64_t indexId;
   rv = aValues->GetInt64(1, &indexId);
   if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -3859,30 +3861,30 @@ private:
   ~UpgradeIndexDataValuesFunction()
   {
     AssertIsOnIOThread();
   }
 
   nsresult
   ReadOldCompressedIDVFromBlob(const uint8_t* aBlobData,
                                uint32_t aBlobDataLength,
-                               nsTArray<IndexDataValue>& aIndexValues);
+                               FallibleTArray<IndexDataValue>& aIndexValues);
 
   NS_IMETHOD
   OnFunctionCall(mozIStorageValueArray* aArguments,
                  nsIVariant** aResult) override;
 };
 
 NS_IMPL_ISUPPORTS(UpgradeIndexDataValuesFunction, mozIStorageFunction)
 
 nsresult
 UpgradeIndexDataValuesFunction::ReadOldCompressedIDVFromBlob(
                                    const uint8_t* aBlobData,
                                    uint32_t aBlobDataLength,
-                                   nsTArray<IndexDataValue>& aIndexValues)
+                                   FallibleTArray<IndexDataValue>& aIndexValues)
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(!IsOnBackgroundThread());
   MOZ_ASSERT(aBlobData);
   MOZ_ASSERT(aBlobDataLength);
   MOZ_ASSERT(aIndexValues.IsEmpty());
 
   const uint8_t* blobDataIter = aBlobData;
@@ -3984,17 +3986,17 @@ UpgradeIndexDataValuesFunction::OnFuncti
 
   const uint8_t* oldBlob;
   uint32_t oldBlobLength;
   rv = aArguments->GetSharedBlob(0, &oldBlobLength, &oldBlob);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  AutoTArray<IndexDataValue, 32> oldIdv;
+  AutoFallibleTArray<IndexDataValue, 32> oldIdv;
   rv = ReadOldCompressedIDVFromBlob(oldBlob, oldBlobLength, oldIdv);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   UniqueFreePtr<uint8_t> newIdv;
   uint32_t newIdvLength;
   rv = MakeCompressedIndexDataValues(oldIdv, newIdv, &newIdvLength);
@@ -5855,19 +5857,20 @@ protected:
 
   static nsresult
   GetUniqueIndexTableForObjectStore(
                                TransactionBase* aTransaction,
                                int64_t aObjectStoreId,
                                Maybe<UniqueIndexTable>& aMaybeUniqueIndexTable);
 
   static nsresult
-  IndexDataValuesFromUpdateInfos(const nsTArray<IndexUpdateInfo>& aUpdateInfos,
-                                 const UniqueIndexTable& aUniqueIndexTable,
-                                 nsTArray<IndexDataValue>& aIndexValues);
+  IndexDataValuesFromUpdateInfos(
+                              const nsTArray<IndexUpdateInfo>& aUpdateInfos,
+                              const UniqueIndexTable& aUniqueIndexTable,
+                              FallibleTArray<IndexDataValue>& aIndexValues);
 
   static nsresult
   InsertIndexTableRows(DatabaseConnection* aConnection,
                        const int64_t aObjectStoreId,
                        const Key& aObjectStoreKey,
                        const FallibleTArray<IndexDataValue>& aIndexValues);
 
   static nsresult
@@ -7904,17 +7907,17 @@ private:
                 const bool aIsLastIndex);
 
   ~DeleteIndexOp()
   { }
 
   nsresult
   RemoveReferencesToIndex(DatabaseConnection* aConnection,
                           const Key& aObjectDataKey,
-                          nsTArray<IndexDataValue>& aIndexValues);
+                          FallibleTArray<IndexDataValue>& aIndexValues);
 
   virtual nsresult
   DoDatabaseWork(DatabaseConnection* aConnection) override;
 };
 
 class NormalTransactionOp
   : public TransactionDatabaseOperationBase
   , public PBackgroundIDBRequestParent
@@ -8042,17 +8045,17 @@ struct ObjectStoreAddOrPutRequestOp::Sto
 class ObjectStoreGetRequestOp final
   : public NormalTransactionOp
 {
   friend class TransactionBase;
 
   const uint32_t mObjectStoreId;
   RefPtr<Database> mDatabase;
   const OptionalKeyRange mOptionalKeyRange;
-  AutoTArray<StructuredCloneReadInfo, 1> mResponse;
+  AutoFallibleTArray<StructuredCloneReadInfo, 1> mResponse;
   PBackgroundParent* mBackgroundParent;
   const uint32_t mLimit;
   const bool mGetAll;
 
 private:
   // Only created by TransactionBase.
   ObjectStoreGetRequestOp(TransactionBase* aTransaction,
                           const RequestParams& aParams,
@@ -8203,17 +8206,17 @@ private:
 
 class IndexGetRequestOp final
   : public IndexRequestOpBase
 {
   friend class TransactionBase;
 
   RefPtr<Database> mDatabase;
   const OptionalKeyRange mOptionalKeyRange;
-  AutoTArray<StructuredCloneReadInfo, 1> mResponse;
+  AutoFallibleTArray<StructuredCloneReadInfo, 1> mResponse;
   PBackgroundParent* mBackgroundParent;
   const uint32_t mLimit;
   const bool mGetAll;
 
 private:
   // Only created by TransactionBase.
   IndexGetRequestOp(TransactionBase* aTransaction,
                     const RequestParams& aParams,
@@ -8230,17 +8233,17 @@ private:
 };
 
 class IndexGetKeyRequestOp final
   : public IndexRequestOpBase
 {
   friend class TransactionBase;
 
   const OptionalKeyRange mOptionalKeyRange;
-  AutoTArray<Key, 1> mResponse;
+  AutoFallibleTArray<Key, 1> mResponse;
   const uint32_t mLimit;
   const bool mGetAll;
 
 private:
   // Only created by TransactionBase.
   IndexGetKeyRequestOp(TransactionBase* aTransaction,
                        const RequestParams& aParams,
                        bool aGetAll);
@@ -16344,20 +16347,20 @@ QuotaClient::InitOrigin(PersistenceType 
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   // We need to see if there are any files in the directory already. If they
   // are database files then we need to cleanup stored files (if it's needed)
   // and also get the usage.
 
-  AutoTArray<nsString, 20> subdirsToProcess;
+  nsAutoTArray<nsString, 20> subdirsToProcess;
   nsTArray<nsCOMPtr<nsIFile>> unknownFiles;
   nsTHashtable<nsStringHashKey> validSubdirs(20);
-  AutoTArray<FileManagerInitInfo, 20> initInfos;
+  nsAutoTArray<FileManagerInitInfo, 20> initInfos;
 
   nsCOMPtr<nsISimpleEnumerator> entries;
   rv = directory->GetDirectoryEntries(getter_AddRefs(entries));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   const NS_ConvertASCIItoUTF16 filesSuffix(
@@ -18194,32 +18197,32 @@ DatabaseOperationBase::GetStructuredClon
   size_t compressedLength = size_t(aBlobDataLength);
 
   size_t uncompressedLength;
   if (NS_WARN_IF(!snappy::GetUncompressedLength(compressed, compressedLength,
                                                 &uncompressedLength))) {
     return NS_ERROR_FILE_CORRUPTED;
   }
 
-  AutoTArray<uint8_t, 512> uncompressed;
+  AutoFallibleTArray<uint8_t, 512> uncompressed;
   if (NS_WARN_IF(!uncompressed.SetLength(uncompressedLength, fallible))) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   char* uncompressedBuffer = reinterpret_cast<char*>(uncompressed.Elements());
 
   if (NS_WARN_IF(!snappy::RawUncompress(compressed, compressedLength,
                                         uncompressedBuffer))) {
     return NS_ERROR_FILE_CORRUPTED;
   }
 
   aInfo->mData.SwapElements(uncompressed);
 
   if (!aFileIds.IsVoid()) {
-    AutoTArray<int64_t, 10> array;
+    nsAutoTArray<int64_t, 10> array;
     nsresult rv = ConvertFileIdsToArray(aFileIds, array);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     for (uint32_t count = array.Length(), index = 0; index < count; index++) {
       int64_t id = array[index];
       MOZ_ASSERT(id != 0);
@@ -18395,17 +18398,17 @@ DatabaseOperationBase::GetUniqueIndexTab
   return NS_OK;
 }
 
 // static
 nsresult
 DatabaseOperationBase::IndexDataValuesFromUpdateInfos(
                                   const nsTArray<IndexUpdateInfo>& aUpdateInfos,
                                   const UniqueIndexTable& aUniqueIndexTable,
-                                  nsTArray<IndexDataValue>& aIndexValues)
+                                  FallibleTArray<IndexDataValue>& aIndexValues)
 {
   MOZ_ASSERT(aIndexValues.IsEmpty());
   MOZ_ASSERT_IF(!aUpdateInfos.IsEmpty(), aUniqueIndexTable.Count());
 
   PROFILER_LABEL("IndexedDB",
                  "DatabaseOperationBase::IndexDataValuesFromUpdateInfos",
                  js::ProfileEntry::Category::STORAGE);
 
@@ -18715,17 +18718,17 @@ DatabaseOperationBase::DeleteObjectStore
   }
 
   rv = selectStmt->BindInt64ByName(objectStoreIdString, aObjectStoreId);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   DatabaseConnection::CachedStatement deleteStmt;
-  AutoTArray<IndexDataValue, 32> indexValues;
+  AutoFallibleTArray<IndexDataValue, 32> indexValues;
 
   DebugOnly<uint32_t> resultCountDEBUG = 0;
 
   bool hasResult;
   while (NS_SUCCEEDED(rv = selectStmt->ExecuteStep(&hasResult)) && hasResult) {
     if (!singleRowOnly) {
       rv = objectStoreKey.SetFromStatement(selectStmt, 1);
       if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -23336,17 +23339,17 @@ UpdateIndexDataValuesFunction::OnFunctio
                                                         cloneInfo,
                                                         &clone))) {
     return NS_ERROR_DOM_DATA_CLONE_ERR;
   }
 
   const IndexMetadata& metadata = mOp->mMetadata;
   const int64_t& objectStoreId = mOp->mObjectStoreId;
 
-  AutoTArray<IndexUpdateInfo, 32> updateInfos;
+  nsAutoTArray<IndexUpdateInfo, 32> updateInfos;
   rv = IDBObjectStore::AppendIndexUpdateInfo(metadata.id(),
                                              metadata.keyPath(),
                                              metadata.unique(),
                                              metadata.multiEntry(),
                                              metadata.locale(),
                                              mCx,
                                              clone,
                                              updateInfos);
@@ -23402,17 +23405,17 @@ UpdateIndexDataValuesFunction::OnFunctio
   }
 
   Key key;
   rv = key.SetFromValueArray(aValues, 0);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  AutoTArray<IndexDataValue, 32> indexValues;
+  AutoFallibleTArray<IndexDataValue, 32> indexValues;
   rv = ReadCompressedIndexDataValues(aValues, 1, indexValues);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   const bool hadPreviousIndexValues = !indexValues.IsEmpty();
 
   const uint32_t updateInfoCount = updateInfos.Length();
@@ -23501,19 +23504,20 @@ DeleteIndexOp::DeleteIndexOp(VersionChan
   , mUnique(aUnique)
   , mIsLastIndex(aIsLastIndex)
 {
   MOZ_ASSERT(aObjectStoreId);
   MOZ_ASSERT(aIndexId);
 }
 
 nsresult
-DeleteIndexOp::RemoveReferencesToIndex(DatabaseConnection* aConnection,
-                                       const Key& aObjectStoreKey,
-                                       nsTArray<IndexDataValue>& aIndexValues)
+DeleteIndexOp::RemoveReferencesToIndex(
+                                   DatabaseConnection* aConnection,
+                                   const Key& aObjectStoreKey,
+                                   FallibleTArray<IndexDataValue>& aIndexValues)
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(!IsOnBackgroundThread());
   MOZ_ASSERT(aConnection);
   MOZ_ASSERT(!aObjectStoreKey.IsUnset());
   MOZ_ASSERT_IF(!mIsLastIndex, !aIndexValues.IsEmpty());
 
   struct MOZ_STACK_CLASS IndexIdComparator final
@@ -23758,17 +23762,17 @@ DeleteIndexOp::DoDatabaseWork(DatabaseCo
 
   NS_NAMED_LITERAL_CSTRING(valueString, "value");
   NS_NAMED_LITERAL_CSTRING(objectDataKeyString, "object_data_key");
 
   DatabaseConnection::CachedStatement deleteIndexRowStmt;
   DatabaseConnection::CachedStatement nullIndexDataValuesStmt;
 
   Key lastObjectStoreKey;
-  AutoTArray<IndexDataValue, 32> lastIndexValues;
+  AutoFallibleTArray<IndexDataValue, 32> lastIndexValues;
 
   bool hasResult;
   while (NS_SUCCEEDED(rv = selectStmt->ExecuteStep(&hasResult)) && hasResult) {
     // We always need the index key to delete the index row.
     Key indexKey;
     rv = indexKey.SetFromStatement(selectStmt, 0);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
@@ -24102,17 +24106,17 @@ ObjectStoreAddOrPutRequestOp::RemoveOldI
 
   bool hasResult;
   rv = indexValuesStmt->ExecuteStep(&hasResult);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (hasResult) {
-    AutoTArray<IndexDataValue, 32> existingIndexValues;
+    AutoFallibleTArray<IndexDataValue, 32> existingIndexValues;
     rv = ReadCompressedIndexDataValues(indexValuesStmt,
                                         0,
                                         existingIndexValues);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     rv = DeleteIndexDataTableRows(aConnection, mResponse, existingIndexValues);
@@ -24630,17 +24634,17 @@ ObjectStoreAddOrPutRequestOp::DoDatabase
     return rv;
   }
 
   // Update our indexes if needed.
   if (!mParams.indexUpdateInfos().IsEmpty()) {
     MOZ_ASSERT(mUniqueIndexTable.isSome());
 
     // Write the index_data_values column.
-    AutoTArray<IndexDataValue, 32> indexValues;
+    AutoFallibleTArray<IndexDataValue, 32> indexValues;
     rv = IndexDataValuesFromUpdateInfos(mParams.indexUpdateInfos(),
                                         mUniqueIndexTable.ref(),
                                         indexValues);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     rv = UpdateIndexValues(aConnection, osid, key, indexValues);
--- a/dom/indexedDB/IDBDatabase.cpp
+++ b/dom/indexedDB/IDBDatabase.cpp
@@ -662,17 +662,17 @@ IDBDatabase::Transaction(const StringOrS
     IDB_REPORT_INTERNAL_ERR();
     return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
   }
 
   if (mClosed || RunningVersionChangeTransaction()) {
     return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
   }
 
-  AutoTArray<nsString, 1> stackSequence;
+  nsAutoTArray<nsString, 1> stackSequence;
 
   if (aStoreNames.IsString()) {
     stackSequence.AppendElement(aStoreNames.GetAsString());
   } else {
     MOZ_ASSERT(aStoreNames.IsStringSequence());
     if (aStoreNames.GetAsStringSequence().IsEmpty()) {
       return NS_ERROR_DOM_INVALID_ACCESS_ERR;
     }
@@ -843,18 +843,18 @@ IDBDatabase::UnregisterTransaction(IDBTr
 
 void
 IDBDatabase::AbortTransactions(bool aShouldWarn)
 {
   AssertIsOnOwningThread();
 
   class MOZ_STACK_CLASS Helper final
   {
-    typedef AutoTArray<RefPtr<IDBTransaction>, 20> StrongTransactionArray;
-    typedef AutoTArray<IDBTransaction*, 20> WeakTransactionArray;
+    typedef nsAutoTArray<RefPtr<IDBTransaction>, 20> StrongTransactionArray;
+    typedef nsAutoTArray<IDBTransaction*, 20> WeakTransactionArray;
 
   public:
     static void
     AbortTransactions(IDBDatabase* aDatabase, const bool aShouldWarn)
     {
       MOZ_ASSERT(aDatabase);
       aDatabase->AssertIsOnOwningThread();
 
--- a/dom/indexedDB/Key.cpp
+++ b/dom/indexedDB/Key.cpp
@@ -465,17 +465,17 @@ Key::EncodeLocaleString(const nsDependen
 
   UErrorCode uerror = U_ZERO_ERROR;
   UCollator* collator = ucol_open(aLocale.get(), &uerror);
   if (NS_WARN_IF(U_FAILURE(uerror))) {
     return NS_ERROR_FAILURE;
   }
   MOZ_ASSERT(collator);
 
-  AutoTArray<uint8_t, 128> keyBuffer;
+  nsAutoTArray<uint8_t, 128> keyBuffer;
   int32_t sortKeyLength = ucol_getSortKey(collator, ustr, length,
                                           keyBuffer.Elements(),
                                           keyBuffer.Length());
   if (sortKeyLength > (int32_t)keyBuffer.Length()) {
     keyBuffer.SetLength(sortKeyLength);
     sortKeyLength = ucol_getSortKey(collator, ustr, length,
                                     keyBuffer.Elements(),
                                     sortKeyLength);
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -602,17 +602,17 @@ public:
 
 NS_IMPL_ISUPPORTS(ContentParentsMemoryReporter, nsIMemoryReporter)
 
 NS_IMETHODIMP
 ContentParentsMemoryReporter::CollectReports(nsIMemoryReporterCallback* cb,
                                              nsISupports* aClosure,
                                              bool aAnonymize)
 {
-  AutoTArray<ContentParent*, 16> cps;
+  nsAutoTArray<ContentParent*, 16> cps;
   ContentParent::GetAllEvenIfDead(cps);
 
   for (uint32_t i = 0; i < cps.Length(); i++) {
     ContentParent* cp = cps[i];
     MessageChannel* channel = cp->GetIPCChannel();
 
     nsString friendlyName;
     cp->FriendlyName(friendlyName, aAnonymize);
@@ -906,17 +906,17 @@ ContentParent::JoinProcessesIOThread(con
   // Don't touch any arguments to this function from now on.
 }
 
 /*static*/ void
 ContentParent::JoinAllSubprocesses()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  AutoTArray<ContentParent*, 8> processes;
+  nsAutoTArray<ContentParent*, 8> processes;
   GetAll(processes);
   if (processes.IsEmpty()) {
     printf_stderr("There are no live subprocesses.");
     return;
   }
 
   printf_stderr("Subprocesses are still alive.  Doing emergency join.\n");
 
@@ -5140,17 +5140,17 @@ ContentParent::IgnoreIPCPrincipal()
                                  "dom.testing.ignore_ipc_principal", false);
   }
   return sIgnoreIPCPrincipal;
 }
 
 void
 ContentParent::NotifyUpdatedDictionaries()
 {
-  AutoTArray<ContentParent*, 8> processes;
+  nsAutoTArray<ContentParent*, 8> processes;
   GetAll(processes);
 
   nsCOMPtr<nsISpellChecker> spellChecker(do_GetService(NS_SPELLCHECKER_CONTRACTID));
   MOZ_ASSERT(spellChecker, "No spell checker?");
 
   InfallibleTArray<nsString> dictionaries;
   spellChecker->GetDictionaryList(&dictionaries);
 
--- a/dom/ipc/PreallocatedProcessManager.cpp
+++ b/dom/ipc/PreallocatedProcessManager.cpp
@@ -66,18 +66,18 @@ public:
 
 private:
   void NuwaFork();
 
   // initialization off the critical path of app startup.
   CancelableTask* mPreallocateAppProcessTask;
 
   // The array containing the preallocated processes. 4 as the inline storage size
-  // should be enough so we don't need to grow the AutoTArray.
-  AutoTArray<RefPtr<ContentParent>, 4> mSpareProcesses;
+  // should be enough so we don't need to grow the nsAutoTArray.
+  nsAutoTArray<RefPtr<ContentParent>, 4> mSpareProcesses;
 
   // Nuwa process is ready for creating new process.
   bool mIsNuwaReady;
 #endif
 
 private:
   static mozilla::StaticRefPtr<PreallocatedProcessManagerImpl> sSingleton;
 
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -701,17 +701,17 @@ private:
   RefPtr<nsIContentChild> mManager;
   uint32_t mChromeFlags;
   int32_t mActiveSuppressDisplayport;
   uint64_t mLayersId;
   CSSRect mUnscaledOuterRect;
   // Whether we have already received a FileDescriptor for the app package.
   bool mAppPackageFileDescriptorRecved;
   // At present only 1 of these is really expected.
-  AutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
+  nsAutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
       mCachedFileDescriptorInfos;
   nscolor mLastBackgroundColor;
   bool mDidFakeShow;
   bool mNotified;
   bool mTriedBrowserInit;
   ScreenOrientationInternal mOrientation;
   bool mUpdateHitRegion;
 
@@ -729,17 +729,17 @@ private:
   double mDefaultScale;
 
   bool mIPCOpen;
   bool mParentIsActive;
   bool mAsyncPanZoomEnabled;
   CSSSize mUnscaledInnerSize;
   bool mDidSetRealShowInfo;
 
-  AutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
+  nsAutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
 
   DISALLOW_EVIL_CONSTRUCTORS(TabChild);
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_TabChild_h
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -1491,19 +1491,19 @@ DoCommandCallback(mozilla::Command aComm
 {
   static_cast<InfallibleTArray<mozilla::CommandInt>*>(aData)->AppendElement(aCommand);
 }
 
 bool
 TabParent::RecvRequestNativeKeyBindings(const WidgetKeyboardEvent& aEvent,
                                         MaybeNativeKeyBinding* aBindings)
 {
-  AutoTArray<mozilla::CommandInt, 4> singleLine;
-  AutoTArray<mozilla::CommandInt, 4> multiLine;
-  AutoTArray<mozilla::CommandInt, 4> richText;
+  AutoInfallibleTArray<mozilla::CommandInt, 4> singleLine;
+  AutoInfallibleTArray<mozilla::CommandInt, 4> multiLine;
+  AutoInfallibleTArray<mozilla::CommandInt, 4> richText;
 
   *aBindings = mozilla::void_t();
 
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget) {
     return true;
   }
 
@@ -1705,19 +1705,19 @@ bool TabParent::SendRealKeyEvent(WidgetK
   }
   event.refPoint += GetChildProcessOffset();
 
   MaybeNativeKeyBinding bindings;
   bindings = void_t();
   if (event.mMessage == eKeyPress) {
     nsCOMPtr<nsIWidget> widget = GetWidget();
 
-    AutoTArray<mozilla::CommandInt, 4> singleLine;
-    AutoTArray<mozilla::CommandInt, 4> multiLine;
-    AutoTArray<mozilla::CommandInt, 4> richText;
+    AutoInfallibleTArray<mozilla::CommandInt, 4> singleLine;
+    AutoInfallibleTArray<mozilla::CommandInt, 4> multiLine;
+    AutoInfallibleTArray<mozilla::CommandInt, 4> richText;
 
     widget->ExecuteNativeKeyBinding(nsIWidget::NativeKeyBindingsForSingleLineEditor,
                                     event, DoCommandCallback, &singleLine);
     widget->ExecuteNativeKeyBinding(nsIWidget::NativeKeyBindingsForMultiLineEditor,
                                     event, DoCommandCallback, &multiLine);
     widget->ExecuteNativeKeyBinding(nsIWidget::NativeKeyBindingsForRichTextEditor,
                                     event, DoCommandCallback, &richText);
 
--- a/dom/media/AudioCaptureStream.cpp
+++ b/dom/media/AudioCaptureStream.cpp
@@ -97,18 +97,18 @@ AudioCaptureStream::ProcessInput(GraphTi
   mBuffer.AdvanceKnownTracksTime(GraphTimeToStreamTimeWithBlocking((aTo)));
 }
 
 void
 AudioCaptureStream::MixerCallback(AudioDataValue* aMixedBuffer,
                                   AudioSampleFormat aFormat, uint32_t aChannels,
                                   uint32_t aFrames, uint32_t aSampleRate)
 {
-  AutoTArray<nsTArray<AudioDataValue>, MONO> output;
-  AutoTArray<const AudioDataValue*, MONO> bufferPtrs;
+  nsAutoTArray<nsTArray<AudioDataValue>, MONO> output;
+  nsAutoTArray<const AudioDataValue*, MONO> bufferPtrs;
   output.SetLength(MONO);
   bufferPtrs.SetLength(MONO);
 
   uint32_t written = 0;
   // We need to copy here, because the mixer will reuse the storage, we should
   // not hold onto it. Buffers are in planar format.
   for (uint32_t channel = 0; channel < aChannels; channel++) {
     AudioDataValue* out = output[channel].AppendElements(aFrames);
--- a/dom/media/AudioSegment.cpp
+++ b/dom/media/AudioSegment.cpp
@@ -80,19 +80,19 @@ PointerForOffsetInChannel(AudioDataValue
              "Offset request out of bounds.");
   return aData + beginningOfChannel + aOffsetSamples;
 }
 
 void
 AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels,
                   uint32_t aSampleRate)
 {
-  AutoTArray<AudioDataValue, SilentChannel::AUDIO_PROCESSING_FRAMES* GUESS_AUDIO_CHANNELS>
+  nsAutoTArray<AudioDataValue, SilentChannel::AUDIO_PROCESSING_FRAMES* GUESS_AUDIO_CHANNELS>
   buf;
-  AutoTArray<const AudioDataValue*, GUESS_AUDIO_CHANNELS> channelData;
+  nsAutoTArray<const AudioDataValue*, GUESS_AUDIO_CHANNELS> channelData;
   uint32_t offsetSamples = 0;
   uint32_t duration = GetDuration();
 
   if (duration <= 0) {
     MOZ_ASSERT(duration == 0);
     return;
   }
 
@@ -127,17 +127,17 @@ AudioSegment::Mix(AudioMixer& aMixer, ui
             PointerForOffsetInChannel(buf.Elements(), outBufferLength,
                                       aOutputChannels, channel, offsetSamples);
           PodCopy(ptr, reinterpret_cast<const AudioDataValue*>(channelData[channel]),
                   frames);
         }
         MOZ_ASSERT(channelData.Length() == aOutputChannels);
       } else if (channelData.Length() > aOutputChannels) {
         // Down mix.
-        AutoTArray<AudioDataValue*, GUESS_AUDIO_CHANNELS> outChannelPtrs;
+        nsAutoTArray<AudioDataValue*, GUESS_AUDIO_CHANNELS> outChannelPtrs;
         outChannelPtrs.SetLength(aOutputChannels);
         uint32_t offsetSamples = 0;
         for (uint32_t channel = 0; channel < aOutputChannels; channel++) {
           outChannelPtrs[channel] =
             PointerForOffsetInChannel(buf.Elements(), outBufferLength,
                                       aOutputChannels, channel, offsetSamples);
         }
         AudioChannelsDownMix(channelData, outChannelPtrs.Elements(),
@@ -161,17 +161,17 @@ AudioSegment::Mix(AudioMixer& aMixer, ui
                "We forgot to write some samples?");
     aMixer.Mix(buf.Elements(), aOutputChannels, offsetSamples, aSampleRate);
   }
 }
 
 void
 AudioSegment::WriteTo(uint64_t aID, AudioMixer& aMixer, uint32_t aOutputChannels, uint32_t aSampleRate)
 {
-  AutoTArray<AudioDataValue,SilentChannel::AUDIO_PROCESSING_FRAMES*GUESS_AUDIO_CHANNELS> buf;
+  nsAutoTArray<AudioDataValue,SilentChannel::AUDIO_PROCESSING_FRAMES*GUESS_AUDIO_CHANNELS> buf;
   // Offset in the buffer that will be written to the mixer, in samples.
   uint32_t offset = 0;
 
   if (GetDuration() <= 0) {
     MOZ_ASSERT(GetDuration() == 0);
     return;
   }
 
--- a/dom/media/AudioSegment.h
+++ b/dom/media/AudioSegment.h
@@ -113,18 +113,18 @@ DownmixAndInterleave(const nsTArray<cons
                      int32_t aDuration, float aVolume, uint32_t aOutputChannels,
                      DestT* aOutput)
 {
 
   if (aChannelData.Length() == aOutputChannels) {
     InterleaveAndConvertBuffer(aChannelData.Elements(),
                                aDuration, aVolume, aOutputChannels, aOutput);
   } else {
-    AutoTArray<SrcT*,GUESS_AUDIO_CHANNELS> outputChannelData;
-    AutoTArray<SrcT, SilentChannel::AUDIO_PROCESSING_FRAMES * GUESS_AUDIO_CHANNELS> outputBuffers;
+    nsAutoTArray<SrcT*,GUESS_AUDIO_CHANNELS> outputChannelData;
+    nsAutoTArray<SrcT, SilentChannel::AUDIO_PROCESSING_FRAMES * GUESS_AUDIO_CHANNELS> outputBuffers;
     outputChannelData.SetLength(aOutputChannels);
     outputBuffers.SetLength(aDuration * aOutputChannels);
     for (uint32_t i = 0; i < aOutputChannels; i++) {
       outputChannelData[i] = outputBuffers.Elements() + aDuration * i;
     }
     AudioChannelsDownMix(aChannelData,
                          outputChannelData.Elements(),
                          aOutputChannels,
@@ -249,18 +249,18 @@ public:
   void Resample(SpeexResamplerState* aResampler, uint32_t aInRate, uint32_t aOutRate)
   {
     mDuration = 0;
 #ifdef DEBUG
     uint32_t segmentChannelCount = ChannelCount();
 #endif
 
     for (ChunkIterator ci(*this); !ci.IsEnded(); ci.Next()) {
-      AutoTArray<nsTArray<T>, GUESS_AUDIO_CHANNELS> output;
-      AutoTArray<const T*, GUESS_AUDIO_CHANNELS> bufferPtrs;
+      nsAutoTArray<nsTArray<T>, GUESS_AUDIO_CHANNELS> output;
+      nsAutoTArray<const T*, GUESS_AUDIO_CHANNELS> bufferPtrs;
       AudioChunk& c = *ci;
       // If this chunk is null, don't bother resampling, just alter its duration
       if (c.IsNull()) {
         c.mDuration = (c.mDuration * aOutRate) / aInRate;
         mDuration += c.mDuration;
         continue;
       }
       uint32_t channels = c.mChannelData.Length();
@@ -390,17 +390,17 @@ public:
   }
 };
 
 template<typename SrcT>
 void WriteChunk(AudioChunk& aChunk,
                 uint32_t aOutputChannels,
                 AudioDataValue* aOutputBuffer)
 {
-  AutoTArray<const SrcT*,GUESS_AUDIO_CHANNELS> channelData;
+  nsAutoTArray<const SrcT*,GUESS_AUDIO_CHANNELS> channelData;
 
   channelData = aChunk.ChannelData<SrcT>();
 
   if (channelData.Length() < aOutputChannels) {
     // Up-mix. Note that this might actually make channelData have more
     // than aOutputChannels temporarily.
     AudioChannelsUpMix(&channelData, aOutputChannels, SilentChannel::ZeroChannel<SrcT>());
   }
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -108,17 +108,17 @@ public:
       // sample rate = 44.1k file, the error will be less than 1 microsecond
       // after playing 24 hours. So we are fine with that.
       mBaseOffset += c.totalFrames;
       mBasePosition += FramesToUs<double>(c.servicedFrames, c.rate);
       mChunks.RemoveElementAt(0);
     }
   }
 private:
-  AutoTArray<Chunk, 7> mChunks;
+  nsAutoTArray<Chunk, 7> mChunks;
   int64_t mBaseOffset;
   double mBasePosition;
 };
 
 AudioStream::AudioStream(DataSource& aSource)
   : mMonitor("AudioStream")
   , mInRate(0)
   , mOutRate(0)
@@ -282,17 +282,17 @@ WriteDumpFile(FILE* aDumpFile, AudioStre
 
   uint32_t samples = aStream->GetOutChannels()*aFrames;
   if (AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_S16) {
     fwrite(aBuffer, 2, samples, aDumpFile);
     return;
   }
 
   NS_ASSERTION(AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_FLOAT32, "bad format");
-  AutoTArray<uint8_t, 1024*2> buf;
+  nsAutoTArray<uint8_t, 1024*2> buf;
   buf.SetLength(samples*2);
   float* input = static_cast<float*>(aBuffer);
   uint8_t* output = buf.Elements();
   for (uint32_t i = 0; i < samples; ++i) {
     SetUint16LE(output + i*2, int16_t(input[i]*32767.0f));
   }
   fwrite(output, 2, samples, aDumpFile);
   fflush(aDumpFile);
@@ -611,17 +611,17 @@ AudioStream::GetTimeStretched(AudioBuffe
     if (c->Frames() == 0) {
       break;
     }
     MOZ_ASSERT(c->Frames() <= toPopFrames);
     if (Downmix(c.get())) {
       mTimeStretcher->putSamples(c->Data(), c->Frames());
     } else {
       // Write silence if downmixing fails.
-      AutoTArray<AudioDataValue, 1000> buf;
+      nsAutoTArray<AudioDataValue, 1000> buf;
       buf.SetLength(mOutChannels * c->Frames());
       memset(buf.Elements(), 0, buf.Length() * sizeof(AudioDataValue));
       mTimeStretcher->putSamples(buf.Elements(), c->Frames());
     }
   }
 
   auto timeStretcher = mTimeStretcher;
   aWriter.Write([timeStretcher] (AudioDataValue* aPtr, uint32_t aFrames) {
--- a/dom/media/DOMMediaStream.h
+++ b/dom/media/DOMMediaStream.h
@@ -578,20 +578,20 @@ protected:
   // This port connects mInputStream to mOwnedStream. All tracks forwarded.
   RefPtr<MediaInputPort> mOwnedPort;
 
   // This port connects mOwnedStream to mPlaybackStream. All tracks not
   // explicitly blocked due to removal are forwarded.
   RefPtr<MediaInputPort> mPlaybackPort;
 
   // MediaStreamTracks corresponding to tracks in our mOwnedStream.
-  AutoTArray<RefPtr<TrackPort>, 2> mOwnedTracks;
+  nsAutoTArray<RefPtr<TrackPort>, 2> mOwnedTracks;
 
   // MediaStreamTracks corresponding to tracks in our mPlaybackStream.
-  AutoTArray<RefPtr<TrackPort>, 2> mTracks;
+  nsAutoTArray<RefPtr<TrackPort>, 2> mTracks;
 
   RefPtr<OwnedStreamListener> mOwnedListener;
   RefPtr<PlaybackStreamListener> mPlaybackListener;
 
   nsTArray<nsAutoPtr<OnTracksAvailableCallback> > mRunOnTracksAvailable;
 
   // Set to true after MediaStreamGraph has created tracks for mPlaybackStream.
   bool mTracksCreated;
--- a/dom/media/FileBlockCache.h
+++ b/dom/media/FileBlockCache.h
@@ -197,17 +197,17 @@ private:
   // cached in memory waiting to be written, or this block is the target of a
   // block move.
   nsTArray< RefPtr<BlockChange> > mBlockChanges;
   // Thread upon which block writes and block moves are performed. This is
   // created upon open, and shutdown (asynchronously) upon close (on the
   // main thread).
   nsCOMPtr<nsIThread> mThread;
   // Queue of pending block indexes that need to be written or moved.
-  //AutoTArray<int32_t, 8> mChangeIndexList;
+  //nsAutoTArray<int32_t, 8> mChangeIndexList;
   Int32Queue mChangeIndexList;
   // True if we've dispatched an event to commit all pending block changes
   // to file on mThread.
   bool mIsWriteScheduled;
   // True if the writer is ready to write data to file.
   bool mIsOpen;
 };
 
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -1093,17 +1093,17 @@ AudioCallbackDriver::EnqueueStreamAndPro
   MonitorAutoLock mon(mGraphImpl->GetMonitor());
   mPromisesForOperation.AppendElement(StreamAndPromiseForOperation(aStream,
                                                                    aPromise,
                                                                    aOperation));
 }
 
 void AudioCallbackDriver::CompleteAudioContextOperations(AsyncCubebOperation aOperation)
 {
-  AutoTArray<StreamAndPromiseForOperation, 1> array;
+  nsAutoTArray<StreamAndPromiseForOperation, 1> array;
 
   // We can't lock for the whole function because AudioContextOperationCompleted
   // will grab the monitor
   {
     MonitorAutoLock mon(GraphImpl()->GetMonitor());
     array.SwapElements(mPromisesForOperation);
   }
 
--- a/dom/media/GraphDriver.h
+++ b/dom/media/GraphDriver.h
@@ -514,17 +514,17 @@ private:
     ~AutoInCallback();
     AudioCallbackDriver* mDriver;
   };
 
   /* Thread for off-main-thread initialization and
    * shutdown of the audio stream. */
   nsCOMPtr<nsIThread> mInitShutdownThread;
   /* This must be accessed with the graph monitor held. */
-  AutoTArray<StreamAndPromiseForOperation, 1> mPromisesForOperation;
+  nsAutoTArray<StreamAndPromiseForOperation, 1> mPromisesForOperation;
   /* This is set during initialization, and can be read safely afterwards. */
   dom::AudioChannel mAudioChannel;
   /* Used to queue us to add the mixer callback on first run. */
   bool mAddedMixer;
 
   /* This is atomic and is set by the audio callback thread. It can be read by
    * any thread safely. */
   Atomic<bool> mInCallback;
--- a/dom/media/Intervals.h
+++ b/dom/media/Intervals.h
@@ -250,17 +250,17 @@ private:
 // An IntervalSet in a collection of Intervals. The IntervalSet is always
 // normalized.
 template<typename T>
 class IntervalSet
 {
 public:
   typedef IntervalSet<T> SelfType;
   typedef Interval<T> ElemType;
-  typedef AutoTArray<ElemType,4> ContainerType;
+  typedef nsAutoTArray<ElemType,4> ContainerType;
   typedef typename ContainerType::index_type IndexType;
 
   IntervalSet()
   {
   }
   virtual ~IntervalSet()
   {
   }
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -789,17 +789,17 @@ MediaCache::FindReusableBlock(TimeStamp 
       blockIndex = mFreeBlocks.GetNextBlock(blockIndex);
     } while (blockIndex >= 0);
   }
 
   // Build a list of the blocks we should consider for the "latest
   // predicted time of next use". We can exploit the fact that the block
   // linked lists are ordered by increasing time of next use. This is
   // actually the whole point of having the linked lists.
-  AutoTArray<uint32_t,8> candidates;
+  nsAutoTArray<uint32_t,8> candidates;
   for (uint32_t i = 0; i < mStreams.Length(); ++i) {
     MediaCacheStream* stream = mStreams[i];
     if (stream->mPinCount > 0) {
       // No point in even looking at this stream's blocks
       continue;
     }
 
     AppendMostReusableBlock(&stream->mMetadataBlocks, &candidates, length);
@@ -1035,17 +1035,17 @@ void
 MediaCache::Update()
 {
   NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
 
   // The action to use for each stream. We store these so we can make
   // decisions while holding the cache lock but implement those decisions
   // without holding the cache lock, since we need to call out to
   // stream, decoder and element code.
-  AutoTArray<StreamAction,10> actions;
+  nsAutoTArray<StreamAction,10> actions;
 
   {
     ReentrantMonitorAutoEnter mon(mReentrantMonitor);
     mUpdateQueued = false;
 #ifdef DEBUG
     mInUpdate = true;
 #endif
 
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -601,17 +601,17 @@ MediaStreamGraphImpl::CreateOrDestroyAud
 
   if (!aStream->GetStreamBuffer().GetAndResetTracksDirty() &&
       !aStream->mAudioOutputStreams.IsEmpty()) {
     return;
   }
 
   STREAM_LOG(LogLevel::Debug, ("Updating AudioOutputStreams for MediaStream %p", aStream));
 
-  AutoTArray<bool,2> audioOutputStreamsFound;
+  nsAutoTArray<bool,2> audioOutputStreamsFound;
   for (uint32_t i = 0; i < aStream->mAudioOutputStreams.Length(); ++i) {
     audioOutputStreamsFound.AppendElement(false);
   }
 
   for (StreamBuffer::TrackIter tracks(aStream->GetStreamBuffer(), MediaSegment::AUDIO);
        !tracks.IsEnded(); tracks.Next()) {
     uint32_t i;
     for (i = 0; i < audioOutputStreamsFound.Length(); ++i) {
@@ -786,17 +786,17 @@ MediaStreamGraphImpl::PlayVideo(MediaStr
   MOZ_ASSERT(mRealtime, "Should only attempt to play video in realtime mode");
 
   if (aStream->mVideoOutputs.IsEmpty())
     return;
 
   TimeStamp currentTimeStamp = CurrentDriver()->GetCurrentTimeStamp();
 
   // Collect any new frames produced in this iteration.
-  AutoTArray<ImageContainer::NonOwningImage,4> newImages;
+  nsAutoTArray<ImageContainer::NonOwningImage,4> newImages;
   RefPtr<Image> blackImage;
 
   MOZ_ASSERT(mProcessedTime >= aStream->mBufferStartTime, "frame position before buffer?");
   // We only look at the non-blocking interval
   StreamTime frameBufferTime = aStream->GraphTimeToStreamTime(mProcessedTime);
   StreamTime bufferEndTime = aStream->GraphTimeToStreamTime(aStream->mStartBlocking);
   StreamTime start;
   const VideoChunk* chunk;
@@ -856,24 +856,24 @@ MediaStreamGraphImpl::PlayVideo(MediaStr
     newImages.AppendElement(ImageContainer::NonOwningImage(image, targetTime));
 
     aStream->mLastPlayedVideoFrame = *frame;
   }
 
   if (!aStream->mLastPlayedVideoFrame.GetImage())
     return;
 
-  AutoTArray<ImageContainer::NonOwningImage,4> images;
+  nsAutoTArray<ImageContainer::NonOwningImage,4> images;
   bool haveMultipleImages = false;
 
   for (uint32_t i = 0; i < aStream->mVideoOutputs.Length(); ++i) {
     VideoFrameContainer* output = aStream->mVideoOutputs[i];
 
     // Find previous frames that may still be valid.
-    AutoTArray<ImageContainer::OwningImage,4> previousImages;
+    nsAutoTArray<ImageContainer::OwningImage,4> previousImages;
     output->GetImageContainer()->GetCurrentImages(&previousImages);
     uint32_t j = previousImages.Length();
     if (j) {
       // Re-use the most recent frame before currentTimeStamp and subsequent,
       // always keeping at least one frame.
       do {
         --j;
       } while (j > 0 && previousImages[j].mTimeStamp > currentTimeStamp);
--- a/dom/media/TrackUnionStream.cpp
+++ b/dom/media/TrackUnionStream.cpp
@@ -62,18 +62,18 @@ TrackUnionStream::TrackUnionStream(DOMMe
     }
     ProcessedMediaStream::RemoveInput(aPort);
   }
   void TrackUnionStream::ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags)
   {
     if (IsFinishedOnGraphThread()) {
       return;
     }
-    AutoTArray<bool,8> mappedTracksFinished;
-    AutoTArray<bool,8> mappedTracksWithMatchingInputTracks;
+    nsAutoTArray<bool,8> mappedTracksFinished;
+    nsAutoTArray<bool,8> mappedTracksWithMatchingInputTracks;
     for (uint32_t i = 0; i < mTrackMap.Length(); ++i) {
       mappedTracksFinished.AppendElement(true);
       mappedTracksWithMatchingInputTracks.AppendElement(false);
     }
     bool allFinished = !mInputs.IsEmpty();
     bool allHaveCurrentData = !mInputs.IsEmpty();
     for (uint32_t i = 0; i < mInputs.Length(); ++i) {
       MediaStream* stream = mInputs[i]->GetSource();
--- a/dom/media/VideoFrameContainer.cpp
+++ b/dom/media/VideoFrameContainer.cpp
@@ -30,17 +30,17 @@ VideoFrameContainer::~VideoFrameContaine
 {}
 
 void VideoFrameContainer::SetCurrentFrame(const gfx::IntSize& aIntrinsicSize,
                                           Image* aImage,
                                           const TimeStamp& aTargetTime)
 {
   if (aImage) {
     MutexAutoLock lock(mMutex);
-    AutoTArray<ImageContainer::NonOwningImage,1> imageList;
+    nsAutoTArray<ImageContainer::NonOwningImage,1> imageList;
     imageList.AppendElement(
         ImageContainer::NonOwningImage(aImage, aTargetTime, ++mFrameID));
     SetCurrentFramesLocked(aIntrinsicSize, imageList);
   } else {
     ClearCurrentFrame(aIntrinsicSize);
   }
 }
 
--- a/dom/media/encoder/OpusTrackEncoder.cpp
+++ b/dom/media/encoder/OpusTrackEncoder.cpp
@@ -308,17 +308,17 @@ OpusTrackEncoder::GetEncodedTrack(Encode
     // original data, the pcm duration will be calculated at rate 48K later.
     if (mEndOfStream && !mEosSetInEncoder) {
       mEosSetInEncoder = true;
       mSourceSegment.AppendNullData(mLookahead);
     }
   }
 
   // Start encoding data.
-  AutoTArray<AudioDataValue, 9600> pcm;
+  nsAutoTArray<AudioDataValue, 9600> pcm;
   pcm.SetLength(GetPacketDuration() * mChannels);
   AudioSegment::ChunkIterator iter(mSourceSegment);
   int frameCopied = 0;
 
   while (!iter.IsEnded() && frameCopied < framesToFetch) {
     AudioChunk chunk = *iter;
 
     // Chunk to the required frame size.
@@ -339,17 +339,17 @@ OpusTrackEncoder::GetEncodedTrack(Encode
     frameCopied += frameToCopy;
     iter.Next();
   }
 
   RefPtr<EncodedFrame> audiodata = new EncodedFrame();
   audiodata->SetFrameType(EncodedFrame::OPUS_AUDIO_FRAME);
   int framesInPCM = frameCopied;
   if (mResampler) {
-    AutoTArray<AudioDataValue, 9600> resamplingDest;
+    nsAutoTArray<AudioDataValue, 9600> resamplingDest;
     // We want to consume all the input data, so we slightly oversize the
     // resampled data buffer so we can fit the output data in. We cannot really
     // predict the output frame count at each call.
     uint32_t outframes = frameCopied * kOpusSamplingRate / mSamplingRate + 1;
     uint32_t inframes = frameCopied;
 
     resamplingDest.SetLength(outframes * mChannels);
 
--- a/dom/media/encoder/TrackEncoder.cpp
+++ b/dom/media/encoder/TrackEncoder.cpp
@@ -135,26 +135,26 @@ AudioTrackEncoder::AppendAudioSegment(co
 void
 AudioTrackEncoder::InterleaveTrackData(AudioChunk& aChunk,
                                        int32_t aDuration,
                                        uint32_t aOutputChannels,
                                        AudioDataValue* aOutput)
 {
   switch(aChunk.mBufferFormat) {
     case AUDIO_FORMAT_S16: {
-      AutoTArray<const int16_t*, 2> array;
+      nsAutoTArray<const int16_t*, 2> array;
       array.SetLength(aOutputChannels);
       for (uint32_t i = 0; i < array.Length(); i++) {
         array[i] = static_cast<const int16_t*>(aChunk.mChannelData[i]);
       }
       InterleaveTrackData(array, aDuration, aOutputChannels, aOutput, aChunk.mVolume);
       break;
     }
     case AUDIO_FORMAT_FLOAT32: {
-      AutoTArray<const float*, 2> array;
+      nsAutoTArray<const float*, 2> array;
       array.SetLength(aOutputChannels);
       for (uint32_t i = 0; i < array.Length(); i++) {
         array[i] = static_cast<const float*>(aChunk.mChannelData[i]);
       }
       InterleaveTrackData(array, aDuration, aOutputChannels, aOutput, aChunk.mVolume);
       break;
    }
    case AUDIO_FORMAT_SILENCE: {
--- a/dom/media/encoder/VorbisTrackEncoder.cpp
+++ b/dom/media/encoder/VorbisTrackEncoder.cpp
@@ -197,18 +197,18 @@ VorbisTrackEncoder::GetEncodedTrack(Enco
 
   // Start encoding data.
   AudioSegment::ChunkIterator iter(*sourceSegment);
 
   AudioDataValue **vorbisBuffer =
     vorbis_analysis_buffer(&mVorbisDsp, (int)sourceSegment->GetDuration());
 
   int framesCopied = 0;
-  AutoTArray<AudioDataValue, 9600> interleavedPcm;
-  AutoTArray<AudioDataValue, 9600> nonInterleavedPcm;
+  nsAutoTArray<AudioDataValue, 9600> interleavedPcm;
+  nsAutoTArray<AudioDataValue, 9600> nonInterleavedPcm;
   interleavedPcm.SetLength(sourceSegment->GetDuration() * mChannels);
   nonInterleavedPcm.SetLength(sourceSegment->GetDuration() * mChannels);
   while (!iter.IsEnded()) {
     AudioChunk chunk = *iter;
     int frameToCopy = chunk.GetDuration();
     if (!chunk.IsNull()) {
       InterleaveTrackData(chunk, frameToCopy, mChannels,
                           interleavedPcm.Elements() + framesCopied * mChannels);
--- a/dom/media/gmp/GMPDecryptorChild.cpp
+++ b/dom/media/gmp/GMPDecryptorChild.cpp
@@ -152,17 +152,17 @@ GMPDecryptorChild::SessionError(const ch
 
 void
 GMPDecryptorChild::KeyStatusChanged(const char* aSessionId,
                                     uint32_t aSessionIdLength,
                                     const uint8_t* aKeyId,
                                     uint32_t aKeyIdLength,
                                     GMPMediaKeyStatus aStatus)
 {
-  AutoTArray<uint8_t, 16> kid;
+  nsAutoTArray<uint8_t, 16> kid;
   kid.AppendElements(aKeyId, aKeyIdLength);
   CALL_ON_GMP_THREAD(SendKeyStatusChanged,
                      nsCString(aSessionId, aSessionIdLength), kid,
                      aStatus);
 }
 
 void
 GMPDecryptorChild::Decrypted(GMPBuffer* aBuffer, GMPErr aResult)
--- a/dom/media/gtest/TestVorbisTrackEncoder.cpp
+++ b/dom/media/gtest/TestVorbisTrackEncoder.cpp
@@ -178,17 +178,17 @@ TEST(VorbisTrackEncoder, EncodedFrame)
   // Generate 1 second samples.
   // Reference PeerConnectionMedia.h::Fake_AudioGenerator
   RefPtr<mozilla::SharedBuffer> samples =
     mozilla::SharedBuffer::Create(rate * sizeof(AudioDataValue));
   AudioDataValue* data = static_cast<AudioDataValue*>(samples->Data());
   for (int i = 0; i < rate; i++) {
     data[i] = ((i%8)*4000) - (7*4000)/2;
   }
-  AutoTArray<const AudioDataValue*,1> channelData;
+  nsAutoTArray<const AudioDataValue*,1> channelData;
   channelData.AppendElement(data);
   AudioSegment segment;
   segment.AppendFrames(samples.forget(), channelData, 44100);
 
   // Track change notification.
   encoder.NotifyQueuedTrackChanges(nullptr, 0, 0, 0, segment);
 
   // Pull Encoded data back from encoder and verify encoded samples.
--- a/dom/media/mediasink/DecodedStream.cpp
+++ b/dom/media/mediasink/DecodedStream.cpp
@@ -495,17 +495,17 @@ SendStreamAudio(DecodedStreamData* aStre
     aOutput->AppendFrom(&silence);
   }
 
   // Always write the whole sample without truncation to be consistent with
   // DecodedAudioDataSink::PlayFromAudioQueue()
   audio->EnsureAudioBuffer();
   RefPtr<SharedBuffer> buffer = audio->mAudioBuffer;
   AudioDataValue* bufferData = static_cast<AudioDataValue*>(buffer->Data());
-  AutoTArray<const AudioDataValue*, 2> channels;
+  nsAutoTArray<const AudioDataValue*, 2> channels;
   for (uint32_t i = 0; i < audio->mChannels; ++i) {
     channels.AppendElement(bufferData + i * audio->mFrames);
   }
   aOutput->AppendFrames(buffer.forget(), channels, audio->mFrames);
   aStream->mAudioFramesWritten += audio->mFrames;
   aOutput->ApplyVolume(aVolume);
 
   aStream->mNextAudioTime = audio->GetEndTime();
@@ -517,17 +517,17 @@ DecodedStream::SendAudio(double aVolume,
   AssertOwnerThread();
 
   if (!mInfo.HasAudio()) {
     return;
   }
 
   AudioSegment output;
   uint32_t rate = mInfo.mAudio.mRate;
-  AutoTArray<RefPtr<MediaData>,10> audio;
+  nsAutoTArray<RefPtr<MediaData>,10> audio;
   TrackID audioTrackId = mInfo.mAudio.mTrackId;
   SourceMediaStream* sourceStream = mData->mStream;
 
   // It's OK to hold references to the AudioData because AudioData
   // is ref-counted.
   mAudioQueue.GetElementsAfter(mData->mNextAudioTime, &audio);
   for (uint32_t i = 0; i < audio.Length(); ++i) {
     SendStreamAudio(mData.get(), mStartTime.ref(), audio[i], &output, rate, aVolume);
@@ -582,17 +582,17 @@ DecodedStream::SendVideo(bool aIsSameOri
   AssertOwnerThread();
 
   if (!mInfo.HasVideo()) {
     return;
   }
 
   VideoSegment output;
   TrackID videoTrackId = mInfo.mVideo.mTrackId;
-  AutoTArray<RefPtr<MediaData>, 10> video;
+  nsAutoTArray<RefPtr<MediaData>, 10> video;
   SourceMediaStream* sourceStream = mData->mStream;
 
   // It's OK to hold references to the VideoData because VideoData
   // is ref-counted.
   mVideoQueue.GetElementsAfter(mData->mNextVideoTime, &video);
 
   for (uint32_t i = 0; i < video.Length(); ++i) {
     VideoData* v = video[i]->As<VideoData>();
--- a/dom/media/mediasink/VideoSink.cpp
+++ b/dom/media/mediasink/VideoSink.cpp
@@ -309,23 +309,23 @@ VideoSink::DisconnectListener()
 
 void
 VideoSink::RenderVideoFrames(int32_t aMaxFrames,
                              int64_t aClockTime,
                              const TimeStamp& aClockTimeStamp)
 {
   AssertOwnerThread();
 
-  AutoTArray<RefPtr<MediaData>,16> frames;
+  nsAutoTArray<RefPtr<MediaData>,16> frames;
   VideoQueue().GetFirstElements(aMaxFrames, &frames);
   if (frames.IsEmpty() || !mContainer) {
     return;
   }
 
-  AutoTArray<ImageContainer::NonOwningImage,16> images;
+  nsAutoTArray<ImageContainer::NonOwningImage,16> images;
   TimeStamp lastFrameTime;
   MediaSink::PlaybackParams params = mAudioSink->GetPlaybackParams();
   for (uint32_t i = 0; i < frames.Length(); ++i) {
     VideoData* frame = frames[i]->As<VideoData>();
 
     frame->mSentToCompositor = true;
 
     if (!frame->mImage || !frame->mImage->IsValid()) {
--- a/dom/media/ogg/OggReader.cpp
+++ b/dom/media/ogg/OggReader.cpp
@@ -291,17 +291,17 @@ void OggReader::SetupTargetSkeleton(Skel
   if (aSkeletonState) {
     if (!HasAudio() && !HasVideo()) {
       // We have a skeleton track, but no audio or video, may as well disable
       // the skeleton, we can't do anything useful with this media.
       aSkeletonState->Deactivate();
     } else if (ReadHeaders(aSkeletonState) && aSkeletonState->HasIndex()) {
       // Extract the duration info out of the index, so we don't need to seek to
       // the end of resource to get it.
-      AutoTArray<uint32_t, 2> tracks;
+      nsAutoTArray<uint32_t, 2> tracks;
       BuildSerialList(tracks);
       int64_t duration = 0;
       if (NS_SUCCEEDED(aSkeletonState->GetDuration(tracks, duration))) {
         LOG(LogLevel::Debug, ("Got duration from Skeleton index %lld", duration));
         mInfo.mMetadataDuration.emplace(TimeUnit::FromMicroseconds(duration));
       }
     }
   }
@@ -390,17 +390,17 @@ nsresult OggReader::ReadMetadata(MediaIn
   // We read packets until all bitstreams have read all their header packets.
   // We record the offset of the first non-header page so that we know
   // what page to seek to when seeking to the media start.
 
   NS_ASSERTION(aTags, "Called with null MetadataTags**.");
   *aTags = nullptr;
 
   ogg_page page;
-  AutoTArray<OggCodecState*,4> bitstreams;
+  nsAutoTArray<OggCodecState*,4> bitstreams;
   nsTArray<uint32_t> serials;
   bool readAllBOS = false;
   while (!readAllBOS) {
     if (!ReadOggPage(&page)) {
       // Some kind of error...
       break;
     }
 
@@ -1249,17 +1249,17 @@ OggReader::IndexedSeekResult OggReader::
 }
 
 OggReader::IndexedSeekResult OggReader::SeekToKeyframeUsingIndex(int64_t aTarget)
 {
   if (!HasSkeleton() || !mSkeletonState->HasIndex()) {
     return SEEK_INDEX_FAIL;
   }
   // We have an index from the Skeleton track, try to use it to seek.
-  AutoTArray<uint32_t, 2> tracks;
+  nsAutoTArray<uint32_t, 2> tracks;
   BuildSerialList(tracks);
   SkeletonState::nsSeekTarget keyframe;
   if (NS_FAILED(mSkeletonState->IndexedSeekTarget(aTarget,
                                                   tracks,
                                                   keyframe)))
   {
     // Could not locate a keypoint for the target in the index.
     return SEEK_INDEX_FAIL;
@@ -1444,17 +1444,17 @@ nsresult OggReader::SeekInternal(int64_t
     // have a way of asking Skeleton to seek to a different target for each
     // stream yet. Using adjustedTarget here is at least correct, if slow.
     IndexedSeekResult sres = SeekToKeyframeUsingIndex(adjustedTarget);
     NS_ENSURE_TRUE(sres != SEEK_FATAL_ERROR, NS_ERROR_FAILURE);
     if (sres == SEEK_INDEX_FAIL) {
       // No index or other non-fatal index-related failure. Try to seek
       // using a bisection search. Determine the already downloaded data
       // in the media cache, so we can try to seek in the cached data first.
-      AutoTArray<SeekRange, 16> ranges;
+      nsAutoTArray<SeekRange, 16> ranges;
       res = GetSeekRanges(ranges);
       NS_ENSURE_SUCCESS(res,res);
 
       // Figure out if the seek target lies in a buffered range.
       SeekRange r = SelectSeekRange(ranges, aTarget, StartTime(), aEndTime, true);
 
       if (!r.IsNull()) {
         // We know the buffered range in which the seek target lies, do a
--- a/dom/media/omx/OMXCodecWrapper.cpp
+++ b/dom/media/omx/OMXCodecWrapper.cpp
@@ -746,17 +746,17 @@ public:
       if (aChunk.IsNull()) {
         bytesCopied = SendSilenceToBuffer(chunkSamples);
       } else {
         bytesCopied = SendChunkToBuffer(aChunk, chunkSamples);
       }
       UpdateAfterSendChunk(chunkSamples, bytesCopied, aSamplesRead);
     } else {
       // Interleave data to a temporary buffer.
-      AutoTArray<AudioDataValue, 9600> pcm;
+      nsAutoTArray<AudioDataValue, 9600> pcm;
       pcm.SetLength(bytesToCopy);
       AudioDataValue* interleavedSource = pcm.Elements();
       AudioTrackEncoder::InterleaveTrackData(aChunk, chunkSamples,
                                              mOMXAEncoder.mChannels,
                                              interleavedSource);
 
       // When the data size of chunk is larger than the buffer capacity,
       // we split it into sub-chunks to fill up buffers.
@@ -848,17 +848,17 @@ private:
   // and return the copied bytes number of audio data.
   size_t SendChunkToBuffer(AudioChunk& aSource, size_t aSamplesNum)
   {
     AudioDataValue* dst = reinterpret_cast<AudioDataValue*>(GetPointer());
     size_t bytesToCopy = aSamplesNum * mOMXAEncoder.mResamplingRatio
                          * mOMXAEncoder.mChannels * sizeof(AudioDataValue);
     uint32_t dstSamplesCopied = aSamplesNum;
     if (mOMXAEncoder.mResampler) {
-      AutoTArray<AudioDataValue, 9600> pcm;
+      nsAutoTArray<AudioDataValue, 9600> pcm;
       pcm.SetLength(bytesToCopy);
       AudioTrackEncoder::InterleaveTrackData(aSource, aSamplesNum,
                                              mOMXAEncoder.mChannels,
                                              pcm.Elements());
       int16_t* tempSource = reinterpret_cast<int16_t*>(pcm.Elements());
       speex_resampler_process_interleaved_int(mOMXAEncoder.mResampler, tempSource,
                                               &aSamplesNum, dst,
                                               &dstSamplesCopied);
--- a/dom/media/platforms/agnostic/VorbisDecoder.cpp
+++ b/dom/media/platforms/agnostic/VorbisDecoder.cpp
@@ -66,18 +66,18 @@ VorbisDataDecoder::Shutdown()
 RefPtr<MediaDataDecoder::InitPromise>
 VorbisDataDecoder::Init()
 {
   vorbis_info_init(&mVorbisInfo);
   vorbis_comment_init(&mVorbisComment);
   PodZero(&mVorbisDsp);
   PodZero(&mVorbisBlock);
 
-  AutoTArray<unsigned char*,4> headers;
-  AutoTArray<size_t,4> headerLens;
+  nsAutoTArray<unsigned char*,4> headers;
+  nsAutoTArray<size_t,4> headerLens;
   if (!XiphExtradataToHeaders(headers, headerLens,
                               mInfo.mCodecSpecificConfig->Elements(),
                               mInfo.mCodecSpecificConfig->Length())) {
     return InitPromise::CreateAndReject(DecoderFailureReason::INIT_ERROR, __func__);
   }
   for (size_t i = 0; i < headers.Length(); i++) {
     if (NS_FAILED(DecodeHeader(headers[i], headerLens[i]))) {
       return InitPromise::CreateAndReject(DecoderFailureReason::INIT_ERROR, __func__);
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
@@ -118,17 +118,17 @@ private:
     }
     // Remove all elements of the map.
     void Clear()
     {
       mMap.Clear();
     }
 
   private:
-    AutoTArray<DurationElement, 16> mMap;
+    nsAutoTArray<DurationElement, 16> mMap;
   };
 
   DurationMap mDurationMap;
 };
 
 } // namespace mozilla
 
 #endif // __FFmpegVideoDecoder_h__
--- a/dom/media/systemservices/MediaUtils.h
+++ b/dom/media/systemservices/MediaUtils.h
@@ -316,17 +316,17 @@ public:
   }
 
 private:
   static uint32_t GetNextId()
   {
     static uint32_t counter = 0;
     return ++counter;
   };
-  AutoTArray<Element, 3> mElements;
+  nsAutoTArray<Element, 3> mElements;
 };
 
 /* media::Refcountable - Add threadsafe ref-counting to something that isn't.
  *
  * Often, reference counting is the most practical way to share an object with
  * another thread without imposing lifetime restrictions, even if there's
  * otherwise no concurrent access happening on the object.  For instance, an
  * algorithm on another thread may find it more expedient to modify a passed-in
--- a/dom/media/webaudio/AudioBuffer.h
+++ b/dom/media/webaudio/AudioBuffer.h
@@ -114,17 +114,17 @@ protected:
 
   already_AddRefed<ThreadSharedFloatArrayBufferList>
   StealJSArrayDataIntoSharedChannels(JSContext* aJSContext);
 
   void ClearJSChannels();
 
   nsWeakPtr mOwnerWindow;
   // Float32Arrays
-  AutoTArray<JS::Heap<JSObject*>, 2> mJSChannels;
+  nsAutoTArray<JS::Heap<JSObject*>, 2> mJSChannels;
 
   // mSharedChannels aggregates the data from mJSChannels. This is non-null
   // if and only if the mJSChannels' buffers are detached.
   RefPtr<ThreadSharedFloatArrayBufferList> mSharedChannels;
 
   uint32_t mLength;
   float mSampleRate;
 };
--- a/dom/media/webaudio/AudioNodeEngine.h
+++ b/dom/media/webaudio/AudioNodeEngine.h
@@ -123,17 +123,17 @@ public:
   }
 
   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
 private:
-  AutoTArray<Storage, 2> mContents;
+  nsAutoTArray<Storage, 2> mContents;
 };
 
 /**
  * aChunk must have been allocated by AllocateAudioBlock.
  */
 void WriteZeroesToAudioBlock(AudioBlock* aChunk, uint32_t aStart,
                              uint32_t aLength);
 
@@ -248,17 +248,17 @@ AudioBufferSumOfSquares(const float* aIn
 /**
  * All methods of this class and its subclasses are called on the
  * MediaStreamGraph thread.
  */
 class AudioNodeEngine
 {
 public:
   // This should be compatible with AudioNodeStream::OutputChunks.
-  typedef AutoTArray<AudioBlock, 1> OutputChunks;
+  typedef nsAutoTArray<AudioBlock, 1> OutputChunks;
 
   explicit AudioNodeEngine(dom::AudioNode* aNode)
     : mNode(aNode)
     , mInputCount(aNode ? aNode->NumberOfInputs() : 1)
     , mOutputCount(aNode ? aNode->NumberOfOutputs() : 0)
   {
     MOZ_ASSERT(NS_IsMainThread());
     MOZ_COUNT_CTOR(AudioNodeEngine);
--- a/dom/media/webaudio/AudioNodeExternalInputStream.cpp
+++ b/dom/media/webaudio/AudioNodeExternalInputStream.cpp
@@ -44,17 +44,17 @@ AudioNodeExternalInputStream::Create(Med
  * count that's a superset of the channels in aInput.
  */
 template <typename T>
 static void
 CopyChunkToBlock(AudioChunk& aInput, AudioBlock *aBlock,
                  uint32_t aOffsetInBlock)
 {
   uint32_t blockChannels = aBlock->ChannelCount();
-  AutoTArray<const T*,2> channels;
+  nsAutoTArray<const T*,2> channels;
   if (aInput.IsNull()) {
     channels.SetLength(blockChannels);
     PodZero(channels.Elements(), blockChannels);
   } else {
     const nsTArray<const T*>& inputChannels = aInput.ChannelData<T>();
     channels.SetLength(inputChannels.Length());
     PodCopy(channels.Elements(), inputChannels.Elements(), channels.Length());
     if (channels.Length() != blockChannels) {
@@ -132,17 +132,17 @@ AudioNodeExternalInputStream::ProcessInp
   if (!IsEnabled() || mInputs.IsEmpty() || mPassThrough) {
     mLastChunks[0].SetNull(WEBAUDIO_BLOCK_SIZE);
     return;
   }
 
   MOZ_ASSERT(mInputs.Length() == 1);
 
   MediaStream* source = mInputs[0]->GetSource();
-  AutoTArray<AudioSegment,1> audioSegments;
+  nsAutoTArray<AudioSegment,1> audioSegments;
   uint32_t inputChannels = 0;
   for (StreamBuffer::TrackIter tracks(source->mBuffer, MediaSegment::AUDIO);
        !tracks.IsEnded(); tracks.Next()) {
     const StreamBuffer::Track& inputTrack = *tracks;
     if (!mInputs[0]->PassTrackThrough(tracks->GetID())) {
       continue;
     }
 
@@ -187,17 +187,17 @@ AudioNodeExternalInputStream::ProcessInp
 
     for (AudioSegment::ChunkIterator iter(segment); !iter.IsEnded(); iter.Next()) {
       inputChannels = GetAudioChannelsSuperset(inputChannels, iter->ChannelCount());
     }
   }
 
   uint32_t accumulateIndex = 0;
   if (inputChannels) {
-    AutoTArray<float,GUESS_AUDIO_CHANNELS*WEBAUDIO_BLOCK_SIZE> downmixBuffer;
+    nsAutoTArray<float,GUESS_AUDIO_CHANNELS*WEBAUDIO_BLOCK_SIZE> downmixBuffer;
     for (uint32_t i = 0; i < audioSegments.Length(); ++i) {
       AudioBlock tmpChunk;
       ConvertSegmentToAudioBlock(&audioSegments[i], &tmpChunk, inputChannels);
       if (!tmpChunk.IsNull()) {
         if (accumulateIndex == 0) {
           mLastChunks[0].AllocateChannels(inputChannels);
         }
         AccumulateInputChunk(accumulateIndex, tmpChunk, &mLastChunks[0], &downmixBuffer);
--- a/dom/media/webaudio/AudioNodeStream.cpp
+++ b/dom/media/webaudio/AudioNodeStream.cpp
@@ -403,17 +403,17 @@ AudioNodeStream::AdvanceAndResume(Stream
 }
 
 void
 AudioNodeStream::ObtainInputBlock(AudioBlock& aTmpChunk,
                                   uint32_t aPortIndex)
 {
   uint32_t inputCount = mInputs.Length();
   uint32_t outputChannelCount = 1;
-  AutoTArray<const AudioBlock*,250> inputChunks;
+  nsAutoTArray<const AudioBlock*,250> inputChunks;
   for (uint32_t i = 0; i < inputCount; ++i) {
     if (aPortIndex != mInputs[i]->InputNumber()) {
       // This input is connected to a different port
       continue;
     }
     MediaStream* s = mInputs[i]->GetSource();
     AudioNodeStream* a = static_cast<AudioNodeStream*>(s);
     MOZ_ASSERT(a == s->AsAudioNodeStream());
@@ -449,30 +449,30 @@ AudioNodeStream::ObtainInputBlock(AudioB
 
   if (outputChannelCount == 0) {
     aTmpChunk.SetNull(WEBAUDIO_BLOCK_SIZE);
     return;
   }
 
   aTmpChunk.AllocateChannels(outputChannelCount);
   // The static storage here should be 1KB, so it's fine
-  AutoTArray<float, GUESS_AUDIO_CHANNELS*WEBAUDIO_BLOCK_SIZE> downmixBuffer;
+  nsAutoTArray<float, GUESS_AUDIO_CHANNELS*WEBAUDIO_BLOCK_SIZE> downmixBuffer;
 
   for (uint32_t i = 0; i < inputChunkCount; ++i) {
     AccumulateInputChunk(i, *inputChunks[i], &aTmpChunk, &downmixBuffer);
   }
 }
 
 void
 AudioNodeStream::AccumulateInputChunk(uint32_t aInputIndex,
                                       const AudioBlock& aChunk,
                                       AudioBlock* aBlock,
                                       nsTArray<float>* aDownmixBuffer)
 {
-  AutoTArray<const float*,GUESS_AUDIO_CHANNELS> channels;
+  nsAutoTArray<const float*,GUESS_AUDIO_CHANNELS> channels;
   UpMixDownMixChunk(&aChunk, aBlock->ChannelCount(), channels, *aDownmixBuffer);
 
   for (uint32_t c = 0; c < channels.Length(); ++c) {
     const float* inputData = static_cast<const float*>(channels[c]);
     float* outputData = aBlock->ChannelFloatsForWrite(c);
     if (inputData) {
       if (aInputIndex == 0) {
         AudioBlockCopyChannelWithScale(inputData, aChunk.mVolume, outputData);
@@ -504,17 +504,17 @@ AudioNodeStream::UpMixDownMixChunk(const
     } else {
       // Fill up the remaining aOutputChannels by zeros
       for (uint32_t j = aOutputChannels.Length(); j < aOutputChannelCount; ++j) {
         aOutputChannels.AppendElement(nullptr);
       }
     }
   } else if (aOutputChannels.Length() > aOutputChannelCount) {
     if (mChannelInterpretation == ChannelInterpretation::Speakers) {
-      AutoTArray<float*,GUESS_AUDIO_CHANNELS> outputChannels;
+      nsAutoTArray<float*,GUESS_AUDIO_CHANNELS> outputChannels;
       outputChannels.SetLength(aOutputChannelCount);
       aDownmixBuffer.SetLength(aOutputChannelCount * WEBAUDIO_BLOCK_SIZE);
       for (uint32_t j = 0; j < aOutputChannelCount; ++j) {
         outputChannels[j] = &aDownmixBuffer[j * WEBAUDIO_BLOCK_SIZE];
       }
 
       AudioChannelsDownMix(aOutputChannels, outputChannels.Elements(),
                            aOutputChannelCount, WEBAUDIO_BLOCK_SIZE);
--- a/dom/media/webaudio/AudioNodeStream.h
+++ b/dom/media/webaudio/AudioNodeStream.h
@@ -36,17 +36,17 @@ class AudioNodeStream : public Processed
   typedef dom::ChannelCountMode ChannelCountMode;
   typedef dom::ChannelInterpretation ChannelInterpretation;
 
 public:
   typedef mozilla::dom::AudioContext AudioContext;
 
   enum { AUDIO_TRACK = 1 };
 
-  typedef AutoTArray<AudioBlock, 1> OutputChunks;
+  typedef nsAutoTArray<AudioBlock, 1> OutputChunks;
 
   // Flags re main thread updates and stream output.
   typedef unsigned Flags;
   enum : Flags {
     NO_STREAM_FLAGS = 0U,
     NEED_MAIN_THREAD_FINISHED = 1U << 0,
     NEED_MAIN_THREAD_CURRENT_TIME = 1U << 1,
     // Internal AudioNodeStreams can only pass their output to another
--- a/dom/media/webaudio/DelayBuffer.h
+++ b/dom/media/webaudio/DelayBuffer.h
@@ -89,17 +89,17 @@ private:
   int OffsetForPosition(int aPosition);
   int ChunkForDelay(int aDelay);
   void UpdateUpmixChannels(int aNewReadChunk, uint32_t channelCount,
                            ChannelInterpretation aChannelInterpretation);
 
   // Circular buffer for capturing delayed samples.
   FallibleTArray<AudioChunk> mChunks;
   // Cache upmixed channel arrays.
-  AutoTArray<const float*,GUESS_AUDIO_CHANNELS> mUpmixChannels;
+  nsAutoTArray<const float*,GUESS_AUDIO_CHANNELS> mUpmixChannels;
   double mSmoothingRate;
   // Current delay, in fractional ticks
   double mCurrentDelay;
   // Maximum delay, in ticks
   int mMaxDelayTicks;
   // The current position in the circular buffer.  The next write will be to
   // this chunk, and the next read may begin before this chunk.
   int mCurrentChunk;
--- a/dom/media/webaudio/WebAudioUtils.cpp
+++ b/dom/media/webaudio/WebAudioUtils.cpp
@@ -31,18 +31,18 @@ WebAudioUtils::Shutdown()
 
 int
 WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler,
                                      uint32_t aChannel,
                                      const float* aIn, uint32_t* aInLen,
                                      float* aOut, uint32_t* aOutLen)
 {
 #ifdef MOZ_SAMPLE_TYPE_S16
-  AutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp1;
-  AutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp2;
+  nsAutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp1;
+  nsAutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp2;
   tmp1.SetLength(*aInLen);
   tmp2.SetLength(*aOutLen);
   ConvertAudioSamples(aIn, tmp1.Elements(), *aInLen);
   int result = speex_resampler_process_int(aResampler, aChannel, tmp1.Elements(), aInLen, tmp2.Elements(), aOutLen);
   ConvertAudioSamples(tmp2.Elements(), aOut, *aOutLen);
   return result;
 #else
   return speex_resampler_process_float(aResampler, aChannel, aIn, aInLen, aOut, aOutLen);
@@ -50,17 +50,17 @@ WebAudioUtils::SpeexResamplerProcess(Spe
 }
 
 int
 WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler,
                                      uint32_t aChannel,
                                      const int16_t* aIn, uint32_t* aInLen,
                                      float* aOut, uint32_t* aOutLen)
 {
-  AutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp;
+  nsAutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp;
 #ifdef MOZ_SAMPLE_TYPE_S16
   tmp.SetLength(*aOutLen);
   int result = speex_resampler_process_int(aResampler, aChannel, aIn, aInLen, tmp.Elements(), aOutLen);
   ConvertAudioSamples(tmp.Elements(), aOut, *aOutLen);
   return result;
 #else
   tmp.SetLength(*aInLen);
   ConvertAudioSamples(aIn, tmp.Elements(), *aInLen);
@@ -73,18 +73,18 @@ int
 WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler,
                                      uint32_t aChannel,
                                      const int16_t* aIn, uint32_t* aInLen,
                                      int16_t* aOut, uint32_t* aOutLen)
 {
 #ifdef MOZ_SAMPLE_TYPE_S16
   return speex_resampler_process_int(aResampler, aChannel, aIn, aInLen, aOut, aOutLen);
 #else
-  AutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp1;
-  AutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp2;
+  nsAutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp1;
+  nsAutoTArray<AudioDataValue, WEBAUDIO_BLOCK_SIZE*4> tmp2;
   tmp1.SetLength(*aInLen);
   tmp2.SetLength(*aOutLen);
   ConvertAudioSamples(aIn, tmp1.Elements(), *aInLen);
   int result = speex_resampler_process_float(aResampler, aChannel, tmp1.Elements(), aInLen, tmp2.Elements(), aOutLen);
   ConvertAudioSamples(tmp2.Elements(), aOut, *aOutLen);
   return result;
 #endif
 }
--- a/dom/media/webaudio/blink/HRTFElevation.cpp
+++ b/dom/media/webaudio/blink/HRTFElevation.cpp
@@ -123,17 +123,17 @@ nsReturnRef<HRTFKernel> HRTFElevation::c
     float response[ResponseFrameSize];
     ConvertAudioSamples(impulse_response_data, response, ResponseFrameSize);
     float* resampledResponse;
 #endif
 
     // Note that depending on the fftSize returned by the panner, we may be truncating the impulse response.
     const size_t resampledResponseLength = fftSizeForSampleRate(sampleRate) / 2;
 
-    AutoTArray<AudioDataValue, 2 * ResponseFrameSize> resampled;
+    nsAutoTArray<AudioDataValue, 2 * ResponseFrameSize> resampled;
     if (sampleRate == rawSampleRate) {
         resampledResponse = response;
         MOZ_ASSERT(resampledResponseLength == ResponseFrameSize);
     } else {
         resampled.SetLength(resampledResponseLength);
         resampledResponse = resampled.Elements();
         speex_resampler_skip_zeros(resampler);
 
@@ -158,17 +158,17 @@ nsReturnRef<HRTFKernel> HRTFElevation::c
             PodZero(resampled.Elements() + out_index,
                     resampled.Length() - out_index);
         }
 
         speex_resampler_reset_mem(resampler);
     }
 
 #ifdef MOZ_SAMPLE_TYPE_S16
-    AutoTArray<float, 2 * ResponseFrameSize> floatArray;
+    nsAutoTArray<float, 2 * ResponseFrameSize> floatArray;
     floatArray.SetLength(resampledResponseLength);
     float *floatResponse = floatArray.Elements();
     ConvertAudioSamples(resampledResponse,
                         floatResponse, resampledResponseLength);
 #else
     float *floatResponse = resampledResponse;
 #endif
 #undef RESAMPLER_PROCESS
--- a/dom/media/webaudio/blink/Reverb.cpp
+++ b/dom/media/webaudio/blink/Reverb.cpp
@@ -76,21 +76,21 @@ static float calculateNormalizationScale
 
     return scale;
 }
 
 Reverb::Reverb(ThreadSharedFloatArrayBufferList* impulseResponse, size_t impulseResponseBufferLength, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads, bool normalize, float sampleRate)
 {
     float scale = 1;
 
-    AutoTArray<const float*,4> irChannels;
+    nsAutoTArray<const float*,4> irChannels;
     for (size_t i = 0; i < impulseResponse->GetChannels(); ++i) {
         irChannels.AppendElement(impulseResponse->GetData(i));
     }
-    AutoTArray<float,1024> tempBuf;
+    nsAutoTArray<float,1024> tempBuf;
 
     if (normalize) {
         scale = calculateNormalizationScale(impulseResponse, impulseResponseBufferLength, sampleRate);
 
         if (scale) {
             tempBuf.SetLength(irChannels.Length()*impulseResponseBufferLength);
             for (uint32_t i = 0; i < irChannels.Length(); ++i) {
                 float* buf = &tempBuf[i*impulseResponseBufferLength];
--- a/dom/media/webm/WebMDemuxer.cpp
+++ b/dom/media/webm/WebMDemuxer.cpp
@@ -384,18 +384,18 @@ WebMDemuxer::ReadMetadata()
       mInfo.mAudio.mChannels = params.channels;
 
       unsigned int nheaders = 0;
       r = nestegg_track_codec_data_count(mContext, track, &nheaders);
       if (r == -1) {
         return NS_ERROR_FAILURE;
       }
 
-      AutoTArray<const unsigned char*,4> headers;
-      AutoTArray<size_t,4> headerLens;
+      nsAutoTArray<const unsigned char*,4> headers;
+      nsAutoTArray<size_t,4> headerLens;
       for (uint32_t header = 0; header < nheaders; ++header) {
         unsigned char* data = 0;
         size_t length = 0;
         r = nestegg_track_codec_data(mContext, track, header, &data, &length);
         if (r == -1) {
           return NS_ERROR_FAILURE;
         }
         headers.AppendElement(data);
--- a/dom/media/webrtc/MediaEngineDefault.cpp
+++ b/dom/media/webrtc/MediaEngineDefault.cpp
@@ -505,17 +505,17 @@ MediaEngineDefaultAudioSource::Restart(c
 void
 MediaEngineDefaultAudioSource::AppendToSegment(AudioSegment& aSegment,
                                                TrackTicks aSamples)
 {
   RefPtr<SharedBuffer> buffer = SharedBuffer::Create(aSamples * sizeof(int16_t));
   int16_t* dest = static_cast<int16_t*>(buffer->Data());
 
   mSineGenerator->generate(dest, aSamples);
-  AutoTArray<const int16_t*,1> channels;
+  nsAutoTArray<const int16_t*,1> channels;
   channels.AppendElement(dest);
   aSegment.AppendFrames(buffer.forget(), channels, aSamples);
 }
 
 NS_IMETHODIMP
 MediaEngineDefaultAudioSource::Notify(nsITimer* aTimer)
 {
   TimeStamp now = TimeStamp::Now();
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -634,17 +634,17 @@ MediaEngineWebRTCMicrophoneSource::Proce
   uint32_t len = mSources.Length();
   for (uint32_t i = 0; i < len; i++) {
     RefPtr<SharedBuffer> buffer = SharedBuffer::Create(length * sizeof(sample));
 
     sample* dest = static_cast<sample*>(buffer->Data());
     memcpy(dest, audio10ms, length * sizeof(sample));
 
     nsAutoPtr<AudioSegment> segment(new AudioSegment());
-    AutoTArray<const sample*,1> channels;
+    nsAutoTArray<const sample*,1> channels;
     channels.AppendElement(dest);
     segment->AppendFrames(buffer.forget(), channels, length);
     TimeStamp insertTime;
     segment->GetStartTime(insertTime);
 
     if (mSources[i]) {
       // Make sure we include the stream and the track.
       // The 0:1 is a flag to note when we've done the final insert for a given input block.
--- a/dom/media/webspeech/recognition/SpeechRecognition.cpp
+++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp
@@ -927,17 +927,17 @@ SpeechRecognition::SplitSamplesBuffer(co
 AudioSegment*
 SpeechRecognition::CreateAudioSegment(nsTArray<RefPtr<SharedBuffer>>& aChunks)
 {
   AudioSegment* segment = new AudioSegment();
   for (uint32_t i = 0; i < aChunks.Length(); ++i) {
     RefPtr<SharedBuffer> buffer = aChunks[i];
     const int16_t* chunkData = static_cast<const int16_t*>(buffer->Data());
 
-    AutoTArray<const int16_t*, 1> channels;
+    nsAutoTArray<const int16_t*, 1> channels;
     channels.AppendElement(chunkData);
     segment->AppendFrames(buffer.forget(), channels, mAudioSamplesPerChunk);
   }
 
   return segment;
 }
 
 void
@@ -954,17 +954,17 @@ SpeechRecognition::FeedAudioData(already
   // chunks, we must buffer and split them in chunks of mAudioSamplesPerChunk
   // (a multiple of Endpointer's frame size) before feeding to Endpointer.
 
   // ensure aSamples is deleted
   RefPtr<SharedBuffer> refSamples = aSamples;
 
   uint32_t samplesIndex = 0;
   const int16_t* samples = static_cast<int16_t*>(refSamples->Data());
-  AutoTArray<RefPtr<SharedBuffer>, 5> chunksToSend;
+  nsAutoTArray<RefPtr<SharedBuffer>, 5> chunksToSend;
 
   // fill up our buffer and make a chunk out of it, if possible
   if (mBufferedSamples > 0) {
     samplesIndex += FillSamplesBuffer(samples, aDuration);
 
     if (mBufferedSamples == mAudioSamplesPerChunk) {
       chunksToSend.AppendElement(mAudioSamplesBuffer.forget());
       mBufferedSamples = 0;
--- a/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm
+++ b/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm
@@ -270,17 +270,17 @@ private:
   RefPtr<OSXSpeechSynthesizerService> mSpeechService;
 };
 
 NS_IMETHODIMP
 EnumVoicesRunnable::Run()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
-  AutoTArray<OSXVoice, 64> list;
+  nsAutoTArray<OSXVoice, 64> list;
 
   NSArray* voices = [NSSpeechSynthesizer availableVoices];
   NSString* defaultVoice = [NSSpeechSynthesizer defaultVoice];
 
   for (NSString* voice in voices) {
     OSXVoice item;
 
     NSDictionary* attr = [NSSpeechSynthesizer attributesForVoice:voice];
--- a/dom/media/webspeech/synth/nsSpeechTask.cpp
+++ b/dom/media/webspeech/synth/nsSpeechTask.cpp
@@ -318,17 +318,17 @@ void
 nsSpeechTask::SendAudioImpl(RefPtr<mozilla::SharedBuffer>& aSamples, uint32_t aDataLen)
 {
   if (aDataLen == 0) {
     mStream->EndAllTrackAndFinish();
     return;
   }
 
   AudioSegment segment;
-  AutoTArray<const int16_t*, 1> channelData;
+  nsAutoTArray<const int16_t*, 1> channelData;
   channelData.AppendElement(static_cast<int16_t*>(aSamples->Data()));
   segment.AppendFrames(aSamples.forget(), channelData, aDataLen);
   mStream->AppendToTrack(1, &segment);
   mStream->AdvanceKnownTracksTime(STREAM_TIME_MAX);
 }
 
 NS_IMETHODIMP
 nsSpeechTask::DispatchStart()
--- a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
+++ b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
@@ -31,25 +31,25 @@ extern mozilla::LogModule* GetSpeechSynt
 namespace {
 
 void
 GetAllSpeechSynthActors(InfallibleTArray<mozilla::dom::SpeechSynthesisParent*>& aActors)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aActors.IsEmpty());
 
-  AutoTArray<mozilla::dom::ContentParent*, 20> contentActors;
+  nsAutoTArray<mozilla::dom::ContentParent*, 20> contentActors;
   mozilla::dom::ContentParent::GetAll(contentActors);
 
   for (uint32_t contentIndex = 0;
        contentIndex < contentActors.Length();
        ++contentIndex) {
     MOZ_ASSERT(contentActors[contentIndex]);
 
-    AutoTArray<mozilla::dom::PSpeechSynthesisParent*, 5> speechsynthActors;
+    AutoInfallibleTArray<mozilla::dom::PSpeechSynthesisParent*, 5> speechsynthActors;
     contentActors[contentIndex]->ManagedPSpeechSynthesisParent(speechsynthActors);
 
     for (uint32_t speechsynthIndex = 0;
          speechsynthIndex < speechsynthActors.Length();
          ++speechsynthIndex) {
       MOZ_ASSERT(speechsynthActors[speechsynthIndex]);
 
       mozilla::dom::SpeechSynthesisParent* actor =
--- a/dom/messagechannel/MessagePort.cpp
+++ b/dom/messagechannel/MessagePort.cpp
@@ -470,20 +470,20 @@ MessagePort::PostMessage(JSContext* aCx,
   if (mState == eStateEntangling) {
     mMessagesForTheOtherPort.AppendElement(data);
     return;
   }
 
   MOZ_ASSERT(mActor);
   MOZ_ASSERT(mMessagesForTheOtherPort.IsEmpty());
 
-  AutoTArray<RefPtr<SharedMessagePortMessage>, 1> array;
+  nsAutoTArray<RefPtr<SharedMessagePortMessage>, 1> array;
   array.AppendElement(data);
 
-  AutoTArray<MessagePortMessage, 1> messages;
+  nsAutoTArray<MessagePortMessage, 1> messages;
   SharedMessagePortMessage::FromSharedToMessagesChild(mActor, array, messages);
   mActor->SendPostMessages(messages);
 }
 
 void
 MessagePort::Start()
 {
   if (mMessageQueueEnabled) {
--- a/dom/mobilemessage/ipc/SmsChild.cpp
+++ b/dom/mobilemessage/ipc/SmsChild.cpp
@@ -344,20 +344,20 @@ MobileMessageCursorChild::HandleContinue
 }
 
 void
 MobileMessageCursorChild::DoNotifyResult(const nsTArray<MobileMessageData>& aDataArray)
 {
   const uint32_t length = aDataArray.Length();
   MOZ_ASSERT(length);
 
-  AutoTArray<nsISupports*, 1> autoArray;
+  AutoFallibleTArray<nsISupports*, 1> autoArray;
   NS_ENSURE_TRUE_VOID(autoArray.SetCapacity(length, fallible));
 
-  AutoTArray<nsCOMPtr<nsISupports>, 1> messages;
+  AutoFallibleTArray<nsCOMPtr<nsISupports>, 1> messages;
   NS_ENSURE_TRUE_VOID(messages.SetCapacity(length, fallible));
 
   for (uint32_t i = 0; i < length; i++) {
     nsCOMPtr<nsISupports> message = CreateMessageFromMessageData(aDataArray[i]);
     NS_ENSURE_TRUE_VOID(messages.AppendElement(message, fallible));
     NS_ENSURE_TRUE_VOID(autoArray.AppendElement(message.get(), fallible));
   }
 
@@ -365,20 +365,20 @@ MobileMessageCursorChild::DoNotifyResult
 }
 
 void
 MobileMessageCursorChild::DoNotifyResult(const nsTArray<ThreadData>& aDataArray)
 {
   const uint32_t length = aDataArray.Length();
   MOZ_ASSERT(length);
 
-  AutoTArray<nsISupports*, 1> autoArray;
+  AutoFallibleTArray<nsISupports*, 1> autoArray;
   NS_ENSURE_TRUE_VOID(autoArray.SetCapacity(length, fallible));
 
-  AutoTArray<nsCOMPtr<nsISupports>, 1> threads;
+  AutoFallibleTArray<nsCOMPtr<nsISupports>, 1> threads;
   NS_ENSURE_TRUE_VOID(threads.SetCapacity(length, fallible));
 
   for (uint32_t i = 0; i < length; i++) {
     nsCOMPtr<nsISupports> thread =
       new MobileMessageThreadInternal(aDataArray[i]);
     NS_ENSURE_TRUE_VOID(threads.AppendElement(thread, fallible));
     NS_ENSURE_TRUE_VOID(autoArray.AppendElement(thread.get(), fallible));
   }
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -153,17 +153,17 @@ public:
 
   NS_IMETHOD Done(JSContext* aCx) final
   {
     AutoJSAPI jsapi;
     DebugOnly<bool> ok = jsapi.Init(mWindow, aCx);
     MOZ_ASSERT(ok);
 
     ErrorResult result;
-    AutoTArray<RefPtr<Notification>, 5> notifications;
+    nsAutoTArray<RefPtr<Notification>, 5> notifications;
 
     for (uint32_t i = 0; i < mStrings.Length(); ++i) {
       RefPtr<Notification> n =
         Notification::ConstructFromFields(mWindow,
                                           mStrings[i].mID,
                                           mStrings[i].mTitle,
                                           mStrings[i].mDir,
                                           mStrings[i].mLang,
@@ -2089,17 +2089,17 @@ public:
   }
 
   void
   WorkerRunInternal(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
   {
     RefPtr<Promise> workerPromise = mPromiseProxy->WorkerPromise();
 
     ErrorResult result;
-    AutoTArray<RefPtr<Notification>, 5> notifications;
+    nsAutoTArray<RefPtr<Notification>, 5> notifications;
     for (uint32_t i = 0; i < mStrings.Length(); ++i) {
       RefPtr<Notification> n =
         Notification::ConstructFromFields(aWorkerPrivate->GlobalScope(),
                                           mStrings[i].mID,
                                           mStrings[i].mTitle,
                                           mStrings[i].mDir,
                                           mStrings[i].mLang,
                                           mStrings[i].mBody,
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -1688,17 +1688,17 @@ void
 
       if (s->UTF8Characters) {
 #if defined(MOZ_MEMORY_WINDOWS)
         if (malloc_usable_size((void *)s->UTF8Characters) != 0) {
           PR_Free((void *)s->UTF8Characters);
         } else {
           void *p = (void *)s->UTF8Characters;
           DWORD nheaps = 0;
-          AutoTArray<HANDLE, 50> heaps;
+          nsAutoTArray<HANDLE, 50> heaps;
           nheaps = GetProcessHeaps(0, heaps.Elements());
           heaps.AppendElements(nheaps);
           GetProcessHeaps(nheaps, heaps.Elements());
           for (DWORD i = 0; i < nheaps; i++) {
             if (InHeap(heaps[i], p)) {
               HeapFree(heaps[i], 0, p);
               break;
             }
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -2106,17 +2106,17 @@ nsresult nsPluginHost::ScanPluginsDirect
   ("nsPluginHost::ScanPluginsDirectory dir=%s\n", dirPath.get()));
 #endif
 
   nsCOMPtr<nsISimpleEnumerator> iter;
   rv = pluginsDir->GetDirectoryEntries(getter_AddRefs(iter));
   if (NS_FAILED(rv))
     return rv;
 
-  AutoTArray<nsCOMPtr<nsIFile>, 6> pluginFiles;
+  nsAutoTArray<nsCOMPtr<nsIFile>, 6> pluginFiles;
 
   bool hasMore;
   while (NS_SUCCEEDED(iter->HasMoreElements(&hasMore)) && hasMore) {
     nsCOMPtr<nsISupports> supports;
     rv = iter->GetNext(getter_AddRefs(supports));
     if (NS_FAILED(rv))
       continue;
     nsCOMPtr<nsIFile> dirEntry(do_QueryInterface(supports, &rv));
@@ -3661,17 +3661,17 @@ nsPluginHost::ParsePostBufferToFixHeader
   *outPostData = 0;
   *outPostDataLen = 0;
 
   const char CR = '\r';
   const char LF = '\n';
   const char CRLFCRLF[] = {CR,LF,CR,LF,'\0'}; // C string"\r\n\r\n"
   const char ContentLenHeader[] = "Content-length";
 
-  AutoTArray<const char*, 8> singleLF;
+  nsAutoTArray<const char*, 8> singleLF;
   const char *pSCntlh = 0;// pointer to start of ContentLenHeader in inPostData
   const char *pSod = 0;   // pointer to start of data in inPostData
   const char *pEoh = 0;   // pointer to end of headers in inPostData
   const char *pEod = inPostData + inPostDataLen; // pointer to end of inPostData
   if (*inPostData == LF) {
     // If no custom headers are required, simply add a blank
     // line ('\n') to the beginning of the file or buffer.
     // so *inPostData == '\n' is valid
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -898,17 +898,17 @@ nsPluginInstanceOwner::GetCompositionStr
     case GCS_COMPCLAUSE: {
       RefPtr<TextRangeArray> ranges = composition->GetLastRanges();
       if (!ranges || ranges->IsEmpty()) {
         aDist->SetLength(sizeof(uint32_t));
         memset(aDist->Elements(), 0, sizeof(uint32_t));
         *aLength = aDist->Length();
         return true;
       }
-      AutoTArray<uint32_t, 16> clauses;
+      nsAutoTArray<uint32_t, 16> clauses;
       clauses.AppendElement(0);
       for (TextRange& range : *ranges) {
         if (!range.IsClause()) {
           continue;
         }
         clauses.AppendElement(range.mEndOffset);
       }
 
--- a/dom/plugins/base/nsPluginsDirUtils.h
+++ b/dom/plugins/base/nsPluginsDirUtils.h
@@ -21,17 +21,17 @@ static nsresult
 ParsePluginMimeDescription(const char *mdesc, nsPluginInfo &info)
 {
     nsresult rv = NS_ERROR_FAILURE;
     if (!mdesc || !*mdesc)
        return rv;
 
     char *mdescDup = PL_strdup(mdesc); // make a dup of intput string we'll change it content
     char anEmptyString[] = "";
-    AutoTArray<char*, 8> tmpMimeTypeArr;
+    nsAutoTArray<char*, 8> tmpMimeTypeArr;
     char delimiters[] = {':',':',';'};
     int mimeTypeVariantCount = 0;
     char *p = mdescDup; // make a dup of intput string we'll change it content
     while(p) {
         char *ptrMimeArray[] = {anEmptyString, anEmptyString, anEmptyString};
 
         // It's easy to point out ptrMimeArray[0] to the string sounds like
         // "Mime type is not specified, plugin will not function properly."
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -2038,17 +2038,17 @@ PluginInstanceChild::ImmGetCompositionSt
                                                  LPVOID aBuf, DWORD aLen)
 {
     if (aIMC != sHookIMC) {
         return sImm32ImmGetCompositionStringStub(aIMC, aIndex, aBuf, aLen);
     }
     if (!sCurrentPluginInstance) {
         return IMM_ERROR_GENERAL;
     }
-    AutoTArray<uint8_t, 16> dist;
+    nsAutoTArray<uint8_t, 16> dist;
     int32_t length = 0; // IMM_ERROR_NODATA
     sCurrentPluginInstance->SendGetCompositionString(aIndex, &dist, &length);
     if (length == IMM_ERROR_NODATA || length == IMM_ERROR_GENERAL) {
       return length;
     }
 
     if (aBuf && aLen >= static_cast<DWORD>(length)) {
         memcpy(aBuf, dist.Elements(), length);
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -802,17 +802,17 @@ PluginInstanceParent::RecvShowDirectBitm
 
 void
 PluginInstanceParent::SetCurrentImage(Image* aImage)
 {
     MOZ_ASSERT(IsUsingDirectDrawing());
     ImageContainer::NonOwningImage holder(aImage);
     holder.mFrameID = ++mFrameID;
 
-    AutoTArray<ImageContainer::NonOwningImage,1> imageList;
+    nsAutoTArray<ImageContainer::NonOwningImage,1> imageList;
     imageList.AppendElement(holder);
     mImageContainer->SetCurrentImages(imageList);
 
     RecordDrawingModel();
 }
 
 bool
 PluginInstanceParent::RecvShowDirectDXGISurface(const WindowsHandle& handle,
@@ -954,17 +954,17 @@ PluginInstanceParent::RecvShow(const NPR
                    updatedRect.right - updatedRect.left,
                    updatedRect.bottom - updatedRect.top);
         surface->MarkDirty(ur);
 
         RefPtr<gfx::SourceSurface> sourceSurface =
             gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface);
         RefPtr<SourceSurfaceImage> image = new SourceSurfaceImage(surface->GetSize(), sourceSurface);
 
-        AutoTArray<ImageContainer::NonOwningImage,1> imageList;
+        nsAutoTArray<ImageContainer::NonOwningImage,1> imageList;
         imageList.AppendElement(
             ImageContainer::NonOwningImage(image));
 
         ImageContainer *container = GetImageContainer();
         container->SetCurrentImages(imageList);
     }
     else if (mImageContainer) {
         mImageContainer->ClearAllImages();
--- a/dom/plugins/ipc/PluginModuleChild.h
+++ b/dom/plugins/ipc/PluginModuleChild.h
@@ -358,17 +358,17 @@ private:
             : _spinning(false)
             , _savedNestableTasksAllowed(false)
         { }
 
         bool _spinning;
         bool _savedNestableTasksAllowed;
     };
 
-    AutoTArray<IncallFrame, 8> mIncallPumpingStack;
+    nsAutoTArray<IncallFrame, 8> mIncallPumpingStack;
 
     static LRESULT CALLBACK NestedInputEventHook(int code,
                                                  WPARAM wParam,
                                                  LPARAM lParam);
     static LRESULT CALLBACK CallWindowProcHook(int code,
                                                WPARAM wParam,
                                                LPARAM lParam);
     void SetEventHooks();
--- a/dom/plugins/ipc/PluginScriptableObjectChild.cpp
+++ b/dom/plugins/ipc/PluginScriptableObjectChild.cpp
@@ -431,17 +431,17 @@ PluginScriptableObjectChild::ScriptableE
     NS_WARNING("Calling method on an invalidated object!");
     return false;
   }
 
   ProtectedActor<PluginScriptableObjectChild> actor(object->parent);
   NS_ASSERTION(actor, "This shouldn't ever be null!");
   NS_ASSERTION(actor->Type() == Proxy, "Bad type!");
 
-  AutoTArray<PluginIdentifier, 10> identifiers;
+  AutoInfallibleTArray<PluginIdentifier, 10> identifiers;
   bool success;
   actor->CallEnumerate(&identifiers, &success);
 
   if (!success) {
     return false;
   }
 
   *aCount = identifiers.Length();
@@ -770,17 +770,17 @@ PluginScriptableObjectChild::AnswerInvok
   NS_ASSERTION(mType == LocalObject, "Bad type!");
 
   if (!(mObject->_class && mObject->_class->invoke)) {
     *aResult = void_t();
     *aSuccess = false;
     return true;
   }
 
-  AutoTArray<NPVariant, 10> convertedArgs;
+  AutoFallibleTArray<NPVariant, 10> convertedArgs;
   uint32_t argCount = aArgs.Length();
 
   if (!convertedArgs.SetLength(argCount, mozilla::fallible)) {
     *aResult = void_t();
     *aSuccess = false;
     return true;
   }
 
@@ -840,17 +840,17 @@ PluginScriptableObjectChild::AnswerInvok
   NS_ASSERTION(mType == LocalObject, "Bad type!");
 
   if (!(mObject->_class && mObject->_class->invokeDefault)) {
     *aResult = void_t();
     *aSuccess = false;
     return true;
   }
 
-  AutoTArray<NPVariant, 10> convertedArgs;
+  AutoFallibleTArray<NPVariant, 10> convertedArgs;
   uint32_t argCount = aArgs.Length();
 
   if (!convertedArgs.SetLength(argCount, mozilla::fallible)) {
     *aResult = void_t();
     *aSuccess = false;
     return true;
   }
 
@@ -1091,17 +1091,17 @@ PluginScriptableObjectChild::AnswerConst
   NS_ASSERTION(mType == LocalObject, "Bad type!");
 
   if (!(mObject->_class && mObject->_class->construct)) {
     *aResult = void_t();
     *aSuccess = false;
     return true;
   }
 
-  AutoTArray<NPVariant, 10> convertedArgs;
+  AutoFallibleTArray<NPVariant, 10> convertedArgs;
   uint32_t argCount = aArgs.Length();
 
   if (!convertedArgs.SetLength(argCount, mozilla::fallible)) {
     *aResult = void_t();
     *aSuccess = false;
     return true;
   }
 
--- a/dom/plugins/ipc/PluginScriptableObjectParent.cpp
+++ b/dom/plugins/ipc/PluginScriptableObjectParent.cpp
@@ -480,17 +480,17 @@ PluginScriptableObjectParent::Scriptable
   NS_ASSERTION(actor->Type() == Proxy, "Bad type!");
 
   const NPNetscapeFuncs* npn = GetNetscapeFuncs(aObject);
   if (!npn) {
     NS_ERROR("No netscape funcs!");
     return false;
   }
 
-  AutoTArray<PluginIdentifier, 10> identifiers;
+  AutoInfallibleTArray<PluginIdentifier, 10> identifiers;
   bool success;
   if (!actor->CallEnumerate(&identifiers, &success)) {
     NS_WARNING("Failed to send message!");
     return false;
   }
 
   if (!success) {
     return false;
@@ -825,17 +825,17 @@ PluginScriptableObjectParent::AnswerInvo
 
   StackIdentifier stackID(aId);
   if (stackID.Failed()) {
     *aResult = void_t();
     *aSuccess = false;
     return true;
   }
 
-  AutoTArray<NPVariant, 10> convertedArgs;
+  AutoFallibleTArray<NPVariant, 10> convertedArgs;
   uint32_t argCount = aArgs.Length();
 
   if (!convertedArgs.SetLength(argCount, fallible)) {
     *aResult = void_t();
     *aSuccess = false;
     return true;
   }
 
@@ -908,17 +908,17 @@ PluginScriptableObjectParent::AnswerInvo
   const NPNetscapeFuncs* npn = GetNetscapeFuncs(instance);
   if (!npn) {
     NS_ERROR("No netscape funcs?!");
     *aResult = void_t();
     *aSuccess = false;
     return true;
   }
 
-  AutoTArray<NPVariant, 10> convertedArgs;
+  AutoFallibleTArray<NPVariant, 10> convertedArgs;
   uint32_t argCount = aArgs.Length();
 
   if (!convertedArgs.SetLength(argCount, fallible)) {
     *aResult = void_t();
     *aSuccess = false;
     return true;
   }
 
@@ -1228,17 +1228,17 @@ PluginScriptableObjectParent::AnswerCons
   const NPNetscapeFuncs* npn = GetNetscapeFuncs(instance);
   if (!npn) {
     NS_ERROR("No netscape funcs?!");
     *aResult = void_t();
     *aSuccess = false;
     return true;
   }
 
-  AutoTArray<NPVariant, 10> convertedArgs;
+  AutoFallibleTArray<NPVariant, 10> convertedArgs;
   uint32_t argCount = aArgs.Length();
 
   if (!convertedArgs.SetLength(argCount, fallible)) {
     *aResult = void_t();
     *aSuccess = false;
     return true;
   }
 
--- a/dom/power/PowerManager.cpp
+++ b/dom/power/PowerManager.cpp
@@ -130,17 +130,17 @@ PowerManager::Callback(const nsAString &
   /**
    * We maintain a local listener list instead of using the global
    * list so that when the window is destroyed we don't have to
    * cleanup the mess.
    * Copy the listeners list before we walk through the callbacks
    * because the callbacks may install new listeners. We expect no
    * more than one listener per window, so it shouldn't be too long.
    */
-  AutoTArray<nsCOMPtr<nsIDOMMozWakeLockListener>, 2> listeners(mListeners);
+  nsAutoTArray<nsCOMPtr<nsIDOMMozWakeLockListener>, 2> listeners(mListeners);
   for (uint32_t i = 0; i < listeners.Length(); ++i) {
     listeners[i]->Callback(aTopic, aState);
   }
 
   return NS_OK;
 }
 
 bool
--- a/dom/power/PowerManagerService.cpp
+++ b/dom/power/PowerManagerService.cpp
@@ -107,17 +107,17 @@ PowerManagerService::Notify(const WakeLo
   nsAutoString state;
   ComputeWakeLockState(aWakeLockInfo, state);
 
   /**
    * Copy the listeners list before we walk through the callbacks
    * because the callbacks may install new listeners. We expect no
    * more than one listener per window, so it shouldn't be too long.
    */
-  AutoTArray<nsCOMPtr<nsIDOMMozWakeLockListener>, 2> listeners(mWakeLockListeners);
+  nsAutoTArray<nsCOMPtr<nsIDOMMozWakeLockListener>, 2> listeners(mWakeLockListeners);
 
   for (uint32_t i = 0; i < listeners.Length(); ++i) {
     listeners[i]->Callback(aWakeLockInfo.topic(), state);
   }
 }
 
 void
 PowerManagerService::SyncProfile()
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -2471,17 +2471,17 @@ QuotaObject::MaybeUpdateSize(int64_t aSi
 
   AssertNoOverflow(quotaManager->mTemporaryStorageUsage, delta);
   uint64_t newTemporaryStorageUsage = quotaManager->mTemporaryStorageUsage +
                                       delta;
 
   if (newTemporaryStorageUsage > quotaManager->mTemporaryStorageLimit) {
     // This will block the thread without holding the lock while waitting.
 
-    AutoTArray<RefPtr<DirectoryLockImpl>, 10> locks;
+    nsAutoTArray<RefPtr<DirectoryLockImpl>, 10> locks;
 
     uint64_t sizeToBeFreed =
       quotaManager->LockedCollectOriginsForEviction(delta, locks);
 
     if (!sizeToBeFreed) {
       return false;
     }
 
@@ -3796,17 +3796,17 @@ QuotaManager::OpenDirectoryInternal(Null
   MOZ_ASSERT(lock);
 
   if (!aExclusive) {
     return;
   }
 
   // All the locks that block this new exclusive lock need to be invalidated.
   // We also need to notify clients to abort operations for them.
-  AutoTArray<nsAutoPtr<nsTHashtable<nsCStringHashKey>>,
+  nsAutoTArray<nsAutoPtr<nsTHashtable<nsCStringHashKey>>,
                Client::TYPE_MAX> origins;
   origins.SetLength(Client::TYPE_MAX);
 
   const nsTArray<DirectoryLockImpl*>& blockedOnLocks =
     lock->GetBlockedOnLocks();
 
   for (DirectoryLockImpl* blockedOnLock : blockedOnLocks) {
     blockedOnLock->Invalidate();
--- a/dom/quota/QuotaManager.h
+++ b/dom/quota/QuotaManager.h
@@ -495,17 +495,17 @@ private:
 
   // A timer that gets activated at shutdown to ensure we close all storages.
   nsCOMPtr<nsITimer> mShutdownTimer;
 
   // A list of all successfully initialized origins. This list isn't protected
   // by any mutex but it is only ever touched on the IO thread.
   nsTArray<nsCString> mInitializedOrigins;
 
-  AutoTArray<RefPtr<Client>, Client::TYPE_MAX> mClients;
+  nsAutoTArray<RefPtr<Client>, Client::TYPE_MAX> mClients;
 
   nsString mIndexedDBPath;
   nsString mStoragePath;
   nsString mPermanentStoragePath;
   nsString mTemporaryStoragePath;
   nsString mDefaultStoragePath;
 
   uint64_t mTemporaryStorageLimit;
--- a/dom/svg/SVGLengthList.h
+++ b/dom/svg/SVGLengthList.h
@@ -125,30 +125,30 @@ private:
   bool AppendItem(SVGLength aLength) {
     return !!mLengths.AppendElement(aLength, fallible);
   }
 
 protected:
 
   /* Rationale for using nsTArray<SVGLength> and not nsTArray<SVGLength, 1>:
    *
-   * It might seem like we should use AutoTArray<SVGLength, 1> instead of
+   * It might seem like we should use nsAutoTArray<SVGLength, 1> instead of
    * nsTArray<SVGLength>. That would preallocate space for one SVGLength and
    * avoid an extra memory allocation call in the common case of the 'x'
    * and 'y' attributes each containing a single length (and the 'dx' and 'dy'
    * attributes being empty). However, consider this:
    *
-   * An empty nsTArray uses sizeof(Header*). An AutoTArray<class E,
+   * An empty nsTArray uses sizeof(Header*). An nsAutoTArray<class E,
    * uint32_t N> on the other hand uses sizeof(Header*) +
    * (2 * sizeof(uint32_t)) + (N * sizeof(E)), which for one SVGLength is
    * sizeof(Header*) + 16 bytes.
    *
    * Now consider that for text elements we have four length list attributes
    * (x, y, dx, dy), each of which can have a baseVal and an animVal list. If
-   * we were to go the AutoTArray<SVGLength, 1> route for each of these, we'd
+   * we were to go the nsAutoTArray<SVGLength, 1> route for each of these, we'd
    * end up using at least 160 bytes for these four attributes alone, even
    * though we only need storage for two SVGLengths (16 bytes) in the common
    * case!!
    *
    * A compromise might be to template SVGLengthList to allow
    * SVGAnimatedLengthList to preallocate space for an SVGLength for the
    * baseVal lists only, and that would cut the space used by the four
    * attributes to 96 bytes. Taking that even further and templating
--- a/dom/voicemail/Voicemail.h
+++ b/dom/voicemail/Voicemail.h
@@ -82,17 +82,17 @@ private:
 
 private:
   nsCOMPtr<nsIVoicemailService> mService;
   RefPtr<Listener> mListener;
 
   // |mStatuses| keeps all instantiated VoicemailStatus objects as well as the
   // empty slots for not interested ones. The length of |mStatuses| is decided
   // in the constructor and is never changed ever since.
-  AutoTArray<RefPtr<VoicemailStatus>, 1> mStatuses;
+  nsAutoTArray<RefPtr<VoicemailStatus>, 1> mStatuses;
 
   // Return a nsIVoicemailProvider instance based on the requests from external
   // components. Return nullptr if aOptionalServiceId contains an invalid
   // service id or the default one is just not available.
   already_AddRefed<nsIVoicemailProvider>
   GetItemByServiceId(const Optional<uint32_t>& aOptionalServiceId,
                      uint32_t& aActualServiceId) const;
 
--- a/dom/workers/Queue.h
+++ b/dom/workers/Queue.h
@@ -12,17 +12,17 @@
 #include "mozilla/Mutex.h"
 #include "nsTArray.h"
 
 BEGIN_WORKERS_NAMESPACE
 
 template <typename T, int TCount>
 struct StorageWithTArray
 {
-  typedef AutoTArray<T, TCount> StorageType;
+  typedef nsAutoTArray<T, TCount> StorageType;
 
   static void Reverse(StorageType& aStorage)
   {
     uint32_t length = aStorage.Length();
     for (uint32_t index = 0; index < length / 2; index++) {
       uint32_t reverseIndex = length - 1 - index;
 
       T t1 = aStorage.ElementAt(index);
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -121,17 +121,17 @@ static_assert(MAX_WORKERS_PER_DOMAIN >= 
 #define GC_REQUEST_OBSERVER_TOPIC "child-gc-request"
 #define CC_REQUEST_OBSERVER_TOPIC "child-cc-request"
 #define MEMORY_PRESSURE_OBSERVER_TOPIC "memory-pressure"
 
 #define BROADCAST_ALL_WORKERS(_func, ...)                                      \
   PR_BEGIN_MACRO                                                               \
     AssertIsOnMainThread();                                                    \
                                                                                \
-    AutoTArray<WorkerPrivate*, 100> workers;                                 \
+    nsAutoTArray<WorkerPrivate*, 100> workers;                                 \
     {                                                                          \
       MutexAutoLock lock(mMutex);                                              \
                                                                                \
       AddAllTopLevelWorkersToArray(workers);                                   \
     }                                                                          \
                                                                                \
     if (!workers.IsEmpty()) {                                                  \
       AutoSafeJSContext cx;                                                    \
@@ -1783,17 +1783,17 @@ RuntimeService::ShutdownIdleThreads(nsIT
 
   NS_ASSERTION(aTimer == runtime->mIdleThreadTimer, "Wrong timer!");
 
   // Cheat a little and grab all threads that expire within one second of now.
   TimeStamp now = TimeStamp::NowLoRes() + TimeDuration::FromSeconds(1);
 
   TimeStamp nextExpiration;
 
-  AutoTArray<RefPtr<WorkerThread>, 20> expiredThreads;
+  nsAutoTArray<RefPtr<WorkerThread>, 20> expiredThreads;
   {
     MutexAutoLock lock(runtime->mMutex);
 
     for (uint32_t index = 0; index < runtime->mIdleThreadArray.Length();
          index++) {
       IdleThreadInfo& info = runtime->mIdleThreadArray[index];
       if (info.mExpirationTime > now) {
         nextExpiration = info.mExpirationTime;
@@ -1987,17 +1987,17 @@ RuntimeService::Shutdown()
   if (obs && NS_FAILED(obs->NotifyObservers(nullptr, WORKERS_SHUTDOWN_TOPIC,
                                             nullptr))) {
     NS_WARNING("NotifyObservers failed!");
   }
 
   {
     MutexAutoLock lock(mMutex);
 
-    AutoTArray<WorkerPrivate*, 100> workers;
+    nsAutoTArray<WorkerPrivate*, 100> workers;
     AddAllTopLevelWorkersToArray(workers);
 
     if (!workers.IsEmpty()) {
       // Cancel all top-level workers.
       {
         MutexAutoUnlock unlock(mMutex);
 
         AutoSafeJSContext cx;
@@ -2028,26 +2028,26 @@ RuntimeService::Cleanup()
       NS_WARNING("Failed to cancel idle timer!");
     }
     mIdleThreadTimer = nullptr;
   }
 
   {
     MutexAutoLock lock(mMutex);
 
-    AutoTArray<WorkerPrivate*, 100> workers;
+    nsAutoTArray<WorkerPrivate*, 100> workers;
     AddAllTopLevelWorkersToArray(workers);
 
     if (!workers.IsEmpty()) {
       nsIThread* currentThread = NS_GetCurrentThread();
       NS_ASSERTION(currentThread, "This should never be null!");
 
       // Shut down any idle threads.
       if (!mIdleThreadArray.IsEmpty()) {
-        AutoTArray<RefPtr<WorkerThread>, 20> idleThreads;
+        nsAutoTArray<RefPtr<WorkerThread>, 20> idleThreads;
 
         uint32_t idleThreadCount = mIdleThreadArray.Length();
         idleThreads.SetLength(idleThreadCount);
 
         for (uint32_t index = 0; index < idleThreadCount; index++) {
           NS_ASSERTION(mIdleThreadArray[index].mThread, "Null thread!");
           idleThreads[index].swap(mIdleThreadArray[index].mThread);
         }
@@ -2192,17 +2192,17 @@ RuntimeService::GetWorkersForWindow(nsPI
   }
 }
 
 void
 RuntimeService::CancelWorkersForWindow(nsPIDOMWindowInner* aWindow)
 {
   AssertIsOnMainThread();
 
-  AutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
+  nsAutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
   GetWorkersForWindow(aWindow, workers);
 
   if (!workers.IsEmpty()) {
     AutoJSAPI jsapi;
     if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(aWindow))) {
       return;
     }
     JSContext* cx = jsapi.cx();
@@ -2220,17 +2220,17 @@ RuntimeService::CancelWorkersForWindow(n
 }
 
 void
 RuntimeService::FreezeWorkersForWindow(nsPIDOMWindowInner* aWindow)
 {
   AssertIsOnMainThread();
   MOZ_ASSERT(aWindow);
 
-  AutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
+  nsAutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
   GetWorkersForWindow(aWindow, workers);
 
   if (!workers.IsEmpty()) {
     AutoJSAPI jsapi;
     if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(aWindow))) {
       return;
     }
     JSContext* cx = jsapi.cx();
@@ -2244,17 +2244,17 @@ RuntimeService::FreezeWorkersForWindow(n
 }
 
 void
 RuntimeService::ThawWorkersForWindow(nsPIDOMWindowInner* aWindow)
 {
   AssertIsOnMainThread();
   MOZ_ASSERT(aWindow);
 
-  AutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
+  nsAutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
   GetWorkersForWindow(aWindow, workers);
 
   if (!workers.IsEmpty()) {
     AutoJSAPI jsapi;
     if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(aWindow))) {
       return;
     }
     JSContext* cx = jsapi.cx();
@@ -2268,31 +2268,31 @@ RuntimeService::ThawWorkersForWindow(nsP
 }
 
 void
 RuntimeService::SuspendWorkersForWindow(nsPIDOMWindowInner* aWindow)
 {
   AssertIsOnMainThread();
   MOZ_ASSERT(aWindow);
 
-  AutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
+  nsAutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
   GetWorkersForWindow(aWindow, workers);
 
   for (uint32_t index = 0; index < workers.Length(); index++) {
     workers[index]->Suspend();
   }
 }
 
 void
 RuntimeService::ResumeWorkersForWindow(nsPIDOMWindowInner* aWindow)
 {
   AssertIsOnMainThread();
   MOZ_ASSERT(aWindow);
 
-  AutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
+  nsAutoTArray<WorkerPrivate*, MAX_WORKERS_PER_DOMAIN> workers;
   GetWorkersForWindow(aWindow, workers);
 
   for (uint32_t index = 0; index < workers.Length(); index++) {
     workers[index]->Resume();
   }
 }
 
 nsresult
--- a/dom/workers/ServiceWorkerEvents.cpp
+++ b/dom/workers/ServiceWorkerEvents.cpp
@@ -194,17 +194,17 @@ public:
     rv = mChannel->SetChannelInfo(&channelInfo);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     mChannel->SynthesizeStatus(mInternalResponse->GetUnfilteredStatus(),
                                mInternalResponse->GetUnfilteredStatusText());
 
-    AutoTArray<InternalHeaders::Entry, 5> entries;
+    nsAutoTArray<InternalHeaders::Entry, 5> entries;
     mInternalResponse->UnfilteredHeaders()->GetEntries(entries);
     for (uint32_t i = 0; i < entries.Length(); ++i) {
        mChannel->SynthesizeHeader(entries[i].mName, entries[i].mValue);
     }
 
     loadInfo->MaybeIncreaseTainting(mInternalResponse->GetTainting());
 
     rv = mChannel->FinishSynthesizedResponse(mResponseURLSpec);
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -2631,17 +2631,17 @@ ServiceWorkerManager::ReportToAllClients
                                          uint32_t aFlags)
 {
   nsCOMPtr<nsIURI> uri;
   nsresult rv = NS_NewURI(getter_AddRefs(uri), aFilename);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
 
-  AutoTArray<uint64_t, 16> windows;
+  nsAutoTArray<uint64_t, 16> windows;
 
   // Report errors to every controlled document.
   for (auto iter = mControlledDocuments.Iter(); !iter.Done(); iter.Next()) {
     ServiceWorkerRegistrationInfo* reg = iter.UserData();
     MOZ_ASSERT(reg);
     if (!reg->mScope.Equals(aScope)) {
       continue;
     }
@@ -5120,17 +5120,17 @@ public:
     for (size_t i = 0; i < mInstances.Length(); ++i) {
       mInstances[i]->DispatchStateChange(mState);
     }
 
     return NS_OK;
   }
 
 private:
-  AutoTArray<RefPtr<ServiceWorker>, 1> mInstances;
+  nsAutoTArray<RefPtr<ServiceWorker>, 1> mInstances;
   ServiceWorkerState mState;
 };
 
 }
 
 void
 ServiceWorkerInfo::UpdateState(ServiceWorkerState aState)
 {
--- a/dom/workers/ServiceWorkerManager.h
+++ b/dom/workers/ServiceWorkerManager.h
@@ -200,17 +200,17 @@ private:
   // This id is shared with WorkerPrivate to match requests issued by service
   // workers to their corresponding serviceWorkerInfo.
   uint64_t mServiceWorkerID;
 
   // We hold rawptrs since the ServiceWorker constructor and destructor ensure
   // addition and removal.
   // There is a high chance of there being at least one ServiceWorker
   // associated with this all the time.
-  AutoTArray<ServiceWorker*, 1> mInstances;
+  nsAutoTArray<ServiceWorker*, 1> mInstances;
 
   RefPtr<ServiceWorkerPrivate> mServiceWorkerPrivate;
   bool mSkipWaitingFlag;
 
   ~ServiceWorkerInfo();
 
   // Generates a unique id for the service worker, with zero being treated as
   // invalid.
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -3123,24 +3123,24 @@ WorkerPrivateParent<Derived>::BroadcastE
                                                     const nsAString& aFilename,
                                                     const nsAString& aLine,
                                                     uint32_t aLineNumber,
                                                     uint32_t aColumnNumber,
                                                     uint32_t aFlags)
 {
   AssertIsOnMainThread();
 
-  AutoTArray<RefPtr<SharedWorker>, 10> sharedWorkers;
+  nsAutoTArray<RefPtr<SharedWorker>, 10> sharedWorkers;
   GetAllSharedWorkers(sharedWorkers);
 
   if (sharedWorkers.IsEmpty()) {
     return;
   }
 
-  AutoTArray<WindowAction, 10> windowActions;
+  nsAutoTArray<WindowAction, 10> windowActions;
   nsresult rv;
 
   // First fire the error event at all SharedWorker objects. This may include
   // multiple objects in a single window as well as objects in different
   // windows.
   for (size_t index = 0; index < sharedWorkers.Length(); index++) {
     RefPtr<SharedWorker>& sharedWorker = sharedWorkers[index];
 
@@ -5149,17 +5149,17 @@ WorkerPrivate::NotifyFeatures(JSContext*
   nsTObserverArray<WorkerFeature*>::ForwardIterator iter(mFeatures);
   while (iter.HasMore()) {
     WorkerFeature* feature = iter.GetNext();
     if (!feature->Notify(aCx, aStatus)) {
       NS_WARNING("Failed to notify feature!");
     }
   }
 
-  AutoTArray<ParentType*, 10> children;
+  nsAutoTArray<ParentType*, 10> children;
   children.AppendElements(mChildWorkers);
 
   for (uint32_t index = 0; index < children.Length(); index++) {
     if (!children[index]->Notify(aCx, aStatus)) {
       NS_WARNING("Failed to notify child worker!");
     }
   }
 }
@@ -5946,17 +5946,17 @@ WorkerPrivate::RunExpiredTimeouts(JSCont
   const TimeStamp actual_now = TimeStamp::Now();
   const TimeStamp now = std::max(actual_now, mTimeouts[0]->mTargetTime);
 
   if (now != actual_now) {
     LOG(TimeoutsLog(), ("Worker %p fudged timeout by %f ms.\n", this,
                         (now - actual_now).ToMilliseconds()));
   }
 
-  AutoTArray<TimeoutInfo*, 10> expiredTimeouts;
+  nsAutoTArray<TimeoutInfo*, 10> expiredTimeouts;
   for (uint32_t index = 0; index < mTimeouts.Length(); index++) {
     nsAutoPtr<TimeoutInfo>& info = mTimeouts[index];
     if (info->mTargetTime > now) {
       break;
     }
     expiredTimeouts.AppendElement(info);
   }
 
--- a/dom/xbl/nsXBLEventHandler.cpp
+++ b/dom/xbl/nsXBLEventHandler.cpp
@@ -135,17 +135,17 @@ nsXBLKeyEventHandler::HandleEvent(nsIDOM
     if (eventPhase != nsIDOMEvent::AT_TARGET)
       return NS_OK;
   }
 
   nsCOMPtr<nsIDOMKeyEvent> key(do_QueryInterface(aEvent));
   if (!key)
     return NS_OK;
 
-  AutoTArray<nsShortcutCandidate, 10> accessKeys;
+  nsAutoTArray<nsShortcutCandidate, 10> accessKeys;
   nsContentUtils::GetAccelKeyCandidates(key, accessKeys);
 
   if (accessKeys.IsEmpty()) {
     ExecuteMatchedHandlers(key, 0, IgnoreModifierState());
     return NS_OK;
   }
 
   for (uint32_t i = 0; i < accessKeys.Length(); ++i) {
--- a/dom/xbl/nsXBLService.cpp
+++ b/dom/xbl/nsXBLService.cpp
@@ -183,17 +183,17 @@ public:
 
   void AddRequest(nsXBLBindingRequest* aRequest) { mBindingRequests.AppendElement(aRequest); }
   bool HasRequest(nsIURI* aURI, nsIContent* aBoundElement);
 
 private:
   ~nsXBLStreamListener();
 
   nsCOMPtr<nsIStreamListener> mInner;
-  AutoTArray<nsXBLBindingRequest*, 8> mBindingRequests;
+  nsAutoTArray<nsXBLBindingRequest*, 8> mBindingRequests;
 
   nsCOMPtr<nsIWeakReference> mBoundDocument;
   nsCOMPtr<nsIXMLContentSink> mSink; // Only set until OnStartRequest
   nsCOMPtr<nsIDocument> mBindingDocument; // Only set until OnStartRequest
 };
 
 /* Implementation file */
 NS_IMPL_ISUPPORTS(nsXBLStreamListener,
@@ -642,17 +642,17 @@ nsXBLService::BindingReady(nsIContent* a
 }
 
 nsresult
 nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
                          bool aPeekOnly, nsIPrincipal* aOriginPrincipal,
                          bool* aIsReady, nsXBLBinding** aResult)
 {
   // More than 6 binding URIs are rare, see bug 55070 comment 18.
-  AutoTArray<nsCOMPtr<nsIURI>, 6> uris;
+  nsAutoTArray<nsCOMPtr<nsIURI>, 6> uris;
   return GetBinding(aBoundElement, aURI, aPeekOnly, aOriginPrincipal, aIsReady,
                     aResult, uris);
 }
 
 static bool
 MayBindToContent(nsXBLPrototypeBinding* aProtoBinding, nsIContent* aBoundElement,
                  nsIURI* aURI)
 {
--- a/dom/xbl/nsXBLWindowKeyHandler.cpp
+++ b/dom/xbl/nsXBLWindowKeyHandler.cpp
@@ -436,17 +436,17 @@ nsXBLWindowKeyHandler::IsHTMLEditableFie
 //
 bool
 nsXBLWindowKeyHandler::WalkHandlersInternal(nsIDOMKeyEvent* aKeyEvent,
                                             nsIAtom* aEventType, 
                                             nsXBLPrototypeHandler* aHandler,
                                             bool aExecute,
                                             bool* aOutReservedForChrome)
 {
-  AutoTArray<nsShortcutCandidate, 10> accessKeys;
+  nsAutoTArray<nsShortcutCandidate, 10> accessKeys;
   nsContentUtils::GetAccelKeyCandidates(aKeyEvent, accessKeys);
 
   if (accessKeys.IsEmpty()) {
     return WalkHandlersAndExecute(aKeyEvent, aEventType, aHandler,
                                   0, IgnoreModifierState(),
                                   aExecute, aOutReservedForChrome);
   }
 
--- a/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp
+++ b/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp
@@ -599,17 +599,17 @@ txXPathNodeUtils::comparePosition(const 
     if (document != otherDocument) {
         return document < otherDocument ? -1 : 1;
     }
 
     // Now either both nodes are in orphan trees, or they are both in the
     // same tree.
 
     // Get parents up the tree.
-    AutoTArray<nsINode*, 8> parents, otherParents;
+    nsAutoTArray<nsINode*, 8> parents, otherParents;
     nsINode* node = aNode.mNode;
     nsINode* otherNode = aOtherNode.mNode;
     nsINode* parent;
     nsINode* otherParent;
     while (node && otherNode) {
         parent = node->GetParentNode();
         otherParent = otherNode->GetParentNode();
 
--- a/dom/xslt/xslt/txExecutionState.h
+++ b/dom/xslt/xslt/txExecutionState.h
@@ -145,17 +145,17 @@ private:
     txStack mResultHandlerStack;
     txStack mParamStack;
     txInstruction* mNextInstruction;
     txVariableMap* mLocalVariables;
     txVariableMap mGlobalVariableValues;
     RefPtr<txAExprResult> mGlobalVarPlaceholderValue;
     int32_t mRecursionDepth;
 
-    AutoTArray<TemplateRule, 10> mTemplateRules;
+    AutoInfallibleTArray<TemplateRule, 10> mTemplateRules;
 
     txIEvalContext* mEvalContext;
     txIEvalContext* mInitialEvalContext;
     //Document* mRTFDocument;
     txOwningExpandedNameMap<txIGlobalParameter>* mGlobalParams;
 
     nsCOMPtr<nsIDocument> mLoadingDocument;
     txLoadedDocumentsHash mLoadedDocuments;
--- a/dom/xul/templates/nsTreeRows.h
+++ b/dom/xul/templates/nsTreeRows.h
@@ -182,17 +182,17 @@ protected:
 
 public:
     /**
      * An iterator that can be used to traverse the tree view.
      */
     class iterator {
     protected:
         int32_t mRowIndex;
-        AutoTArray<Link, 8> mLink;
+        nsAutoTArray<Link, 8> mLink;
 
         void Next();
         void Prev();
 
         friend class Subtree; // so InsertRowAt can initialize us
         friend class nsTreeRows; // so nsTreeRows can initialize us
 
         /**
--- a/dom/xul/templates/nsXULContentBuilder.cpp
+++ b/dom/xul/templates/nsXULContentBuilder.cpp
@@ -1265,17 +1265,17 @@ nsXULContentBuilder::IsOpen(nsIContent* 
     return true;
 }
 
 nsresult
 nsXULContentBuilder::RemoveGeneratedContent(nsIContent* aElement)
 {
     // Keep a queue of "ungenerated" elements that we have to probe
     // for generated content.
-    AutoTArray<nsIContent*, 8> ungenerated;
+    nsAutoTArray<nsIContent*, 8> ungenerated;
     if (ungenerated.AppendElement(aElement) == nullptr)
         return NS_ERROR_OUT_OF_MEMORY;
 
     uint32_t count;
     while (0 != (count = ungenerated.Length())) {
         // Pull the next "ungenerated" element off the queue.
         uint32_t last = count - 1;
         nsCOMPtr<nsIContent> element = ungenerated[last];
--- a/dom/xul/templates/nsXULTemplateBuilder.cpp
+++ b/dom/xul/templates/nsXULTemplateBuilder.cpp
@@ -2353,17 +2353,17 @@ nsXULTemplateBuilder::CompileBinding(nsT
 
 nsresult
 nsXULTemplateBuilder::AddSimpleRuleBindings(nsTemplateRule* aRule,
                                             nsIContent* aElement)
 {
     // Crawl the content tree of a "simple" rule, adding a variable
     // assignment for any attribute whose value is "rdf:".
 
-    AutoTArray<nsIContent*, 8> elements;
+    nsAutoTArray<nsIContent*, 8> elements;
 
     if (elements.AppendElement(aElement) == nullptr)
         return NS_ERROR_OUT_OF_MEMORY;
 
     while (elements.Length()) {
         // Pop the next element off the stack
         uint32_t i = elements.Length() - 1;
         nsIContent* element = elements[i];
--- a/dom/xul/templates/nsXULTreeBuilder.cpp
+++ b/dom/xul/templates/nsXULTreeBuilder.cpp
@@ -1458,17 +1458,17 @@ nsXULTreeBuilder::OpenContainer(int32_t 
 }
 
 nsresult
 nsXULTreeBuilder::OpenSubtreeOf(nsTreeRows::Subtree* aSubtree,
                                 int32_t aIndex,
                                 nsIXULTemplateResult *aResult,
                                 int32_t* aDelta)
 {
-    AutoTArray<int32_t, 8> open;
+    nsAutoTArray<int32_t, 8> open;
     int32_t count = 0;
 
     int32_t rulecount = mQuerySets.Length();
 
     for (int32_t r = 0; r < rulecount; r++) {
         nsTemplateQuerySet* queryset = mQuerySets[r];
         OpenSubtreeForQuerySet(aSubtree, aIndex, aResult, queryset, &count, open);
     }
--- a/editor/libeditor/nsEditor.cpp
+++ b/editor/libeditor/nsEditor.cpp
@@ -2659,17 +2659,17 @@ struct SavedRange {
 };
 
 nsresult
 nsEditor::SplitNodeImpl(nsIContent& aExistingRightNode,
                         int32_t aOffset,
                         nsIContent& aNewLeftNode)
 {
   // Remember all selection points.
-  AutoTArray<SavedRange, 10> savedRanges;
+  nsAutoTArray<SavedRange, 10> savedRanges;
   for (size_t i = 0; i < nsISelectionController::NUM_SELECTIONTYPES - 1; ++i) {
     SelectionType type(1 << i);
     SavedRange range;
     range.mSelection = GetSelection(type);
     if (type == nsISelectionController::SELECTION_NORMAL) {
       NS_ENSURE_TRUE(range.mSelection, NS_ERROR_NULL_POINTER);
     } else if (!range.mSelection) {
       // For non-normal selections, skip over the non-existing ones.
@@ -2806,17 +2806,17 @@ nsEditor::JoinNodesImpl(nsINode* aNodeTo
   uint32_t firstNodeLength = aNodeToJoin->Length();
 
   int32_t joinOffset;
   GetNodeLocation(aNodeToJoin, &joinOffset);
   int32_t keepOffset;
   nsINode* parent = GetNodeLocation(aNodeToKeep, &keepOffset);
 
   // Remember all selection points.
-  AutoTArray<SavedRange, 10> savedRanges;
+  nsAutoTArray<SavedRange, 10> savedRanges;
   for (size_t i = 0; i < nsISelectionController::NUM_SELECTIONTYPES - 1; ++i) {
     SelectionType type(1 << i);
     SavedRange range;
     range.mSelection = GetSelection(type);
     if (type == nsISelectionController::SELECTION_NORMAL) {
       NS_ENSURE_TRUE(range.mSelection, NS_ERROR_NULL_POINTER);
     } else if (!range.mSelection) {
       // For non-normal selections, skip over the non-existing ones.
--- a/embedding/components/commandhandler/nsCommandGroup.cpp
+++ b/embedding/components/commandhandler/nsCommandGroup.cpp
@@ -209,17 +209,17 @@ nsControllerCommandGroup::ClearGroupsHas
 NS_IMETHODIMP
 nsControllerCommandGroup::AddCommandToGroup(const char* aCommand,
                                             const char* aGroup)
 {
   nsDependentCString groupKey(aGroup);
   nsTArray<nsCString>* commandList = mGroupsHash.Get(groupKey);
   if (!commandList) {
     // make this list
-    commandList = new AutoTArray<nsCString, 8>;
+    commandList = new nsAutoTArray<nsCString, 8>;
     mGroupsHash.Put(groupKey, commandList);
   }
 
 #ifdef DEBUG
   nsCString* appended =
 #endif
   commandList->AppendElement(aCommand);
   NS_ASSERTION(appended, "Append failed");
--- a/extensions/cookie/nsPermissionManager.h
+++ b/extensions/cookie/nsPermissionManager.h
@@ -116,17 +116,17 @@ public:
     }
 
     static PLDHashNumber HashKey(const PermissionKey* aKey)
     {
       return aKey->GetHashCode();
     }
 
     // Force the hashtable to use the copy constructor when shuffling entries
-    // around, otherwise the Auto part of our AutoTArray won't be happy!
+    // around, otherwise the Auto part of our nsAutoTArray won't be happy!
     enum { ALLOW_MEMMOVE = false };
 
     inline nsTArray<PermissionEntry> & GetPermissions()
     {
       return mPermissions;
     }
 
     inline int32_t GetPermissionIndex(uint32_t aType) const
@@ -145,17 +145,17 @@ public:
           return mPermissions[i];
 
       // unknown permission... return relevant data
       return PermissionEntry(-1, aType, nsIPermissionManager::UNKNOWN_ACTION,
                              nsIPermissionManager::EXPIRE_NEVER, 0, 0);
     }
 
   private:
-    AutoTArray<PermissionEntry, 1> mPermissions;
+    nsAutoTArray<PermissionEntry, 1> mPermissions;
   };
 
   // nsISupports
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPERMISSIONMANAGER
   NS_DECL_NSIOBSERVER
 
   nsPermissionManager();
--- a/gfx/2d/StackArray.h
+++ b/gfx/2d/StackArray.h
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* A handy class that will allocate data for size*T objects on the stack and
- * otherwise allocate them on the heap. It is similar in purpose to AutoTArray */
+ * otherwise allocate them on the heap. It is similar in purpose to nsAutoTArray */
 
 template <class T, size_t size>
 class StackArray
 {
 public:
   StackArray(size_t count) {
     if (count > size) {
       mData = new T[count];
--- a/gfx/gl/DecomposeIntoNoRepeatTriangles.h
+++ b/gfx/gl/DecomposeIntoNoRepeatTriangles.h
@@ -40,18 +40,18 @@ public:
         return mTexCoords;
     }
 
     unsigned int elements() {
         return mVertexCoords.Length();
     }
 private:
     // Reserve inline storage for one quad (2 triangles, 3 coords).
-    AutoTArray<coord, 6> mVertexCoords;
-    AutoTArray<coord, 6> mTexCoords;
+    nsAutoTArray<coord, 6> mVertexCoords;
+    nsAutoTArray<coord, 6> mTexCoords;
 
     static void
     AppendRectToCoordArray(InfallibleTArray<coord>& array, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1);
 };
 
 /**
   * Decompose drawing the possibly-wrapped aTexCoordRect rectangle
   * of a texture of aTexSize into one or more rectangles (represented
--- a/gfx/gl/GLContextProviderGLX.cpp
+++ b/gfx/gl/GLContextProviderGLX.cpp
@@ -773,17 +773,17 @@ GLContextGLX::CreateGLContext(
     ScopedXErrorHandler xErrorHandler;
 
 TRY_AGAIN_NO_SHARING:
 
     error = false;
 
     GLXContext glxContext = shareContext ? shareContext->mContext : nullptr;
     if (glx.HasCreateContextAttribs()) {
-        AutoTArray<int, 11> attrib_list;
+        nsAutoTArray<int, 11> attrib_list;
         if (glx.HasRobustness()) {
             int robust_attribs[] = {
                 LOCAL_GL_CONTEXT_FLAGS_ARB, LOCAL_GL_CONTEXT_ROBUST_ACCESS_BIT_ARB,
                 LOCAL_GL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB, LOCAL_GL_LOSE_CONTEXT_ON_RESET_ARB,
             };
             attrib_list.AppendElements(robust_attribs, MOZ_ARRAY_LENGTH(robust_attribs));
         }
         if (profile == ContextProfile::OpenGLCore) {
--- a/gfx/layers/ImageContainer.cpp
+++ b/gfx/layers/ImageContainer.cpp
@@ -288,17 +288,17 @@ ImageContainer::ClearAllImages()
 }
 
 void
 ImageContainer::SetCurrentImageInTransaction(Image *aImage)
 {
   NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
   NS_ASSERTION(!mImageClient, "Should use async image transfer with ImageBridge.");
 
-  AutoTArray<NonOwningImage,1> images;
+  nsAutoTArray<NonOwningImage,1> images;
   images.AppendElement(NonOwningImage(aImage));
   SetCurrentImageInternal(images);
 }
 
 bool ImageContainer::IsAsync() const
 {
   return mImageClient != nullptr;
 }
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -629,17 +629,17 @@ public:
 
   bool HasImage() const { return !mImages.IsEmpty(); }
   Image* GetImage() const
   {
     return mImages.IsEmpty() ? nullptr : mImages[0].mImage.get();
   }
 
 private:
-  AutoTArray<ImageContainer::OwningImage,4> mImages;
+  nsAutoTArray<ImageContainer::OwningImage,4> mImages;
 };
 
 struct PlanarYCbCrData {
   // Luminance buffer
   uint8_t* mYChannel;
   int32_t mYStride;
   gfx::IntSize mYSize;
   int32_t mYSkip;
--- a/gfx/layers/LayerTreeInvalidation.cpp
+++ b/gfx/layers/LayerTreeInvalidation.cpp
@@ -16,17 +16,17 @@
 #include "mozilla/gfx/Point.h"          // for IntSize
 #include "mozilla/mozalloc.h"           // for operator new, etc
 #include "nsAutoPtr.h"                  // for nsRefPtr, nsAutoPtr, etc
 #include "nsDataHashtable.h"            // for nsDataHashtable
 #include "nsDebug.h"                    // for NS_ASSERTION
 #include "nsHashKeys.h"                 // for nsPtrHashKey
 #include "nsISupportsImpl.h"            // for Layer::AddRef, etc
 #include "nsRect.h"                     // for IntRect
-#include "nsTArray.h"                   // for AutoTArray, nsTArray_Impl
+#include "nsTArray.h"                   // for nsAutoTArray, nsTArray_Impl
 #include "mozilla/layers/ImageHost.h"
 #include "mozilla/layers/LayerManagerComposite.h"
 
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace layers {
 
@@ -378,17 +378,17 @@ struct ContainerLayerProperties : public
     // else, effective transforms have applied on children.
 
     result.OrWith(invalidOfLayer);
 
     return result;
   }
 
   // The old list of children:
-  AutoTArray<UniquePtr<LayerPropertiesBase>,1> mChildren;
+  nsAutoTArray<UniquePtr<LayerPropertiesBase>,1> mChildren;
   float mPreXScale;
   float mPreYScale;
 };
 
 struct ColorLayerProperties : public LayerPropertiesBase
 {
   explicit ColorLayerProperties(ColorLayer *aLayer)
     : LayerPropertiesBase(aLayer)
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -1341,17 +1341,17 @@ ContainerLayer::Collect3DContextLeaves(n
       aToSort.AppendElement(l);
     }
   }
 }
 
 void
 ContainerLayer::SortChildrenBy3DZOrder(nsTArray<Layer*>& aArray)
 {
-  AutoTArray<Layer*, 10> toSort;
+  nsAutoTArray<Layer*, 10> toSort;
 
   for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) {
     ContainerLayer* container = l->AsContainerLayer();
     if (container && container->Extend3DContext() &&
         !container->UseIntermediateSurface()) {
       container->Collect3DContextLeaves(toSort);
     } else {
       if (toSort.Length() > 0) {
--- a/gfx/layers/basic/BasicLayerManager.cpp
+++ b/gfx/layers/basic/BasicLayerManager.cpp
@@ -38,17 +38,17 @@
 #include "mozilla/mozalloc.h"           // for operator new
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsCOMPtr.h"                   // for already_AddRefed
 #include "nsDebug.h"                    // for NS_ASSERTION, etc
 #include "nsISupportsImpl.h"            // for gfxContext::Release, etc
 #include "nsPoint.h"                    // for nsIntPoint
 #include "nsRect.h"                     // for mozilla::gfx::IntRect
 #include "nsRegion.h"                   // for nsIntRegion, etc
-#include "nsTArray.h"                   // for AutoTArray
+#include "nsTArray.h"                   // for nsAutoTArray
 #ifdef MOZ_ENABLE_SKIA
 #include "skia/include/core/SkCanvas.h"         // for SkCanvas
 #include "skia/include/core/SkBitmapDevice.h"   // for SkBitmapDevice
 #else
 #define PIXMAN_DONT_DEFINE_STDINT
 #include "pixman.h"                     // for pixman_f_transform, etc
 #endif
 class nsIWidget;
@@ -892,17 +892,17 @@ BasicLayerManager::PaintSelfOrChildren(P
     } else {
       data->Paint(aGroupTarget->GetDrawTarget(),
                   aGroupTarget->GetDeviceOffset(),
                   aPaintContext.mLayer->GetMaskLayer());
     }
   } else {
     ContainerLayer* container =
         static_cast<ContainerLayer*>(aPaintContext.mLayer);
-    AutoTArray<Layer*, 12> children;
+    nsAutoTArray<Layer*, 12> children;
     container->SortChildrenBy3DZOrder(children);
     for (uint32_t i = 0; i < children.Length(); i++) {
       Layer* layer = children.ElementAt(i);
       if (layer->IsBackfaceHidden()) {
         continue;
       }
       if (!layer->AsContainerLayer() && !layer->IsVisible()) {
         continue;
--- a/gfx/layers/client/CanvasClient.cpp
+++ b/gfx/layers/client/CanvasClient.cpp
@@ -115,17 +115,17 @@ CanvasClient2D::Update(gfx::IntSize aSiz
   }
 
   if (bufferCreated && !AddTextureClient(mBuffer)) {
     mBuffer = nullptr;
     return;
   }
 
   if (updated) {
-    AutoTArray<CompositableForwarder::TimedTextureClient,1> textures;
+    nsAutoTArray<CompositableForwarder::TimedTextureClient,1> textures;
     CompositableForwarder::TimedTextureClient* t = textures.AppendElement();
     t->mTextureClient = mBuffer;
     t->mPictureRect = nsIntRect(nsIntPoint(0, 0), mBuffer->GetSize());
     t->mFrameID = mFrameID;
     GetForwarder()->UseTextures(this, textures);
     mBuffer->SyncWithObject(GetForwarder()->GetSyncObject());
   }
 }
@@ -471,17 +471,17 @@ CanvasClientSharedSurface::Updated()
 #endif
 
   mFront = mNewFront;
   mNewFront = nullptr;
 
   // Add the new TexClient.
   MOZ_ALWAYS_TRUE( AddTextureClient(mFront) );
 
-  AutoTArray<CompositableForwarder::TimedTextureClient,1> textures;
+  nsAutoTArray<CompositableForwarder::TimedTextureClient,1> textures;
   CompositableForwarder::TimedTextureClient* t = textures.AppendElement();
   t->mTextureClient = mFront;
   t->mPictureRect = nsIntRect(nsIntPoint(0, 0), mFront->GetSize());
   t->mFrameID = mFrameID;
   forwarder->UseTextures(this, textures);
 }
 
 void
--- a/gfx/layers/client/ClientContainerLayer.h
+++ b/gfx/layers/client/ClientContainerLayer.h
@@ -8,17 +8,17 @@
 
 #include <stdint.h>                     // for uint32_t
 #include "ClientLayerManager.h"         // for ClientLayerManager, etc
 #include "Layers.h"                     // for Layer, ContainerLayer, etc
 #include "nsDebug.h"                    // for NS_ASSERTION
 #include "nsISupportsImpl.h"            // for MOZ_COUNT_CTOR, etc
 #include "nsISupportsUtils.h"           // for NS_ADDREF, NS_RELEASE
 #include "nsRegion.h"                   // for nsIntRegion
-#include "nsTArray.h"                   // for AutoTArray
+#include "nsTArray.h"                   // for nsAutoTArray
 #include "ReadbackProcessor.h"
 #include "ClientPaintedLayer.h"
 
 namespace mozilla {
 namespace layers {
 
 class ShadowableLayer;
 
@@ -45,17 +45,17 @@ protected:
 
 public:
   virtual void RenderLayer() override
   {
     RenderMaskLayers(this);
     
     DefaultComputeSupportsComponentAlphaChildren();
 
-    AutoTArray<Layer*, 12> children;
+    nsAutoTArray<Layer*, 12> children;
     SortChildrenBy3DZOrder(children);
 
     ReadbackProcessor readback;
     readback.BuildUpdates(this);
 
     for (uint32_t i = 0; i < children.Length(); i++) {
       Layer* child = children.ElementAt(i);
       if (!child->IsVisible()) {
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -21,17 +21,17 @@
 #include "mozilla/layers/PLayerChild.h"  // for PLayerChild
 #include "mozilla/layers/LayerTransactionChild.h"
 #include "mozilla/layers/ShadowLayerChild.h"
 #include "mozilla/layers/TextureClientPool.h" // for TextureClientPool
 #include "mozilla/layers/PersistentBufferProvider.h"
 #include "ClientReadbackLayer.h"        // for ClientReadbackLayer
 #include "nsAString.h"
 #include "nsIWidgetListener.h"
-#include "nsTArray.h"                   // for AutoTArray
+#include "nsTArray.h"                   // for AutoInfallibleTArray
 #include "nsXULAppAPI.h"                // for XRE_GetProcessType, etc
 #include "TiledLayerBuffer.h"
 #include "mozilla/dom/WindowBinding.h"  // for Overfill Callback
 #include "FrameLayerBuilder.h"          // for FrameLayerbuilder
 #ifdef MOZ_WIDGET_ANDROID
 #include "AndroidBridge.h"
 #include "LayerMetricsWrapper.h"
 #endif
@@ -598,17 +598,17 @@ ClientLayerManager::ForwardTransaction(b
   if (!mTransactionIdAllocator->GetTransactionStart().IsNull()) {
     transactionStart = mTransactionIdAllocator->GetTransactionStart();
   } else {
     transactionStart = mTransactionStart;
   }
 
   // forward this transaction's changeset to our LayerManagerComposite
   bool sent;
-  AutoTArray<EditReply, 10> replies;
+  AutoInfallibleTArray<EditReply, 10> replies;
   if (mForwarder->EndTransaction(&replies, mRegionToClear,
         mLatestTransactionId, aScheduleComposite, mPaintSequenceNumber,
         mIsRepeatTransaction, transactionStart, &sent)) {
     for (nsTArray<EditReply>::size_type i = 0; i < replies.Length(); ++i) {
       const EditReply& reply = replies[i];
 
       switch (reply.type()) {
       case EditReply::TOpContentBufferSwap: {
--- a/gfx/layers/client/ClientLayerManager.h
+++ b/gfx/layers/client/ClientLayerManager.h
@@ -345,18 +345,18 @@ private:
 
   // An incrementing sequence number for paints.
   // Incremented in BeginTransaction(), but not for repeat transactions.
   uint32_t mPaintSequenceNumber;
 
   APZTestData mApzTestData;
 
   RefPtr<ShadowLayerForwarder> mForwarder;
-  AutoTArray<RefPtr<TextureClientPool>,2> mTexturePools;
-  AutoTArray<dom::OverfillCallback*,0> mOverfillCallbacks;
+  nsAutoTArray<RefPtr<TextureClientPool>,2> mTexturePools;
+  nsAutoTArray<dom::OverfillCallback*,0> mOverfillCallbacks;
   mozilla::TimeStamp mTransactionStart;
 
   nsTArray<DidCompositeObserver*> mDidCompositeObservers;
 
   RefPtr<MemoryPressureObserver> mMemoryPressureObserver;
 };
 
 class ClientLayer : public ShadowableLayer
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -374,17 +374,17 @@ ContentClientRemoteBuffer::Updated(const
                                                aVisibleRegion,
                                                aDidSelfCopy);
 
   MOZ_ASSERT(mTextureClient);
   if (mTextureClientOnWhite) {
     mForwarder->UseComponentAlphaTextures(this, mTextureClient,
                                           mTextureClientOnWhite);
   } else {
-    AutoTArray<CompositableForwarder::TimedTextureClient,1> textures;
+    nsAutoTArray<CompositableForwarder::TimedTextureClient,1> textures;
     CompositableForwarder::TimedTextureClient* t = textures.AppendElement();
     t->mTextureClient = mTextureClient;
     IntSize size = mTextureClient->GetSize();
     t->mPictureRect = nsIntRect(0, 0, size.width, size.height);
     GetForwarder()->UseTextures(this, textures);
   }
   mForwarder->UpdateTextureRegion(this,
                                   ThebesBufferData(BufferRect(),
--- a/gfx/layers/client/ImageClient.cpp
+++ b/gfx/layers/client/ImageClient.cpp
@@ -118,17 +118,17 @@ ImageClientSingle::FlushAllImages(AsyncT
     RemoveTextureWithWaiter(b.mTextureClient, aAsyncTransactionWaiter);
   }
   mBuffers.Clear();
 }
 
 bool
 ImageClientSingle::UpdateImage(ImageContainer* aContainer, uint32_t aContentFlags)
 {
-  AutoTArray<ImageContainer::OwningImage,4> images;
+  nsAutoTArray<ImageContainer::OwningImage,4> images;
   uint32_t generationCounter;
   aContainer->GetCurrentImages(&images, &generationCounter);
 
   if (mLastUpdateGenerationCounter == generationCounter) {
     return true;
   }
   mLastUpdateGenerationCounter = generationCounter;
 
@@ -144,17 +144,17 @@ ImageClientSingle::UpdateImage(ImageCont
     // SetCurrentImages call but before UpdateImageClientNow.
     // This can also happen if all images in the list are invalid.
     // We return true because the caller would attempt to recreate the
     // ImageClient otherwise, and that isn't going to help.
     return true;
   }
 
   nsTArray<Buffer> newBuffers;
-  AutoTArray<CompositableForwarder::TimedTextureClient,4> textures;
+  nsAutoTArray<CompositableForwarder::TimedTextureClient,4> textures;
 
   for (auto& img : images) {
     Image* image = img.mImage;
 
 #ifdef MOZ_WIDGET_GONK
     if (image->GetFormat() == ImageFormat::OVERLAY_IMAGE) {
       OverlayImage* overlayImage = static_cast<OverlayImage*>(image);
       OverlaySource source;
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -1396,17 +1396,17 @@ AsyncCompositionManager::TransformShadow
     if (ApplyAsyncContentTransformToTree(root, &foundRoot, clipDeferredFromChildren)) {
 #if defined(MOZ_ANDROID_APZ)
       MOZ_ASSERT(foundRoot);
       if (foundRoot && mFixedLayerMargins != ScreenMargin()) {
         MoveScrollbarForLayerMargin(root, mRootScrollableId, mFixedLayerMargins);
       }
 #endif
     } else {
-      AutoTArray<Layer*,1> scrollableLayers;
+      nsAutoTArray<Layer*,1> scrollableLayers;
 #ifdef MOZ_WIDGET_ANDROID
       mLayerManager->GetRootScrollableLayers(scrollableLayers);
 #else
       mLayerManager->GetScrollableLayers(scrollableLayers);
 #endif
 
       for (uint32_t i = 0; i < scrollableLayers.Length(); i++) {
         if (scrollableLayers[i]) {
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -24,17 +24,17 @@
 #include "mozilla/layers/AsyncCompositionManager.h" // for ViewTransform
 #include "mozilla/layers/LayerMetricsWrapper.h" // for LayerMetricsWrapper
 #include "mozilla/mozalloc.h"           // for operator delete, etc
 #include "mozilla/RefPtr.h"                   // for nsRefPtr
 #include "nsDebug.h"                    // for NS_ASSERTION
 #include "nsISupportsImpl.h"            // for MOZ_COUNT_CTOR, etc
 #include "nsISupportsUtils.h"           // for NS_ADDREF, NS_RELEASE
 #include "nsRegion.h"                   // for nsIntRegion
-#include "nsTArray.h"                   // for AutoTArray
+#include "nsTArray.h"                   // for nsAutoTArray
 #include "TextRenderer.h"               // for TextRenderer
 #include <vector>
 #include "VRManager.h"                  // for VRManager
 #include "GeckoProfiler.h"              // for GeckoProfiler
 #ifdef MOZ_ENABLE_PROFILER_SPS
 #include "ProfilerMarkers.h"            // for ProfilerMarkers
 #endif
 
@@ -185,17 +185,17 @@ ContainerRenderVR(ContainerT* aContainer
     }
   }
 
   gfx::IntRect rtBounds = previousTarget->GetRect();
   DUMP("eyeResolution: %d %d targetRT: %d %d %d %d\n", WH(eyeResolution), XYWH(rtBounds));
 
   compositor->SetRenderTarget(surface);
 
-  AutoTArray<Layer*, 12> children;
+  nsAutoTArray<Layer*, 12> children;
   aContainer->SortChildrenBy3DZOrder(children);
 
   gfx::Matrix4x4 origTransform = aContainer->GetEffectiveTransform();
 
   for (uint32_t i = 0; i < children.Length(); i++) {
     LayerComposite* layerToRender = static_cast<LayerComposite*>(children.ElementAt(i)->ImplData());
     Layer* layer = layerToRender->GetLayer();
     uint32_t contentFlags = layer->GetContentFlags();
@@ -331,17 +331,17 @@ NeedToDrawCheckerboardingForLayer(Layer*
          aLayer->IsOpaqueForVisibility() &&
          LayerHasCheckerboardingAPZC(aLayer, aOutCheckerboardingColor);
 }
 
 /* all of the prepared data that we need in RenderLayer() */
 struct PreparedData
 {
   RefPtr<CompositingRenderTarget> mTmpTarget;
-  AutoTArray<PreparedLayer, 12> mLayers;
+  nsAutoTArray<PreparedLayer, 12> mLayers;
   bool mNeedsSurfaceCopy;
 };
 
 // ContainerPrepare is shared between RefLayer and ContainerLayer
 template<class ContainerT> void
 ContainerPrepare(ContainerT* aContainer,
                  LayerManagerComposite* aManager,
                  const RenderTargetIntRect& aClipRect)
@@ -356,17 +356,17 @@ ContainerPrepare(ContainerT* aContainer,
     // want to render thebes layers only once and then composite the intermeidate surfaces
     // with different transforms twice.
     return;
   }
 
   /**
    * Determine which layers to draw.
    */
-  AutoTArray<Layer*, 12> children;
+  nsAutoTArray<Layer*, 12> children;
   aContainer->SortChildrenBy3DZOrder(children);
 
   for (uint32_t i = 0; i < children.Length(); i++) {
     LayerComposite* layerToRender = static_cast<LayerComposite*>(children.ElementAt(i)->ImplData());
 
     RenderTargetIntRect clipRect = layerToRender->GetLayer()->
         CalculateScissorRect(aClipRect);
 
--- a/gfx/layers/composite/FPSCounter.h
+++ b/gfx/layers/composite/FPSCounter.h
@@ -7,17 +7,17 @@
 #define mozilla_layers_opengl_FPSCounter_h_
 
 #include <algorithm>                    // for min
 #include <stddef.h>                     // for size_t
 #include <map>                          // for std::map
 #include "GLDefs.h"                     // for GLuint
 #include "mozilla/RefPtr.h"             // for already_AddRefed, RefCounted
 #include "mozilla/TimeStamp.h"          // for TimeStamp, TimeDuration
-#include "nsTArray.h"                   // for AutoTArray, nsTArray_Impl, etc
+#include "nsTArray.h"                   // for nsAutoTArray, nsTArray_Impl, etc
 #include "prio.h"                       // for NSPR file i/o
 
 namespace mozilla {
 namespace layers {
 
 class DataTextureSource;
 class Compositor;
 
@@ -82,17 +82,17 @@ private:
   nsresult  WriteFrameTimeStamps();
 
   /***
    * mFrameTimestamps is a psuedo circular buffer
    * Since we have a constant write time and don't
    * read at an offset except our latest write
    * we don't need an explicit read pointer.
    */
-  AutoTArray<TimeStamp, kMaxFrames> mFrameTimestamps;
+  nsAutoTArray<TimeStamp, kMaxFrames> mFrameTimestamps;
   int mWriteIndex;      // points to next open write slot
   int mIteratorIndex;   // used only when iterating
   const char* mFPSName;
   TimeStamp mLastInterval;
 };
 
 struct FPSState {
   FPSState();
--- a/gfx/layers/composite/FrameUniformityData.h
+++ b/gfx/layers/composite/FrameUniformityData.h
@@ -25,17 +25,17 @@ public:
 
 struct LayerTransforms {
   LayerTransforms() {}
 
   gfx::Point GetAverage();
   gfx::Point GetStdDev();
 
   // 60 fps * 5 seconds worth of data
-  AutoTArray<gfx::Point, 300> mTransforms;
+  nsAutoTArray<gfx::Point, 300> mTransforms;
 };
 
 class LayerTransformRecorder {
 public:
   LayerTransformRecorder() {}
   ~LayerTransformRecorder();
 
   void RecordTransform(Layer* aLayer, const gfx::Point& aTransform);
--- a/gfx/layers/ipc/CompositableTransactionParent.cpp
+++ b/gfx/layers/ipc/CompositableTransactionParent.cpp
@@ -167,17 +167,17 @@ CompositableParentManager::ReceiveCompos
                                                 op.transactionId()));
       }
       break;
     }
     case CompositableOperation::TOpUseTexture: {
       const OpUseTexture& op = aEdit.get_OpUseTexture();
       CompositableHost* compositable = AsCompositable(op);
 
-      AutoTArray<CompositableHost::TimedTexture,4> textures;
+      nsAutoTArray<CompositableHost::TimedTexture,4> textures;
       for (auto& timedTexture : op.textures()) {
         CompositableHost::TimedTexture* t = textures.AppendElement();
         t->mTexture =
             TextureHost::AsTextureHost(timedTexture.textureParent());
         MOZ_ASSERT(t->mTexture);
         t->mTimeStamp = timedTexture.timeStamp();
         t->mPictureRect = timedTexture.picture();
         t->mFrameID = timedTexture.frameID();
--- a/gfx/layers/ipc/CompositorChild.cpp
+++ b/gfx/layers/ipc/CompositorChild.cpp
@@ -90,17 +90,17 @@ CompositorChild::Destroy()
 
   // From now on the only message we can send is Stop.
 
   if (mLayerManager) {
     mLayerManager->Destroy();
     mLayerManager = nullptr;
   }
 
-  AutoTArray<PLayerTransactionChild*, 16> transactions;
+  nsAutoTArray<PLayerTransactionChild*, 16> transactions;
   ManagedPLayerTransactionChild(transactions);
   for (int i = transactions.Length() - 1; i >= 0; --i) {
     RefPtr<LayerTransactionChild> layers =
       static_cast<LayerTransactionChild*>(transactions[i]);
     layers->Destroy();
   }
 
   SendStop();
--- a/gfx/layers/ipc/CompositorChild.h
+++ b/gfx/layers/ipc/CompositorChild.h
@@ -190,17 +190,17 @@ private:
 
   // Weakly hold the TabChild that made a request to be alerted when
   // the transaction has been received.
   nsWeakPtr mWeakTabChild;      // type is TabChild
 
   DISALLOW_EVIL_CONSTRUCTORS(CompositorChild);
 
   // When we receive overfill numbers, notify these client layer managers
-  AutoTArray<ClientLayerManager*,0> mOverfillObservers;
+  nsAutoTArray<ClientLayerManager*,0> mOverfillObservers;
 
   // True until the beginning of the two-step shutdown sequence of this actor.
   bool mCanSend;
 };
 
 } // namespace layers
 } // namespace mozilla
 
--- a/gfx/layers/ipc/ImageBridgeChild.cpp
+++ b/gfx/layers/ipc/ImageBridgeChild.cpp
@@ -30,18 +30,18 @@
 #include "mozilla/layers/ImageClient.h"  // for ImageClient
 #include "mozilla/layers/LayersMessages.h"  // for CompositableOperation
 #include "mozilla/layers/PCompositableChild.h"  // for PCompositableChild
 #include "mozilla/layers/PImageContainerChild.h"
 #include "mozilla/layers/TextureClient.h"  // for TextureClient
 #include "mozilla/mozalloc.h"           // for operator new, etc
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsISupportsImpl.h"            // for ImageContainer::AddRef, etc
-#include "nsTArray.h"                   // for AutoTArray, nsTArray, etc
-#include "nsTArrayForwardDeclare.h"     // for AutoTArray
+#include "nsTArray.h"                   // for nsAutoTArray, nsTArray, etc
+#include "nsTArrayForwardDeclare.h"     // for AutoInfallibleTArray
 #include "nsThreadUtils.h"              // for NS_IsMainThread
 #include "nsXULAppAPI.h"                // for XRE_GetIOMessageLoop
 #include "mozilla/StaticPtr.h"          // for StaticRefPtr
 #include "mozilla/layers/TextureClient.h"
 
 namespace mozilla {
 namespace ipc {
 class Shmem;
@@ -141,17 +141,17 @@ Atomic<bool> ImageBridgeChild::sIsShutDo
 void
 ImageBridgeChild::UseTextures(CompositableClient* aCompositable,
                               const nsTArray<TimedTextureClient>& aTextures)
 {
   MOZ_ASSERT(aCompositable);
   MOZ_ASSERT(aCompositable->GetIPDLActor());
   MOZ_ASSERT(aCompositable->IsConnected());
 
-  AutoTArray<TimedTexture,4> textures;
+  nsAutoTArray<TimedTexture,4> textures;
 
   for (auto& t : aTextures) {
     MOZ_ASSERT(t.mTextureClient);
     MOZ_ASSERT(t.mTextureClient->GetIPDLActor());
 
     if (!t.mTextureClient->IsSharedWithCompositor()) {
       return;
     }
@@ -649,27 +649,27 @@ ImageBridgeChild::EndTransaction()
   MOZ_ASSERT(!mTxn->Finished(), "forgot BeginTransaction?");
 
   AutoEndTransaction _(mTxn);
 
   if (mTxn->IsEmpty()) {
     return;
   }
 
-  AutoTArray<CompositableOperation, 10> cset;
+  AutoInfallibleTArray<CompositableOperation, 10> cset;
   cset.SetCapacity(mTxn->mOperations.size());
   if (!mTxn->mOperations.empty()) {
     cset.AppendElements(&mTxn->mOperations.front(), mTxn->mOperations.size());
   }
 
   if (!IsSameProcess()) {
     ShadowLayerForwarder::PlatformSyncBeforeUpdate();
   }
 
-  AutoTArray<EditReply, 10> replies;
+  AutoInfallibleTArray<EditReply, 10> replies;
 
   if (mTxn->mSwapRequired) {
     if (!SendUpdate(cset, mTxn->mDestroyedActors, &replies)) {
       NS_WARNING("could not send async texture transaction");
       mTxn->FallbackDestroyActors();
       return;
     }
   } else {
--- a/gfx/layers/ipc/ImageBridgeParent.cpp
+++ b/gfx/layers/ipc/ImageBridgeParent.cpp
@@ -327,17 +327,17 @@ public:
 ImageBridgeParent::NotifyImageComposites(nsTArray<ImageCompositeNotification>& aNotifications)
 {
   // Group the notifications by destination process ID and then send the
   // notifications in one message per group.
   aNotifications.Sort(ProcessIdComparator());
   uint32_t i = 0;
   bool ok = true;
   while (i < aNotifications.Length()) {
-    AutoTArray<ImageCompositeNotification,1> notifications;
+    nsAutoTArray<ImageCompositeNotification,1> notifications;
     notifications.AppendElement(aNotifications[i]);
     uint32_t end = i + 1;
     MOZ_ASSERT(aNotifications[i].imageContainerParent());
     ProcessId pid = aNotifications[i].imageContainerParent()->OtherPid();
     while (end < aNotifications.Length() &&
            aNotifications[end].imageContainerParent()->OtherPid() == pid) {
       notifications.AppendElement(aNotifications[end]);
       ++end;
--- a/gfx/layers/ipc/ImageContainerParent.h
+++ b/gfx/layers/ipc/ImageContainerParent.h
@@ -21,17 +21,17 @@ class ImageHost;
 class ImageContainerParent : public PImageContainerParent
 {
 public:
   ImageContainerParent() {}
   ~ImageContainerParent();
 
   virtual bool RecvAsyncDelete() override;
 
-  AutoTArray<ImageHost*,1> mImageHosts;
+  nsAutoTArray<ImageHost*,1> mImageHosts;
 
 private:
   virtual void ActorDestroy(ActorDestroyReason why) override {}
 };
 
 } // namespace layers
 } // namespace mozilla
 
--- a/gfx/layers/ipc/ShadowLayers.cpp
+++ b/gfx/layers/ipc/ShadowLayers.cpp
@@ -24,17 +24,17 @@
 #include "mozilla/layers/LayersMessages.h"  // for Edit, etc
 #include "mozilla/layers/LayersSurfaces.h"  // for SurfaceDescriptor, etc
 #include "mozilla/layers/LayersTypes.h"  // for MOZ_LAYERS_LOG
 #include "mozilla/layers/LayerTransactionChild.h"
 #include "ShadowLayerUtils.h"
 #include "mozilla/layers/TextureClient.h"  // for TextureClient
 #include "mozilla/mozalloc.h"           // for operator new, etc
 #include "nsAutoPtr.h"                  // for nsRefPtr, getter_AddRefs, etc
-#include "nsTArray.h"                   // for AutoTArray, nsTArray, etc
+#include "nsTArray.h"                   // for nsAutoTArray, nsTArray, etc
 #include "nsXULAppAPI.h"                // for XRE_GetProcessType, etc
 #include "mozilla/ReentrantMonitor.h"
 
 namespace mozilla {
 namespace ipc {
 class Shmem;
 } // namespace ipc
 
@@ -382,17 +382,17 @@ ShadowLayerForwarder::UpdateTextureRegio
 }
 
 void
 ShadowLayerForwarder::UseTextures(CompositableClient* aCompositable,
                                   const nsTArray<TimedTextureClient>& aTextures)
 {
   MOZ_ASSERT(aCompositable && aCompositable->IsConnected());
 
-  AutoTArray<TimedTexture,4> textures;
+  nsAutoTArray<TimedTexture,4> textures;
 
   for (auto& t : aTextures) {
     MOZ_ASSERT(t.mTextureClient);
     MOZ_ASSERT(t.mTextureClient->GetIPDLActor());
     FenceHandle fence = t.mTextureClient->GetAcquireFenceHandle();
     textures.AppendElement(TimedTexture(nullptr, t.mTextureClient->GetIPDLActor(),
                                         fence.IsValid() ? MaybeFence(fence) : MaybeFence(null_t()),
                                         t.mTimeStamp, t.mPictureRect,
@@ -663,17 +663,17 @@ ShadowLayerForwarder::EndTransaction(Inf
     attrs.specific() = null_t();
     mutant->FillSpecificAttributes(attrs.specific());
 
     MOZ_LAYERS_LOG(("[LayersForwarder] OpSetLayerAttributes(%p)\n", mutant));
 
     mTxn->AddEdit(OpSetLayerAttributes(nullptr, Shadow(shadow), attrs));
   }
 
-  AutoTArray<Edit, 10> cset;
+  AutoInfallibleTArray<Edit, 10> cset;
   size_t nCsets = mTxn->mCset.size() + mTxn->mPaints.size();
   MOZ_ASSERT(nCsets > 0 || mTxn->RotationChanged(), "should have bailed by now");
 
   cset.SetCapacity(nCsets);
   if (!mTxn->mCset.empty()) {
     cset.AppendElements(&mTxn->mCset.front(), mTxn->mCset.size());
   }
   // Paints after non-paint ops, including attribute changes.  See
--- a/gfx/layers/opengl/CompositorOGL.h
+++ b/gfx/layers/opengl/CompositorOGL.h
@@ -23,17 +23,17 @@
 #include "mozilla/gfx/Types.h"          // for Float, SurfaceFormat, etc
 #include "mozilla/layers/Compositor.h"  // for SurfaceInitMode, Compositor, etc
 #include "mozilla/layers/CompositorTypes.h"  // for MaskType::MaskType::NumMaskTypes, etc
 #include "mozilla/layers/LayersTypes.h"
 #include "nsAutoPtr.h"                  // for nsRefPtr, nsAutoPtr
 #include "nsCOMPtr.h"                   // for already_AddRefed
 #include "nsDebug.h"                    // for NS_ASSERTION, NS_WARNING
 #include "nsISupportsImpl.h"            // for MOZ_COUNT_CTOR, etc
-#include "nsTArray.h"                   // for AutoTArray, nsTArray, etc
+#include "nsTArray.h"                   // for nsAutoTArray, nsTArray, etc
 #include "nsThreadUtils.h"              // for nsRunnable
 #include "nsXULAppAPI.h"                // for XRE_GetProcessType
 #include "nscore.h"                     // for NS_IMETHOD
 #include "gfxVR.h"
 
 #if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 21
 #include "nsTHashtable.h"               // for nsTHashtable
 #endif
--- a/gfx/src/nsRegion.cpp
+++ b/gfx/src/nsRegion.cpp
@@ -300,17 +300,17 @@ void nsRegion::SimplifyOutwardByArea(uin
   if (!n)
     return;
 
   pixman_box32_t *end = boxes + n;
   pixman_box32_t *topRectsEnd = boxes+1;
   pixman_box32_t *topRects = boxes;
 
   // we need some temporary storage for merging both rows of rectangles
-  AutoTArray<pixman_box32_t, 10> tmpStorage;
+  nsAutoTArray<pixman_box32_t, 10> tmpStorage;
   tmpStorage.SetCapacity(n);
   pixman_box32_t *tmpRect = tmpStorage.Elements();
 
   pixman_box32_t *destRect = boxes;
   pixman_box32_t *rect = tmpRect;
   // find the end of the first span of rectangles
   while (topRectsEnd < end && topRectsEnd->y1 == topRects->y1) {
     topRectsEnd++;
--- a/gfx/thebes/gfxCoreTextShaper.cpp
+++ b/gfx/thebes/gfxCoreTextShaper.cpp
@@ -344,20 +344,20 @@ gfxCoreTextShaper::SetGlyphsFromRun(gfxS
     UniquePtr<CFIndex[]> glyphToCharArray;
     const CGGlyph* glyphs = nullptr;
     const CGPoint* positions = nullptr;
     const CFIndex* glyphToChar = nullptr;
 
     // Testing indicates that CTRunGetGlyphsPtr (almost?) always succeeds,
     // and so allocating a new array and copying data with CTRunGetGlyphs
     // will be extremely rare.
-    // If this were not the case, we could use an AutoTArray<> to
+    // If this were not the case, we could use an nsAutoTArray<> to
     // try and avoid the heap allocation for small runs.
     // It's possible that some future change to CoreText will mean that
-    // CTRunGetGlyphsPtr fails more often; if this happens, AutoTArray<>
+    // CTRunGetGlyphsPtr fails more often; if this happens, nsAutoTArray<>
     // may become an attractive option.
     glyphs = ::CTRunGetGlyphsPtr(aCTRun);
     if (!glyphs) {
         glyphsArray = MakeUniqueFallible<CGGlyph[]>(numGlyphs);
         if (!glyphsArray) {
             return NS_ERROR_OUT_OF_MEMORY;
         }
         ::CTRunGetGlyphs(aCTRun, ::CFRangeMake(0, 0), glyphsArray.get());
@@ -385,32 +385,32 @@ gfxCoreTextShaper::SetGlyphsFromRun(gfxS
         }
         ::CTRunGetStringIndices(aCTRun, ::CFRangeMake(0, 0), glyphToCharArray.get());
         glyphToChar = glyphToCharArray.get();
     }
 
     double runWidth = ::CTRunGetTypographicBounds(aCTRun, ::CFRangeMake(0, 0),
                                                   nullptr, nullptr, nullptr);
 
-    AutoTArray<gfxShapedText::DetailedGlyph,1> detailedGlyphs;
+    nsAutoTArray<gfxShapedText::DetailedGlyph,1> detailedGlyphs;
     gfxShapedText::CompressedGlyph *charGlyphs =
         aShapedText->GetCharacterGlyphs() + aOffset;
 
     // CoreText gives us the glyphindex-to-charindex mapping, which relates each glyph
     // to a source text character; we also need the charindex-to-glyphindex mapping to
     // find the glyph for a given char. Note that some chars may not map to any glyph
     // (ligature continuations), and some may map to several glyphs (eg Indic split vowels).
     // We set the glyph index to NO_GLYPH for chars that have no associated glyph, and we
     // record the last glyph index for cases where the char maps to several glyphs,
     // so that our clumping will include all the glyph fragments for the character.
 
     // The charToGlyph array is indexed by char position within the stringRange of the glyph run.
 
     static const int32_t NO_GLYPH = -1;
-    AutoTArray<int32_t,SMALL_GLYPH_RUN> charToGlyphArray;
+    AutoFallibleTArray<int32_t,SMALL_GLYPH_RUN> charToGlyphArray;
     if (!charToGlyphArray.SetLength(stringRange.length, fallible)) {
         return NS_ERROR_OUT_OF_MEMORY;
     }
     int32_t *charToGlyph = charToGlyphArray.Elements();
     for (int32_t offset = 0; offset < stringRange.length; ++offset) {
         charToGlyph[offset] = NO_GLYPH;
     }
     for (int32_t i = 0; i < numGlyphs; ++i) {
--- a/gfx/thebes/gfxDWriteFontList.cpp
+++ b/gfx/thebes/gfxDWriteFontList.cpp
@@ -65,17 +65,17 @@ GetDirectWriteFontName(IDWriteFont *aFon
 
     RefPtr<IDWriteLocalizedStrings> names;
     hr = aFont->GetFaceNames(getter_AddRefs(names));
     if (FAILED(hr)) {
         return hr;
     }
 
     BOOL exists;
-    AutoTArray<wchar_t,32> faceName;
+    nsAutoTArray<wchar_t,32> faceName;
     UINT32 englishIdx = 0;
     hr = names->FindLocaleName(L"en-us", &englishIdx, &exists);
     if (FAILED(hr)) {
         return hr;
     }
 
     if (!exists) {
         // No english found, use whatever is first in the list.
@@ -109,17 +109,17 @@ GetDirectWriteFaceName(IDWriteFont *aFon
 
     BOOL exists;
     RefPtr<IDWriteLocalizedStrings> infostrings;
     hr = aFont->GetInformationalStrings(aWhichName, getter_AddRefs(infostrings), &exists);
     if (FAILED(hr) || !exists) {
         return E_FAIL;
     }
 
-    AutoTArray<wchar_t,32> faceName;
+    nsAutoTArray<wchar_t,32> faceName;
     UINT32 englishIdx = 0;
     hr = infostrings->FindLocaleName(L"en-us", &englishIdx, &exists);
     if (FAILED(hr)) {
         return hr;
     }
 
     if (!exists) {
         // No english found, use whatever is first in the list.
@@ -299,17 +299,17 @@ gfxDWriteFontFamily::LocalizedName(nsASt
         if (FAILED(hr)) {
             return;
         }
         if (!exists) {
             // Use 0 index if english is not found.
             idx = 0;
         }
     }
-    AutoTArray<WCHAR, 32> famName;
+    AutoFallibleTArray<WCHAR, 32> famName;
     UINT32 length;
     
     hr = names->GetStringLength(idx, &length);
     if (FAILED(hr)) {
         return;
     }
     
     if (!famName.SetLength(length + 1, fallible)) {
@@ -393,17 +393,17 @@ UsingArabicOrHebrewScriptSystemLocale()
         return true;
     default:
         return false;
     }
 }
 
 nsresult
 gfxDWriteFontEntry::CopyFontTable(uint32_t aTableTag,
-                                  nsTArray<uint8_t> &aBuffer)
+                                  FallibleTArray<uint8_t> &aBuffer)
 {
     gfxDWriteFontList *pFontList = gfxDWriteFontList::PlatformFontList();
 
     // Don't use GDI table loading for symbol fonts or for
     // italic fonts in Arabic-script system locales because of
     // potential cmap discrepancies, see bug 629386.
     // Ditto for Hebrew, bug 837498.
     if (mFont && pFontList->UseGDIFontTableAccess() &&
@@ -628,17 +628,17 @@ gfxDWriteFontEntry::CreateFontFace(IDWri
         !(mFontFace->GetSimulations() & DWRITE_FONT_SIMULATIONS_BOLD)) {
         // if so, we need to return not mFontFace itself but a version that
         // has the Bold simulation - unfortunately, DWrite doesn't provide
         // a simple API for this
         UINT32 numberOfFiles = 0;
         if (FAILED(mFontFace->GetFiles(&numberOfFiles, nullptr))) {
             return NS_ERROR_FAILURE;
         }
-        AutoTArray<IDWriteFontFile*,1> files;
+        nsAutoTArray<IDWriteFontFile*,1> files;
         files.AppendElements(numberOfFiles);
         if (FAILED(mFontFace->GetFiles(&numberOfFiles, files.Elements()))) {
             return NS_ERROR_FAILURE;
         }
         HRESULT hr = gfxWindowsPlatform::GetPlatform()->GetDWriteFactory()->
             CreateFontFace(mFontFace->GetType(),
                            numberOfFiles,
                            files.Elements(),
@@ -674,17 +674,17 @@ gfxDWriteFontEntry::IsCJKFont()
 {
     if (mIsCJK != UNINITIALIZED_VALUE) {
         return mIsCJK;
     }
 
     mIsCJK = false;
 
     const uint32_t kOS2Tag = TRUETYPE_TAG('O','S','/','2');
-    AutoTArray<uint8_t, 128> buffer;
+    AutoFallibleTArray<uint8_t,128> buffer;
     if (CopyFontTable(kOS2Tag, buffer) != NS_OK) {
         return mIsCJK;
     }
 
     // ulCodePageRange bit definitions for the CJK codepages,
     // from http://www.microsoft.com/typography/otspec/os2.htm#cpr
     const uint32_t CJK_CODEPAGE_BITS =
         (1 << 17) | // codepage 932 - JIS/Japan
@@ -1060,17 +1060,17 @@ gfxDWriteFontList::GetFontsFromCollectio
         if (FAILED(hr)) {
             continue;
         }
         if (!exists) {
             // Use 0 index if english is not found.
             englishIdx = 0;
         }
 
-        AutoTArray<WCHAR, 32> enName;
+        AutoFallibleTArray<WCHAR, 32> enName;
         UINT32 length;
 
         hr = names->GetStringLength(englishIdx, &length);
         if (FAILED(hr)) {
             continue;
         }
 
         if (!enName.SetLength(length + 1, fallible)) {
@@ -1105,17 +1105,17 @@ gfxDWriteFontList::GetFontsFromCollectio
         mFontFamilies.Put(name, fam);
 
         // now add other family name localizations, if present
         uint32_t nameCount = names->GetCount();
         uint32_t nameIndex;
 
         for (nameIndex = 0; nameIndex < nameCount; nameIndex++) {
             UINT32 nameLen;
-            AutoTArray<WCHAR, 32> localizedName;
+            AutoFallibleTArray<WCHAR, 32> localizedName;
 
             // only add other names
             if (nameIndex == englishIdx) {
                 continue;
             }
 
             hr = names->GetStringLength(nameIndex, &nameLen);
             if (FAILED(hr)) {
@@ -1326,17 +1326,17 @@ static HRESULT GetFamilyName(IDWriteFont
         return hr;
     }
 
     // If the specified locale doesn't exist, select the first on the list.
     if (!exists) {
         index = 0;
     }
 
-    AutoTArray<WCHAR, 32> name;
+    AutoFallibleTArray<WCHAR, 32> name;
     UINT32 length;
 
     hr = familyNames->GetStringLength(index, &length);
     if (FAILED(hr)) {
         return hr;
     }
 
     if (!name.SetLength(length + 1, fallible)) {
@@ -1512,17 +1512,17 @@ private:
     RefPtr<IDWriteFontCollection> mBundledFonts;
 #endif
 };
 
 void
 DirectWriteFontInfo::LoadFontFamilyData(const nsAString& aFamilyName)
 {
     // lookup the family
-    AutoTArray<wchar_t, 32> famName;
+    nsAutoTArray<wchar_t, 32> famName;
 
     uint32_t len = aFamilyName.Length();
     if(!famName.SetLength(len + 1, fallible)) {
         return;
     }
     memcpy(famName.Elements(), aFamilyName.BeginReading(), len * sizeof(char16_t));
     famName[len] = 0;
 
--- a/gfx/thebes/gfxDWriteFontList.h
+++ b/gfx/thebes/gfxDWriteFontList.h
@@ -170,17 +170,17 @@ public:
       return mFont;
     }
 
 protected:
     friend class gfxDWriteFont;
     friend class gfxDWriteFontList;
 
     virtual nsresult CopyFontTable(uint32_t aTableTag,
-                                   nsTArray<uint8_t>& aBuffer) override;
+                                   FallibleTArray<uint8_t>& aBuffer) override;
 
     virtual gfxFont *CreateFontInstance(const gfxFontStyle *aFontStyle,
                                         bool aNeedsBold);
     
     nsresult CreateFontFace(
         IDWriteFontFace **aFontFace,
         DWRITE_FONT_SIMULATIONS aSimulations = DWRITE_FONT_SIMULATIONS_NONE);
 
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -452,17 +452,17 @@ nsresult
 FT2FontEntry::ReadCMAP(FontInfoData *aFontInfoData)
 {
     if (mCharacterMap) {
         return NS_OK;
     }
 
     RefPtr<gfxCharacterMap> charmap = new gfxCharacterMap();
 
-    AutoTArray<uint8_t, 16384> buffer;
+    AutoFallibleTArray<uint8_t,16384> buffer;
     nsresult rv = CopyFontTable(TTAG_cmap, buffer);
     
     if (NS_SUCCEEDED(rv)) {
         bool unicodeFont;
         bool symbolFont;
         rv = gfxFontUtils::ReadCMAP(buffer.Elements(), buffer.Length(),
                                     *charmap, mUVSOffset,
                                     unicodeFont, symbolFont);
@@ -506,17 +506,18 @@ FT2FontEntry::ReadCMAP(FontInfoData *aFo
     } else {
         // if error occurred, initialize to null cmap
         mCharacterMap = new gfxCharacterMap();
     }
     return rv;
 }
 
 nsresult
-FT2FontEntry::CopyFontTable(uint32_t aTableTag, nsTArray<uint8_t>& aBuffer)
+FT2FontEntry::CopyFontTable(uint32_t aTableTag,
+                            FallibleTArray<uint8_t>& aBuffer)
 {
     AutoFTFace face(this);
     if (!face) {
         return NS_ERROR_FAILURE;
     }
 
     FT_Error status;
     FT_ULong len = 0;
@@ -1347,17 +1348,17 @@ gfxFT2FontList::GetSystemFontList(Infall
         auto family = static_cast<FT2FontFamily*>(iter.Data().get());
         family->AddFacesToFontList(retValue, FT2FontFamily::kHidden);
     }
 }
 
 static void
 LoadSkipSpaceLookupCheck(nsTHashtable<nsStringHashKey>& aSkipSpaceLookupCheck)
 {
-    AutoTArray<nsString, 5> skiplist;
+    nsAutoTArray<nsString, 5> skiplist;
     gfxFontUtils::GetPrefsFontList(
         "font.whitelist.skip_default_features_space_check",
         skiplist);
     uint32_t numFonts = skiplist.Length();
     for (uint32_t i = 0; i < numFonts; i++) {
         ToLowerCase(skiplist[i]);
         aSkipSpaceLookupCheck.PutEntry(skiplist[i]);
     }
--- a/gfx/thebes/gfxFT2FontList.h
+++ b/gfx/thebes/gfxFT2FontList.h
@@ -73,17 +73,17 @@ public:
     // This may fail and return null, so caller must be prepared to handle this.
     cairo_scaled_font_t *CreateScaledFont(const gfxFontStyle *aStyle);
 
     nsresult ReadCMAP(FontInfoData *aFontInfoData = nullptr);
 
     virtual hb_blob_t* GetFontTable(uint32_t aTableTag) override;
 
     virtual nsresult CopyFontTable(uint32_t aTableTag,
-                                   nsTArray<uint8_t>& aBuffer) override;
+                                   FallibleTArray<uint8_t>& aBuffer) override;
 
     // Check for various kinds of brokenness, and set flags on the entry
     // accordingly so that we avoid using bad font tables
     void CheckForBrokenFont(gfxFontFamily *aFamily);
 
     virtual void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
                                         FontListSizes* aSizes) const;
     virtual void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -739,17 +739,17 @@ gfxFontconfigFontEntry::CreateFontInstan
         new gfxFontconfigFont(scaledFont, this, aFontStyle, aNeedsBold);
     cairo_scaled_font_destroy(scaledFont);
 
     return newFont;
 }
 
 nsresult
 gfxFontconfigFontEntry::CopyFontTable(uint32_t aTableTag,
-                                      nsTArray<uint8_t>& aBuffer)
+                                      FallibleTArray<uint8_t>& aBuffer)
 {
     NS_ASSERTION(!mIsDataUserFont,
                  "data fonts should be reading tables directly from memory");
 
     if (!mFTFaceInitialized) {
         mFTFaceInitialized = true;
         FcChar8 *filename;
         if (FcPatternGetString(mFontPattern, FC_FILE, 0, &filename) != FcResultMatch) {
--- a/gfx/thebes/gfxFcPlatformFontList.h
+++ b/gfx/thebes/gfxFcPlatformFontList.h
@@ -132,17 +132,17 @@ protected:
     cairo_scaled_font_t*
     CreateScaledFont(FcPattern* aRenderPattern,
                      const gfxFontStyle *aStyle,
                      bool aNeedsBold);
 
     // override to pull data from FTFace
     virtual nsresult
     CopyFontTable(uint32_t aTableTag,
-                  nsTArray<uint8_t>& aBuffer) override;
+                  FallibleTArray<uint8_t>& aBuffer) override;
 
     // if HB or GR faces are gone, close down the FT_Face
     void MaybeReleaseFTFace();
 
     double GetAspect();
 
     // pattern for a single face of a family
     nsCountedRef<FcPattern> mFontPattern;
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -342,17 +342,17 @@ static void
 LookupAlternateValues(gfxFontFeatureValueSet *featureLookup,
                       const nsAString& aFamily,
                       const nsTArray<gfxAlternateValue>& altValue,
                       nsTArray<gfxFontFeature>& aFontFeatures)
 {
     uint32_t numAlternates = altValue.Length();
     for (uint32_t i = 0; i < numAlternates; i++) {
         const gfxAlternateValue& av = altValue.ElementAt(i);
-        AutoTArray<uint32_t,4> values;
+        nsAutoTArray<uint32_t,4> values;
 
         // map <family, name, feature> ==> <values>
         bool found =
             featureLookup->GetFontFeatureValuesFor(aFamily, av.alternate,
                                                    av.value, values);
         uint32_t numValues = values.Length();
 
         // nothing defined, skip
@@ -517,17 +517,17 @@ gfxFontShaper::MergeFontFeatures(
             break;
         default:
             MOZ_ASSERT_UNREACHABLE("Unexpected variantSubSuper");
             break;
     }
 
     // add font-specific feature values from style rules
     if (aStyle->featureValueLookup && numAlts > 0) {
-        AutoTArray<gfxFontFeature,4> featureList;
+        nsAutoTArray<gfxFontFeature,4> featureList;
 
         // insert list of alternate feature settings
         LookupAlternateValues(aStyle->featureValueLookup, aFamilyName,
                               aStyle->alternateValues, featureList);
 
         count = featureList.Length();
         for (i = 0; i < count; i++) {
             const gfxFontFeature& feature = featureList.ElementAt(i);
@@ -2185,18 +2185,18 @@ gfxFont::RenderSVGGlyph(gfxContext *aCon
 bool
 gfxFont::RenderColorGlyph(DrawTarget* aDrawTarget,
                           mozilla::gfx::ScaledFont* scaledFont,
                           GlyphRenderingOptions* aRenderingOptions,
                           mozilla::gfx::DrawOptions aDrawOptions,
                           const mozilla::gfx::Point& aPoint,
                           uint32_t aGlyphId) const
 {
-    AutoTArray<uint16_t, 8> layerGlyphs;
-    AutoTArray<mozilla::gfx::Color, 8> layerColors;
+    nsAutoTArray<uint16_t, 8> layerGlyphs;
+    nsAutoTArray<mozilla::gfx::Color, 8> layerColors;
 
     if (!GetFontEntry()->GetColorLayersInfo(aGlyphId, layerGlyphs, layerColors)) {
         return false;
     }
 
     for (uint32_t layerIndex = 0; layerIndex < layerGlyphs.Length();
          layerIndex++) {
         Glyph glyph;
@@ -3143,18 +3143,18 @@ gfxFont::InitFakeSmallCapsRun(DrawTarget
                 // use reduced-size font, then fall through to uppercase the text
                 f = smallCapsFont;
                 MOZ_FALLTHROUGH;
 
             case kUppercase:
                 // apply uppercase transform to the string
                 nsDependentSubstring origString(aText + runStart, runLength);
                 nsAutoString convertedString;
-                AutoTArray<bool,50> charsToMergeArray;
-                AutoTArray<bool,50> deletedCharsArray;
+                nsAutoTArray<bool,50> charsToMergeArray;
+                nsAutoTArray<bool,50> deletedCharsArray;
 
                 bool mergeNeeded = nsCaseTransformTextRunFactory::
                     TransformString(origString,
                                     convertedString,
                                     true,
                                     mStyle.explicitLanguage
                                       ? mStyle.language.get() : nullptr,
                                     charsToMergeArray,
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -2078,17 +2078,17 @@ protected:
     // by the platform
     bool                       mApplySyntheticBold;
 
     bool                       mKerningSet;     // kerning explicitly set?
     bool                       mKerningEnabled; // if set, on or off?
 
     nsExpirationState          mExpirationState;
     gfxFontStyle               mStyle;
-    AutoTArray<gfxGlyphExtents*,1> mGlyphExtentsArray;
+    nsAutoTArray<gfxGlyphExtents*,1> mGlyphExtentsArray;
     nsAutoPtr<nsTHashtable<nsPtrHashKey<GlyphChangeObserver> > > mGlyphChangeObservers;
 
     gfxFloat                   mAdjustedSize;
 
     // Conversion factor from font units to dev units; note that this may be
     // zero (in the degenerate case where mAdjustedSize has become zero).
     // This is OK because we only multiply by this factor, never divide.
     float                      mFUnitsConvFactor;
--- a/gfx/thebes/gfxFontEntry.cpp
+++ b/gfx/thebes/gfxFontEntry.cpp
@@ -518,22 +518,22 @@ gfxFontEntry::TryGetColorGlyphs()
 /**
  * FontTableBlobData
  *
  * See FontTableHashEntry for the general strategy.
  */
 
 class gfxFontEntry::FontTableBlobData {
 public:
-    explicit FontTableBlobData(nsTArray<uint8_t>&& aBuffer)
-        : mTableData(Move(aBuffer))
-        , mHashtable(nullptr)
-        , mHashKey(0)
+    // Adopts the content of aBuffer.
+    explicit FontTableBlobData(FallibleTArray<uint8_t>& aBuffer)
+        : mHashtable(nullptr), mHashKey(0)
     {
         MOZ_COUNT_CTOR(FontTableBlobData);
+        mTableData.SwapElements(aBuffer);
     }
 
     ~FontTableBlobData() {
         MOZ_COUNT_DTOR(FontTableBlobData);
         if (mHashtable && mHashKey) {
             mHashtable->RemoveEntry(mHashKey);
         }
     }
@@ -565,36 +565,36 @@ public:
     size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const {
         return mTableData.ShallowSizeOfExcludingThis(aMallocSizeOf);
     }
     size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
         return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
     }
 
 private:
-    // The font table data block
-    nsTArray<uint8_t> mTableData;
+    // The font table data block, owned (via adoption)
+    FallibleTArray<uint8_t> mTableData;
 
     // The blob destroy function needs to know the owning hashtable
     // and the hashtable key, so that it can remove the entry.
     nsTHashtable<FontTableHashEntry> *mHashtable;
     uint32_t                          mHashKey;
 
     // not implemented
     FontTableBlobData(const FontTableBlobData&);
 };
 
 hb_blob_t *
 gfxFontEntry::FontTableHashEntry::
-ShareTableAndGetBlob(nsTArray<uint8_t>&& aTable,
+ShareTableAndGetBlob(FallibleTArray<uint8_t>& aTable,
                      nsTHashtable<FontTableHashEntry> *aHashtable)
 {
     Clear();
     // adopts elements of aTable
-    mSharedBlobData = new FontTableBlobData(Move(aTable));
+    mSharedBlobData = new FontTableBlobData(aTable);
     mBlob = hb_blob_create(mSharedBlobData->GetTable(),
                            mSharedBlobData->GetTableLength(),
                            HB_MEMORY_MODE_READONLY,
                            mSharedBlobData, DeleteFontTableBlobData);
     if (!mSharedBlobData) {
         // The FontTableBlobData was destroyed during hb_blob_create().
         // The (empty) blob is still be held in the hashtable with a strong
         // reference.
@@ -651,17 +651,17 @@ gfxFontEntry::GetExistingFontTable(uint3
     }
 
     *aBlob = entry->GetBlob();
     return true;
 }
 
 hb_blob_t *
 gfxFontEntry::ShareFontTableAndGetBlob(uint32_t aTag,
-                                       nsTArray<uint8_t>* aBuffer)
+                                       FallibleTArray<uint8_t>* aBuffer)
 {
     if (MOZ_UNLIKELY(!mFontTableCache)) {
         // we do this here rather than on fontEntry construction
         // because not all shapers will access the table cache at all
       mFontTableCache = new nsTHashtable<FontTableHashEntry>(8);
     }
 
     FontTableHashEntry *entry = mFontTableCache->PutEntry(aTag);
@@ -670,17 +670,17 @@ gfxFontEntry::ShareFontTableAndGetBlob(u
     }
 
     if (!aBuffer) {
         // ensure the entry is null