Bug 1434686 part 4. Use IgnoreErrors() in dom/. r=mystor
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 01 Feb 2018 14:21:14 -0500
changeset 402107 a3d5547b0b7f7aa9a3e5eaed7b3151cadff42334
parent 402106 c0dc4d5fc3dd641c4dfe9a1d32642a85c3a6ae46
child 402108 fb0b7a29a7ecb345a9464218cc6444c46c4affc0
push id99494
push userbzbarsky@mozilla.com
push dateThu, 01 Feb 2018 19:23:47 +0000
treeherdermozilla-inbound@709f49913e92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmystor
bugs1434686
milestone60.0a1
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
Bug 1434686 part 4. Use IgnoreErrors() in dom/. r=mystor MozReview-Commit-ID: GwVDrTLPTOb
dom/base/CustomElementRegistry.cpp
dom/base/Navigator.cpp
dom/base/nsContentAreaDragDrop.cpp
dom/base/nsFocusManager.cpp
dom/base/nsFrameLoader.cpp
dom/base/nsGlobalWindowOuter.h
dom/base/nsINode.cpp
dom/base/nsMimeTypeArray.cpp
dom/clients/manager/ClientSource.cpp
dom/console/Console.cpp
dom/events/DOMEventTargetHelper.cpp
dom/events/DataTransferItemList.cpp
dom/fetch/InternalHeaders.cpp
dom/html/HTMLButtonElement.cpp
dom/html/HTMLImageElement.cpp
dom/html/HTMLInputElement.cpp
dom/html/HTMLScriptElement.cpp
dom/html/HTMLSelectElement.cpp
dom/html/HTMLTableElement.cpp
dom/html/HTMLTextAreaElement.cpp
dom/html/ImageDocument.cpp
dom/html/nsTextEditorState.cpp
dom/media/webaudio/AudioContext.cpp
dom/promise/PromiseDebugging.cpp
dom/serviceworkers/ServiceWorkerEvents.cpp
dom/serviceworkers/ServiceWorkerScriptCache.cpp
dom/svg/SVGAnimationElement.cpp
dom/svg/SVGUseElement.cpp
dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
dom/workers/ScriptLoader.cpp
dom/xbl/nsXBLBinding.cpp
dom/xbl/nsXBLPrototypeHandler.cpp
dom/xul/nsXULElement.cpp
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -67,31 +67,30 @@ class CustomElementCallbackReaction fina
 };
 
 //-----------------------------------------------------
 // CustomElementCallback
 
 void
 CustomElementCallback::Call()
 {
-  IgnoredErrorResult rv;
   switch (mType) {
     case nsIDocument::eConnected:
-      static_cast<LifecycleConnectedCallback *>(mCallback.get())->Call(mThisObject, rv);
+      static_cast<LifecycleConnectedCallback *>(mCallback.get())->Call(mThisObject);
       break;
     case nsIDocument::eDisconnected:
-      static_cast<LifecycleDisconnectedCallback *>(mCallback.get())->Call(mThisObject, rv);
+      static_cast<LifecycleDisconnectedCallback *>(mCallback.get())->Call(mThisObject);
       break;
     case nsIDocument::eAdopted:
       static_cast<LifecycleAdoptedCallback *>(mCallback.get())->Call(mThisObject,
-        mAdoptedCallbackArgs.mOldDocument, mAdoptedCallbackArgs.mNewDocument, rv);
+        mAdoptedCallbackArgs.mOldDocument, mAdoptedCallbackArgs.mNewDocument);
       break;
     case nsIDocument::eAttributeChanged:
       static_cast<LifecycleAttributeChangedCallback *>(mCallback.get())->Call(mThisObject,
-        mArgs.name, mArgs.oldValue, mArgs.newValue, mArgs.namespaceURI, rv);
+        mArgs.name, mArgs.oldValue, mArgs.newValue, mArgs.namespaceURI);
       break;
   }
 }
 
 void
 CustomElementCallback::Traverse(nsCycleCollectionTraversalCallback& aCb) const
 {
   NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(aCb, "mThisObject");
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1474,18 +1474,17 @@ Navigator::RequestVRPresentation(VRDispl
 {
   nsGlobalWindowInner* win = nsGlobalWindowInner::Cast(mWindow);
   win->DispatchVRDisplayActivate(aDisplay.DisplayId(), VRDisplayEventReason::Requested);
 }
 
 nsINetworkProperties*
 Navigator::GetNetworkProperties()
 {
-  IgnoredErrorResult rv;
-  return GetConnection(rv);
+  return GetConnection(IgnoreErrors());
 }
 
 network::Connection*
 Navigator::GetConnection(ErrorResult& aRv)
 {
   if (!mConnection) {
     if (!mWindow) {
       aRv.Throw(NS_ERROR_UNEXPECTED);
--- a/dom/base/nsContentAreaDragDrop.cpp
+++ b/dom/base/nsContentAreaDragDrop.cpp
@@ -55,16 +55,17 @@
 #include "nsRange.h"
 #include "TabParent.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLAreaElement.h"
 #include "mozilla/dom/HTMLAnchorElement.h"
 #include "nsVariant.h"
 
 using namespace mozilla::dom;
+using mozilla::IgnoreErrors;
 
 class MOZ_STACK_CLASS DragDataProducer
 {
 public:
   DragDataProducer(nsPIDOMWindowOuter* aWindow,
                    nsIContent* aTarget,
                    nsIContent* aSelectionTargetNode,
                    bool aIsAltKeyPressed);
@@ -348,20 +349,19 @@ DragDataProducer::GetNodeString(nsIConte
                                 nsAString & outNodeString)
 {
   nsCOMPtr<nsINode> node = inNode;
 
   outNodeString.Truncate();
 
   // use a range to get the text-equivalent of the node
   nsCOMPtr<nsIDocument> doc = node->OwnerDoc();
-  mozilla::IgnoredErrorResult rv;
-  RefPtr<nsRange> range = doc->CreateRange(rv);
+  RefPtr<nsRange> range = doc->CreateRange(IgnoreErrors());
   if (range) {
-    range->SelectNode(*node, rv);
+    range->SelectNode(*node, IgnoreErrors());
     range->ToString(outNodeString);
   }
 }
 
 nsresult
 DragDataProducer::Produce(DataTransfer* aDataTransfer,
                           bool* aCanDrag,
                           nsISelection** aSelection,
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -2445,29 +2445,25 @@ nsFocusManager::MoveCaretToFocus(nsIPres
         RefPtr<nsRange> newRange = doc->CreateRange(rv);
         if (NS_WARN_IF(rv.Failed())) {
           rv.SuppressException();
           return;
         }
 
         // Set the range to the start of the currently focused node
         // Make sure it's collapsed
-        {
-          IgnoredErrorResult ignored;
-          newRange->SelectNodeContents(*aContent, ignored);
-        }
+        newRange->SelectNodeContents(*aContent, IgnoreErrors());
 
         if (!aContent->GetFirstChild() ||
             aContent->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) {
           // If current focus node is a leaf, set range to before the
           // node by using the parent as a container.
           // This prevents it from appearing as selected.
-          IgnoredErrorResult err1, err2;
-          newRange->SetStartBefore(*aContent, err1);
-          newRange->SetEndBefore(*aContent, err2);
+          newRange->SetStartBefore(*aContent, IgnoreErrors());
+          newRange->SetEndBefore(*aContent, IgnoreErrors());
         }
         domSelection->AddRange(newRange);
         domSelection->CollapseToStart();
       }
     }
   }
 }
 
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -904,23 +904,21 @@ nsFrameLoader::Show(int32_t marginWidth,
       nsAutoString designMode;
       htmlDoc->GetDesignMode(designMode);
 
       if (designMode.EqualsLiteral("on")) {
         // Hold on to the editor object to let the document reattach to the
         // same editor object, instead of creating a new one.
         RefPtr<HTMLEditor> htmlEditor = mDocShell->GetHTMLEditor();
         Unused << htmlEditor;
-        {
-          IgnoredErrorResult rv;
-          htmlDoc->SetDesignMode(NS_LITERAL_STRING("off"), Nothing(), rv);
-        }
-
-        IgnoredErrorResult rv;
-        htmlDoc->SetDesignMode(NS_LITERAL_STRING("on"), Nothing(), rv);
+        htmlDoc->SetDesignMode(NS_LITERAL_STRING("off"), Nothing(),
+                               IgnoreErrors());
+
+        htmlDoc->SetDesignMode(NS_LITERAL_STRING("on"), Nothing(),
+                               IgnoreErrors());
       } else {
         // Re-initialize the presentation for contenteditable documents
         bool editable = false,
              hasEditingSession = false;
         mDocShell->GetEditable(&editable);
         mDocShell->GetHasEditingSession(&hasEditingSession);
         RefPtr<HTMLEditor> htmlEditor = mDocShell->GetHTMLEditor();
         if (editable && hasEditingSession && htmlEditor) {
--- a/dom/base/nsGlobalWindowOuter.h
+++ b/dom/base/nsGlobalWindowOuter.h
@@ -692,19 +692,19 @@ public:
   GetContentInternal(mozilla::ErrorResult& aError,
                      mozilla::dom::CallerType aCallerType);
   void GetContentOuter(JSContext* aCx,
                        JS::MutableHandle<JSObject*> aRetval,
                        mozilla::dom::CallerType aCallerType,
                        mozilla::ErrorResult& aError);
   already_AddRefed<nsPIDOMWindowOuter> GetContent()
   {
-    mozilla::IgnoredErrorResult ignored;
     nsCOMPtr<nsPIDOMWindowOuter> win =
-      GetContentInternal(ignored, mozilla::dom::CallerType::System);
+      GetContentInternal(mozilla::IgnoreErrors(),
+                         mozilla::dom::CallerType::System);
     return win.forget();
   }
 
   // ChromeWindow bits.  Do NOT call these unless your window is in
   // fact chrome.
   nsIBrowserDOMWindow* GetBrowserDOMWindowOuter();
   void SetBrowserDOMWindowOuter(nsIBrowserDOMWindow* aBrowserWindow);
   void SetCursorOuter(const nsAString& aCursor, mozilla::ErrorResult& aError);
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -1771,18 +1771,17 @@ nsINode::ReplaceWith(const Sequence<Owni
 void
 nsINode::Remove()
 {
   nsCOMPtr<nsINode> parent = GetParentNode();
   if (!parent) {
     return;
   }
 
-  IgnoredErrorResult err;
-  parent->RemoveChild(*this, err);
+  parent->RemoveChild(*this, IgnoreErrors());
 }
 
 Element*
 nsINode::GetFirstElementChild() const
 {
   for (nsIContent* child = GetFirstChild();
        child;
        child = child->GetNextSibling()) {
--- a/dom/base/nsMimeTypeArray.cpp
+++ b/dom/base/nsMimeTypeArray.cpp
@@ -169,18 +169,17 @@ void
 nsMimeTypeArray::EnsurePluginMimeTypes()
 {
   if (!mMimeTypes.IsEmpty() || !mWindow) {
     return;
   }
 
   RefPtr<Navigator> navigator = mWindow->Navigator();
 
-  IgnoredErrorResult rv;
-  nsPluginArray *pluginArray = navigator->GetPlugins(rv);
+  nsPluginArray *pluginArray = navigator->GetPlugins(IgnoreErrors());
   if (!pluginArray) {
     return;
   }
 
   pluginArray->GetMimeTypes(mMimeTypes);
   pluginArray->GetCTPMimeTypes(mCTPMimeTypes);
 }
 
--- a/dom/clients/manager/ClientSource.cpp
+++ b/dom/clients/manager/ClientSource.cpp
@@ -398,18 +398,17 @@ ClientSource::SetController(const Servic
   nsPIDOMWindowInner* window = GetInnerWindow();
   if (window) {
     swc = window->Navigator()->ServiceWorker();
   }
 
   // TODO: Also self.navigator.serviceWorker on workers when its exposed there
 
   if (swc && nsContentUtils::IsSafeToRunScript()) {
-    IgnoredErrorResult ignored;
-    swc->ControllerChanged(ignored);
+    swc->ControllerChanged(IgnoreErrors());
   }
 }
 
 RefPtr<ClientOpPromise>
 ClientSource::Control(const ClientControlledArgs& aArgs)
 {
   NS_ASSERT_OWNINGTHREAD(ClientSource);
 
--- a/dom/console/Console.cpp
+++ b/dom/console/Console.cpp
@@ -2730,18 +2730,17 @@ Console::MaybeExecuteDumpFunctionForTrac
   message.AppendLiteral("\n");
   ExecuteDumpFunction(message);
 }
 
 void
 Console::ExecuteDumpFunction(const nsAString& aMessage)
 {
   if (mDumpFunction) {
-    IgnoredErrorResult rv;
-    mDumpFunction->Call(aMessage, rv);
+    mDumpFunction->Call(aMessage);
     return;
   }
 
   NS_ConvertUTF16toUTF8 str(aMessage);
   MOZ_LOG(nsContentUtils::DOMDumpLog(), LogLevel::Debug, ("%s", str.get()));
 #ifdef ANDROID
   __android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", str.get());
 #endif
--- a/dom/events/DOMEventTargetHelper.cpp
+++ b/dom/events/DOMEventTargetHelper.cpp
@@ -355,42 +355,40 @@ DOMEventTargetHelper::WantsUntrusted(boo
   // We can let listeners on workers to always handle all the events.
   *aRetVal = (doc && !nsContentUtils::IsChromeDoc(doc)) || !NS_IsMainThread();
   return rv;
 }
 
 void
 DOMEventTargetHelper::EventListenerAdded(nsAtom* aType)
 {
-  IgnoredErrorResult rv;
-  EventListenerWasAdded(Substring(nsDependentAtomString(aType), 2), rv);
+  EventListenerWasAdded(Substring(nsDependentAtomString(aType), 2),
+                        IgnoreErrors());
   MaybeUpdateKeepAlive();
 }
 
 void
 DOMEventTargetHelper::EventListenerAdded(const nsAString& aType)
 {
-  IgnoredErrorResult rv;
-  EventListenerWasAdded(aType, rv);
+  EventListenerWasAdded(aType, IgnoreErrors());
   MaybeUpdateKeepAlive();
 }
 
 void
 DOMEventTargetHelper::EventListenerRemoved(nsAtom* aType)
 {
-  IgnoredErrorResult rv;
-  EventListenerWasRemoved(Substring(nsDependentAtomString(aType), 2), rv);
+  EventListenerWasRemoved(Substring(nsDependentAtomString(aType), 2),
+                          IgnoreErrors());
   MaybeUpdateKeepAlive();
 }
 
 void
 DOMEventTargetHelper::EventListenerRemoved(const nsAString& aType)
 {
-  IgnoredErrorResult rv;
-  EventListenerWasRemoved(aType, rv);
+  EventListenerWasRemoved(aType, IgnoreErrors());
   MaybeUpdateKeepAlive();
 }
 
 void
 DOMEventTargetHelper::KeepAliveIfHasListenersFor(const nsAString& aType)
 {
   mKeepingAliveTypes.mStrings.AppendElement(aType);
   MaybeUpdateKeepAlive();
--- a/dom/events/DataTransferItemList.cpp
+++ b/dom/events/DataTransferItemList.cpp
@@ -573,19 +573,18 @@ DataTransferItemList::GenerateFiles(File
 
   uint32_t count = Length();
   for (uint32_t i = 0; i < count; i++) {
     bool found;
     RefPtr<DataTransferItem> item = IndexedGetter(i, found);
     MOZ_ASSERT(found);
 
     if (item->Kind() == DataTransferItem::KIND_FILE) {
-      IgnoredErrorResult rv;
-      RefPtr<File> file = item->GetAsFile(*aFilesPrincipal, rv);
-      if (NS_WARN_IF(rv.Failed() || !file)) {
+      RefPtr<File> file = item->GetAsFile(*aFilesPrincipal, IgnoreErrors());
+      if (NS_WARN_IF(!file)) {
         continue;
       }
       aFiles->Append(file);
     }
   }
 }
 
 } // namespace mozilla
--- a/dom/fetch/InternalHeaders.cpp
+++ b/dom/fetch/InternalHeaders.cpp
@@ -344,18 +344,17 @@ public:
     : mInternalHeaders(aInternalHeaders)
   {
     MOZ_DIAGNOSTIC_ASSERT(mInternalHeaders);
   }
 
   NS_IMETHOD
   VisitHeader(const nsACString& aHeader, const nsACString& aValue) override
   {
-    IgnoredErrorResult result;
-    mInternalHeaders->Append(aHeader, aValue, result);
+    mInternalHeaders->Append(aHeader, aValue, IgnoreErrors());
     return NS_OK;
   }
 };
 
 NS_IMPL_ISUPPORTS(FillHeaders, nsIHttpHeaderVisitor)
 
 } // namespace
 
--- a/dom/html/HTMLButtonElement.cpp
+++ b/dom/html/HTMLButtonElement.cpp
@@ -458,18 +458,17 @@ HTMLButtonElement::SaveState()
 
   return NS_OK;
 }
 
 bool
 HTMLButtonElement::RestoreState(nsPresState* aState)
 {
   if (aState && aState->IsDisabledSet() && !aState->GetDisabled()) {
-    IgnoredErrorResult rv;
-    SetDisabled(false, rv);
+    SetDisabled(false, IgnoreErrors());
   }
 
   return false;
 }
 
 EventStates
 HTMLButtonElement::IntrinsicState() const
 {
--- a/dom/html/HTMLImageElement.cpp
+++ b/dom/html/HTMLImageElement.cpp
@@ -490,18 +490,17 @@ HTMLImageElement::AfterMaybeChangeAttr(i
     if (InResponsiveMode()) {
       // per spec, full selection runs when this changes, even though
       // it doesn't directly affect the source selection
       QueueImageLoadTask(true);
     } else if (OwnerDoc()->ShouldLoadImages()) {
       // Bug 1076583 - We still use the older synchronous algorithm in
       // non-responsive mode. Force a new load of the image with the
       // new cross origin policy
-      IgnoredErrorResult error;
-      ForceReload(aNotify, error);
+      ForceReload(aNotify, IgnoreErrors());
     }
   }
 }
 
 nsresult
 HTMLImageElement::GetEventTargetParent(EventChainPreVisitor& aVisitor)
 {
   // We handle image element with attribute ismap in its corresponding frame
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -743,18 +743,17 @@ nsColorPickerShownCallback::UpdateIntern
 
   nsAutoString oldValue;
   if (aTrustedUpdate) {
     valueChanged = true;
   } else {
     mInput->GetValue(oldValue, CallerType::System);
   }
 
-  IgnoredErrorResult rv;
-  mInput->SetValue(aColor, CallerType::System, rv);
+  mInput->SetValue(aColor, CallerType::System, IgnoreErrors());
 
   if (!aTrustedUpdate) {
     nsAutoString newValue;
     mInput->GetValue(newValue, CallerType::System);
     if (!oldValue.Equals(newValue)) {
       valueChanged = true;
     }
   }
@@ -1888,25 +1887,23 @@ HTMLInputElement::GetList() const
 }
 
 void
 HTMLInputElement::SetValue(Decimal aValue, CallerType aCallerType)
 {
   MOZ_ASSERT(!aValue.isInfinity(), "aValue must not be Infinity!");
 
   if (aValue.isNaN()) {
-    IgnoredErrorResult rv;
-    SetValue(EmptyString(), aCallerType, rv);
+    SetValue(EmptyString(), aCallerType, IgnoreErrors());
     return;
   }
 
   nsAutoString value;
   mInputType->ConvertNumberToString(aValue, value);
-  IgnoredErrorResult rv;
-  SetValue(value, aCallerType, rv);
+  SetValue(value, aCallerType, IgnoreErrors());
 }
 
 Nullable<Date>
 HTMLInputElement::GetValueAsDate(ErrorResult& aRv)
 {
   if (!IsDateTimeInputType(mType)) {
     return Nullable<Date>();
   }
@@ -6686,18 +6683,17 @@ HTMLInputElement::RestoreState(nsPresSta
         // before the type change.)
         SetValueInternal(inputState->GetValue(),
                          nsTextEditorState::eSetValue_Notify);
         break;
     }
   }
 
   if (aState->IsDisabledSet() && !aState->GetDisabled()) {
-    IgnoredErrorResult ignored;
-    SetDisabled(false, ignored);
+    SetDisabled(false, IgnoreErrors());
   }
 
   return restoredCheckedState;
 }
 
 bool
 HTMLInputElement::AllowDrop()
 {
--- a/dom/html/HTMLScriptElement.cpp
+++ b/dom/html/HTMLScriptElement.cpp
@@ -185,18 +185,17 @@ HTMLScriptElement::GetScriptType(nsAStri
 
   aType.Assign(type);
   return true;
 }
 
 void
 HTMLScriptElement::GetScriptText(nsAString& text)
 {
-  IgnoredErrorResult rv;
-  GetText(text, rv);
+  GetText(text, IgnoreErrors());
 }
 
 void
 HTMLScriptElement::GetScriptCharset(nsAString& charset)
 {
   GetCharset(charset);
 }
 
--- a/dom/html/HTMLSelectElement.cpp
+++ b/dom/html/HTMLSelectElement.cpp
@@ -1462,18 +1462,17 @@ HTMLSelectElement::RestoreState(nsPresSt
     RestoreStateTo(state);
 
     // Don't flush, if the frame doesn't exist yet it doesn't care if
     // we're reset or not.
     DispatchContentReset();
   }
 
   if (aState->IsDisabledSet() && !aState->GetDisabled()) {
-    IgnoredErrorResult rv;
-    SetDisabled(false, rv);
+    SetDisabled(false, IgnoreErrors());
   }
 
   return false;
 }
 
 void
 HTMLSelectElement::RestoreStateTo(SelectState* aNewSelected)
 {
--- a/dom/html/HTMLTableElement.cpp
+++ b/dom/html/HTMLTableElement.cpp
@@ -637,18 +637,17 @@ HTMLTableElement::CreateTHead()
 
       if (refNode->IsHTMLElement() &&
           !refNode->IsHTMLElement(nsGkAtoms::caption) &&
           !refNode->IsHTMLElement(nsGkAtoms::colgroup)) {
         break;
       }
     }
 
-    IgnoredErrorResult rv;
-    nsINode::InsertBefore(*head, refNode, rv);
+    nsINode::InsertBefore(*head, refNode, IgnoreErrors());
   }
   return head.forget();
 }
 
 void
 HTMLTableElement::DeleteTHead()
 {
   HTMLTableSectionElement* tHead = GetTHead();
@@ -700,19 +699,18 @@ HTMLTableElement::CreateCaption()
     nsContentUtils::QNameChanged(mNodeInfo, nsGkAtoms::caption,
                                  getter_AddRefs(nodeInfo));
 
     caption = NS_NewHTMLTableCaptionElement(nodeInfo.forget());
     if (!caption) {
       return nullptr;
     }
 
-    IgnoredErrorResult rv;
     nsCOMPtr<nsINode> firsChild = nsINode::GetFirstChild();
-    nsINode::InsertBefore(*caption, firsChild, rv);
+    nsINode::InsertBefore(*caption, firsChild, IgnoreErrors());
   }
   return caption.forget();
 }
 
 void
 HTMLTableElement::DeleteCaption()
 {
   HTMLTableCaptionElement* caption = GetCaption();
@@ -741,18 +739,17 @@ HTMLTableElement::CreateTBody()
        child;
        child = child->GetPreviousSibling()) {
     if (child->IsHTMLElement(nsGkAtoms::tbody)) {
       referenceNode = child->GetNextSibling();
       break;
     }
   }
 
-  IgnoredErrorResult rv;
-  nsINode::InsertBefore(*newBody, referenceNode, rv);
+  nsINode::InsertBefore(*newBody, referenceNode, IgnoreErrors());
 
   return newBody.forget();
 }
 
 already_AddRefed<nsGenericHTMLElement>
 HTMLTableElement::InsertRow(int32_t aIndex, ErrorResult& aError)
 {
   /* get the ref row at aIndex
--- a/dom/html/HTMLTextAreaElement.cpp
+++ b/dom/html/HTMLTextAreaElement.cpp
@@ -784,18 +784,17 @@ HTMLTextAreaElement::SetValueFromSetRang
                           nsTextEditorState::eSetValue_ByContent |
                           nsTextEditorState::eSetValue_Notify);
 }
 
 nsresult
 HTMLTextAreaElement::Reset()
 {
   nsAutoString resetVal;
-  IgnoredErrorResult res;
-  GetDefaultValue(resetVal, res);
+  GetDefaultValue(resetVal, IgnoreErrors());
   SetValueChanged(false);
 
   nsresult rv = SetValueInternal(resetVal,
                                  nsTextEditorState::eSetValue_Internal);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
@@ -886,18 +885,17 @@ HTMLTextAreaElement::RestoreState(nsPres
     nsAutoString data;
     state->GetData(data);
     ErrorResult rv;
     SetValue(data, rv);
     ENSURE_SUCCESS(rv, false);
   }
 
   if (aState->IsDisabledSet() && !aState->GetDisabled()) {
-    IgnoredErrorResult rv;
-    SetDisabled(false, rv);
+    SetDisabled(false, IgnoreErrors());
   }
 
   return false;
 }
 
 EventStates
 HTMLTextAreaElement::IntrinsicState() const
 {
@@ -1307,18 +1305,17 @@ HTMLTextAreaElement::GetRows()
   }
 
   return DEFAULT_ROWS_TEXTAREA;
 }
 
 NS_IMETHODIMP_(void)
 HTMLTextAreaElement::GetDefaultValueFromContent(nsAString& aValue)
 {
-  IgnoredErrorResult rv;
-  GetDefaultValue(aValue, rv);
+  GetDefaultValue(aValue, IgnoreErrors());
 }
 
 NS_IMETHODIMP_(bool)
 HTMLTextAreaElement::ValueChanged() const
 {
   return mValueChanged;
 }
 
--- a/dom/html/ImageDocument.cpp
+++ b/dom/html/ImageDocument.cpp
@@ -363,26 +363,20 @@ ImageDocument::ShrinkToFit()
       classList->Remove(NS_LITERAL_STRING("overflowingVertical"), ignored);
     }
     ignored.SuppressException();
     return;
   }
 
   // Keep image content alive while changing the attributes.
   RefPtr<HTMLImageElement> image = HTMLImageElement::FromContent(mImageContent);
-  {
-    IgnoredErrorResult ignored;
-    image->SetWidth(std::max(1, NSToCoordFloor(GetRatio() * mImageWidth)),
-                    ignored);
-  }
-  {
-    IgnoredErrorResult ignored;
-    image->SetHeight(std::max(1, NSToCoordFloor(GetRatio() * mImageHeight)),
-                     ignored);
-  }
+  image->SetWidth(std::max(1, NSToCoordFloor(GetRatio() * mImageWidth)),
+                  IgnoreErrors());
+  image->SetHeight(std::max(1, NSToCoordFloor(GetRatio() * mImageHeight)),
+                   IgnoreErrors());
 
   // The view might have been scrolled when zooming in, scroll back to the
   // origin now that we're showing a shrunk-to-window version.
   ScrollImageTo(0, 0, false);
 
   if (!mImageContent) {
     // ScrollImageTo flush destroyed our content.
     return;
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -2035,22 +2035,20 @@ nsTextEditorState::UnbindFromFrame(nsTex
   // Save our selection state if needed.
   // Note that GetSelectionRange will attempt to work with our selection
   // controller, so we should make sure we do it before we start doing things
   // like destroying our editor (if we have one), tearing down the selection
   // controller, and so forth.
   if (!IsSelectionCached()) {
     // Go ahead and cache it now.
     uint32_t start = 0, end = 0;
-    IgnoredErrorResult rangeRv;
-    GetSelectionRange(&start, &end, rangeRv);
+    GetSelectionRange(&start, &end, IgnoreErrors());
 
-    IgnoredErrorResult dirRv;
     nsITextControlFrame::SelectionDirection direction =
-      GetSelectionDirection(dirRv);
+      GetSelectionDirection(IgnoreErrors());
 
     SelectionProperties& props = GetSelectionProperties();
     props.SetStart(start);
     props.SetEnd(end);
     props.SetDirection(direction);
     HTMLInputElement* number = GetParentNumberControl(aFrame);
     if (number) {
       // If we are inside a number control, cache the selection on the
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -667,18 +667,17 @@ void AudioContext::DisconnectFromOwner()
 void
 AudioContext::Shutdown()
 {
   mIsShutDown = true;
 
   // We don't want to touch promises if the global is going away soon.
   if (!mIsDisconnecting) {
     if (!mIsOffline) {
-      IgnoredErrorResult dummy;
-      RefPtr<Promise> ignored = Close(dummy);
+      RefPtr<Promise> ignored = Close(IgnoreErrors());
     }
 
     for (auto p : mPromiseGripArray) {
       p->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
     }
 
     mPromiseGripArray.Clear();
   }
--- a/dom/promise/PromiseDebugging.cpp
+++ b/dom/promise/PromiseDebugging.cpp
@@ -272,34 +272,32 @@ PromiseDebugging::FlushUncaughtRejection
     if (!promise) {
       continue;
     }
 
     for (size_t j = 0; j < observers.Length(); ++j) {
       RefPtr<UncaughtRejectionObserver> obs =
         static_cast<UncaughtRejectionObserver*>(observers[j].get());
 
-      IgnoredErrorResult err;
-      obs->OnLeftUncaught(promise, err);
+      obs->OnLeftUncaught(promise, IgnoreErrors());
     }
     JSAutoCompartment ac(cx, promise);
     Promise::ReportRejectedPromise(cx, promise);
   }
   storage->mUncaughtRejections.clear();
 
   // Notify observers of consumed Promise.
 
   for (size_t i = 0; i < consumed.length(); i++) {
     JS::RootedObject promise(cx, consumed[i]);
 
     for (size_t j = 0; j < observers.Length(); ++j) {
       RefPtr<UncaughtRejectionObserver> obs =
         static_cast<UncaughtRejectionObserver*>(observers[j].get());
 
-      IgnoredErrorResult err;
-      obs->OnConsumed(promise, err);
+      obs->OnConsumed(promise, IgnoreErrors());
     }
   }
   storage->mConsumedRejections.clear();
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/serviceworkers/ServiceWorkerEvents.cpp
+++ b/dom/serviceworkers/ServiceWorkerEvents.cpp
@@ -732,17 +732,17 @@ RespondWithHandler::ResolvedCallback(JSC
                                                           mScriptSpec,
                                                           responseURL,
                                                           Move(closure));
 
   nsCOMPtr<nsIInputStream> body;
   ir->GetUnfilteredBody(getter_AddRefs(body));
   // Errors and redirects may not have a body.
   if (body) {
-    IgnoredErrorResult error;
+    ErrorResult error;
     response->SetBodyUsed(aCx, error);
     if (NS_WARN_IF(error.Failed())) {
       autoCancel.SetCancelErrorResult(aCx, error);
       return;
     }
   }
 
   MOZ_ALWAYS_SUCCEEDS(worker->DispatchToMainThread(startRunnable.forget()));
--- a/dom/serviceworkers/ServiceWorkerScriptCache.cpp
+++ b/dom/serviceworkers/ServiceWorkerScriptCache.cpp
@@ -613,19 +613,18 @@ private:
     ir->SetURLList(aCN->URLList());
 
     ir->InitChannelInfo(aCN->GetChannelInfo());
     UniquePtr<PrincipalInfo> principalInfo = aCN->TakePrincipalInfo();
     if (principalInfo) {
       ir->SetPrincipalInfo(Move(principalInfo));
     }
 
-    IgnoredErrorResult ignored;
     RefPtr<InternalHeaders> internalHeaders = aCN->GetInternalHeaders();
-    ir->Headers()->Fill(*(internalHeaders.get()), ignored);
+    ir->Headers()->Fill(*(internalHeaders.get()), IgnoreErrors());
 
     RefPtr<Response> response =
       new Response(aCache->GetGlobalObject(), ir, nullptr);
 
     RequestOrUSVString request;
     request.SetAsUSVString().Rebind(aCN->URL().Data(), aCN->URL().Length());
 
     // For now we have to wait until the Put Promise is fulfilled before we can
--- a/dom/svg/SVGAnimationElement.cpp
+++ b/dom/svg/SVGAnimationElement.cpp
@@ -381,18 +381,17 @@ SVGAnimationElement::ActivateByHyperlink
       AnimationNeedsResample();
       // As with SVGSVGElement::SetCurrentTime, we need to trigger
       // a synchronous sample now.
       FlushAnimations();
     }
     // else, silently fail. We mustn't be part of an SVG document fragment that
     // is attached to the document tree so there's nothing we can do here
   } else {
-    IgnoredErrorResult rv;
-    BeginElement(rv);
+    BeginElement(IgnoreErrors());
   }
 }
 
 //----------------------------------------------------------------------
 // Implementation helpers
 
 nsSMILTimeContainer*
 SVGAnimationElement::GetTimeContainer()
--- a/dom/svg/SVGUseElement.cpp
+++ b/dom/svg/SVGUseElement.cpp
@@ -253,19 +253,19 @@ SVGUseElement::CreateAnonymousContent()
         return nullptr;
       }
     }
   }
 
   nsNodeInfoManager* nodeInfoManager =
     targetContent->OwnerDoc() == OwnerDoc() ?
       nullptr : OwnerDoc()->NodeInfoManager();
-  IgnoredErrorResult rv;
   nsCOMPtr<nsINode> newnode =
-    nsNodeUtils::Clone(targetContent, true, nodeInfoManager, nullptr, rv);
+    nsNodeUtils::Clone(targetContent, true, nodeInfoManager, nullptr,
+                       IgnoreErrors());
   nsCOMPtr<nsIContent> newcontent = do_QueryInterface(newnode);
 
   if (!newcontent)
     return nullptr;
 
   if (newcontent->IsAnyOfSVGElements(nsGkAtoms::svg, nsGkAtoms::symbol)) {
     nsSVGElement *newElement = static_cast<nsSVGElement*>(newcontent.get());
 
--- a/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
+++ b/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
@@ -691,18 +691,17 @@ PersistNodeFixup::FixupAttribute(nsINode
     NS_ConvertASCIItoUTF16 namespaceURI(aNamespaceURI);
     RefPtr<dom::Attr> attr = attrMap->GetNamedItemNS(namespaceURI, attribute);
     nsresult rv = NS_OK;
     if (attr) {
         nsString uri;
         attr->GetValue(uri);
         rv = FixupURI(uri);
         if (NS_SUCCEEDED(rv)) {
-            IgnoredErrorResult err;
-            attr->SetValue(uri, err);
+            attr->SetValue(uri, IgnoreErrors());
         }
     }
 
     return rv;
 }
 
 nsresult
 PersistNodeFixup::FixupAnchor(nsINode *aNode)
@@ -744,18 +743,17 @@ PersistNodeFixup::FixupAnchor(nsINode *a
         nsCOMPtr<nsIURI> newURI;
         nsresult rv = NS_NewURI(getter_AddRefs(newURI), oldCValue,
                                 mParent->GetCharacterSet(), relativeURI);
         if (NS_SUCCEEDED(rv) && newURI) {
             newURI->SetUserPass(EmptyCString());
             nsAutoCString uriSpec;
             rv = newURI->GetSpec(uriSpec);
             NS_ENSURE_SUCCESS(rv, rv);
-            IgnoredErrorResult err;
-            attr->SetValue(NS_ConvertUTF8toUTF16(uriSpec), err);
+            attr->SetValue(NS_ConvertUTF8toUTF16(uriSpec), IgnoreErrors());
         }
     }
 
     return NS_OK;
 }
 
 static void
 AppendXMLAttr(const nsAString& key, const nsAString& aValue, nsAString& aBuffer)
@@ -1123,29 +1121,26 @@ PersistNodeFixup::FixupNode(nsINode* aNo
                 case NS_FORM_INPUT_NUMBER:
                 case NS_FORM_INPUT_RANGE:
                 case NS_FORM_INPUT_DATE:
                 case NS_FORM_INPUT_TIME:
                 case NS_FORM_INPUT_COLOR:
                     nodeAsInput->GetValue(valueStr, dom::CallerType::System);
                     // Avoid superfluous value="" serialization
                     if (valueStr.IsEmpty()) {
-                      IgnoredErrorResult ignored;
-                      outElt->RemoveAttribute(valueAttr, ignored);
+                      outElt->RemoveAttribute(valueAttr, IgnoreErrors());
                     } else {
-                      IgnoredErrorResult ignored;
-                      outElt->SetAttribute(valueAttr, valueStr, ignored);
+                      outElt->SetAttribute(valueAttr, valueStr, IgnoreErrors());
                     }
                     break;
                 case NS_FORM_INPUT_CHECKBOX:
                 case NS_FORM_INPUT_RADIO:
                     {
                         bool checked = nodeAsInput->Checked();
-                        IgnoredErrorResult ignored;
-                        outElt->SetDefaultChecked(checked, ignored);
+                        outElt->SetDefaultChecked(checked, IgnoreErrors());
                     }
                     break;
                 default:
                     break;
             }
         }
         return rv;
     }
@@ -1155,31 +1150,29 @@ PersistNodeFixup::FixupNode(nsINode* aNo
         nsresult rv = GetNodeToFixup(aNodeIn, aNodeOut);
         if (NS_SUCCEEDED(rv) && *aNodeOut) {
             // Tell the document encoder to serialize the text child we create below
             *aSerializeCloneKids = true;
 
             nsAutoString valueStr;
             nodeAsTextArea->GetValue(valueStr);
 
-            IgnoredErrorResult err;
-            (*aNodeOut)->SetTextContent(valueStr, err);
+            (*aNodeOut)->SetTextContent(valueStr, IgnoreErrors());
         }
         return rv;
     }
 
     dom::HTMLOptionElement* nodeAsOption = dom::HTMLOptionElement::FromContent(content);
     if (nodeAsOption) {
         nsresult rv = GetNodeToFixup(aNodeIn, aNodeOut);
         if (NS_SUCCEEDED(rv) && *aNodeOut) {
             dom::HTMLOptionElement* outElt =
                 dom::HTMLOptionElement::FromContent((*aNodeOut)->AsContent());
             bool selected = nodeAsOption->Selected();
-            IgnoredErrorResult ignored;
-            outElt->SetDefaultSelected(selected, ignored);
+            outElt->SetDefaultSelected(selected, IgnoreErrors());
         }
         return rv;
     }
 
     return NS_OK;
 }
 
 } // unnamed namespace
--- a/dom/workers/ScriptLoader.cpp
+++ b/dom/workers/ScriptLoader.cpp
@@ -1644,18 +1644,17 @@ CacheCreator::DeleteCache()
 {
   AssertIsOnMainThread();
 
   // This is called when the load is canceled which can occur before
   // mCacheStorage is initialized.
   if (mCacheStorage) {
     // It's safe to do this while Cache::Match() and Cache::Put() calls are
     // running.
-    IgnoredErrorResult rv;
-    RefPtr<Promise> promise = mCacheStorage->Delete(mCacheName, rv);
+    RefPtr<Promise> promise = mCacheStorage->Delete(mCacheName, IgnoreErrors());
 
     // We don't care to know the result of the promise object.
   }
 
   // Always call this here to ensure the loaders array is cleared.
   FailLoaders(NS_ERROR_FAILURE);
 }
 
@@ -1776,23 +1775,22 @@ CacheScriptLoader::ResolvedCallback(JSCo
   rv = UNWRAP_OBJECT(Response, &obj, response);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     Fail(rv);
     return;
   }
 
   InternalHeaders* headers = response->GetInternalHeaders();
 
-  IgnoredErrorResult ignored;
   headers->Get(NS_LITERAL_CSTRING("content-security-policy"),
-               mCSPHeaderValue, ignored);
+               mCSPHeaderValue, IgnoreErrors());
   headers->Get(NS_LITERAL_CSTRING("content-security-policy-report-only"),
-               mCSPReportOnlyHeaderValue, ignored);
+               mCSPReportOnlyHeaderValue, IgnoreErrors());
   headers->Get(NS_LITERAL_CSTRING("referrer-policy"),
-               mReferrerPolicyHeaderValue, ignored);
+               mReferrerPolicyHeaderValue, IgnoreErrors());
 
   nsCOMPtr<nsIInputStream> inputStream;
   response->GetBody(getter_AddRefs(inputStream));
   mChannelInfo = response->GetChannelInfo();
   const UniquePtr<PrincipalInfo>& pInfo = response->GetPrincipalInfo();
   if (pInfo) {
     mPrincipalInfo = mozilla::MakeUnique<PrincipalInfo>(*pInfo);
   }
--- a/dom/xbl/nsXBLBinding.cpp
+++ b/dom/xbl/nsXBLBinding.cpp
@@ -316,19 +316,19 @@ nsXBLBinding::GenerateAnonymousContent()
   // using the attribute-setting shorthand hack.
   uint32_t contentCount = content->GetChildCount();
 
   // Plan to build the content by default.
   bool hasContent = (contentCount > 0);
   if (hasContent) {
     nsIDocument* doc = mBoundElement->OwnerDoc();
 
-    IgnoredErrorResult rv;
     nsCOMPtr<nsINode> clonedNode =
-      nsNodeUtils::Clone(content, true, doc->NodeInfoManager(), nullptr, rv);
+      nsNodeUtils::Clone(content, true, doc->NodeInfoManager(), nullptr,
+                         IgnoreErrors());
     // FIXME: Bug 1399558, Why is this code OK assuming that nsNodeUtils::Clone
     // never fails?
     mContent = clonedNode->AsElement();
 
     // Search for <xbl:children> elements in the XBL content. In the presence
     // of multiple default insertion points, we use the last one in document
     // order.
     for (nsIContent* child = mContent; child; child = child->GetNextNode(mContent)) {
--- a/dom/xbl/nsXBLPrototypeHandler.cpp
+++ b/dom/xbl/nsXBLPrototypeHandler.cpp
@@ -670,18 +670,17 @@ nsXBLPrototypeHandler::GetController(Eve
   // XXX Fix this so there's a generic interface that describes controllers,
   // This code should have no special knowledge of what objects might have controllers.
   nsCOMPtr<nsIControllers> controllers;
 
   nsCOMPtr<nsIContent> targetContent(do_QueryInterface(aTarget));
   RefPtr<nsXULElement> xulElement =
     nsXULElement::FromContentOrNull(targetContent);
   if (xulElement) {
-    IgnoredErrorResult rv;
-    controllers = xulElement->GetControllers(rv);
+    controllers = xulElement->GetControllers(IgnoreErrors());
   }
 
   if (!controllers) {
     HTMLTextAreaElement* htmlTextArea = HTMLTextAreaElement::FromContent(targetContent);
     if (htmlTextArea)
       htmlTextArea->GetControllers(getter_AddRefs(controllers));
   }
 
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -874,18 +874,17 @@ nsXULElement::RemoveChildAt_Deprecated(u
           }
         }
 
         nsCOMPtr<nsIDOMXULSelectControlItemElement> curItem;
         controlElement->GetCurrentItem(getter_AddRefs(curItem));
         nsCOMPtr<nsIContent> curNode = do_QueryInterface(curItem);
         if (curNode && nsContentUtils::ContentIsDescendantOf(curNode, oldKid)) {
             // Current item going away
-            IgnoredErrorResult ignored;
-            nsCOMPtr<nsIBoxObject> box = xulElement->GetBoxObject(ignored);
+            nsCOMPtr<nsIBoxObject> box = xulElement->GetBoxObject(IgnoreErrors());
             listBox = do_QueryInterface(box);
             if (listBox && oldKidElem) {
               listBox->GetIndexOfItem(oldKidElem, &newCurrentIndex);
             }
 
             // If any of this fails, we'll just set the current item to null
             if (newCurrentIndex == -1)
               newCurrentIndex = -2;
@@ -969,18 +968,17 @@ nsXULElement::RemoveChildNode(nsIContent
           }
         }
 
         nsCOMPtr<nsIDOMXULSelectControlItemElement> curItem;
         controlElement->GetCurrentItem(getter_AddRefs(curItem));
         nsCOMPtr<nsIContent> curNode = do_QueryInterface(curItem);
         if (curNode && nsContentUtils::ContentIsDescendantOf(curNode, aKid)) {
             // Current item going away
-            IgnoredErrorResult ignored;
-            nsCOMPtr<nsIBoxObject> box = xulElement->GetBoxObject(ignored);
+            nsCOMPtr<nsIBoxObject> box = xulElement->GetBoxObject(IgnoreErrors());
             listBox = do_QueryInterface(box);
             if (listBox && oldKidElem) {
               listBox->GetIndexOfItem(oldKidElem, &newCurrentIndex);
             }
 
             // If any of this fails, we'll just set the current item to null
             if (newCurrentIndex == -1)
               newCurrentIndex = -2;