Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r?froydnj
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Sat, 21 Oct 2017 23:53:02 +0900
changeset 1327188 f7cb9aaf583c58b80b69503450c25485df8cfca3
parent 1324066 bcb43f219e70b2e09aa0d3f121565eafe34cea1d
child 1327189 d8f6b5743dc649a8780cac9583677603a91a3323
push id229668
push userVYV03354@nifty.ne.jp
push dateSat, 21 Oct 2017 14:57:58 +0000
treeherdertry@d8f6b5743dc6 [default view] [failures only]
reviewersfroydnj
bugs1313150
milestone58.0a1
Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r?froydnj MozReview-Commit-ID: 7JoD4VYzZp3
accessible/xpcom/nsAccessibleRelation.cpp
accessible/xpcom/xpcAccessible.cpp
accessible/xpcom/xpcAccessibleHyperText.cpp
accessible/xpcom/xpcAccessibleSelectable.cpp
accessible/xpcom/xpcAccessibleTable.cpp
accessible/xpcom/xpcAccessibleTableCell.cpp
accessible/xpcom/xpcAccessibleTextRange.cpp
docshell/base/nsDocShell.cpp
dom/base/nsContentPermissionHelper.cpp
dom/base/nsDOMWindowUtils.cpp
dom/bindings/nsScriptError.cpp
dom/events/DataTransfer.cpp
dom/events/EventListenerService.cpp
dom/html/HTMLFormElement.cpp
dom/html/nsIConstraintValidation.cpp
dom/media/MediaManager.cpp
dom/payments/PaymentRequestData.cpp
dom/payments/ipc/PaymentRequestParent.cpp
dom/presentation/PresentationDeviceManager.cpp
dom/presentation/PresentationService.cpp
dom/presentation/PresentationSessionInfo.cpp
dom/workers/ServiceWorkerManager.cpp
dom/xul/templates/nsXULTemplateBuilder.cpp
editor/libeditor/HTMLEditor.cpp
intl/strres/nsStringBundle.cpp
layout/inspector/inDOMUtils.cpp
netwerk/base/BackgroundFileSaver.cpp
netwerk/cookie/nsCookieService.cpp
security/manager/pki/nsNSSDialogs.cpp
security/manager/ssl/PKCS11ModuleDB.cpp
security/manager/ssl/nsCertTree.cpp
security/manager/ssl/nsNSSASN1Object.cpp
security/manager/ssl/nsNSSCertHelper.cpp
security/manager/ssl/nsNSSCertificate.cpp
security/manager/ssl/nsNSSCertificateDB.cpp
security/manager/ssl/nsNSSIOLayer.cpp
security/manager/ssl/nsPKCS11Slot.cpp
toolkit/components/alerts/nsXULAlerts.cpp
toolkit/components/feeds/FeedProcessor.js
toolkit/components/perfmonitoring/nsPerformanceStats.cpp
toolkit/components/printingui/unixshared/nsPrintProgress.cpp
toolkit/components/printingui/unixshared/nsPrintingPromptService.cpp
toolkit/components/printingui/win/nsPrintProgress.cpp
toolkit/components/printingui/win/nsPrintingPromptService.cpp
toolkit/components/url-classifier/nsUrlClassifierInfo.cpp
toolkit/components/windowwatcher/nsWindowWatcher.cpp
toolkit/profile/content/createProfileWizard.js
toolkit/profile/content/profileSelection.js
uriloader/exthandler/ContentHandlerService.cpp
uriloader/exthandler/HandlerServiceParent.cpp
uriloader/exthandler/android/nsMIMEInfoAndroid.cpp
uriloader/exthandler/nsExternalHelperAppService.cpp
uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
uriloader/exthandler/win/nsMIMEInfoWin.cpp
uriloader/prefetch/nsOfflineCacheUpdate.cpp
widget/nsHTMLFormatConverter.cpp
widget/nsTransferable.cpp
widget/windows/JumpListBuilder.cpp
xpcom/components/nsComponentManager.cpp
xpcom/ds/nsArray.cpp
xpcom/ds/nsHashPropertyBag.cpp
xpcom/ds/nsIMutableArray.idl
xpcom/tests/unit/test_nsIMutableArray.js
xpfe/components/directory/nsDirectoryViewer.cpp
--- a/accessible/xpcom/nsAccessibleRelation.cpp
+++ b/accessible/xpcom/nsAccessibleRelation.cpp
@@ -16,28 +16,27 @@ using namespace mozilla::a11y;
 
 nsAccessibleRelation::nsAccessibleRelation(uint32_t aType,
                                            Relation* aRel) :
   mType(aType)
 {
   mTargets = do_CreateInstance(NS_ARRAY_CONTRACTID);
   Accessible* targetAcc = nullptr;
   while ((targetAcc = aRel->Next()))
-    mTargets->AppendElement(static_cast<nsIAccessible*>(ToXPC(targetAcc)), false);
+    mTargets->AppendElement(static_cast<nsIAccessible*>(ToXPC(targetAcc)));
 }
 
 nsAccessibleRelation::nsAccessibleRelation(uint32_t aType,
                                            const nsTArray<ProxyAccessible*>* aTargets) :
   mType(aType)
 {
   mTargets = do_CreateInstance(NS_ARRAY_CONTRACTID);
   for (uint32_t idx = 0; idx < aTargets->Length(); ++idx) {
     mTargets->AppendElement(
-      static_cast<nsIAccessible*>(ToXPC(aTargets->ElementAt(idx))),
-      false);
+      static_cast<nsIAccessible*>(ToXPC(aTargets->ElementAt(idx))));
   }
 }
 
 nsAccessibleRelation::~nsAccessibleRelation()
 {
 }
 
 // nsISupports
--- a/accessible/xpcom/xpcAccessible.cpp
+++ b/accessible/xpcom/xpcAccessible.cpp
@@ -147,17 +147,17 @@ xpcAccessible::GetChildren(nsIArray** aC
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMutableArray> children =
     do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint32_t childCount = IntlGeneric().ChildCount();
   for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
     AccessibleOrProxy child = IntlGeneric().ChildAt(childIdx);
-    children->AppendElement(static_cast<nsIAccessible*>(ToXPC(child)), false);
+    children->AppendElement(static_cast<nsIAccessible*>(ToXPC(child)));
   }
 
   children.forget(aChildren);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetIndexInParent(int32_t* aIndexInParent)
@@ -550,17 +550,17 @@ xpcAccessible::GetRelations(nsIArray** a
   for (uint32_t idx = 0; idx < ArrayLength(relationTypes); idx++) {
     nsCOMPtr<nsIAccessibleRelation> relation;
     nsresult rv = GetRelationByType(relationTypes[idx], getter_AddRefs(relation));
 
     if (NS_SUCCEEDED(rv) && relation) {
       uint32_t targets = 0;
       relation->GetTargetsCount(&targets);
       if (targets)
-        relations->AppendElement(relation, false);
+        relations->AppendElement(relation);
     }
   }
 
   NS_ADDREF(*aRelations = relations);
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/accessible/xpcom/xpcAccessibleHyperText.cpp
+++ b/accessible/xpcom/xpcAccessibleHyperText.cpp
@@ -535,18 +535,17 @@ xpcAccessibleHyperText::GetSelectionRang
   nsCOMPtr<nsIMutableArray> xpcRanges =
     do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   AutoTArray<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->AppendElement(new xpcAccessibleTextRange(Move(ranges[idx])));
 
   xpcRanges.forget(aRanges);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetVisibleRanges(nsIArray** aRanges)
 {
@@ -560,18 +559,17 @@ xpcAccessibleHyperText::GetVisibleRanges
   nsCOMPtr<nsIMutableArray> xpcRanges =
     do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsTArray<TextRange> ranges;
   Intl()->VisibleRanges(&ranges);
   uint32_t len = ranges.Length();
   for (uint32_t idx = 0; idx < len; idx++)
-    xpcRanges->AppendElement(new xpcAccessibleTextRange(Move(ranges[idx])),
-                             false);
+    xpcRanges->AppendElement(new xpcAccessibleTextRange(Move(ranges[idx])));
 
   xpcRanges.forget(aRanges);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetRangeByChild(nsIAccessible* aChild,
                                         nsIAccessibleTextRange** aRange)
--- a/accessible/xpcom/xpcAccessibleSelectable.cpp
+++ b/accessible/xpcom/xpcAccessibleSelectable.cpp
@@ -29,17 +29,17 @@ xpcAccessibleSelectable::GetSelectedItem
     return NS_OK;
 
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMutableArray> xpcItems =
     do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   for (uint32_t idx = 0; idx < itemCount; idx++)
-    xpcItems->AppendElement(static_cast<nsIAccessible*>(ToXPC(items[idx])), false);
+    xpcItems->AppendElement(static_cast<nsIAccessible*>(ToXPC(items[idx])));
 
   NS_ADDREF(*aSelectedItems = xpcItems);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleSelectable::GetSelectedItemCount(uint32_t* aSelectionCount)
 {
--- a/accessible/xpcom/xpcAccessibleTable.cpp
+++ b/accessible/xpcom/xpcAccessibleTable.cpp
@@ -274,17 +274,17 @@ xpcAccessibleTable::GetSelectedCells(nsI
   NS_ENSURE_SUCCESS(rv, rv);
 
   AutoTArray<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);
+    selCells->AppendElement(static_cast<nsIAccessible*>(ToXPC(cell)));
   }
 
   NS_ADDREF(*aSelectedCells = selCells);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::GetSelectedCellIndices(uint32_t* aCellsArraySize,
--- a/accessible/xpcom/xpcAccessibleTableCell.cpp
+++ b/accessible/xpcom/xpcAccessibleTableCell.cpp
@@ -110,18 +110,17 @@ xpcAccessibleTableCell::GetColumnHeaderC
 
   AutoTArray<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);
+    cells->AppendElement(static_cast<nsIAccessible*>(ToXPC(headerCells[idx])));
   }
 
   NS_ADDREF(*aHeaderCells = cells);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTableCell::GetRowHeaderCells(nsIArray** aHeaderCells)
@@ -134,18 +133,17 @@ xpcAccessibleTableCell::GetRowHeaderCell
 
   AutoTArray<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);
+    cells->AppendElement(static_cast<nsIAccessible*>(ToXPC(headerCells[idx])));
   }
 
   NS_ADDREF(*aHeaderCells = cells);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTableCell::IsSelected(bool* aSelected)
--- a/accessible/xpcom/xpcAccessibleTextRange.cpp
+++ b/accessible/xpcom/xpcAccessibleTextRange.cpp
@@ -82,17 +82,17 @@ xpcAccessibleTextRange::GetEmbeddedChild
     do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsTArray<Accessible*> objects;
   mRange.EmbeddedChildren(&objects);
 
   uint32_t len = objects.Length();
   for (uint32_t idx = 0; idx < len; idx++)
-    xpcList->AppendElement(static_cast<nsIAccessible*>(ToXPC(objects[idx])), false);
+    xpcList->AppendElement(static_cast<nsIAccessible*>(ToXPC(objects[idx])));
 
   xpcList.forget(aList);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTextRange::Compare(nsIAccessibleTextRange* aOtherRange,
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -6840,29 +6840,29 @@ nsDocShell::RefreshURI(nsIURI* aURI, int
 
   if (!mRefreshURIList) {
     mRefreshURIList = nsArray::Create();
   }
 
   if (busyFlags & BUSY_FLAGS_BUSY || (!mIsActive && mDisableMetaRefreshWhenInactive)) {
     // We don't  want to create the timer right now. Instead queue up the request
     // and trigger the timer in EndPageLoad() or whenever we become active.
-    mRefreshURIList->AppendElement(refreshTimer, /*weak =*/ false);
+    mRefreshURIList->AppendElement(refreshTimer);
   } else {
     // There is no page loading going on right now.  Create the
     // timer and fire it right away.
     nsCOMPtr<nsPIDOMWindowOuter> win = GetWindow();
     NS_ENSURE_TRUE(win, NS_ERROR_FAILURE);
 
     nsCOMPtr<nsITimer> timer;
     MOZ_TRY_VAR(timer,
                 NS_NewTimerWithCallback(refreshTimer, aDelay, nsITimer::TYPE_ONE_SHOT,
                                         win->TabGroup()->EventTargetFor(TaskCategory::Network)));
 
-    mRefreshURIList->AppendElement(timer, /*weak =*/ false);  // owning timer ref
+    mRefreshURIList->AppendElement(timer);  // owning timer ref
   }
   return NS_OK;
 }
 
 nsresult
 nsDocShell::ForceRefreshURIFromTimer(nsIURI* aURI,
                                      int32_t aDelay,
                                      bool aMetaRefresh,
@@ -7279,17 +7279,17 @@ nsDocShell::SuspendRefreshURIs()
       timer->GetCallback(getter_AddRefs(callback));
 
       timer->Cancel();
 
       nsCOMPtr<nsITimerCallback> rt = do_QueryInterface(callback);
       NS_ASSERTION(rt,
                    "RefreshURIList timer callbacks should only be RefreshTimer objects");
 
-      mRefreshURIList->ReplaceElementAt(rt, i, /*weak =*/ false);
+      mRefreshURIList->ReplaceElementAt(rt, i);
     }
   }
 
   // Suspend refresh URIs for our child shells as well.
   nsTObserverArray<nsDocLoader*>::ForwardIterator iter(mChildList);
   while (iter.HasMore()) {
     nsCOMPtr<nsIDocShell> shell = do_QueryObject(iter.GetNext());
     if (shell) {
@@ -7344,17 +7344,17 @@ nsDocShell::RefreshURIFromQueue()
                                 refreshInfo, delay, nsITimer::TYPE_ONE_SHOT,
                                 win->TabGroup()->EventTargetFor(TaskCategory::Network));
 
         if (timer) {
           // Replace the nsRefreshTimer element in the queue with
           // its corresponding timer object, so that in case another
           // load comes through before the timer can go off, the timer will
           // get cancelled in CancelRefreshURITimer()
-          mRefreshURIList->ReplaceElementAt(timer, n, /*weak =*/ false);
+          mRefreshURIList->ReplaceElementAt(timer, n);
         }
       }
     }
   }
 
   return NS_OK;
 }
 
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -251,17 +251,17 @@ ContentPermissionType::GetOptions(nsIArr
   for (uint32_t i = 0; i < mOptions.Length(); ++i) {
     nsCOMPtr<nsISupportsString> isupportsString =
       do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = isupportsString->SetData(mOptions[i]);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    rv = options->AppendElement(isupportsString, false);
+    rv = options->AppendElement(isupportsString);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   options.forget(aOptions);
   return NS_OK;
 }
 
 // nsContentPermissionUtils
@@ -271,17 +271,17 @@ nsContentPermissionUtils::ConvertPermiss
                                                           nsIMutableArray* aDesArray)
 {
   uint32_t len = aSrcArray.Length();
   for (uint32_t i = 0; i < len; i++) {
     RefPtr<ContentPermissionType> cpt =
       new ContentPermissionType(aSrcArray[i].type(),
                                 aSrcArray[i].access(),
                                 aSrcArray[i].options());
-    aDesArray->AppendElement(cpt, false);
+    aDesArray->AppendElement(cpt);
   }
   return len;
 }
 
 /* static */ uint32_t
 nsContentPermissionUtils::ConvertArrayToPermissionRequest(nsIArray* aSrcArray,
                                                           nsTArray<PermissionRequest>& aDesArray)
 {
@@ -336,17 +336,17 @@ nsContentPermissionUtils::CreatePermissi
                                                 const nsACString& aAccess,
                                                 const nsTArray<nsString>& aOptions,
                                                 nsIArray** aTypesArray)
 {
   nsCOMPtr<nsIMutableArray> types = do_CreateInstance(NS_ARRAY_CONTRACTID);
   RefPtr<ContentPermissionType> permType = new ContentPermissionType(aType,
                                                                        aAccess,
                                                                        aOptions);
-  types->AppendElement(permType, false);
+  types->AppendElement(permType);
   types.forget(aTypesArray);
 
   return NS_OK;
 }
 
 /* static */ PContentPermissionRequestParent*
 nsContentPermissionUtils::CreateContentPermissionRequestParent(const nsTArray<PermissionRequest>& aRequests,
                                                                Element* element,
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2515,17 +2515,17 @@ nsDOMWindowUtils::AudioDevices(uint16_t 
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsTArray<RefPtr<AudioDeviceInfo>> collection;
   CubebUtils::GetDeviceCollection(collection,
                                   aSide == AUDIO_INPUT
                                     ? CubebUtils::Side::Input
                                     : CubebUtils::Side::Output);
   for (auto device: collection) {
-    devices->AppendElement(device, false);
+    devices->AppendElement(device);
   }
 
   devices.forget(aDevices);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/dom/bindings/nsScriptError.cpp
+++ b/dom/bindings/nsScriptError.cpp
@@ -427,17 +427,17 @@ nsScriptErrorBase::GetNotes(nsIArray** a
 {
     nsresult rv = NS_OK;
     nsCOMPtr<nsIMutableArray> array =
         do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     uint32_t len = mNotes.Length();
     for (uint32_t i = 0; i < len; i++)
-        array->AppendElement(mNotes[i], false);
+        array->AppendElement(mNotes[i]);
     array.forget(aNotes);
 
     return NS_OK;
 }
 
 NS_IMPL_ISUPPORTS(nsScriptError, nsIConsoleMessage, nsIScriptError)
 
 nsScriptErrorNote::nsScriptErrorNote()
--- a/dom/events/DataTransfer.cpp
+++ b/dom/events/DataTransfer.cpp
@@ -963,17 +963,17 @@ DataTransfer::GetTransferables(nsILoadCo
   if (!transArray) {
     return nullptr;
   }
 
   uint32_t count = MozItemCount();
   for (uint32_t i = 0; i < count; i++) {
     nsCOMPtr<nsITransferable> transferable = GetTransferable(i, aLoadContext);
     if (transferable) {
-      transArray->AppendElement(transferable, /*weak =*/ false);
+      transArray->AppendElement(transferable);
     }
   }
 
   return transArray.forget();
 }
 
 already_AddRefed<nsITransferable>
 DataTransfer::GetTransferable(uint32_t aIndex, nsILoadContext* aLoadContext)
--- a/dom/events/EventListenerService.cpp
+++ b/dom/events/EventListenerService.cpp
@@ -392,17 +392,17 @@ EventListenerService::NotifyAboutMainThr
       NS_DispatchToCurrentThread(runnable);
     }
   }
 
   RefPtr<EventListenerChange> changes =
     mPendingListenerChangesSet.LookupForAdd(aTarget).OrInsert(
       [this, aTarget] () {
         EventListenerChange* c = new EventListenerChange(aTarget);
-        mPendingListenerChanges->AppendElement(c, false);
+        mPendingListenerChanges->AppendElement(c);
         return c;
       });
   changes->AddChangedListenerName(aName);
 }
 
 void
 EventListenerService::NotifyPendingChanges()
 {
--- a/dom/html/HTMLFormElement.cpp
+++ b/dom/html/HTMLFormElement.cpp
@@ -1912,18 +1912,17 @@ HTMLFormElement::CheckFormValidity(nsIMu
       nsContentUtils::DispatchTrustedEvent(sortedControls[i]->OwnerDoc(),
                                            static_cast<nsIContent*>(sortedControls[i]),
                                            NS_LITERAL_STRING("invalid"),
                                            false, true, &defaultAction);
 
       // Add all unhandled invalid controls to aInvalidElements if the caller
       // requested them.
       if (defaultAction && aInvalidElements) {
-        aInvalidElements->AppendElement(ToSupports(sortedControls[i]),
-                                        false);
+        aInvalidElements->AppendElement(ToSupports(sortedControls[i]));
       }
     }
   }
 
   return ret;
 }
 
 bool
--- a/dom/html/nsIConstraintValidation.cpp
+++ b/dom/html/nsIConstraintValidation.cpp
@@ -165,17 +165,17 @@ nsIConstraintValidation::ReportValidity(
   // Return true on error here because that's what we always did
   NS_ENSURE_SUCCESS(rv, true);
 
   bool hasObserver = false;
   rv = theEnum->HasMoreElements(&hasObserver);
 
   nsCOMPtr<nsIMutableArray> invalidElements =
     do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-  invalidElements->AppendElement(content, false);
+  invalidElements->AppendElement(content);
 
   NS_ENSURE_SUCCESS(rv, true);
   nsCOMPtr<nsISupports> inst;
   nsCOMPtr<nsIFormSubmitObserver> observer;
   bool more = true;
   while (NS_SUCCEEDED(theEnum->HasMoreElements(&more)) && more) {
     theEnum->GetNext(getter_AddRefs(inst));
     observer = do_QueryInterface(inst);
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -2517,17 +2517,17 @@ MediaManager::GetUserMedia(nsPIDOMWindow
             new MediaStreamError(window, NS_LITERAL_STRING("NotFoundError"));
         onFailure->OnError(error);
         return;
       }
 
       nsCOMPtr<nsIMutableArray> devicesCopy = nsArray::Create(); // before we give up devices below
       if (!askPermission) {
         for (auto& device : **devices) {
-          nsresult rv = devicesCopy->AppendElement(device, /*weak =*/ false);
+          nsresult rv = devicesCopy->AppendElement(device);
           if (NS_WARN_IF(NS_FAILED(rv))) {
             return;
           }
         }
       }
 
       // Pass callbacks and listeners along to GetUserMediaTask.
       RefPtr<GetUserMediaTask> task (new GetUserMediaTask(c,
@@ -3316,17 +3316,17 @@ MediaManager::GetActiveMediaCaptureWindo
     // XXXkhuey ...
     if (!window) {
       continue;
     }
 
     if (winListener->CapturingVideo() || winListener->CapturingAudio() ||
         winListener->CapturingScreen() || winListener->CapturingWindow() ||
         winListener->CapturingApplication()) {
-      array->AppendElement(window, /*weak =*/ false);
+      array->AppendElement(window);
     }
   }
 
   array.forget(aArray);
   return NS_OK;
 }
 
 // XXX flags might be better...
--- a/dom/payments/PaymentRequestData.cpp
+++ b/dom/payments/PaymentRequestData.cpp
@@ -187,17 +187,17 @@ PaymentDetailsModifier::Create(const IPC
     nsCOMPtr<nsIMutableArray> items = do_CreateInstance(NS_ARRAY_CONTRACTID);
     MOZ_ASSERT(items);
     for (const IPCPaymentItem& item : aIPCModifier.additionalDisplayItems()) {
       nsCOMPtr<nsIPaymentItem> additionalItem;
       rv = PaymentItem::Create(item, getter_AddRefs(additionalItem));
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
-      rv = items->AppendElement(additionalItem, false);
+      rv = items->AppendElement(additionalItem);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
     }
     displayItems = items.forget();
   }
   nsCOMPtr<nsIPaymentDetailsModifier> modifier =
     new PaymentDetailsModifier(aIPCModifier.supportedMethods(),
@@ -356,17 +356,17 @@ PaymentDetails::Create(const IPCPaymentD
     nsCOMPtr<nsIMutableArray> items = do_CreateInstance(NS_ARRAY_CONTRACTID);
     MOZ_ASSERT(items);
     for (const IPCPaymentItem& displayItem : aIPCDetails.displayItems()) {
       nsCOMPtr<nsIPaymentItem> item;
       rv = PaymentItem::Create(displayItem, getter_AddRefs(item));
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
-      rv = items->AppendElement(item, false);
+      rv = items->AppendElement(item);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
     }
     displayItems = items.forget();
   }
 
   nsCOMPtr<nsIArray> shippingOptions;
@@ -374,17 +374,17 @@ PaymentDetails::Create(const IPCPaymentD
     nsCOMPtr<nsIMutableArray> options = do_CreateInstance(NS_ARRAY_CONTRACTID);
     MOZ_ASSERT(options);
     for (const IPCPaymentShippingOption& shippingOption : aIPCDetails.shippingOptions()) {
       nsCOMPtr<nsIPaymentShippingOption> option;
       rv = PaymentShippingOption::Create(shippingOption, getter_AddRefs(option));
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
-      rv = options->AppendElement(option, false);
+      rv = options->AppendElement(option);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
     }
     shippingOptions = options.forget();
   }
 
   nsCOMPtr<nsIArray> modifiers;
@@ -392,17 +392,17 @@ PaymentDetails::Create(const IPCPaymentD
     nsCOMPtr<nsIMutableArray> detailsModifiers = do_CreateInstance(NS_ARRAY_CONTRACTID);
     MOZ_ASSERT(detailsModifiers);
     for (const IPCPaymentDetailsModifier& modifier : aIPCDetails.modifiers()) {
       nsCOMPtr<nsIPaymentDetailsModifier> detailsModifier;
       rv = PaymentDetailsModifier::Create(modifier, getter_AddRefs(detailsModifier));
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
-      rv = detailsModifiers->AppendElement(detailsModifier, false);
+      rv = detailsModifiers->AppendElement(detailsModifier);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
     }
     modifiers = detailsModifiers.forget();
   }
 
   nsCOMPtr<nsIPaymentDetails> details =
--- a/dom/payments/ipc/PaymentRequestParent.cpp
+++ b/dom/payments/ipc/PaymentRequestParent.cpp
@@ -42,17 +42,17 @@ PaymentRequestParent::RecvRequestPayment
       nsCOMPtr<nsIMutableArray> methodData = do_CreateInstance(NS_ARRAY_CONTRACTID);
       MOZ_ASSERT(methodData);
       for (IPCPaymentMethodData data : request.methodData()) {
         nsCOMPtr<nsIPaymentMethodData> method;
         rv = payments::PaymentMethodData::Create(data, getter_AddRefs(method));
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return IPC_FAIL_NO_REASON(this);
         }
-        rv = methodData->AppendElement(method, false);
+        rv = methodData->AppendElement(method);
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return IPC_FAIL_NO_REASON(this);
         }
       }
 
       nsCOMPtr<nsIPaymentDetails> details;
       rv = payments::PaymentDetails::Create(request.details(), getter_AddRefs(details));
       if (NS_WARN_IF(NS_FAILED(rv))) {
--- a/dom/presentation/PresentationDeviceManager.cpp
+++ b/dom/presentation/PresentationDeviceManager.cpp
@@ -179,26 +179,26 @@ PresentationDeviceManager::GetAvailableD
         presentationUrls.AppendElement(presentationUrl);
       }
     }
   }
 
   nsCOMPtr<nsIMutableArray> devices = do_CreateInstance(NS_ARRAY_CONTRACTID);
   for (uint32_t i = 0; i < mDevices.Length(); ++i) {
     if (presentationUrls.IsEmpty()) {
-      devices->AppendElement(mDevices[i], false);
+      devices->AppendElement(mDevices[i]);
       continue;
     }
 
     for (uint32_t j = 0; j < presentationUrls.Length(); ++j) {
       bool isSupported;
       if (NS_SUCCEEDED(mDevices[i]->IsRequestedUrlSupported(presentationUrls[j],
                                                             &isSupported)) &&
           isSupported) {
-        devices->AppendElement(mDevices[i], false);
+        devices->AppendElement(mDevices[i]);
         break;
       }
     }
   }
 
   devices.forget(aRetVal);
 
   return NS_OK;
--- a/dom/presentation/PresentationService.cpp
+++ b/dom/presentation/PresentationService.cpp
@@ -77,17 +77,17 @@ ConvertURLArrayHelper(const nsTArray<nsS
       return rv;
     }
 
     rv = isupportsString->SetData(url);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
-    rv = urls->AppendElement(isupportsString, false);
+    rv = urls->AppendElement(isupportsString);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   }
 
   urls.forget(aResult);
   return NS_OK;
 }
--- a/dom/presentation/PresentationSessionInfo.cpp
+++ b/dom/presentation/PresentationSessionInfo.cpp
@@ -169,17 +169,17 @@ TCPPresentationChannelDescription::GetTc
   // into account. And at the first stage Presentation API is only exposed on
   // Firefox OS where the first IP appears enough for most scenarios.
   nsCOMPtr<nsISupportsCString> address = do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID);
   if (NS_WARN_IF(!address)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
   address->SetData(mAddress);
 
-  array->AppendElement(address, false);
+  array->AppendElement(address);
   array.forget(aRetVal);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TCPPresentationChannelDescription::GetTcpPort(uint16_t* aRetVal)
 {
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -3729,17 +3729,17 @@ ServiceWorkerManager::GetAllRegistration
     for (auto it2 = it1.UserData()->mInfos.Iter(); !it2.Done(); it2.Next()) {
       ServiceWorkerRegistrationInfo* reg = it2.UserData();
       MOZ_ASSERT(reg);
 
       if (reg->mPendingUninstall) {
         continue;
       }
 
-      array->AppendElement(reg, false);
+      array->AppendElement(reg);
     }
   }
 
   array.forget(aResult);
   return NS_OK;
 }
 
 // MUST ONLY BE CALLED FROM Remove(), RemoveAll() and RemoveAllRegistrations()!
--- a/dom/xul/templates/nsXULTemplateBuilder.cpp
+++ b/dom/xul/templates/nsXULTemplateBuilder.cpp
@@ -1397,17 +1397,17 @@ nsXULTemplateBuilder::LoadDataSourceUrls
             // ok, the datasource is certainly a node of the current document
             nsCOMPtr<nsIDOMDocument> domdoc = do_QueryInterface(aDocument);
             nsCOMPtr<nsIDOMElement> dsnode;
 
             domdoc->GetElementById(Substring(uriStr, 1),
                                    getter_AddRefs(dsnode));
 
             if (dsnode)
-                uriList->AppendElement(dsnode, false);
+                uriList->AppendElement(dsnode);
             continue;
         }
 
         // N.B. that `failure' (e.g., because it's an unknown
         // protocol) leaves uriStr unaltered.
         NS_MakeAbsoluteURI(uriStr, uriStr, docurl);
 
         nsCOMPtr<nsIURI> uri;
@@ -1415,17 +1415,17 @@ nsXULTemplateBuilder::LoadDataSourceUrls
         if (NS_FAILED(rv) || !uri)
             continue; // Necko will barf if our URI is weird
 
         // don't add the uri to the list if the document is not allowed to
         // load it
         if (!isTrusted && NS_FAILED(docPrincipal->CheckMayLoad(uri, true, false)))
           continue;
 
-        uriList->AppendElement(uri, false);
+        uriList->AppendElement(uri);
     }
 
     nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(mRoot);
     rv = mQueryProcessor->GetDatasource(uriList,
                                         rootNode,
                                         isTrusted,
                                         this,
                                         aShouldDelayBuilding,
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -2760,17 +2760,17 @@ HTMLEditor::GetLinkedObjects(nsIArray** 
     // loop through the content iterator for each content node
     while (!iter->IsDone()) {
       nsCOMPtr<nsIDOMNode> node (do_QueryInterface(iter->GetCurrentNode()));
       if (node) {
         // Let nsURIRefObject make the hard decisions:
         nsCOMPtr<nsIURIRefObject> refObject;
         rv = NS_NewHTMLURIRefObject(getter_AddRefs(refObject), node);
         if (NS_SUCCEEDED(rv)) {
-          nodes->AppendElement(refObject, false);
+          nodes->AppendElement(refObject);
         }
       }
       iter->Next();
     }
   }
 
   nodes.forget(aNodeList);
   return NS_OK;
@@ -3055,17 +3055,17 @@ HTMLEditor::GetEmbeddedObjects(nsIArray*
 
       // See if it's an image or an embed and also include all links.
       // Let mail decide which link to send or not
       if (element->IsAnyOfHTMLElements(nsGkAtoms::img, nsGkAtoms::embed,
                                        nsGkAtoms::a) ||
           (element->IsHTMLElement(nsGkAtoms::body) &&
            element->HasAttr(kNameSpaceID_None, nsGkAtoms::background))) {
         nsCOMPtr<nsIDOMNode> domNode = do_QueryInterface(node);
-        nodes->AppendElement(domNode, false);
+        nodes->AppendElement(domNode);
        }
      }
      iter->Next();
    }
 
   nodes.forget(aNodeList);
   return rv;
 }
--- a/intl/strres/nsStringBundle.cpp
+++ b/intl/strres/nsStringBundle.cpp
@@ -227,17 +227,17 @@ nsStringBundle::GetCombinedEnumeration(n
 
   bool hasMore;
   rv = overrideEnumerator->HasMoreElements(&hasMore);
   NS_ENSURE_SUCCESS(rv, rv);
   while (hasMore) {
 
     rv = overrideEnumerator->GetNext(getter_AddRefs(supports));
     if (NS_SUCCEEDED(rv))
-      resultArray->AppendElement(supports, false);
+      resultArray->AppendElement(supports);
 
     rv = overrideEnumerator->HasMoreElements(&hasMore);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   // ok, now we have the override elements in resultArray
   nsCOMPtr<nsISimpleEnumerator> propEnumerator;
   rv = mProps->Enumerate(getter_AddRefs(propEnumerator));
@@ -256,17 +256,17 @@ nsStringBundle::GetCombinedEnumeration(n
       nsAutoCString key;
       propElement->GetKey(key);
 
       nsAutoString value;
       rv = aOverrideStrings->GetStringFromName(mPropertiesURL, key, value);
 
       // if it isn't there, then it is safe to append
       if (NS_FAILED(rv))
-        resultArray->AppendElement(propElement, false);
+        resultArray->AppendElement(propElement);
     }
 
     rv = propEnumerator->HasMoreElements(&hasMore);
     NS_ENSURE_SUCCESS(rv, rv);
   } while (hasMore);
 
   return resultArray->Enumerate(aResult);
 }
--- a/layout/inspector/inDOMUtils.cpp
+++ b/layout/inspector/inDOMUtils.cpp
@@ -254,17 +254,17 @@ inDOMUtils::GetCSSStyleRules(nsIDOMEleme
       ruleNode = ruleNode->GetParent();
     }
 
     for (nsRuleNode* ruleNode : Reversed(ruleNodes)) {
       RefPtr<Declaration> decl = do_QueryObject(ruleNode->GetRule());
       if (decl) {
         css::Rule* owningRule = decl->GetOwningRule();
         if (owningRule) {
-          rules->AppendElement(owningRule, /*weak =*/ false);
+          rules->AppendElement(owningRule);
         }
       }
     }
   } else {
     nsIDocument* doc = element->GetOwnerDocument();
     nsIPresShell* shell = doc->GetShell();
     if (!shell) {
       return NS_OK;
@@ -305,17 +305,17 @@ inDOMUtils::GetCSSStyleRules(nsIDOMEleme
       ServoStyleRule* rule = nullptr;
       for (ServoStyleRuleMap* map : maps) {
         rule = map->Lookup(rawRule);
         if (rule) {
           break;
         }
       }
       if (rule) {
-        rules->AppendElement(static_cast<css::Rule*>(rule), false);
+        rules->AppendElement(static_cast<css::Rule*>(rule));
       } else {
         MOZ_ASSERT_UNREACHABLE("We should be able to map a raw rule to a rule");
       }
     }
   }
 
   rules.forget(_retval);
 
@@ -1065,17 +1065,17 @@ inDOMUtils::GetBindingURLs(nsIDOMElement
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
   NS_ENSURE_ARG_POINTER(content);
 
   nsXBLBinding *binding = content->GetXBLBinding();
 
   while (binding) {
-    urls->AppendElement(binding->PrototypeBinding()->BindingURI(), false);
+    urls->AppendElement(binding->PrototypeBinding()->BindingURI());
     binding = binding->GetBaseBinding();
   }
 
   urls.forget(_retval);
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/netwerk/base/BackgroundFileSaver.cpp
+++ b/netwerk/base/BackgroundFileSaver.cpp
@@ -291,17 +291,17 @@ BackgroundFileSaver::GetSignatureInfo(ns
   MOZ_ASSERT(NS_IsMainThread(), "Can't inspect signature off the main thread");
   // We acquire a lock because mSignatureInfo is written on the worker thread.
   MutexAutoLock lock(mLock);
   if (!mComplete || !mSignatureInfoEnabled) {
     return NS_ERROR_NOT_AVAILABLE;
   }
   nsCOMPtr<nsIMutableArray> sigArray = do_CreateInstance(NS_ARRAY_CONTRACTID);
   for (int i = 0; i < mSignatureInfo.Count(); ++i) {
-    sigArray->AppendElement(mSignatureInfo[i], false);
+    sigArray->AppendElement(mSignatureInfo[i]);
   }
   *aSignatureInfo = sigArray;
   NS_IF_ADDREF(*aSignatureInfo);
   return NS_OK;
 }
 
 // Called on the control thread.
 nsresult
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -2290,17 +2290,17 @@ nsCookieService::NotifyChanged(nsISuppor
   os->NotifyObservers(aSubject, "session-cookie-changed", aData);
 }
 
 already_AddRefed<nsIArray>
 nsCookieService::CreatePurgeList(nsICookie2* aCookie)
 {
   nsCOMPtr<nsIMutableArray> removedList =
     do_CreateInstance(NS_ARRAY_CONTRACTID);
-  removedList->AppendElement(aCookie, false);
+  removedList->AppendElement(aCookie);
   return removedList.forget();
 }
 
 /******************************************************************************
  * nsCookieService:
  * public transaction helper impl
  ******************************************************************************/
 
@@ -4605,17 +4605,17 @@ nsCookieService::PurgeCookies(int64_t aC
 
     const nsCookieEntry::ArrayType &cookies = entry->GetCookies();
     for (nsCookieEntry::IndexType i = 0; i < cookies.Length(); ) {
       nsListIter iter(entry, i);
       nsCookie* cookie = cookies[i];
 
       // check if the cookie has expired
       if (cookie->Expiry() <= currentTime) {
-        removedList->AppendElement(cookie, false);
+        removedList->AppendElement(cookie);
         COOKIE_LOGEVICTED(cookie, "Cookie expired");
 
         // remove from list; do not increment our iterator
         gCookieService->RemoveCookieFromList(iter, paramsArray);
 
       } else {
         // check if the cookie is over the age limit
         if (cookie->LastAccessed() <= purgeTime) {
@@ -4648,17 +4648,17 @@ nsCookieService::PurgeCookies(int64_t aC
   }
 
   // sort the list again, this time grouping cookies with a common entryclass
   // together, and with ascending index. this allows us to iterate backwards
   // over the list removing cookies, without having to adjust indexes as we go.
   purgeList.Sort(CompareCookiesByIndex());
   for (PurgeList::index_type i = purgeList.Length(); i--; ) {
     nsCookie *cookie = purgeList[i].Cookie();
-    removedList->AppendElement(cookie, false);
+    removedList->AppendElement(cookie);
     COOKIE_LOGEVICTED(cookie, "Cookie too old");
 
     RemoveCookieFromList(purgeList[i], paramsArray);
   }
 
   // Update the database if we have entries to purge.
   if (paramsArray) {
     uint32_t length;
--- a/security/manager/pki/nsNSSDialogs.cpp
+++ b/security/manager/pki/nsNSSDialogs.cpp
@@ -105,23 +105,23 @@ nsNSSDialogs::ConfirmDownloadCACert(nsII
   NS_ENSURE_ARG(trust);
   NS_ENSURE_ARG(importConfirmed);
 
   nsCOMPtr<nsIMutableArray> argArray = nsArrayBase::Create();
   if (!argArray) {
     return NS_ERROR_FAILURE;
   }
 
-  nsresult rv = argArray->AppendElement(cert, false);
+  nsresult rv = argArray->AppendElement(cert);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   nsCOMPtr<nsIWritablePropertyBag2> retVals = new nsHashPropertyBag();
-  rv = argArray->AppendElement(retVals, false);
+  rv = argArray->AppendElement(retVals);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   // Get the parent window for the dialog
   nsCOMPtr<mozIDOMWindowProxy> parent = do_GetInterface(ctx);
   rv = nsNSSDialogHelper::openDialog(parent,
                                      "chrome://pippki/content/downloadcert.xul",
@@ -189,58 +189,58 @@ nsNSSDialogs::ChooseCertificate(nsIInter
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIWritableVariant> hostnameVariant = new nsVariant();
   nsresult rv = hostnameVariant->SetAsAUTF8String(hostname);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  rv = argArray->AppendElement(hostnameVariant, false);
+  rv = argArray->AppendElement(hostnameVariant);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   nsCOMPtr<nsIWritableVariant> organizationVariant = new nsVariant();
   rv = organizationVariant->SetAsAUTF8String(organization);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  rv = argArray->AppendElement(organizationVariant, false);
+  rv = argArray->AppendElement(organizationVariant);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   nsCOMPtr<nsIWritableVariant> issuerOrgVariant = new nsVariant();
   rv = issuerOrgVariant->SetAsAUTF8String(issuerOrg);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  rv = argArray->AppendElement(issuerOrgVariant, false);
+  rv = argArray->AppendElement(issuerOrgVariant);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   nsCOMPtr<nsIWritableVariant> portVariant = new nsVariant();
   rv = portVariant->SetAsInt32(port);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  rv = argArray->AppendElement(portVariant, false);
+  rv = argArray->AppendElement(portVariant);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
-  rv = argArray->AppendElement(certList, false);
+  rv = argArray->AppendElement(certList);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   nsCOMPtr<nsIWritablePropertyBag2> retVals = new nsHashPropertyBag();
-  rv = argArray->AppendElement(retVals, false);
+  rv = argArray->AppendElement(retVals);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   rv = nsNSSDialogHelper::openDialog(nullptr,
                                      "chrome://pippki/content/clientauthask.xul",
                                      argArray);
   if (NS_FAILED(rv)) {
--- a/security/manager/ssl/PKCS11ModuleDB.cpp
+++ b/security/manager/ssl/PKCS11ModuleDB.cpp
@@ -197,27 +197,27 @@ PKCS11ModuleDB::ListModules(nsISimpleEnu
     return NS_ERROR_FAILURE;
   }
 
   /* lock down the list for reading */
   AutoSECMODListReadLock lock;
   for (SECMODModuleList* list = SECMOD_GetDefaultModuleList(); list;
        list = list->next) {
     nsCOMPtr<nsIPKCS11Module> module = new nsPKCS11Module(list->module);
-    nsresult rv = array->AppendElement(module, false);
+    nsresult rv = array->AppendElement(module);
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
 
   /* Get the modules in the database that didn't load */
   for (SECMODModuleList* list = SECMOD_GetDeadModuleList(); list;
        list = list->next) {
     nsCOMPtr<nsIPKCS11Module> module = new nsPKCS11Module(list->module);
-    nsresult rv = array->AppendElement(module, false);
+    nsresult rv = array->AppendElement(module);
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
 
   return array->Enumerate(_retval);
 }
 
--- a/security/manager/ssl/nsCertTree.cpp
+++ b/security/manager/ssl/nsCertTree.cpp
@@ -1116,17 +1116,17 @@ nsCertTree::GetCellText(int32_t row, nsI
     rv = mNSSComponent->GetPIPNSSBundleString(stringID, _retval);
   } else {
     return NS_ERROR_FAILURE;
   }
   if (mCellText) {
     nsCOMPtr<nsISupportsString> text(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv));
     NS_ENSURE_SUCCESS(rv, rv);
     text->SetData(_retval);
-    mCellText->ReplaceElementAt(text, arrayIndex, false);
+    mCellText->ReplaceElementAt(text, arrayIndex);
   }
   return rv;
 }
 
 NS_IMETHODIMP
 nsCertTree::SetTree(nsITreeBoxObject *tree)
 {
   mTree = tree;
--- a/security/manager/ssl/nsNSSASN1Object.cpp
+++ b/security/manager/ssl/nsNSSASN1Object.cpp
@@ -169,17 +169,17 @@ buildASN1ObjectFromDER(unsigned char *da
       printableItem = new nsNSSASN1PrintableItem();
 
       asn1Obj = printableItem;
       asn1Obj->SetType(tagnum);
       asn1Obj->SetTag(tagnum);
       printableItem->SetData((char*)data, len);
     }
     data += len;
-    parentObjects->AppendElement(asn1Obj, false);
+    parentObjects->AppendElement(asn1Obj);
   }
 
   return NS_OK;
 }
 
 nsresult
 CreateFromDER(unsigned char *data,
               unsigned int   len,
--- a/security/manager/ssl/nsNSSCertHelper.cpp
+++ b/security/manager/ssl/nsNSSCertHelper.cpp
@@ -1622,23 +1622,23 @@ ProcessSECAlgorithmID(SECAlgorithmID* al
     sequence->SetDisplayValue(text);
     sequence->SetIsValidContainer(false);
   } else {
     nsCOMPtr<nsIASN1PrintableItem> printableItem = new nsNSSASN1PrintableItem();
 
     printableItem->SetDisplayValue(text);
     nsCOMPtr<nsIMutableArray> asn1Objects;
     sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
-    asn1Objects->AppendElement(printableItem, false);
+    asn1Objects->AppendElement(printableItem);
     GetPIPNSSBundleString("CertDumpAlgID", text);
     printableItem->SetDisplayName(text);
 
     printableItem = new nsNSSASN1PrintableItem();
 
-    asn1Objects->AppendElement(printableItem, false);
+    asn1Objects->AppendElement(printableItem);
     GetPIPNSSBundleString("CertDumpParams", text);
     printableItem->SetDisplayName(text);
     if ((algOIDTag == SEC_OID_ANSIX962_EC_PUBLIC_KEY) &&
         (algID->parameters.len > 2) &&
         (algID->parameters.data[0] == nsIASN1Object::ASN1_OBJECT_ID)) {
       paramsOID.len = algID->parameters.len - 2;
       paramsOID.data = algID->parameters.data + 2;
       GetOIDText(&paramsOID, text);
@@ -1678,17 +1678,17 @@ ProcessTime(PRTime dispTime,
   text.AppendLiteral(" GMT)");
 
   nsCOMPtr<nsIASN1PrintableItem> printableItem = new nsNSSASN1PrintableItem();
 
   printableItem->SetDisplayValue(text);
   printableItem->SetDisplayName(nsDependentString(displayName));
   nsCOMPtr<nsIMutableArray> asn1Objects;
   parentSequence->GetASN1Objects(getter_AddRefs(asn1Objects));
-  asn1Objects->AppendElement(printableItem, false);
+  asn1Objects->AppendElement(printableItem);
   return NS_OK;
 }
 
 static nsresult
 ProcessSubjectPublicKeyInfo(CERTSubjectPublicKeyInfo* spki,
                             nsIASN1Sequence* parentSequence)
 {
   nsCOMPtr<nsIASN1Sequence> spkiSequence = new nsNSSASN1Sequence();
@@ -1701,17 +1701,17 @@ ProcessSubjectPublicKeyInfo(CERTSubjectP
   nsCOMPtr<nsIASN1Sequence> sequenceItem;
   nsresult rv = ProcessSECAlgorithmID(
     &spki->algorithm, getter_AddRefs(sequenceItem));
   if (NS_FAILED(rv))
     return rv;
   sequenceItem->SetDisplayName(text);
   nsCOMPtr<nsIMutableArray> asn1Objects;
   spkiSequence->GetASN1Objects(getter_AddRefs(asn1Objects));
-  asn1Objects->AppendElement(sequenceItem, false);
+  asn1Objects->AppendElement(sequenceItem);
 
   nsCOMPtr<nsIASN1PrintableItem> printableItem = new nsNSSASN1PrintableItem();
 
   text.Truncate();
 
   UniqueSECKEYPublicKey key(SECKEY_ExtractPublicKey(spki));
   bool displayed = false;
   if (key) {
@@ -1764,20 +1764,20 @@ ProcessSubjectPublicKeyInfo(CERTSubjectP
     data.data = spki->subjectPublicKey.data;
     data.len = spki->subjectPublicKey.len / 8;
     ProcessRawBytes(&data, text);
   }
 
   printableItem->SetDisplayValue(text);
   GetPIPNSSBundleString("CertDumpSubjPubKey", text);
   printableItem->SetDisplayName(text);
-  asn1Objects->AppendElement(printableItem, false);
+  asn1Objects->AppendElement(printableItem);
 
   parentSequence->GetASN1Objects(getter_AddRefs(asn1Objects));
-  asn1Objects->AppendElement(spkiSequence, false);
+  asn1Objects->AppendElement(spkiSequence);
   return NS_OK;
 }
 
 static nsresult
 ProcessExtensions(CERTCertExtension** extensions,
                   nsIASN1Sequence* parentSequence)
 {
   nsCOMPtr<nsIASN1Sequence> extensionSequence = new nsNSSASN1Sequence;
@@ -1791,20 +1791,20 @@ ProcessExtensions(CERTCertExtension** ex
   nsCOMPtr<nsIMutableArray> asn1Objects;
   extensionSequence->GetASN1Objects(getter_AddRefs(asn1Objects));
   for (i = 0; extensions[i] != nullptr; i++) {
     rv = ProcessSingleExtension(
       extensions[i], getter_AddRefs(newExtension));
     if (NS_FAILED(rv))
       return rv;
 
-    asn1Objects->AppendElement(newExtension, false);
+    asn1Objects->AppendElement(newExtension);
   }
   parentSequence->GetASN1Objects(getter_AddRefs(asn1Objects));
-  asn1Objects->AppendElement(extensionSequence, false);
+  asn1Objects->AppendElement(extensionSequence);
   return NS_OK;
 }
 
 static bool registered;
 static SECStatus
 RegisterDynamicOids()
 {
   unsigned int i;
@@ -1864,46 +1864,46 @@ nsNSSCertificate::CreateTBSCertificateAS
 
   nsCOMPtr<nsIMutableArray> asn1Objects;
   sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
 
   nsresult rv = ProcessVersion(&mCert->version, getter_AddRefs(printableItem));
   if (NS_FAILED(rv))
     return rv;
 
-  asn1Objects->AppendElement(printableItem, false);
+  asn1Objects->AppendElement(printableItem);
 
   rv = ProcessSerialNumberDER(mCert->serialNumber, printableItem);
   if (NS_FAILED(rv))
     return rv;
-  asn1Objects->AppendElement(printableItem, false);
+  asn1Objects->AppendElement(printableItem);
 
   nsCOMPtr<nsIASN1Sequence> algID;
   rv = ProcessSECAlgorithmID(&mCert->signature, getter_AddRefs(algID));
   if (NS_FAILED(rv))
     return rv;
 
   GetPIPNSSBundleString("CertDumpSigAlg", text);
   algID->SetDisplayName(text);
-  asn1Objects->AppendElement(algID, false);
+  asn1Objects->AppendElement(algID);
 
   nsString value;
   ProcessName(&mCert->issuer, getter_Copies(value));
 
   printableItem = new nsNSSASN1PrintableItem();
 
   printableItem->SetDisplayValue(value);
   GetPIPNSSBundleString("CertDumpIssuer", text);
   printableItem->SetDisplayName(text);
-  asn1Objects->AppendElement(printableItem, false);
+  asn1Objects->AppendElement(printableItem);
 
   nsCOMPtr<nsIASN1Sequence> validitySequence = new nsNSSASN1Sequence();
   GetPIPNSSBundleString("CertDumpValidity", text);
   validitySequence->SetDisplayName(text);
-  asn1Objects->AppendElement(validitySequence, false);
+  asn1Objects->AppendElement(validitySequence);
   GetPIPNSSBundleString("CertDumpNotBefore", text);
   nsCOMPtr<nsIX509CertValidity> validityData;
   GetValidity(getter_AddRefs(validityData));
   PRTime notBefore, notAfter;
 
   validityData->GetNotBefore(&notBefore);
   validityData->GetNotAfter(&notAfter);
   validityData = nullptr;
@@ -1918,17 +1918,17 @@ nsNSSCertificate::CreateTBSCertificateAS
 
   GetPIPNSSBundleString("CertDumpSubject", text);
 
   printableItem = new nsNSSASN1PrintableItem();
 
   printableItem->SetDisplayName(text);
   ProcessName(&mCert->subject, getter_Copies(value));
   printableItem->SetDisplayValue(value);
-  asn1Objects->AppendElement(printableItem, false);
+  asn1Objects->AppendElement(printableItem);
 
   rv = ProcessSubjectPublicKeyInfo(&mCert->subjectPublicKeyInfo, sequence);
   if (NS_FAILED(rv))
     return rv;
 
   SECItem data;
   // Is there an issuerUniqueID?
   if (mCert->issuerID.data) {
@@ -1940,34 +1940,34 @@ nsNSSCertificate::CreateTBSCertificateAS
     data.len = (mCert->issuerID.len + 7) / 8;
 
     ProcessRawBytes(&data, text);
     printableItem = new nsNSSASN1PrintableItem();
 
     printableItem->SetDisplayValue(text);
     GetPIPNSSBundleString("CertDumpIssuerUniqueID", text);
     printableItem->SetDisplayName(text);
-    asn1Objects->AppendElement(printableItem, false);
+    asn1Objects->AppendElement(printableItem);
   }
 
   if (mCert->subjectID.data) {
     // The subjectID is encoded as a bit string.
     // The function ProcessRawBytes expects the
     // length to be in bytes, so let's convert the
     // length in a temporary SECItem
     data.data = mCert->subjectID.data;
     data.len = (mCert->subjectID.len + 7) / 8;
 
     ProcessRawBytes(&data, text);
     printableItem = new nsNSSASN1PrintableItem();
 
     printableItem->SetDisplayValue(text);
     GetPIPNSSBundleString("CertDumpSubjectUniqueID", text);
     printableItem->SetDisplayName(text);
-    asn1Objects->AppendElement(printableItem, false);
+    asn1Objects->AppendElement(printableItem);
   }
   if (mCert->extensions) {
     rv = ProcessExtensions(mCert->extensions, sequence);
     if (NS_FAILED(rv))
       return rv;
   }
   sequence.forget(retSequence);
   return NS_OK;
@@ -1998,41 +1998,41 @@ nsNSSCertificate::CreateASN1Struct(nsIAS
   sequence.forget(aRetVal);
 
   // This sequence will be contain the tbsCertificate, signatureAlgorithm,
   // and signatureValue.
   rv = CreateTBSCertificateASN1Struct(getter_AddRefs(sequence));
   if (NS_FAILED(rv))
     return rv;
 
-  asn1Objects->AppendElement(sequence, false);
+  asn1Objects->AppendElement(sequence);
   nsCOMPtr<nsIASN1Sequence> algID;
 
   rv = ProcessSECAlgorithmID(&mCert->signatureWrap.signatureAlgorithm,
                              getter_AddRefs(algID));
   if (NS_FAILED(rv))
     return rv;
   nsString text;
   GetPIPNSSBundleString("CertDumpSigAlg", text);
   algID->SetDisplayName(text);
-  asn1Objects->AppendElement(algID, false);
+  asn1Objects->AppendElement(algID);
   nsCOMPtr<nsIASN1PrintableItem> printableItem = new nsNSSASN1PrintableItem();
   GetPIPNSSBundleString("CertDumpCertSig", text);
   printableItem->SetDisplayName(text);
   // The signatureWrap is encoded as a bit string.
   // The function ProcessRawBytes expects the
   // length to be in bytes, so let's convert the
   // length in a temporary SECItem
   SECItem temp;
   temp.data = mCert->signatureWrap.signature.data;
   temp.len = mCert->signatureWrap.signature.len / 8;
   text.Truncate();
   ProcessRawBytes(&temp, text);
   printableItem->SetDisplayValue(text);
-  asn1Objects->AppendElement(printableItem, false);
+  asn1Objects->AppendElement(printableItem);
   return NS_OK;
 }
 
 uint32_t
 getCertType(CERTCertificate* cert)
 {
   nsNSSCertTrust trust(cert->trust);
   if (cert->nickname && trust.HasAnyUser())
--- a/security/manager/ssl/nsNSSCertificate.cpp
+++ b/security/manager/ssl/nsNSSCertificate.cpp
@@ -709,17 +709,17 @@ nsNSSCertificate::GetChain(nsIArray** _r
   if (!array) {
     return NS_ERROR_FAILURE;
   }
   CERTCertListNode* node;
   for (node = CERT_LIST_HEAD(nssChain.get());
        !CERT_LIST_END(node, nssChain.get());
        node = CERT_LIST_NEXT(node)) {
     nsCOMPtr<nsIX509Cert> cert = nsNSSCertificate::Create(node->cert);
-    array->AppendElement(cert, false);
+    array->AppendElement(cert);
   }
   *_rvChain = array;
   NS_IF_ADDREF(*_rvChain);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNSSCertificate::GetSubjectName(nsAString& _subjectName)
--- a/security/manager/ssl/nsNSSCertificateDB.cpp
+++ b/security/manager/ssl/nsNSSCertificateDB.cpp
@@ -468,17 +468,17 @@ nsNSSCertificateDB::ImportCertificates(u
   // Now let's create some certs to work with
   for (int i = 0; i < certCollection->numcerts; i++) {
     SECItem* currItem = &certCollection->rawCerts[i];
     nsCOMPtr<nsIX509Cert> cert = nsNSSCertificate::ConstructFromDER(
       BitwiseCast<char*, unsigned char*>(currItem->data), currItem->len);
     if (!cert) {
       return NS_ERROR_FAILURE;
     }
-    nsresult rv = array->AppendElement(cert, false);
+    nsresult rv = array->AppendElement(cert);
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
 
   return handleCACertDownload(WrapNotNull(array), ctx, locker);
 }
 
--- a/security/manager/ssl/nsNSSIOLayer.cpp
+++ b/security/manager/ssl/nsNSSIOLayer.cpp
@@ -2415,17 +2415,17 @@ ClientAuthDataRunnable::RunOnTargetThrea
       for (CERTCertListNode* node = CERT_LIST_HEAD(certList);
            !CERT_LIST_END(node, certList);
            node = CERT_LIST_NEXT(node)) {
         nsCOMPtr<nsIX509Cert> tempCert = nsNSSCertificate::Create(node->cert);
         if (!tempCert) {
           goto loser;
         }
 
-        rv = certArray->AppendElement(tempCert, false);
+        rv = certArray->AppendElement(tempCert);
         if (NS_FAILED(rv)) {
           goto loser;
         }
       }
 
       // Throw up the client auth dialog and get back the index of the selected cert
       rv = getNSSDialogs(getter_AddRefs(dialogs),
                          NS_GET_IID(nsIClientAuthDialogs),
--- a/security/manager/ssl/nsPKCS11Slot.cpp
+++ b/security/manager/ssl/nsPKCS11Slot.cpp
@@ -346,17 +346,17 @@ nsPKCS11Module::ListSlots(nsISimpleEnume
   /* applications which allow new slot creation (which Firefox now does
    * since it uses the WaitForSlotEvent call) need to hold the
    * ModuleList Read lock to prevent the slot array from changing out
    * from under it. */
   AutoSECMODListReadLock lock;
   for (int i = 0; i < mModule->slotCount; i++) {
     if (mModule->slots[i]) {
       nsCOMPtr<nsIPKCS11Slot> slot = new nsPKCS11Slot(mModule->slots[i]);
-      nsresult rv = array->AppendElement(slot, false);
+      nsresult rv = array->AppendElement(slot);
       if (NS_FAILED(rv)) {
         return rv;
       }
     }
   }
 
   return array->Enumerate(_retval);
 }
--- a/toolkit/components/alerts/nsXULAlerts.cpp
+++ b/toolkit/components/alerts/nsXULAlerts.cpp
@@ -230,121 +230,121 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAle
 
   nsCOMPtr<nsIMutableArray> argsArray = nsArray::Create();
 
   // create scriptable versions of our strings that we can store in our nsIMutableArray....
   nsCOMPtr<nsISupportsString> scriptableImageUrl (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
   NS_ENSURE_TRUE(scriptableImageUrl, NS_ERROR_FAILURE);
 
   scriptableImageUrl->SetData(imageUrl);
-  rv = argsArray->AppendElement(scriptableImageUrl, /*weak =*/ false);
+  rv = argsArray->AppendElement(scriptableImageUrl);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupportsString> scriptableAlertTitle (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
   NS_ENSURE_TRUE(scriptableAlertTitle, NS_ERROR_FAILURE);
 
   scriptableAlertTitle->SetData(title);
-  rv = argsArray->AppendElement(scriptableAlertTitle, /*weak =*/ false);
+  rv = argsArray->AppendElement(scriptableAlertTitle);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupportsString> scriptableAlertText (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
   NS_ENSURE_TRUE(scriptableAlertText, NS_ERROR_FAILURE);
 
   scriptableAlertText->SetData(text);
-  rv = argsArray->AppendElement(scriptableAlertText, /*weak =*/ false);
+  rv = argsArray->AppendElement(scriptableAlertText);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupportsPRBool> scriptableIsClickable (do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID));
   NS_ENSURE_TRUE(scriptableIsClickable, NS_ERROR_FAILURE);
 
   scriptableIsClickable->SetData(textClickable);
-  rv = argsArray->AppendElement(scriptableIsClickable, /*weak =*/ false);
+  rv = argsArray->AppendElement(scriptableIsClickable);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupportsString> scriptableAlertCookie (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
   NS_ENSURE_TRUE(scriptableAlertCookie, NS_ERROR_FAILURE);
 
   scriptableAlertCookie->SetData(cookie);
-  rv = argsArray->AppendElement(scriptableAlertCookie, /*weak =*/ false);
+  rv = argsArray->AppendElement(scriptableAlertCookie);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupportsPRInt32> scriptableOrigin (do_CreateInstance(NS_SUPPORTS_PRINT32_CONTRACTID));
   NS_ENSURE_TRUE(scriptableOrigin, NS_ERROR_FAILURE);
 
   int32_t origin =
     LookAndFeel::GetInt(LookAndFeel::eIntID_AlertNotificationOrigin);
   scriptableOrigin->SetData(origin);
 
-  rv = argsArray->AppendElement(scriptableOrigin, /*weak =*/ false);
+  rv = argsArray->AppendElement(scriptableOrigin);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupportsString> scriptableBidi (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
   NS_ENSURE_TRUE(scriptableBidi, NS_ERROR_FAILURE);
 
   scriptableBidi->SetData(bidi);
-  rv = argsArray->AppendElement(scriptableBidi, /*weak =*/ false);
+  rv = argsArray->AppendElement(scriptableBidi);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupportsString> scriptableLang (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
   NS_ENSURE_TRUE(scriptableLang, NS_ERROR_FAILURE);
 
   scriptableLang->SetData(lang);
-  rv = argsArray->AppendElement(scriptableLang, /*weak =*/ false);
+  rv = argsArray->AppendElement(scriptableLang);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupportsPRBool> scriptableRequireInteraction (do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID));
   NS_ENSURE_TRUE(scriptableRequireInteraction, NS_ERROR_FAILURE);
 
   scriptableRequireInteraction->SetData(requireInteraction);
-  rv = argsArray->AppendElement(scriptableRequireInteraction, /*weak =*/ false);
+  rv = argsArray->AppendElement(scriptableRequireInteraction);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Alerts with the same name should replace the old alert in the same position.
   // Provide the new alert window with a pointer to the replaced window so that
   // it may take the same position.
   nsCOMPtr<nsISupportsInterfacePointer> replacedWindow = do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
   NS_ENSURE_TRUE(replacedWindow, NS_ERROR_FAILURE);
   mozIDOMWindowProxy* previousAlert = mNamedWindows.GetWeak(name);
   replacedWindow->SetData(previousAlert);
   replacedWindow->SetDataIID(&NS_GET_IID(mozIDOMWindowProxy));
-  rv = argsArray->AppendElement(replacedWindow, /*weak =*/ false);
+  rv = argsArray->AppendElement(replacedWindow);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (requireInteraction) {
     mPersistentAlertCount++;
   }
 
   // Add an observer (that wraps aAlertListener) to remove the window from
   // mNamedWindows when it is closed.
   nsCOMPtr<nsISupportsInterfacePointer> ifptr = do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   RefPtr<nsXULAlertObserver> alertObserver = new nsXULAlertObserver(this, name, aAlertListener, requireInteraction);
   nsCOMPtr<nsISupports> iSupports(do_QueryInterface(alertObserver));
   ifptr->SetData(iSupports);
   ifptr->SetDataIID(&NS_GET_IID(nsIObserver));
-  rv = argsArray->AppendElement(ifptr, /*weak =*/ false);
+  rv = argsArray->AppendElement(ifptr);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // The source contains the host and port of the site that sent the
   // notification. It is empty for system alerts.
   nsCOMPtr<nsISupportsString> scriptableAlertSource (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
   NS_ENSURE_TRUE(scriptableAlertSource, NS_ERROR_FAILURE);
   scriptableAlertSource->SetData(source);
-  rv = argsArray->AppendElement(scriptableAlertSource, /*weak =*/ false);
+  rv = argsArray->AppendElement(scriptableAlertSource);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupportsCString> scriptableIconURL (do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID));
   NS_ENSURE_TRUE(scriptableIconURL, NS_ERROR_FAILURE);
   if (aIconURI) {
     nsAutoCString iconURL;
     rv = aIconURI->GetSpec(iconURL);
     NS_ENSURE_SUCCESS(rv, rv);
     scriptableIconURL->SetData(iconURL);
   }
-  rv = argsArray->AppendElement(scriptableIconURL, /*weak =*/ false);
+  rv = argsArray->AppendElement(scriptableIconURL);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<mozIDOMWindowProxy> newWindow;
   nsAutoCString features("chrome,dialog=yes,titlebar=no,popup=yes");
   if (inPrivateBrowsing) {
     features.AppendLiteral(",private");
   }
   rv = wwatch->OpenWindow(nullptr, ALERT_CHROME_URL, "_blank", features.get(),
--- a/toolkit/components/feeds/FeedProcessor.js
+++ b/toolkit/components/feeds/FeedProcessor.js
@@ -1578,17 +1578,17 @@ FeedProcessor.prototype = {
 
     // If an nsIFeedContainer was on top of the stack,
     // we need to normalize it
     if (elementInfo.containerClass == Cc[ENTRY_CONTRACTID])
       containerParent.normalize();
 
     // If it's an array, re-set the last element
     if (isArray)
-      container.replaceElementAt(element, container.length - 1, false);
+      container.replaceElementAt(element, container.length - 1);
   },
 
   _prefixForNS: function FP_prefixForNS(uri) {
     if (!uri)
       return "";
     var prefix = gNamespaces[uri];
     if (prefix)
       return prefix + ":";
--- a/toolkit/components/perfmonitoring/nsPerformanceStats.cpp
+++ b/toolkit/components/perfmonitoring/nsPerformanceStats.cpp
@@ -460,17 +460,17 @@ NS_IMPL_ISUPPORTS(nsPerformanceSnapshot,
 /* nsIArray getComponentsData (); */
 NS_IMETHODIMP
 nsPerformanceSnapshot::GetComponentsData(nsIArray * *aComponents)
 {
   const size_t length = mComponentsData.Length();
   nsCOMPtr<nsIMutableArray> components = do_CreateInstance(NS_ARRAY_CONTRACTID);
   for (size_t i = 0; i < length; ++i) {
     nsCOMPtr<nsIPerformanceStats> stats = mComponentsData[i];
-    mozilla::DebugOnly<nsresult> rv = components->AppendElement(stats, false);
+    mozilla::DebugOnly<nsresult> rv = components->AppendElement(stats);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
   }
   components.forget(aComponents);
   return NS_OK;
 }
 
 /* nsIPerformanceStats getProcessData (); */
 NS_IMETHODIMP
--- a/toolkit/components/printingui/unixshared/nsPrintProgress.cpp
+++ b/toolkit/components/printingui/unixshared/nsPrintProgress.cpp
@@ -65,19 +65,19 @@ NS_IMETHODIMP nsPrintProgress::OpenProgr
 
     nsCOMPtr<nsISupportsInterfacePointer> ifptr =
       do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     ifptr->SetData(static_cast<nsIPrintProgress*>(this));
     ifptr->SetDataIID(&NS_GET_IID(nsIPrintProgress));
 
-    array->AppendElement(ifptr, /*weak =*/ false);
+    array->AppendElement(ifptr);
 
-    array->AppendElement(parameters, /*weak =*/ false);
+    array->AppendElement(parameters);
 
     // We will set the opener of the dialog to be the nsIDOMWindow for the
     // browser XUL window itself, as opposed to the content. That way, the
     // progress window has access to the opener.
     auto* pParentWindow = nsPIDOMWindowOuter::From(parent);
     nsCOMPtr<nsIDocShell> docShell = pParentWindow->GetDocShell();
     NS_ENSURE_STATE(docShell);
 
--- a/toolkit/components/printingui/unixshared/nsPrintingPromptService.cpp
+++ b/toolkit/components/printingui/unixshared/nsPrintingPromptService.cpp
@@ -209,27 +209,27 @@ nsPrintingPromptService::DoDialog(mozIDO
     }
 
     // create a nsIMutableArray of the parameters
     // being passed to the window
     nsCOMPtr<nsIMutableArray> array = nsArray::Create();
 
     nsCOMPtr<nsISupports> psSupports(do_QueryInterface(aPS));
     NS_ASSERTION(psSupports, "PrintSettings must be a supports");
-    array->AppendElement(psSupports, /*weak =*/ false);
+    array->AppendElement(psSupports);
 
     if (aWebBrowserPrint) {
       nsCOMPtr<nsISupports> wbpSupports(do_QueryInterface(aWebBrowserPrint));
       NS_ASSERTION(wbpSupports, "nsIWebBrowserPrint must be a supports");
-      array->AppendElement(wbpSupports, /*weak =*/ false);
+      array->AppendElement(wbpSupports);
     }
 
     nsCOMPtr<nsISupports> blkSupps(do_QueryInterface(aParamBlock));
     NS_ASSERTION(blkSupps, "IOBlk must be a supports");
-    array->AppendElement(blkSupps, /*weak =*/ false);
+    array->AppendElement(blkSupps);
 
     nsCOMPtr<mozIDOMWindowProxy> dialog;
     nsresult rv = mWatcher->OpenWindow(aParent, aChromeURL, "_blank",
                               "centerscreen,chrome,modal,titlebar", array,
                               getter_AddRefs(dialog));
 
     // if aWebBrowserPrint is not null then we are printing
     // so we want to pass back NS_ERROR_ABORT on cancel
--- a/toolkit/components/printingui/win/nsPrintProgress.cpp
+++ b/toolkit/components/printingui/win/nsPrintProgress.cpp
@@ -93,19 +93,19 @@ NS_IMETHODIMP nsPrintProgress::OpenProgr
 
     nsCOMPtr<nsISupportsInterfacePointer> ifptr =
       do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     ifptr->SetData(static_cast<nsIPrintProgress*>(this));
     ifptr->SetDataIID(&NS_GET_IID(nsIPrintProgress));
 
-    array->AppendElement(ifptr, /*weak =*/ false);
+    array->AppendElement(ifptr);
 
-    array->AppendElement(parameters, /*weak = */ false);
+    array->AppendElement(parameters);
 
     // We will set the opener of the dialog to be the nsIDOMWindow for the
     // browser XUL window itself, as opposed to the content. That way, the
     // progress window has access to the opener.
     nsCOMPtr<nsPIDOMWindowOuter> pParentWindow = nsPIDOMWindowOuter::From(parent);
     NS_ENSURE_STATE(pParentWindow);
 
     nsCOMPtr<nsIDocShell> docShell = pParentWindow->GetDocShell();
--- a/toolkit/components/printingui/win/nsPrintingPromptService.cpp
+++ b/toolkit/components/printingui/win/nsPrintingPromptService.cpp
@@ -259,21 +259,21 @@ nsPrintingPromptService::DoDialog(mozIDO
     }
 
     // create a nsIMutableArray of the parameters
     // being passed to the window
     nsCOMPtr<nsIMutableArray> array = nsArray::Create();
 
     nsCOMPtr<nsISupports> psSupports(do_QueryInterface(aPS));
     NS_ASSERTION(psSupports, "PrintSettings must be a supports");
-    array->AppendElement(psSupports, /*weak =*/ false);
+    array->AppendElement(psSupports);
 
     nsCOMPtr<nsISupports> blkSupps(do_QueryInterface(aParamBlock));
     NS_ASSERTION(blkSupps, "IOBlk must be a supports");
-    array->AppendElement(blkSupps, /*weak =*/ false);
+    array->AppendElement(blkSupps);
 
     nsCOMPtr<mozIDOMWindowProxy> dialog;
     nsresult rv = mWatcher->OpenWindow(aParent, aChromeURL, "_blank",
                               "centerscreen,chrome,modal,titlebar", array,
                               getter_AddRefs(dialog));
 
     return rv;
 }
--- a/toolkit/components/url-classifier/nsUrlClassifierInfo.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierInfo.cpp
@@ -61,17 +61,17 @@ nsUrlClassifierCacheEntry::GetMatches(ns
 {
   if (!aMatches) {
     return NS_ERROR_NULL_POINTER;
   }
 
   nsCOMPtr<nsIMutableArray> array(do_CreateInstance(NS_ARRAY_CONTRACTID));
 
   for (uint32_t i = 0;i < matches.Length(); i++) {
-    array->AppendElement(matches[i], false);
+    array->AppendElement(matches[i]);
   }
 
   NS_ADDREF(*aMatches = array);
 
   return NS_OK;
 }
 
 NS_IMPL_ISUPPORTS(nsUrlClassifierCacheInfo,
@@ -93,15 +93,15 @@ nsUrlClassifierCacheInfo::GetEntries(nsI
 {
   if (!aEntries) {
     return NS_ERROR_NULL_POINTER;
   }
 
   nsCOMPtr<nsIMutableArray> array(do_CreateInstance(NS_ARRAY_CONTRACTID));
 
   for (uint32_t i = 0;i < entries.Length(); i++) {
-    array->AppendElement(entries[i], false);
+    array->AppendElement(entries[i]);
   }
 
   NS_ADDREF(*aEntries = array);
 
   return NS_OK;
 }
--- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp
+++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp
@@ -325,17 +325,17 @@ ConvertArgsToArray(nsISupports* aArgumen
 
     return array.forget();
   }
 
   nsCOMPtr<nsIMutableArray> singletonArray =
     do_CreateInstance(NS_ARRAY_CONTRACTID);
   NS_ENSURE_TRUE(singletonArray, nullptr);
 
-  nsresult rv = singletonArray->AppendElement(aArguments, /* aWeak = */ false);
+  nsresult rv = singletonArray->AppendElement(aArguments);
   NS_ENSURE_SUCCESS(rv, nullptr);
 
   return singletonArray.forget();
 }
 
 NS_IMETHODIMP
 nsWindowWatcher::OpenWindow(mozIDOMWindowProxy* aParent,
                             const char* aUrl,
--- a/toolkit/profile/content/createProfileWizard.js
+++ b/toolkit/profile/content/createProfileWizard.js
@@ -196,14 +196,14 @@ function onFinish() {
   if (window.opener) {
     // Add new profile to the list in the Profile Manager.
     window.opener.CreateProfile(profile);
   } else {
     // Use the newly created Profile.
     var profileLock = profile.lock(null);
 
     var dialogParams = window.arguments[0].QueryInterface(I.nsIDialogParamBlock);
-    dialogParams.objects.insertElementAt(profileLock, 0, false);
+    dialogParams.objects.insertElementAt(profileLock, 0);
   }
 
   // Exit the wizard.
   return true;
 }
--- a/toolkit/profile/content/profileSelection.js
+++ b/toolkit/profile/content/profileSelection.js
@@ -90,17 +90,17 @@ function acceptDialog() {
 
     var lockedTitle = gProfileManagerBundle.getString("profileLockedTitle");
     var locked =
       gProfileManagerBundle.getFormattedString("profileLocked2", [appName, selectedProfile.profile.name, appName]);
     Services.prompt.alert(window, lockedTitle, locked);
 
     return false;
   }
-  gDialogParams.objects.insertElementAt(profileLock.nsIProfileLock, 0, false);
+  gDialogParams.objects.insertElementAt(profileLock.nsIProfileLock, 0);
 
   gProfileService.selectedProfile = selectedProfile.profile;
   gProfileService.defaultProfile = selectedProfile.profile;
   updateStartupPrefs();
 
   gDialogParams.SetInt(0, 1);
 
   gDialogParams.SetString(0, selectedProfile.profile.name);
--- a/uriloader/exthandler/ContentHandlerService.cpp
+++ b/uriloader/exthandler/ContentHandlerService.cpp
@@ -106,17 +106,17 @@ NS_IMPL_ISUPPORTS(RemoteHandlerApp, nsIH
 
 static inline void CopyHanderInfoTonsIHandlerInfo(HandlerInfo info, nsIHandlerInfo* aHandlerInfo)
 {
   HandlerApp preferredApplicationHandler = info.preferredApplicationHandler();
   nsCOMPtr<nsIHandlerApp> preferredApp(new RemoteHandlerApp(preferredApplicationHandler));
   aHandlerInfo->SetPreferredApplicationHandler(preferredApp);
   nsCOMPtr<nsIMutableArray> possibleHandlers;
   aHandlerInfo->GetPossibleApplicationHandlers(getter_AddRefs(possibleHandlers));
-  possibleHandlers->AppendElement(preferredApp, false);
+  possibleHandlers->AppendElement(preferredApp);
 }
 ContentHandlerService::~ContentHandlerService()
 {
 }
 
 NS_IMETHODIMP ContentHandlerService::AsyncInit()
 {
   return NS_ERROR_NOT_IMPLEMENTED;
--- a/uriloader/exthandler/HandlerServiceParent.cpp
+++ b/uriloader/exthandler/HandlerServiceParent.cpp
@@ -26,17 +26,17 @@ protected:
   nsCOMPtr<nsIMutableArray> mPossibleApps;
 };
 
 NS_IMPL_ISUPPORTS(ProxyHandlerInfo, nsIHandlerInfo)
 
 ProxyHandlerInfo::ProxyHandlerInfo(const HandlerInfo& aHandlerInfo) : mHandlerInfo(aHandlerInfo), mPossibleApps(do_CreateInstance(NS_ARRAY_CONTRACTID))
 {
   for (auto& happ : aHandlerInfo.possibleApplicationHandlers()) {
-    mPossibleApps->AppendElement(new RemoteHandlerApp(happ), false);
+    mPossibleApps->AppendElement(new RemoteHandlerApp(happ));
   }
 }
 
 /* readonly attribute ACString type; */
 NS_IMETHODIMP ProxyHandlerInfo::GetType(nsACString & aType)
 {
   aType.Assign(mHandlerInfo.type());
   return NS_OK;
--- a/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp
+++ b/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp
@@ -372,17 +372,17 @@ nsMIMEInfoAndroid::LaunchWithFile(nsIFil
 
 nsMIMEInfoAndroid::nsMIMEInfoAndroid(const nsACString& aMIMEType) :
   mType(aMIMEType), mAlwaysAsk(true),
   mPrefAction(nsIMIMEInfo::useHelperApp)
 {
   mPrefApp = new nsMIMEInfoAndroid::SystemChooser(this);
   nsresult rv;
   mHandlerApps = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-  mHandlerApps->AppendElement(mPrefApp, false);
+  mHandlerApps->AppendElement(mPrefApp);
 }
 
 #define SYSTEMCHOOSER_NAME u"Android chooser"
 #define SYSTEMCHOOSER_DESCRIPTION u"Android's default handler application chooser"
 
 NS_IMPL_ISUPPORTS(nsMIMEInfoAndroid::SystemChooser, nsIHandlerApp)
 
 nsresult nsMIMEInfoAndroid::SystemChooser::GetName(nsAString & aName) {
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -2023,17 +2023,17 @@ nsExternalAppHandler::OnSaveComplete(nsI
       if (loadInfo) {
         nsresult rv = NS_OK;
         nsCOMPtr<nsIMutableArray> redirectChain =
           do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
         NS_ENSURE_SUCCESS(rv, rv);
         LOG(("nsExternalAppHandler: Got %zu redirects\n",
              loadInfo->RedirectChain().Length()));
         for (nsIRedirectHistoryEntry* entry : loadInfo->RedirectChain()) {
-          redirectChain->AppendElement(entry, false);
+          redirectChain->AppendElement(entry);
         }
         mRedirects = redirectChain;
       }
     }
 
     if (NS_FAILED(aStatus)) {
       nsAutoString path;
       mTempFile->GetPath(path);
--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
+++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
@@ -119,17 +119,17 @@ nsMIMEInfoUnix::GetPossibleApplicationHa
 
     QList<ContentAction::Action> actions =
       ContentAction::Action::actionsForFile(QUrl(), QString(mSchemeOrType.get()));
 
     for (int i = 0; i < actions.size(); ++i) {
       nsContentHandlerApp* app =
         new nsContentHandlerApp(nsString((char16_t*)actions[i].name().data()), 
                                 mSchemeOrType, actions[i]);
-      mPossibleApplications->AppendElement(app, false);
+      mPossibleApplications->AppendElement(app);
     }
   }
 
   *aPossibleAppHandlers = mPossibleApplications;
   NS_ADDREF(*aPossibleAppHandlers);
   return NS_OK;
 }
 #endif
--- a/uriloader/exthandler/win/nsMIMEInfoWin.cpp
+++ b/uriloader/exthandler/win/nsMIMEInfoWin.cpp
@@ -518,17 +518,17 @@ void nsMIMEInfoWin::ProcessPath(nsCOMPtr
       return;
   }
 
   nsCOMPtr<nsILocalHandlerApp> aApp;
   if (!GetLocalHandlerApp(appFilesystemCommand, aApp))
     return;
 
   // Save in our main tracking arrays
-  appList->AppendElement(aApp, false);
+  appList->AppendElement(aApp);
   trackList.AppendElement(lower);
 }
 
 // Helper routine that handles a compare between a path
 // and an array of paths.
 static bool IsPathInList(nsAString& appPath,
                            nsTArray<nsString>& trackList)
 {
--- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp
@@ -789,17 +789,17 @@ nsOfflineManifestItem::AddNamespace(uint
 
     nsCOMPtr<nsIApplicationCacheNamespace> ns =
         do_CreateInstance(NS_APPLICATIONCACHENAMESPACE_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = ns->Init(namespaceType, namespaceSpec, data);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    rv = mNamespaces->AppendElement(ns, false);
+    rv = mNamespaces->AppendElement(ns);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return NS_OK;
 }
 
 static nsresult
 GetURIDirectory(nsIURI* uri, nsACString &directory)
 {
--- a/widget/nsHTMLFormatConverter.cpp
+++ b/widget/nsHTMLFormatConverter.cpp
@@ -96,17 +96,17 @@ nsHTMLFormatConverter :: AddFlavorToList
 
   nsCOMPtr<nsISupportsCString> dataFlavor =
       do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, &rv);
   if ( dataFlavor ) {
     dataFlavor->SetData ( nsDependentCString(inFlavor) );
     // add to list as an nsISupports so the correct interface gets the addref
     // in AppendElement()
     nsCOMPtr<nsISupports> genericFlavor ( do_QueryInterface(dataFlavor) );
-    inList->AppendElement ( genericFlavor, /*weak =*/ false);
+    inList->AppendElement ( genericFlavor );
   }
   return rv;
 
 } // AddFlavorToList
 
 
 //
 // CanConvert
--- a/widget/nsTransferable.cpp
+++ b/widget/nsTransferable.cpp
@@ -269,17 +269,17 @@ nsTransferable::GetTransferDataFlavors()
   nsCOMPtr<nsIMutableArray> array = nsArray::Create();
 
   for (size_t i = 0; i < mDataArray.Length(); ++i) {
     DataStruct& data = mDataArray.ElementAt(i);
     nsCOMPtr<nsISupportsCString> flavorWrapper = do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID);
     if ( flavorWrapper ) {
       flavorWrapper->SetData ( data.GetFlavor() );
       nsCOMPtr<nsISupports> genericWrapper ( do_QueryInterface(flavorWrapper) );
-      array->AppendElement( genericWrapper, /*weak =*/ false );
+      array->AppendElement( genericWrapper );
     }
   }
 
   return array.forget();
 }
 
 
 //
@@ -552,17 +552,17 @@ nsTransferable::FlavorsTransferableCanIm
       for (uint32_t i = 0; i < importListLen; ++i ) {
         nsCOMPtr<nsISupportsCString> flavorWrapper =
             do_QueryElementAt(convertedList, i);
         nsAutoCString flavorStr;
         flavorWrapper->GetData( flavorStr );
 
         if (GetDataForFlavor (mDataArray, flavorStr.get())
             == mDataArray.NoIndex) // Don't append if already in intrinsic list
-          array->AppendElement (flavorWrapper, /*weak =*/ false);
+          array->AppendElement (flavorWrapper);
       } // foreach flavor that can be converted to
     }
   } // if a converter exists
 
   array.forget(_retval);
   return NS_OK;
 } // FlavorsTransferableCanImport
 
@@ -597,17 +597,17 @@ nsTransferable::FlavorsTransferableCanEx
       for ( uint32_t i=0; i < importListLen; ++i ) {
         nsCOMPtr<nsISupportsCString> flavorWrapper =
             do_QueryElementAt(convertedList, i);
         nsAutoCString flavorStr;
         flavorWrapper->GetData( flavorStr );
 
         if (GetDataForFlavor (mDataArray, flavorStr.get())
             == mDataArray.NoIndex) // Don't append if already in intrinsic list
-          array->AppendElement (flavorWrapper, /*weak =*/ false);
+          array->AppendElement (flavorWrapper);
       } // foreach flavor that can be converted to
     }
   } // if a converter exists
 
   array.forget(_retval);
   return NS_OK;
 } // FlavorsTransferableCanExport
 
--- a/widget/windows/JumpListBuilder.cpp
+++ b/widget/windows/JumpListBuilder.cpp
@@ -582,17 +582,17 @@ nsresult JumpListBuilder::TransferIObjec
     }
 
     if (pLink)
       pLink->Release();
     if (pItem)
       pItem->Release();
 
     if (NS_SUCCEEDED(rv)) {
-      removedItems->AppendElement(item, false);
+      removedItems->AppendElement(item);
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP JumpListBuilder::Observe(nsISupports* aSubject,
                                        const char* aTopic,
                                        const char16_t* aData)
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -1947,17 +1947,17 @@ nsComponentManagerImpl::GetManifestLocat
   for (uint32_t i = 0; i < sModuleLocations->Length(); ++i) {
     ComponentLocation& l = sModuleLocations->ElementAt(i);
     FileLocation loc = l.location;
     nsCString uriString;
     loc.GetURIString(uriString);
     nsCOMPtr<nsIURI> uri;
     rv = NS_NewURI(getter_AddRefs(uri), uriString);
     if (NS_SUCCEEDED(rv)) {
-      locations->AppendElement(uri, false);
+      locations->AppendElement(uri);
     }
   }
 
   locations.forget(aLocations);
   return NS_OK;
 }
 
 EXPORT_XPCOM_API(nsresult)
--- a/xpcom/ds/nsArray.cpp
+++ b/xpcom/ds/nsArray.cpp
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #include "nsArray.h"
 #include "nsArrayEnumerator.h"
-#include "nsIWeakReference.h"
-#include "nsIWeakReferenceUtils.h"
 #include "nsThreadUtils.h"
 
 // used by IndexOf()
 struct MOZ_STACK_CLASS findIndexOfClosure
 {
   // This is only used for pointer comparison, so we can just use a void*.
   void* targetElement;
   uint32_t startIndex;
@@ -107,76 +105,40 @@ NS_IMETHODIMP
 nsArrayBase::Enumerate(nsISimpleEnumerator** aResult)
 {
   return NS_NewArrayEnumerator(aResult, static_cast<nsIArray*>(this));
 }
 
 // nsIMutableArray implementation
 
 NS_IMETHODIMP
-nsArrayBase::AppendElement(nsISupports* aElement, bool aWeak)
+nsArrayBase::AppendElement(nsISupports* aElement)
 {
-  bool result;
-  if (aWeak) {
-    nsCOMPtr<nsIWeakReference> elementRef = do_GetWeakReference(aElement);
-    NS_ASSERTION(elementRef,
-                 "AppendElement: Trying to use weak references on an object that doesn't support it");
-    if (!elementRef) {
-      return NS_ERROR_FAILURE;
-    }
-    result = mArray.AppendObject(elementRef);
-  }
-
-  else {
-    // add the object directly
-    result = mArray.AppendObject(aElement);
-  }
+  bool result = mArray.AppendObject(aElement);
   return result ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 nsArrayBase::RemoveElementAt(uint32_t aIndex)
 {
   bool result = mArray.RemoveObjectAt(aIndex);
   return result ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsArrayBase::InsertElementAt(nsISupports* aElement, uint32_t aIndex, bool aWeak)
+nsArrayBase::InsertElementAt(nsISupports* aElement, uint32_t aIndex)
 {
-  nsCOMPtr<nsISupports> elementRef;
-  if (aWeak) {
-    elementRef = do_GetWeakReference(aElement);
-    NS_ASSERTION(elementRef,
-                 "InsertElementAt: Trying to use weak references on an object that doesn't support it");
-    if (!elementRef) {
-      return NS_ERROR_FAILURE;
-    }
-  } else {
-    elementRef = aElement;
-  }
-  bool result = mArray.InsertObjectAt(elementRef, aIndex);
+  bool result = mArray.InsertObjectAt(aElement, aIndex);
   return result ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsArrayBase::ReplaceElementAt(nsISupports* aElement, uint32_t aIndex, bool aWeak)
+nsArrayBase::ReplaceElementAt(nsISupports* aElement, uint32_t aIndex)
 {
-  nsCOMPtr<nsISupports> elementRef;
-  if (aWeak) {
-    elementRef = do_GetWeakReference(aElement);
-    NS_ASSERTION(elementRef,
-                 "ReplaceElementAt: Trying to use weak references on an object that doesn't support it");
-    if (!elementRef) {
-      return NS_ERROR_FAILURE;
-    }
-  } else {
-    elementRef = aElement;
-  }
-  mArray.ReplaceObjectAt(elementRef, aIndex);
+  mArray.ReplaceObjectAt(aElement, aIndex);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsArrayBase::Clear()
 {
   mArray.Clear();
   return NS_OK;
--- a/xpcom/ds/nsHashPropertyBag.cpp
+++ b/xpcom/ds/nsHashPropertyBag.cpp
@@ -112,17 +112,17 @@ nsHashPropertyBagBase::GetEnumerator(nsI
   if (!propertyArray) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   for (auto iter = mPropertyHash.Iter(); !iter.Done(); iter.Next()) {
     const nsAString& key = iter.Key();
     nsIVariant* data = iter.UserData();
     nsSimpleProperty* sprop = new nsSimpleProperty(key, data);
-    propertyArray->AppendElement(sprop, false);
+    propertyArray->AppendElement(sprop);
   }
 
   return NS_NewArrayEnumerator(aResult, propertyArray);
 }
 
 #define IMPL_GETSETPROPERTY_AS(Name, Type) \
 NS_IMETHODIMP \
 nsHashPropertyBagBase::GetPropertyAs ## Name (const nsAString & prop, Type *_retval) \
--- a/xpcom/ds/nsIMutableArray.idl
+++ b/xpcom/ds/nsIMutableArray.idl
@@ -24,24 +24,18 @@
 interface nsIMutableArray : nsIArrayExtensions
 {
     /**
      * appendElement()
      * 
      * Append an element at the end of the array.
      *
      * @param element The element to append.
-     * @param weak    Whether or not to store the element using a weak
-     *                reference.
-     * @throws NS_ERROR_FAILURE when a weak reference is requested,
-     *                          but the element does not support
-     *                          nsIWeakReference.
      */
-    void appendElement(in nsISupports element,
-                       [optional] in boolean weak);
+    void appendElement(in nsISupports element);
 
     /**
      * removeElementAt()
      * 
      * Remove an element at a specific position, moving all elements
      * stored at a higher position down one.
      * To remove a specific element, use indexOf() to find the index
      * first, then call removeElementAt().
@@ -62,49 +56,36 @@ interface nsIMutableArray : nsIArrayExte
      * @param index   The position in the array:
      *                If the position is lower than the current length
      *                of the array, the elements at that position and
      *                onwards are bumped one position up.
      *                If the position is equal to the current length
      *                of the array, the new element is appended.
      *                An index lower than 0 or higher than the current
      *                length of the array is invalid and will be ignored.
-     *
-     * @throws NS_ERROR_FAILURE when a weak reference is requested,
-     *                          but the element does not support
-     *                          nsIWeakReference.
      */
-    void insertElementAt(in nsISupports element, in unsigned long index,
-                         in boolean weak);
+    void insertElementAt(in nsISupports element, in unsigned long index);
 
     /**
      * replaceElementAt()
      *
      * Replace the element at the given position.
      *
      * @param element The new element to insert
      * @param index   The position in the array
      *                If the position is lower than the current length
      *                of the array, an existing element will be replaced.
      *                If the position is equal to the current length
      *                of the array, the new element is appended.
      *                If the position is higher than the current length
      *                of the array, empty elements are appended followed
      *                by the new element at the specified position.
      *                An index lower than 0 is invalid and will be ignored.
-     *
-     * @param weak    Whether or not to store the new element using a weak
-     *                reference.
-     *
-     * @throws NS_ERROR_FAILURE when a weak reference is requested,
-     *                          but the element does not support
-     *                          nsIWeakReference.
      */
-    void replaceElementAt(in nsISupports element, in unsigned long index,
-                          in boolean weak);
+    void replaceElementAt(in nsISupports element, in unsigned long index);
     
     
     /**
      * clear()
      *
      * clear the entire array, releasing all stored objects
      */
     void clear();
--- a/xpcom/tests/unit/test_nsIMutableArray.js
+++ b/xpcom/tests/unit/test_nsIMutableArray.js
@@ -42,17 +42,17 @@ function test_object_gets_appended()
 
 function test_insert_at_beginning()
 {
   var arr = create_n_element_array(5);
   // just a sanity check
   do_check_eq(5, arr.length);
   var str = new SupportsString();
   str.data = "hello";
-  arr.insertElementAt(str, 0, false);
+  arr.insertElementAt(str, 0);
   do_check_eq(6, arr.length);
   var obj = arr.queryElementAt(0, Ci.nsISupportsString);
   do_check_eq(str, obj);
   // check the data of all the other objects
   for (let i=1; i<arr.length; i++) {
     let obj = arr.queryElementAt(i, Ci.nsISupportsString);
     do_check_eq("element " + (i-1), obj.data);
   }
@@ -61,27 +61,27 @@ function test_insert_at_beginning()
 function test_replace_element()
 {
   var arr = create_n_element_array(5);
   // just a sanity check
   do_check_eq(5, arr.length);
   var str = new SupportsString();
   str.data = "hello";
   // replace first element
-  arr.replaceElementAt(str, 0, false);
+  arr.replaceElementAt(str, 0);
   do_check_eq(5, arr.length);
   var obj = arr.queryElementAt(0, Ci.nsISupportsString);
   do_check_eq(str, obj);
   // replace last element
-  arr.replaceElementAt(str, arr.length - 1, false);
+  arr.replaceElementAt(str, arr.length - 1);
   do_check_eq(5, arr.length);
   obj = arr.queryElementAt(arr.length - 1, Ci.nsISupportsString);
   do_check_eq(str, obj);
   // replace after last element, should insert empty elements
-  arr.replaceElementAt(str, 9, false);
+  arr.replaceElementAt(str, 9);
   do_check_eq(10, arr.length);
   obj = arr.queryElementAt(9, Ci.nsISupportsString);
   do_check_eq(str, obj);
   // AFAIK there's no way to check the empty elements, since you can't QI them.
 }
 
 function test_clear()
 {
--- a/xpfe/components/directory/nsDirectoryViewer.cpp
+++ b/xpfe/components/directory/nsDirectoryViewer.cpp
@@ -847,17 +847,17 @@ nsHTTPIndex::GetTargets(nsIRDFResource *
         // by using a global connection list and an immediately-firing timer
 		if (doNetworkRequest && mConnectionList)
 		{
 		    uint32_t connectionIndex;
                     nsresult idx_rv = mConnectionList->IndexOf(0, aSource, &connectionIndex);
 		    if (NS_FAILED(idx_rv))
 		    {
     		    // add aSource into list of connections to make
-	    	    mConnectionList->AppendElement(aSource, /*weak =*/ false);
+	    	    mConnectionList->AppendElement(aSource);
 
                 // if we don't have a timer about to fire, create one
                 // which should fire as soon as possible (out-of-band)
             	if (!mTimer)
             	{
                     rv = NS_NewTimerWithFuncCallback(getter_AddRefs(mTimer),
                                                      nsHTTPIndex::FireTimer,
                                                      this,
@@ -881,19 +881,19 @@ nsHTTPIndex::AddElement(nsIRDFResource *
 {
 
     if (!mNodeList)
     {
         mNodeList = nsArray::Create();
     }
 
     // order required: parent, prop, then child
-    mNodeList->AppendElement(parent, /*weak =*/ false);
-    mNodeList->AppendElement(prop, /*weak =*/ false);
-    mNodeList->AppendElement(child, /*weak = */ false);
+    mNodeList->AppendElement(parent);
+    mNodeList->AppendElement(prop);
+    mNodeList->AppendElement(child);
 
 	if (!mTimer)
 	{
         return NS_NewTimerWithFuncCallback(getter_AddRefs(mTimer),
                                            nsHTTPIndex::FireTimer,
                                            this,
                                            1,
                                            nsITimer::TYPE_ONE_SHOT,