Bug 1469769 - Part 6a: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r?froydnj draft
authorChris Peterson <cpeterson@mozilla.com>
Sun, 17 Jun 2018 22:43:11 -0700
changeset 808630 5708724e2874f57b00d85f067ccb00b9bb4aa6b6
parent 808629 a215c8f1adcc79328bf0970181bfcace3097a9a2
child 808631 b0b946b29ef097ba39a2e988aab8e8bd547d367e
push id113444
push usercpeterson@mozilla.com
push dateWed, 20 Jun 2018 07:17:30 +0000
reviewersfroydnj
bugs1469769
milestone62.0a1
Bug 1469769 - Part 6a: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r?froydnj This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b. MozReview-Commit-ID: 5UQVHElSpCr
accessible/base/AccGroupInfo.cpp
accessible/base/DocManager.cpp
accessible/base/TextUpdater.cpp
accessible/base/nsAccUtils.cpp
accessible/generic/BaseAccessibles.cpp
accessible/generic/HyperTextAccessible.cpp
accessible/html/HTMLListAccessible.cpp
accessible/mac/mozAccessible.mm
accessible/xul/XULMenuAccessible.cpp
chrome/nsChromeRegistryContent.cpp
docshell/base/nsDocShell.cpp
docshell/base/nsDocShellLoadTypes.h
dom/animation/Animation.h
dom/animation/CSSPseudoElement.cpp
dom/animation/EffectCompositor.cpp
dom/animation/EffectSet.cpp
dom/animation/KeyframeEffect.cpp
dom/base/Element.cpp
dom/base/FormData.cpp
dom/base/FragmentOrElement.cpp
dom/base/ThirdPartyUtil.cpp
dom/base/nsAttrValue.cpp
dom/base/nsContentIterator.cpp
dom/base/nsContentUtils.cpp
dom/base/nsDocument.cpp
dom/base/nsINode.cpp
dom/base/nsINode.h
dom/base/nsObjectLoadingContent.cpp
dom/base/nsStyleLinkElement.cpp
dom/fetch/Fetch.cpp
dom/fetch/FetchConsumer.cpp
dom/file/uri/BlobURL.cpp
dom/html/HTMLFormElement.cpp
dom/html/HTMLInputElement.cpp
dom/html/HTMLInputElement.h
dom/html/HTMLMediaElement.cpp
dom/html/PluginDocument.cpp
dom/html/nsHTMLContentSink.cpp
dom/html/nsTextEditorState.cpp
dom/indexedDB/IndexedDatabaseManager.cpp
dom/indexedDB/Key.cpp
dom/indexedDB/KeyPath.cpp
dom/ipc/ContentChild.cpp
dom/ipc/TabParent.cpp
dom/jsurl/nsJSProtocolHandler.cpp
dom/media/MediaCache.cpp
dom/media/eme/DetailedPromise.cpp
dom/media/gmp/GMPVideoHost.cpp
dom/media/webaudio/AudioNodeEngine.h
dom/media/webaudio/BiquadFilterNode.cpp
dom/media/webaudio/PannerNode.cpp
dom/media/webaudio/WaveShaperNode.cpp
dom/media/webaudio/blink/PeriodicWave.cpp
dom/plugins/base/nsNPAPIPluginInstance.cpp
dom/plugins/base/nsNPAPIPluginStreamListener.cpp
dom/plugins/base/nsPluginHost.cpp
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/plugins/base/nsPluginsDirWin.cpp
dom/plugins/ipc/NPEventOSX.h
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginInterposeOSX.mm
dom/plugins/ipc/PluginModuleChild.cpp
dom/plugins/ipc/PluginModuleParent.cpp
dom/plugins/ipc/PluginScriptableObjectParent.cpp
dom/plugins/ipc/PluginScriptableObjectUtils-inl.h
dom/plugins/ipc/PluginScriptableObjectUtils.h
dom/presentation/ipc/PresentationChild.cpp
dom/presentation/ipc/PresentationParent.cpp
dom/quota/Client.h
dom/serviceworkers/ServiceWorkerEvents.cpp
dom/smil/nsSMILAnimationFunction.cpp
dom/smil/nsSMILNullType.cpp
dom/smil/nsSMILTimedElement.cpp
dom/svg/DOMSVGPathSeg.cpp
dom/svg/DOMSVGPathSegList.cpp
dom/svg/SVGContentUtils.cpp
dom/svg/SVGLength.cpp
dom/svg/SVGMotionSMILAnimationFunction.cpp
dom/svg/SVGMotionSMILAttr.cpp
dom/svg/SVGPathData.cpp
dom/svg/nsSVGAngle.cpp
dom/svg/nsSVGElement.cpp
dom/svg/nsSVGLength2.cpp
dom/svg/nsSVGTransform.cpp
dom/workers/RuntimeService.cpp
dom/workers/WorkerDebuggerManager.cpp
dom/xhr/XMLHttpRequestMainThread.cpp
dom/xml/nsXMLFragmentContentSink.cpp
dom/xslt/xpath/txCoreFunctionCall.cpp
dom/xslt/xpath/txExpr.h
dom/xslt/xpath/txExprLexer.cpp
dom/xslt/xpath/txExprParser.cpp
dom/xslt/xpath/txLiteralExpr.cpp
dom/xslt/xpath/txNodeTypeTest.cpp
dom/xslt/xpath/txRelationalExpr.cpp
dom/xslt/xslt/txBufferingHandler.cpp
dom/xslt/xslt/txEXSLTFunctions.cpp
dom/xslt/xslt/txXSLTPatterns.h
dom/xul/XULDocument.cpp
dom/xul/XULPopupElement.cpp
dom/xul/nsXULPrototypeDocument.cpp
editor/composer/nsEditingSession.cpp
editor/libeditor/EditorBase.cpp
editor/libeditor/PlaceholderTransaction.cpp
editor/libeditor/WSRunObject.cpp
extensions/cookie/nsPermissionManager.cpp
extensions/spellcheck/src/mozInlineSpellChecker.cpp
extensions/spellcheck/src/mozSpellChecker.cpp
gfx/layers/ipc/CompositorBridgeChild.cpp
gfx/layers/ipc/CompositorBridgeParent.cpp
gfx/layers/opengl/OGLShaderProgram.h
gfx/src/nsCoord.h
gfx/src/nsDeviceContext.cpp
gfx/thebes/gfxASurface.cpp
gfx/thebes/gfxAndroidPlatform.cpp
gfx/thebes/gfxDWriteFontList.cpp
gfx/thebes/gfxFT2FontList.cpp
gfx/thebes/gfxFcPlatformFontList.cpp
gfx/thebes/gfxFont.cpp
gfx/thebes/gfxFontEntry.cpp
gfx/thebes/gfxFontEntry.h
gfx/thebes/gfxFontInfoLoader.cpp
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatform.h
gfx/thebes/gfxUserFontSet.cpp
image/MultipartImage.cpp
image/decoders/EXIF.cpp
image/decoders/icon/mac/nsIconChannelCocoa.mm
image/decoders/icon/win/nsIconChannel.cpp
image/encoders/bmp/nsBMPEncoder.cpp
image/encoders/png/nsPNGEncoder.cpp
image/imgRequestProxy.cpp
intl/unicharutil/util/nsUnicodeProperties.cpp
ipc/glue/Transport_win.cpp
layout/base/PresShell.cpp
layout/base/StackArena.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsLayoutUtils.cpp
layout/generic/BlockReflowInput.h
layout/generic/FrameChildList.cpp
layout/generic/WritingModes.h
layout/generic/nsBlockFrame.cpp
layout/generic/nsColumnSetFrame.cpp
layout/generic/nsContainerFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsFrameSelection.cpp
layout/generic/nsHTMLCanvasFrame.cpp
layout/generic/nsLeafFrame.cpp
layout/inspector/inDeepTreeWalker.cpp
layout/mathml/nsMathMLChar.cpp
layout/mathml/nsMathMLContainerFrame.cpp
layout/mathml/nsMathMLmencloseFrame.cpp
layout/mathml/nsMathMLmrowFrame.cpp
layout/painting/nsCSSRenderingBorders.cpp
layout/painting/nsDisplayList.cpp
layout/painting/nsDisplayList.h
layout/painting/nsImageRenderer.cpp
layout/printing/nsPrintJob.cpp
layout/style/CounterStyleManager.cpp
layout/style/FontFace.cpp
layout/style/Loader.cpp
layout/style/nsComputedDOMStyle.cpp
layout/style/nsFontFaceLoader.cpp
layout/style/nsLayoutStylesheetCache.cpp
layout/style/nsStyleCoord.cpp
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
layout/style/nsStyleTransformMatrix.cpp
layout/style/nsStyleUtil.cpp
layout/svg/SVGTextFrame.cpp
layout/svg/nsCSSFilterInstance.cpp
layout/svg/nsSVGFilterInstance.cpp
layout/svg/nsSVGUtils.cpp
layout/tables/BasicTableLayoutStrategy.cpp
layout/tables/nsCellMap.cpp
layout/tables/nsTableFrame.cpp
layout/tables/nsTableRowFrame.cpp
layout/tables/nsTableRowGroupFrame.cpp
layout/tables/nsTableWrapperFrame.cpp
layout/xul/grid/nsGridLayout2.h
layout/xul/nsRootBoxFrame.cpp
layout/xul/nsSprocketLayout.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
modules/libjar/nsJARChannel.cpp
modules/libjar/nsJARURI.cpp
modules/libjar/zipwriter/nsZipWriter.cpp
netwerk/base/ChannelDiverterParent.cpp
netwerk/base/nsAsyncStreamCopier.cpp
netwerk/base/nsBufferedStreams.cpp
netwerk/base/nsFileStreams.cpp
netwerk/base/nsInputStreamPump.cpp
netwerk/base/nsNetUtil.cpp
netwerk/base/nsProtocolProxyService.cpp
netwerk/base/nsRequestObserverProxy.cpp
netwerk/base/nsSimpleNestedURI.cpp
netwerk/base/nsSimpleURI.cpp
netwerk/base/nsSocketTransport2.cpp
netwerk/base/nsStandardURL.cpp
netwerk/base/nsStandardURL.h
netwerk/base/nsStreamTransportService.cpp
netwerk/base/nsURLHelper.cpp
netwerk/base/nsURLParsers.cpp
netwerk/cache/nsDiskCacheMap.cpp
netwerk/cache/nsDiskCacheStreams.cpp
netwerk/cache/nsDiskCacheStreams.h
netwerk/cache2/CacheFile.cpp
netwerk/cache2/CacheFileContextEvictor.cpp
netwerk/cache2/CacheFileIOManager.cpp
netwerk/cache2/CacheFileIOManager.h
netwerk/cache2/CacheIndex.cpp
netwerk/cache2/CacheIndex.h
netwerk/cookie/nsCookieService.cpp
netwerk/cookie/nsCookieService.h
netwerk/dns/DNSRequestChild.cpp
netwerk/ipc/NeckoChild.cpp
netwerk/protocol/about/nsAboutProtocolHandler.cpp
netwerk/protocol/ftp/FTPChannelParent.cpp
netwerk/protocol/ftp/nsFtpProtocolHandler.cpp
netwerk/protocol/gio/nsGIOProtocolHandler.cpp
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpConnection.cpp
netwerk/protocol/http/nsHttpConnectionMgr.cpp
netwerk/socket/nsSOCKSIOLayer.cpp
netwerk/socket/nsUDPSocketProvider.cpp
parser/html/nsHtml5AtomTable.cpp
parser/html/nsHtml5Highlighter.cpp
parser/html/nsHtml5Parser.cpp
parser/html/nsHtml5SpeculativeLoad.cpp
parser/html/nsHtml5StreamParser.cpp
parser/html/nsHtml5TreeOpExecutor.cpp
parser/html/nsHtml5TreeOpExecutor.h
storage/FileSystemModule.cpp
storage/VacuumManager.cpp
toolkit/components/find/nsFind.cpp
toolkit/components/places/History.h
toolkit/components/places/nsFaviconService.h
toolkit/components/places/nsNavHistory.cpp
toolkit/components/places/nsNavHistory.h
toolkit/components/places/nsNavHistoryResult.cpp
toolkit/components/printingui/ipc/nsPrintingProxy.cpp
toolkit/components/statusfilter/nsBrowserStatusFilter.cpp
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
toolkit/components/url-classifier/nsUrlClassifierProxies.cpp
toolkit/profile/nsProfileLock.cpp
uriloader/base/nsURILoader.cpp
uriloader/exthandler/mac/nsMIMEInfoMac.h
uriloader/exthandler/nsExternalProtocolHandler.cpp
uriloader/exthandler/uikit/nsMIMEInfoUIKit.h
uriloader/prefetch/OfflineCacheUpdateChild.cpp
uriloader/prefetch/nsOfflineCacheUpdateService.cpp
uriloader/prefetch/nsPrefetchService.cpp
widget/cocoa/nsCocoaWindow.mm
widget/cocoa/nsNativeThemeCocoa.mm
widget/gtk/nsDragService.cpp
widget/gtk/nsNativeThemeGTK.cpp
widget/nsBaseWidget.cpp
widget/nsNativeTheme.cpp
widget/uikit/nsLookAndFeel.mm
widget/windows/LSPAnnotator.cpp
widget/windows/TaskbarTabPreview.cpp
widget/windows/WinTaskbar.cpp
widget/windows/nsDragService.cpp
widget/windows/nsImageClipboard.cpp
widget/windows/nsUXThemeData.cpp
xpcom/base/nsCycleCollector.cpp
xpcom/ds/nsCheapSets.h
xpcom/io/Base64.cpp
xpcom/io/nsBinaryStream.cpp
xpcom/io/nsDirectoryService.cpp
xpcom/io/nsEscape.cpp
xpcom/io/nsMultiplexInputStream.cpp
xpcom/io/nsPipe3.cpp
xpcom/io/nsStorageStream.cpp
xpcom/io/nsStreamUtils.cpp
xpcom/string/nsTSubstring.cpp
xpcom/tests/gtest/TestCallTemplates.cpp
xpcom/threads/LazyIdleThread.cpp
xpcom/threads/nsIIdleRunnable.h
xpfe/appshell/nsAppShellService.cpp
xpfe/appshell/nsWebShellWindow.cpp
--- a/accessible/base/AccGroupInfo.cpp
+++ b/accessible/base/AccGroupInfo.cpp
@@ -202,17 +202,17 @@ AccGroupInfo::NextItemTo(Accessible* aIt
     Accessible* nextItem = parent->GetChildAt(idx);
     AccGroupInfo* nextGroupInfo = nextItem->GetGroupInfo();
     if (nextGroupInfo &&
         nextGroupInfo->ConceptualParent() == groupInfo->ConceptualParent()) {
       return nextItem;
     }
   }
 
-  NS_NOTREACHED("Item in the middle of the group but there's no next item!");
+  MOZ_ASSERT_UNREACHABLE("Item in the middle of the group but there's no next item!");
   return nullptr;
 }
 
 bool
 AccGroupInfo::ShouldReportRelations(role aRole, role aParentRole)
 {
   // We only want to report hierarchy-based node relations for items in tree or
   // list form.  ARIA level/owns relations are always reported.
--- a/accessible/base/DocManager.cpp
+++ b/accessible/base/DocManager.cpp
@@ -314,44 +314,44 @@ DocManager::OnStateChange(nsIWebProgress
 NS_IMETHODIMP
 DocManager::OnProgressChange(nsIWebProgress* aWebProgress,
                              nsIRequest* aRequest,
                              int32_t aCurSelfProgress,
                              int32_t aMaxSelfProgress,
                              int32_t aCurTotalProgress,
                              int32_t aMaxTotalProgress)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DocManager::OnLocationChange(nsIWebProgress* aWebProgress,
                              nsIRequest* aRequest, nsIURI* aLocation,
                              uint32_t aFlags)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DocManager::OnStatusChange(nsIWebProgress* aWebProgress,
                            nsIRequest* aRequest, nsresult aStatus,
                            const char16_t* aMessage)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DocManager::OnSecurityChange(nsIWebProgress* aWebProgress,
                              nsIRequest* aRequest,
                              uint32_t aState)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIDOMEventListener
 
 NS_IMETHODIMP
 DocManager::HandleEvent(Event* aEvent)
--- a/accessible/base/TextUpdater.cpp
+++ b/accessible/base/TextUpdater.cpp
@@ -186,17 +186,17 @@ TextUpdater::ComputeTextChangeEvents(con
       --rowIdx;
       row -= colLen;
       continue;
     }
     if (dist == row[colIdx - 1]) { // deletion
       --colIdx;
       continue;
     }
-    NS_NOTREACHED("huh?");
+    MOZ_ASSERT_UNREACHABLE("huh?");
     return;
   }
 
   if (rowEnd)
     FireInsertEvent(Substring(aStr2, 0, rowEnd), 0, aEvents);
   if (colEnd)
     FireDeleteEvent(Substring(aStr1, 0, colEnd), 0, aEvents);
 }
--- a/accessible/base/nsAccUtils.cpp
+++ b/accessible/base/nsAccUtils.cpp
@@ -315,17 +315,17 @@ nsAccUtils::ConvertToScreenCoords(int32_
 
     case nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE:
     {
       coords += GetScreenCoordsForParent(aAccessible);
       break;
     }
 
     default:
-      NS_NOTREACHED("invalid coord type!");
+      MOZ_ASSERT_UNREACHABLE("invalid coord type!");
   }
 
   return coords;
 }
 
 void
 nsAccUtils::ConvertScreenCoordsTo(int32_t *aX, int32_t *aY,
                                   uint32_t aCoordinateType,
@@ -347,17 +347,17 @@ nsAccUtils::ConvertScreenCoordsTo(int32_
     {
       nsIntPoint coords = GetScreenCoordsForParent(aAccessible);
       *aX -= coords.x;
       *aY -= coords.y;
       break;
     }
 
     default:
-    NS_NOTREACHED("invalid coord type!");
+    MOZ_ASSERT_UNREACHABLE("invalid coord type!");
   }
 }
 
 nsIntPoint
 nsAccUtils::GetScreenCoordsForParent(Accessible* aAccessible)
 {
   Accessible* parent = aAccessible->Parent();
   if (!parent)
--- a/accessible/generic/BaseAccessibles.cpp
+++ b/accessible/generic/BaseAccessibles.cpp
@@ -36,24 +36,24 @@ LeafAccessible::ChildAtPoint(int32_t aX,
 {
   // Don't walk into leaf accessibles.
   return this;
 }
 
 bool
 LeafAccessible::InsertChildAt(uint32_t aIndex, Accessible* aChild)
 {
-  NS_NOTREACHED("InsertChildAt called on leaf accessible!");
+  MOZ_ASSERT_UNREACHABLE("InsertChildAt called on leaf accessible!");
   return false;
 }
 
 bool
 LeafAccessible::RemoveChild(Accessible* aChild)
 {
-  NS_NOTREACHED("RemoveChild called on leaf accessible!");
+  MOZ_ASSERT_UNREACHABLE("RemoveChild called on leaf accessible!");
   return false;
 }
 
 bool
 LeafAccessible::IsAcceptableChild(nsIContent* aEl) const
 {
   // No children for leaf accessible.
   return false;
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -1254,17 +1254,17 @@ HyperTextAccessible::TextBounds(int32_t 
 
   nsIntRect bounds;
   int32_t prevOffset = GetChildOffset(childIdx);
   int32_t offset1 = startOffset - prevOffset;
 
   while (childIdx < static_cast<int32_t>(ChildCount())) {
     nsIFrame* frame = GetChildAt(childIdx++)->GetFrame();
     if (!frame) {
-      NS_NOTREACHED("No frame for a child!");
+      MOZ_ASSERT_UNREACHABLE("No frame for a child!");
       continue;
     }
 
     int32_t nextOffset = GetChildOffset(childIdx);
     if (nextOffset >= static_cast<int32_t>(endOffset)) {
       bounds.UnionRect(bounds, GetBoundsInFrame(frame, offset1,
                                                 endOffset - prevOffset));
       break;
@@ -1500,17 +1500,17 @@ HyperTextAccessible::CaretLineNumber()
         int32_t addLines = lineIterForCaret->FindLineContaining(caretFrame);
         lineNumber += addLines;
       }
     }
 
     caretFrame = parentFrame;
   }
 
-  NS_NOTREACHED("DOM ancestry had this hypertext but frame ancestry didn't");
+  MOZ_ASSERT_UNREACHABLE("DOM ancestry had this hypertext but frame ancestry didn't");
   return lineNumber;
 }
 
 LayoutDeviceIntRect
 HyperTextAccessible::GetCaretRect(nsIWidget** aWidget)
 {
   *aWidget = nullptr;
 
--- a/accessible/html/HTMLListAccessible.cpp
+++ b/accessible/html/HTMLListAccessible.cpp
@@ -101,17 +101,17 @@ HTMLLIAccessible::InsertChildAt(uint32_t
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLLIAccessible: public
 
 void
 HTMLLIAccessible::UpdateBullet(bool aHasBullet)
 {
   if (aHasBullet == !!mBullet) {
-    NS_NOTREACHED("Bullet and accessible are in sync already!");
+    MOZ_ASSERT_UNREACHABLE("Bullet and accessible are in sync already!");
     return;
   }
 
   TreeMutation mt(this);
   if (aHasBullet) {
     mBullet = new HTMLListBulletAccessible(mContent, mDoc);
     mDoc->BindToDocument(mBullet, nullptr);
     InsertChildAt(0, mBullet);
--- a/accessible/mac/mozAccessible.mm
+++ b/accessible/mac/mozAccessible.mm
@@ -715,17 +715,17 @@ ConvertToNSArray(nsTArray<ProxyAccessibl
 
 #define ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule) \
   case roles::geckoRole: \
     return macRole;
 
   switch (mRole) {
 #include "RoleMap.h"
     default:
-      NS_NOTREACHED("Unknown role.");
+      MOZ_ASSERT_UNREACHABLE("Unknown role.");
       return NSAccessibilityUnknownRole;
   }
 
 #undef ROLE
 }
 
 - (NSString*)subrole
 {
--- a/accessible/xul/XULMenuAccessible.cpp
+++ b/accessible/xul/XULMenuAccessible.cpp
@@ -524,17 +524,17 @@ XULMenupopupAccessible::ContainerWidget(
 
     // different kind of popups like panel or tooltip
     if (!menuParent->IsMenu())
       return nullptr;
 
     menuPopupFrame = static_cast<nsMenuPopupFrame*>(menuParent);
   }
 
-  NS_NOTREACHED("Shouldn't be a real case.");
+  MOZ_ASSERT_UNREACHABLE("Shouldn't be a real case.");
   return nullptr;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULMenubarAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 XULMenubarAccessible::
--- a/chrome/nsChromeRegistryContent.cpp
+++ b/chrome/nsChromeRegistryContent.cpp
@@ -173,17 +173,17 @@ nsChromeRegistryContent::GetFlagsFromPac
   }
   *aFlags = entry->flags;
   return NS_OK;
 }
 
 // All functions following only make sense in chrome, and therefore assert
 
 #define CONTENT_NOTREACHED() \
-  NS_NOTREACHED("Content should not be calling this")
+  MOZ_ASSERT_UNREACHABLE("Content should not be calling this")
 
 #define CONTENT_NOT_IMPLEMENTED() \
   CONTENT_NOTREACHED();           \
   return NS_ERROR_NOT_IMPLEMENTED;
 
 NS_IMETHODIMP
 nsChromeRegistryContent::GetLocalesForPackage(const nsACString& aPackage,
                                               nsIUTF8StringEnumerator* *aResult)
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -5672,17 +5672,17 @@ nsDocShell::GetVisibility(bool* aVisibil
   RefPtr<nsDocShell> parentItem = docShell->GetParentDocshell();
   while (parentItem) {
     presShell = docShell->GetPresShell();
 
     nsCOMPtr<nsIPresShell> pPresShell = parentItem->GetPresShell();
 
     // Null-check for crash in bug 267804
     if (!pPresShell) {
-      NS_NOTREACHED("parent docshell has null pres shell");
+      MOZ_ASSERT_UNREACHABLE("parent docshell has null pres shell");
       return NS_OK;
     }
 
     vm = presShell->GetViewManager();
     if (vm) {
       view = vm->GetRootView();
     }
 
@@ -6962,17 +6962,17 @@ nsDocShell::OnStateChange(nsIWebProgress
   // information is available.
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::OnLocationChange(nsIWebProgress* aProgress, nsIRequest* aRequest,
                              nsIURI* aURI, uint32_t aFlags)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 void
 nsDocShell::OnRedirectStateChange(nsIChannel* aOldChannel,
                                   nsIChannel* aNewChannel,
                                   uint32_t aRedirectFlags,
                                   uint32_t aStateFlags)
@@ -7072,25 +7072,25 @@ nsDocShell::OnRedirectStateChange(nsICha
   }
 }
 
 NS_IMETHODIMP
 nsDocShell::OnStatusChange(nsIWebProgress* aWebProgress,
                            nsIRequest* aRequest,
                            nsresult aStatus, const char16_t* aMessage)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::OnSecurityChange(nsIWebProgress* aWebProgress,
                              nsIRequest* aRequest, uint32_t aState)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 nsresult
 nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
                         nsIChannel* aChannel, nsresult aStatus)
 {
   if (!aChannel) {
@@ -10971,17 +10971,17 @@ nsDocShell::AddHeadersToChannel(nsIInput
     //
     // FINALLY: we can set the header!
     //
 
     rv = httpChannel->SetRequestHeader(headerName, headerValue, true);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  NS_NOTREACHED("oops");
+  MOZ_ASSERT_UNREACHABLE("oops");
   return NS_ERROR_UNEXPECTED;
 }
 
 nsresult
 nsDocShell::DoChannelLoad(nsIChannel* aChannel,
                           nsIURILoader* aURILoader,
                           bool aBypassClassifier)
 {
--- a/docshell/base/nsDocShellLoadTypes.h
+++ b/docshell/base/nsDocShellLoadTypes.h
@@ -191,17 +191,17 @@ ConvertLoadTypeToDocShellInfoLoadType(ui
       break;
     case LOAD_REPLACE_BYPASS_CACHE:
       docShellLoadType = nsIDocShellLoadInfo::loadReplaceBypassCache;
       break;
     case LOAD_RELOAD_ALLOW_MIXED_CONTENT:
       docShellLoadType = nsIDocShellLoadInfo::loadReloadMixedContent;
       break;
     default:
-      NS_NOTREACHED("Unexpected load type value");
+      MOZ_ASSERT_UNREACHABLE("Unexpected load type value");
   }
 
   return docShellLoadType;
 }
 
 static inline uint32_t
 ConvertDocShellInfoLoadTypeToLoadType(nsDocShellInfoLoadType aDocShellLoadType)
 {
@@ -273,17 +273,17 @@ ConvertDocShellInfoLoadTypeToLoadType(ns
       break;
     case nsIDocShellLoadInfo::loadReplaceBypassCache:
       loadType = LOAD_REPLACE_BYPASS_CACHE;
       break;
     case nsIDocShellLoadInfo::loadReloadMixedContent:
       loadType = LOAD_RELOAD_ALLOW_MIXED_CONTENT;
       break;
     default:
-      NS_NOTREACHED("Unexpected nsDocShellInfoLoadType value");
+      MOZ_ASSERT_UNREACHABLE("Unexpected nsDocShellInfoLoadType value");
   }
 
   return loadType;
 }
 
 static inline nsDOMNavigationTiming::Type
 ConvertLoadTypeToNavigationType(uint32_t aLoadType)
 {
--- a/dom/animation/Animation.h
+++ b/dom/animation/Animation.h
@@ -398,17 +398,17 @@ protected:
   void PauseAt(const TimeDuration& aReadyTime);
   void FinishPendingAt(const TimeDuration& aReadyTime)
   {
     if (mPendingState == PendingState::PlayPending) {
       ResumeAt(aReadyTime);
     } else if (mPendingState == PendingState::PausePending) {
       PauseAt(aReadyTime);
     } else {
-      NS_NOTREACHED("Can't finish pending if we're not in a pending state");
+      MOZ_ASSERT_UNREACHABLE("Can't finish pending if we're not in a pending state");
     }
   }
   void ApplyPendingPlaybackRate()
   {
     if (mPendingPlaybackRate) {
       mPlaybackRate = *mPendingPlaybackRate;
       mPendingPlaybackRate.reset();
     }
--- a/dom/animation/CSSPseudoElement.cpp
+++ b/dom/animation/CSSPseudoElement.cpp
@@ -114,16 +114,16 @@ CSSPseudoElement::GetCSSPseudoElementPro
   switch (aType) {
     case CSSPseudoElementType::before:
       return nsGkAtoms::cssPseudoElementBeforeProperty;
 
     case CSSPseudoElementType::after:
       return nsGkAtoms::cssPseudoElementAfterProperty;
 
     default:
-      NS_NOTREACHED("Should not try to get CSSPseudoElement "
+      MOZ_ASSERT_UNREACHABLE("Should not try to get CSSPseudoElement "
                     "other than ::before or ::after");
       return nullptr;
   }
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -476,17 +476,17 @@ EffectCompositor::GetElementToRestyle(do
   if (aPseudoType == CSSPseudoElementType::before) {
     return nsLayoutUtils::GetBeforePseudo(aElement);
   }
 
   if (aPseudoType == CSSPseudoElementType::after) {
     return nsLayoutUtils::GetAfterPseudo(aElement);
   }
 
-  NS_NOTREACHED("Should not try to get the element to restyle for a pseudo "
+  MOZ_ASSERT_UNREACHABLE("Should not try to get the element to restyle for a pseudo "
                 "other that :before or :after");
   return nullptr;
 }
 
 bool
 EffectCompositor::HasPendingStyleUpdates() const
 {
   for (auto& elementSet : mElementsToRestyle) {
--- a/dom/animation/EffectSet.cpp
+++ b/dom/animation/EffectSet.cpp
@@ -137,17 +137,17 @@ EffectSet::GetEffectSetPropertyAtom(CSSP
 
     case CSSPseudoElementType::before:
       return nsGkAtoms::animationEffectsForBeforeProperty;
 
     case CSSPseudoElementType::after:
       return nsGkAtoms::animationEffectsForAfterProperty;
 
     default:
-      NS_NOTREACHED("Should not try to get animation effects for a pseudo "
+      MOZ_ASSERT_UNREACHABLE("Should not try to get animation effects for a pseudo "
                     "other that :before or :after");
       return nullptr;
   }
 }
 
 void
 EffectSet::AddEffect(dom::KeyframeEffect& aEffect)
 {
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -922,17 +922,17 @@ KeyframeEffect::GetTarget(Nullable<Ownin
                                               mTarget->mPseudoType);
       break;
 
     case CSSPseudoElementType::NotPseudo:
       aRv.SetValue().SetAsElement() = mTarget->mElement;
       break;
 
     default:
-      NS_NOTREACHED("Animation of unsupported pseudo-type");
+      MOZ_ASSERT_UNREACHABLE("Animation of unsupported pseudo-type");
       aRv.SetNull();
   }
 }
 
 void
 KeyframeEffect::SetTarget(const Nullable<ElementOrCSSPseudoElement>& aTarget)
 {
   Maybe<OwningAnimationTarget> newTarget = ConvertTarget(aTarget);
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -3238,17 +3238,17 @@ Element::GetEventTargetParentForLinks(Ev
       if (NS_SUCCEEDED(rv)) {
         aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
       }
       break;
     }
 
   default:
     // switch not in sync with the optimization switch earlier in this function
-    NS_NOTREACHED("switch statements not in sync");
+    MOZ_ASSERT_UNREACHABLE("switch statements not in sync");
   }
 }
 
 nsresult
 Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor)
 {
   // Optimisation: return early if this event doesn't interest us.
   // IMPORTANT: this switch and the switch below it must be kept in sync!
@@ -3352,17 +3352,17 @@ Element::PostHandleEventForLinks(EventCh
           aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
         }
       }
     }
     break;
 
   default:
     // switch not in sync with the optimization switch earlier in this function
-    NS_NOTREACHED("switch statements not in sync");
+    MOZ_ASSERT_UNREACHABLE("switch statements not in sync");
     return NS_ERROR_UNEXPECTED;
   }
 
   return rv;
 }
 
 void
 Element::GetLinkTarget(nsAString& aTarget)
--- a/dom/base/FormData.cpp
+++ b/dom/base/FormData.cpp
@@ -98,17 +98,17 @@ NS_INTERFACE_MAP_END
 
 // -------------------------------------------------------------------------
 // HTMLFormSubmission
 nsresult
 FormData::GetEncodedSubmission(nsIURI* aURI,
                                nsIInputStream** aPostDataStream,
                                nsCOMPtr<nsIURI>& aOutURI)
 {
-  NS_NOTREACHED("Shouldn't call FormData::GetEncodedSubmission");
+  MOZ_ASSERT_UNREACHABLE("Shouldn't call FormData::GetEncodedSubmission");
   return NS_OK;
 }
 
 void
 FormData::Append(const nsAString& aName, const nsAString& aValue,
                  ErrorResult& aRv)
 {
   AddNameValuePair(aName, aValue);
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -2099,17 +2099,17 @@ FragmentOrElement::GetText()
   return nullptr;
 }
 
 uint32_t
 FragmentOrElement::TextLength() const
 {
   // We can remove this assertion if it turns out to be useful to be able
   // to depend on this returning 0
-  NS_NOTREACHED("called FragmentOrElement::TextLength");
+  MOZ_ASSERT_UNREACHABLE("called FragmentOrElement::TextLength");
 
   return 0;
 }
 
 bool
 FragmentOrElement::TextIsOnlyWhitespace()
 {
   return false;
--- a/dom/base/ThirdPartyUtil.cpp
+++ b/dom/base/ThirdPartyUtil.cpp
@@ -165,17 +165,17 @@ ThirdPartyUtil::IsThirdPartyWindow(mozID
       *aResult = true;
       return NS_OK;
     }
 
     current = parent;
     currentURI = parentURI;
   } while (1);
 
-  NS_NOTREACHED("should've returned");
+  MOZ_ASSERT_UNREACHABLE("should've returned");
   return NS_ERROR_UNEXPECTED;
 }
 
 // Determine if the URI associated with aChannel or any URI of the window
 // hierarchy associated with the channel is foreign with respect to aSecondURI.
 // See docs for mozIThirdPartyUtil.
 NS_IMETHODIMP
 ThirdPartyUtil::IsThirdPartyChannel(nsIChannel* aChannel,
--- a/dom/base/nsAttrValue.cpp
+++ b/dom/base/nsAttrValue.cpp
@@ -322,17 +322,17 @@ nsAttrValue::SetTo(const nsAttrValue& aO
     }
     default:
     {
       if (IsSVGType(otherCont->mType)) {
         // All SVG types are just pointers to classes and will therefore have
         // the same size so it doesn't really matter which one we assign
         cont->mValue.mSVGAngle = otherCont->mValue.mSVGAngle;
       } else {
-        NS_NOTREACHED("unknown type stored in MiscContainer");
+        MOZ_ASSERT_UNREACHABLE("unknown type stored in MiscContainer");
       }
       break;
     }
   }
 
   void* otherPtr = MISC_STR_PTR(otherCont);
   if (otherPtr) {
     if (static_cast<ValueBaseType>(otherCont->mStringBits & NS_ATTRVALUE_BASETYPE_MASK) ==
@@ -588,17 +588,17 @@ nsAttrValue::ToString(nsAString& aResult
       intStr.AppendInt(GetIntegerValue());
       aResult = intStr;
 
       break;
     }
 #ifdef DEBUG
     case eColor:
     {
-      NS_NOTREACHED("color attribute without string data");
+      MOZ_ASSERT_UNREACHABLE("color attribute without string data");
       aResult.Truncate();
       break;
     }
 #endif
     case eEnum:
     {
       GetEnumString(aResult, false);
       break;
@@ -773,17 +773,17 @@ nsAttrValue::GetEnumString(nsAString& aR
       if (!aRealTag && allEnumBits & NS_ATTRVALUE_ENUMTABLE_VALUE_NEEDS_TO_UPPER) {
         nsContentUtils::ASCIIToUpper(aResult);
       }
       return;
     }
     table++;
   }
 
-  NS_NOTREACHED("couldn't find value in EnumTable");
+  MOZ_ASSERT_UNREACHABLE("couldn't find value in EnumTable");
 }
 
 uint32_t
 nsAttrValue::GetAtomCount() const
 {
   ValueType type = Type();
 
   if (type == eAtom) {
@@ -894,17 +894,17 @@ nsAttrValue::HashValue() const
       return NS_PTR_TO_INT32(cont->mValue.mIntMargin);
     }
     default:
     {
       if (IsSVGType(cont->mType)) {
         // All SVG types are just pointers to classes so we can treat them alike
         return NS_PTR_TO_INT32(cont->mValue.mSVGAngle);
       }
-      NS_NOTREACHED("unknown type stored in MiscContainer");
+      MOZ_ASSERT_UNREACHABLE("unknown type stored in MiscContainer");
       return 0;
     }
   }
 }
 
 bool
 nsAttrValue::Equals(const nsAttrValue& aOther) const
 {
@@ -1004,17 +1004,17 @@ nsAttrValue::Equals(const nsAttrValue& a
         // Currently this method is never called for nsAttrValue objects that
         // point to SVG data types.
         // If that changes then we probably want to add methods to the
         // corresponding SVG types to compare their base values.
         // As a shortcut, however, we can begin by comparing the pointers.
         MOZ_ASSERT(false, "Comparing nsAttrValues that point to SVG data");
         return false;
       }
-      NS_NOTREACHED("unknown type stored in MiscContainer");
+      MOZ_ASSERT_UNREACHABLE("unknown type stored in MiscContainer");
       return false;
     }
   }
   if (needsStringComparison) {
     if (thisCont->mStringBits == otherCont->mStringBits) {
       return true;
     }
     if ((static_cast<ValueBaseType>(thisCont->mStringBits & NS_ATTRVALUE_BASETYPE_MASK) ==
@@ -1326,17 +1326,17 @@ nsAttrValue::SetIntValueAndType(int32_t 
       }
       case eEnum:
       {
         cont->mValue.mEnumValue = aValue;
         break;
       }
       default:
       {
-        NS_NOTREACHED("unknown integer type");
+        MOZ_ASSERT_UNREACHABLE("unknown integer type");
         break;
       }
     }
     cont->mType = aType;
     SetMiscAtomOrString(aStringValue);
   } else {
     NS_ASSERTION(!mBits, "Reset before calling SetIntValueAndType!");
     mBits = (aValue * NS_ATTRVALUE_INTEGERTYPE_MULTIPLIER) | aType;
--- a/dom/base/nsContentIterator.cpp
+++ b/dom/base/nsContentIterator.cpp
@@ -454,17 +454,17 @@ nsContentIterator::InitInternal(const Ra
         mLast = aEnd.Container()->AsContent();
       }
     }
   } else {
     cChild = aEnd.Ref();
 
     if (NS_WARN_IF(!cChild)) {
       // No child at offset!
-      NS_NOTREACHED("nsContentIterator::nsContentIterator");
+      MOZ_ASSERT_UNREACHABLE("nsContentIterator::nsContentIterator");
       return NS_ERROR_FAILURE;
     }
 
     if (mPre) {
       mLast  = GetDeepLastChild(cChild);
       NS_WARNING_ASSERTION(mLast, "GetDeepLastChild returned null");
 
       if (NS_WARN_IF(!NodeIsInTraversalRange(mLast, mPre, aStart, aEnd))) {
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -5028,17 +5028,17 @@ nsContentUtils::ParseFragmentHTML(const 
                                   nsAtom* aContextLocalName,
                                   int32_t aContextNamespace,
                                   bool aQuirks,
                                   bool aPreventScriptExecution)
 {
   AutoTimelineMarker m(aTargetNode->OwnerDoc()->GetDocShell(), "Parse HTML");
 
   if (nsContentUtils::sFragmentParsingActive) {
-    NS_NOTREACHED("Re-entrant fragment parsing attempted.");
+    MOZ_ASSERT_UNREACHABLE("Re-entrant fragment parsing attempted.");
     return NS_ERROR_DOM_INVALID_STATE_ERR;
   }
   mozilla::AutoRestore<bool> guard(nsContentUtils::sFragmentParsingActive);
   nsContentUtils::sFragmentParsingActive = true;
   if (!sHTMLFragmentParser) {
     NS_ADDREF(sHTMLFragmentParser = new nsHtml5StringParser());
     // Now sHTMLFragmentParser owns the object
   }
@@ -5084,17 +5084,17 @@ nsContentUtils::ParseFragmentHTML(const 
 nsresult
 nsContentUtils::ParseDocumentHTML(const nsAString& aSourceBuffer,
                                   nsIDocument* aTargetDocument,
                                   bool aScriptingEnabledForNoscriptParsing)
 {
   AutoTimelineMarker m(aTargetDocument->GetDocShell(), "Parse HTML");
 
   if (nsContentUtils::sFragmentParsingActive) {
-    NS_NOTREACHED("Re-entrant fragment parsing attempted.");
+    MOZ_ASSERT_UNREACHABLE("Re-entrant fragment parsing attempted.");
     return NS_ERROR_DOM_INVALID_STATE_ERR;
   }
   mozilla::AutoRestore<bool> guard(nsContentUtils::sFragmentParsingActive);
   nsContentUtils::sFragmentParsingActive = true;
   if (!sHTMLFragmentParser) {
     NS_ADDREF(sHTMLFragmentParser = new nsHtml5StringParser());
     // Now sHTMLFragmentParser owns the object
   }
@@ -5111,17 +5111,17 @@ nsContentUtils::ParseFragmentXML(const n
                                  nsIDocument* aDocument,
                                  nsTArray<nsString>& aTagStack,
                                  bool aPreventScriptExecution,
                                  DocumentFragment** aReturn)
 {
   AutoTimelineMarker m(aDocument->GetDocShell(), "Parse XML");
 
   if (nsContentUtils::sFragmentParsingActive) {
-    NS_NOTREACHED("Re-entrant fragment parsing attempted.");
+    MOZ_ASSERT_UNREACHABLE("Re-entrant fragment parsing attempted.");
     return NS_ERROR_DOM_INVALID_STATE_ERR;
   }
   mozilla::AutoRestore<bool> guard(nsContentUtils::sFragmentParsingActive);
   nsContentUtils::sFragmentParsingActive = true;
   if (!sXMLFragmentParser) {
     nsCOMPtr<nsIParser> parser = do_CreateInstance(kCParserCID);
     parser.forget(&sXMLFragmentParser);
     // sXMLFragmentParser now owns the parser
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -8214,17 +8214,17 @@ void
 nsDocument::UnblockOnload(bool aFireSync)
 {
   if (mDisplayDocument) {
     mDisplayDocument->UnblockOnload(aFireSync);
     return;
   }
 
   if (mOnloadBlockCount == 0 && mAsyncOnloadBlockCount == 0) {
-    NS_NOTREACHED("More UnblockOnload() calls than BlockOnload() calls; dropping call");
+    MOZ_ASSERT_UNREACHABLE("More UnblockOnload() calls than BlockOnload() calls; dropping call");
     return;
   }
 
   --mOnloadBlockCount;
 
   if (mOnloadBlockCount == 0) {
     if (mScriptGlobalObject) {
       // Only manipulate the loadgroup in this case, because if mScriptGlobalObject
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -775,17 +775,17 @@ nsINode::CompareDocumentPosition(nsINode
           return NodeBinding::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC |
             NodeBinding::DOCUMENT_POSITION_PRECEDING;
         }
         if (attrName->Equals(attr2->NodeInfo())) {
           return NodeBinding::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC |
             NodeBinding::DOCUMENT_POSITION_FOLLOWING;
         }
       }
-      NS_NOTREACHED("neither attribute in the element");
+      MOZ_ASSERT_UNREACHABLE("neither attribute in the element");
       return NodeBinding::DOCUMENT_POSITION_DISCONNECTED;
     }
 
     if (elem) {
       node2 = elem;
       parents2.AppendElement(attr2);
     }
   }
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -1433,17 +1433,17 @@ private:
         return next;
       }
       nsINode* parent = cur->GetParentNode();
       if (parent == aRoot) {
         return nullptr;
       }
       cur = parent;
     }
-    NS_NOTREACHED("How did we get here?");
+    MOZ_ASSERT_UNREACHABLE("How did we get here?");
   }
 
 public:
 
   /**
    * Get the previous nsIContent in the pre-order tree traversal of the DOM.  If
    * aRoot is non-null, then it must be an ancestor of |this|
    * (possibly equal to |this|) and only nsIContents that are descendants of
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -497,17 +497,17 @@ IsPluginEnabledByExtension(nsIURI* uri, 
   // Disables any native PDF plugins, when internal PDF viewer is enabled.
   if (ext.EqualsIgnoreCase("pdf") && nsContentUtils::IsPDFJSEnabled()) {
     return false;
   }
 
   RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
 
   if (!pluginHost) {
-    NS_NOTREACHED("No pluginhost");
+    MOZ_ASSERT_UNREACHABLE("No pluginhost");
     return false;
   }
 
   return pluginHost->HavePluginForExtension(ext, mimeType);
 }
 
 ///
 /// Member Functions
@@ -524,22 +524,22 @@ nsObjectLoadingContent::QueueCheckPlugin
 }
 
 // Tedious syntax to create a plugin stream listener with checks and put it in
 // mFinalListener
 bool
 nsObjectLoadingContent::MakePluginListener()
 {
   if (!mInstanceOwner) {
-    NS_NOTREACHED("expecting a spawned plugin");
+    MOZ_ASSERT_UNREACHABLE("expecting a spawned plugin");
     return false;
   }
   RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
   if (!pluginHost) {
-    NS_NOTREACHED("No pluginHost");
+    MOZ_ASSERT_UNREACHABLE("No pluginHost");
     return false;
   }
   NS_ASSERTION(!mFinalListener, "overwriting a final listener");
   nsresult rv;
   RefPtr<nsNPAPIPluginInstance> inst;
   nsCOMPtr<nsIStreamListener> finalListener;
   rv = mInstanceOwner->GetInstance(getter_AddRefs(inst));
   NS_ENSURE_SUCCESS(rv, false);
@@ -557,17 +557,17 @@ nsObjectLoadingContent::SetupFrameLoader
   nsCOMPtr<nsIContent> thisContent =
     do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
   NS_ASSERTION(thisContent, "must be a content");
 
   mFrameLoader = nsFrameLoader::Create(thisContent->AsElement(),
                                        /* aOpener = */ nullptr,
                                        mNetworkCreated, aJSPluginId);
   if (!mFrameLoader) {
-    NS_NOTREACHED("nsFrameLoader::Create failed");
+    MOZ_ASSERT_UNREACHABLE("nsFrameLoader::Create failed");
   }
 }
 
 // Helper to spawn the frameloader and return a pointer to its docshell.
 already_AddRefed<nsIDocShell>
 nsObjectLoadingContent::SetupDocShell(nsIURI* aRecursionCheckURI)
 {
   SetupFrameLoader(nsFakePluginTag::NOT_JSPLUGIN);
@@ -578,17 +578,17 @@ nsObjectLoadingContent::SetupDocShell(ns
   nsCOMPtr<nsIDocShell> docShell;
 
   if (aRecursionCheckURI) {
     nsresult rv = mFrameLoader->CheckForRecursiveLoad(aRecursionCheckURI);
     if (NS_SUCCEEDED(rv)) {
       IgnoredErrorResult result;
       docShell = mFrameLoader->GetDocShell(result);
       if (result.Failed()) {
-        NS_NOTREACHED("Could not get DocShell from mFrameLoader?");
+        MOZ_ASSERT_UNREACHABLE("Could not get DocShell from mFrameLoader?");
       }
     } else {
       LOG(("OBJLC [%p]: Aborting recursive load", this));
     }
   }
 
   if (!docShell) {
     mFrameLoader->Destroy();
@@ -668,23 +668,23 @@ nsObjectLoadingContent::nsObjectLoadingC
   , mPreferFallback(false)
   , mPreferFallbackKnown(false) {}
 
 nsObjectLoadingContent::~nsObjectLoadingContent()
 {
   // Should have been unbound from the tree at this point, and
   // CheckPluginStopEvent keeps us alive
   if (mFrameLoader) {
-    NS_NOTREACHED("Should not be tearing down frame loaders at this point");
+    MOZ_ASSERT_UNREACHABLE("Should not be tearing down frame loaders at this point");
     mFrameLoader->Destroy();
   }
   if (mInstanceOwner || mInstantiating) {
     // This is especially bad as delayed stop will try to hold on to this
     // object...
-    NS_NOTREACHED("Should not be tearing down a plugin at this point!");
+    MOZ_ASSERT_UNREACHABLE("Should not be tearing down a plugin at this point!");
     StopPluginInstance();
   }
   DestroyImageLoadingContent();
 }
 
 nsresult
 nsObjectLoadingContent::InstantiatePluginInstance(bool aIsLoading)
 {
@@ -726,17 +726,17 @@ nsObjectLoadingContent::InstantiatePlugi
     LOG(("OBJLC [%p]: Not instantiating plugin with no frame", this));
     return NS_OK;
   }
 
   nsresult rv = NS_ERROR_FAILURE;
   RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
 
   if (!pluginHost) {
-    NS_NOTREACHED("No pluginhost");
+    MOZ_ASSERT_UNREACHABLE("No pluginhost");
     return NS_ERROR_FAILURE;
   }
 
   // If you add early return(s), be sure to balance this call to
   // appShell->SuspendNative() with additional call(s) to
   // appShell->ReturnNative().
   nsCOMPtr<nsIAppShell> appShell = do_GetService(kAppShellCID);
   if (appShell) {
@@ -995,29 +995,29 @@ nsObjectLoadingContent::OnStartRequest(n
     return NS_BINDING_ABORTED;
   }
 
   // If we already switched to type plugin, this channel can just be passed to
   // the final listener.
   if (mType == eType_Plugin) {
     if (!mInstanceOwner) {
       // We drop mChannel when stopping plugins, so something is wrong
-      NS_NOTREACHED("Opened a channel in plugin mode, but don't have a plugin");
+      MOZ_ASSERT_UNREACHABLE("Opened a channel in plugin mode, but don't have a plugin");
       return NS_BINDING_ABORTED;
     }
     if (MakePluginListener()) {
       return mFinalListener->OnStartRequest(aRequest, nullptr);
     }
-    NS_NOTREACHED("Failed to create PluginStreamListener, aborting channel");
+    MOZ_ASSERT_UNREACHABLE("Failed to create PluginStreamListener, aborting channel");
     return NS_BINDING_ABORTED;
   }
 
   // Otherwise we should be state loading, and call LoadObject with the channel
   if (mType != eType_Loading) {
-    NS_NOTREACHED("Should be type loading at this point");
+    MOZ_ASSERT_UNREACHABLE("Should be type loading at this point");
     return NS_BINDING_ABORTED;
   }
   NS_ASSERTION(!mChannelLoaded, "mChannelLoaded set already?");
   NS_ASSERTION(!mFinalListener, "mFinalListener exists already?");
 
   mChannelLoaded = true;
 
   nsCOMPtr<nsIChannel> chan(do_QueryInterface(aRequest));
@@ -1109,17 +1109,17 @@ nsObjectLoadingContent::OnDataAvailable(
   if (mFinalListener) {
     // This may re-enter in the case of plugin listeners
     nsCOMPtr<nsIStreamListener> listenerGrip(mFinalListener);
     return listenerGrip->OnDataAvailable(aRequest, aContext, aInputStream,
                                          aOffset, aCount);
   }
 
   // We shouldn't have a connected channel with no final listener
-  NS_NOTREACHED("Got data for channel with no connected final listener");
+  MOZ_ASSERT_UNREACHABLE("Got data for channel with no connected final listener");
   mChannel = nullptr;
 
   return NS_ERROR_UNEXPECTED;
 }
 
 // nsIFrameLoaderOwner
 NS_IMETHODIMP_(already_AddRefed<nsFrameLoader>)
 nsObjectLoadingContent::GetFrameLoader()
@@ -1328,17 +1328,17 @@ nsObjectLoadingContent::ObjectState() co
         case eFallbackAlternate:
           return NS_EVENT_STATE_BROKEN;
         case eFallbackVulnerableUpdatable:
           return NS_EVENT_STATE_VULNERABLE_UPDATABLE;
         case eFallbackVulnerableNoUpdate:
           return NS_EVENT_STATE_VULNERABLE_NO_UPDATE;
       }
   }
-  NS_NOTREACHED("unknown type?");
+  MOZ_ASSERT_UNREACHABLE("unknown type?");
   return NS_EVENT_STATE_LOADING;
 }
 
 void
 nsObjectLoadingContent::MaybeRewriteYoutubeEmbed(nsIURI* aURI, nsIURI* aBaseURI, nsIURI** aOutURI)
 {
   nsCOMPtr<nsIContent> thisContent =
     do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
@@ -1445,17 +1445,17 @@ nsObjectLoadingContent::MaybeRewriteYout
                                   msgName,
                                   params, ArrayLength(params));
 }
 
 bool
 nsObjectLoadingContent::CheckLoadPolicy(int16_t *aContentPolicy)
 {
   if (!aContentPolicy || !mURI) {
-    NS_NOTREACHED("Doing it wrong");
+    MOZ_ASSERT_UNREACHABLE("Doing it wrong");
     return false;
   }
 
   nsCOMPtr<nsIContent> thisContent =
     do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
   NS_ASSERTION(thisContent, "Must be an instance of content");
 
   nsIDocument* doc = thisContent->OwnerDoc();
@@ -1484,17 +1484,17 @@ nsObjectLoadingContent::CheckLoadPolicy(
 
   return true;
 }
 
 bool
 nsObjectLoadingContent::CheckProcessPolicy(int16_t *aContentPolicy)
 {
   if (!aContentPolicy) {
-    NS_NOTREACHED("Null out variable");
+    MOZ_ASSERT_UNREACHABLE("Null out variable");
     return false;
   }
 
   nsCOMPtr<nsIContent> thisContent =
     do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
   NS_ASSERTION(thisContent, "Must be an instance of content");
 
   nsIDocument* doc = thisContent->OwnerDoc();
@@ -1509,17 +1509,17 @@ nsObjectLoadingContent::CheckProcessPoli
       break;
     // FIXME Fake plugins look just like real plugins to CSP, should they use
     // the fake plugin's handler URI and look like documents instead?
     case eType_FakePlugin:
     case eType_Plugin:
       objectType = GetContentPolicyType();
       break;
     default:
-      NS_NOTREACHED("Calling checkProcessPolicy with a unloadable type");
+      MOZ_ASSERT_UNREACHABLE("Calling checkProcessPolicy with a unloadable type");
       return false;
   }
 
   nsCOMPtr<nsILoadInfo> secCheckLoadInfo =
     new LoadInfo(doc->NodePrincipal(), // loading principal
                  doc->NodePrincipal(), // triggering principal
                  thisContent,
                  nsILoadInfo::SEC_ONLY_FOR_EXPLICIT_CONTENTSEC_CHECK,
@@ -1627,17 +1627,17 @@ nsObjectLoadingContent::UpdateObjectPara
 
   nsAutoString uriStr;
   // Different elements keep this in various locations
   if (thisElement->NodeInfo()->Equals(nsGkAtoms::object)) {
     thisElement->GetAttr(kNameSpaceID_None, nsGkAtoms::data, uriStr);
   } else if (thisElement->NodeInfo()->Equals(nsGkAtoms::embed)) {
     thisElement->GetAttr(kNameSpaceID_None, nsGkAtoms::src, uriStr);
   } else {
-    NS_NOTREACHED("Unrecognized plugin-loading tag");
+    MOZ_ASSERT_UNREACHABLE("Unrecognized plugin-loading tag");
   }
 
   mRewrittenYoutubeEmbed = false;
   // Note that the baseURI changing could affect the newURI, even if uriStr did
   // not change.
   if (!uriStr.IsEmpty()) {
     rv = nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(newURI),
                                                    uriStr,
@@ -1694,17 +1694,17 @@ nsObjectLoadingContent::UpdateObjectPara
   // If we have a channel and are type loading, as opposed to having an existing
   // channel for a previous load.
   bool newChannel = useChannel && mType == eType_Loading;
 
   if (newChannel && mChannel) {
     nsCString channelType;
     rv = mChannel->GetContentType(channelType);
     if (NS_FAILED(rv)) {
-      NS_NOTREACHED("GetContentType failed");
+      MOZ_ASSERT_UNREACHABLE("GetContentType failed");
       stateInvalid = true;
       channelType.Truncate();
     }
 
     LOG(("OBJLC [%p]: Channel has a content type of %s", this, channelType.get()));
 
     bool binaryChannelType = false;
     if (channelType.EqualsASCII(APPLICATION_GUESS_FROM_EXT)) {
@@ -1714,17 +1714,17 @@ nsObjectLoadingContent::UpdateObjectPara
     } else if (channelType.EqualsASCII(APPLICATION_OCTET_STREAM)
                || channelType.EqualsASCII(BINARY_OCTET_STREAM)) {
       binaryChannelType = true;
     }
 
     // Channel can change our URI through redirection
     rv = NS_GetFinalChannelURI(mChannel, getter_AddRefs(newURI));
     if (NS_FAILED(rv)) {
-      NS_NOTREACHED("NS_GetFinalChannelURI failure");
+      MOZ_ASSERT_UNREACHABLE("NS_GetFinalChannelURI failure");
       stateInvalid = true;
     }
 
     ObjectType typeHint = newMime.IsEmpty() ? eType_Null
                           : GetTypeOfContent(newMime, mSkipFakePlugins);
 
     //
     // In order of preference:
@@ -1897,17 +1897,17 @@ nsObjectLoadingContent::UpdateObjectPara
 // channel.
 NS_IMETHODIMP
 nsObjectLoadingContent::InitializeFromChannel(nsIRequest *aChannel)
 {
   LOG(("OBJLC [%p] InitializeFromChannel: %p", this, aChannel));
   if (mType != eType_Loading || mChannel) {
     // We could technically call UnloadObject() here, if consumers have a valid
     // reason for wanting to call this on an already-loaded tag.
-    NS_NOTREACHED("Should not have begun loading at this point");
+    MOZ_ASSERT_UNREACHABLE("Should not have begun loading at this point");
     return NS_ERROR_UNEXPECTED;
   }
 
   // Because we didn't open this channel from an initial LoadObject, we'll
   // update our parameters now, so the OnStartRequest->LoadObject doesn't
   // believe our src/type suddenly changed.
   UpdateObjectParameters();
   // But we always want to load from a channel, in this case.
@@ -2040,17 +2040,17 @@ nsObjectLoadingContent::LoadObject(bool 
   } else if (mType == eType_Loading && mChannel) {
     // We're still waiting on a channel load, already opened one, and
     // channel parameters didn't change
     return NS_OK;
   } else if (mChannelLoaded && mChannel != aLoadingChannel) {
     // The only time we should have a loaded channel with a changed state is
     // when the channel has just opened -- in which case this call should
     // have originated from OnStartRequest
-    NS_NOTREACHED("Loading with a channel, but state doesn't make sense");
+    MOZ_ASSERT_UNREACHABLE("Loading with a channel, but state doesn't make sense");
     return NS_OK;
   }
 
   //
   // Security checks
   //
 
   if (mType != eType_Null) {
@@ -2142,25 +2142,25 @@ nsObjectLoadingContent::LoadObject(bool 
     mActivated = true;
   }
 
   // Sanity check: We shouldn't have any loaded resources, pending events, or
   // a final listener at this point
   if (mFrameLoader || mPendingInstantiateEvent || mInstanceOwner ||
       mPendingCheckPluginStopEvent || mFinalListener)
   {
-    NS_NOTREACHED("Trying to load new plugin with existing content");
+    MOZ_ASSERT_UNREACHABLE("Trying to load new plugin with existing content");
     rv = NS_ERROR_UNEXPECTED;
     return NS_OK;
   }
 
   // More sanity-checking:
   // If mChannel is set, mChannelLoaded should be set, and vice-versa
   if (mType != eType_Null && !!mChannel != mChannelLoaded) {
-    NS_NOTREACHED("Trying to load with bad channel state");
+    MOZ_ASSERT_UNREACHABLE("Trying to load with bad channel state");
     rv = NS_ERROR_UNEXPECTED;
     return NS_OK;
   }
 
   ///
   /// Attempt to load new type
   ///
 
@@ -2177,17 +2177,17 @@ nsObjectLoadingContent::LoadObject(bool 
   // If we decide to synchronously spawn a plugin, we do it after firing
   // notifications to avoid re-entry causing notifications to fire out of order.
   bool doSpawnPlugin = false;
   switch (mType) {
     case eType_Image:
       if (!mChannel) {
         // We have a LoadImage() call, but UpdateObjectParameters requires a
         // channel for images, so this is not a valid state.
-        NS_NOTREACHED("Attempting to load image without a channel?");
+        MOZ_ASSERT_UNREACHABLE("Attempting to load image without a channel?");
         rv = NS_ERROR_UNEXPECTED;
         break;
       }
       rv = LoadImageWithChannel(mChannel, getter_AddRefs(finalListener));
       // finalListener will receive OnStartRequest below
     break;
     case eType_Plugin:
     {
@@ -2281,17 +2281,17 @@ nsObjectLoadingContent::LoadObject(bool 
       }
 
       nsCOMPtr<nsIURI> handlerURI;
       if (tag) {
         tag->GetHandlerURI(getter_AddRefs(handlerURI));
       }
 
       if (!handlerURI) {
-        NS_NOTREACHED("Selected type is not a proper fake plugin handler");
+        MOZ_ASSERT_UNREACHABLE("Selected type is not a proper fake plugin handler");
         rv = NS_ERROR_FAILURE;
         break;
       }
 
       nsCString spec;
       handlerURI->GetSpec(spec);
       LOG(("OBJLC [%p]: Loading fake plugin handler (%s)", this, spec.get()));
 
@@ -2303,17 +2303,17 @@ nsObjectLoadingContent::LoadObject(bool 
       }
     }
     break;
     case eType_Document:
     {
       if (!mChannel) {
         // We could mFrameLoader->LoadURI(mURI), but UpdateObjectParameters
         // requires documents have a channel, so this is not a valid state.
-        NS_NOTREACHED("Attempting to load a document without a channel");
+        MOZ_ASSERT_UNREACHABLE("Attempting to load a document without a channel");
         rv = NS_ERROR_FAILURE;
         break;
       }
 
       nsCOMPtr<nsIDocShell> docShell = SetupDocShell(mURI);
       if (!docShell) {
         rv = NS_ERROR_FAILURE;
         break;
@@ -2327,17 +2327,17 @@ nsObjectLoadingContent::LoadObject(bool 
       mChannel->SetLoadFlags(flags);
 
       nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(docShell));
       NS_ASSERTION(req, "Docshell must be an ifreq");
 
       nsCOMPtr<nsIURILoader>
         uriLoader(do_GetService(NS_URI_LOADER_CONTRACTID, &rv));
       if (NS_FAILED(rv)) {
-        NS_NOTREACHED("Failed to get uriLoader service");
+        MOZ_ASSERT_UNREACHABLE("Failed to get uriLoader service");
         mFrameLoader->Destroy();
         mFrameLoader = nullptr;
         break;
       }
 
       rv = uriLoader->OpenChannel(mChannel, nsIURILoader::DONT_RETARGET, req,
                                   getter_AddRefs(finalListener));
       // finalListener will receive OnStartRequest below
@@ -2852,17 +2852,17 @@ nsObjectLoadingContent::ScriptRequestPlu
   if (callerIsContentJS && !mScriptRequested &&
       InActiveDocument(thisContent) && mType == eType_Null &&
       mFallbackType >= eFallbackClickToPlay) {
     nsCOMPtr<nsIRunnable> ev =
       new nsSimplePluginEvent(thisContent,
                               NS_LITERAL_STRING("PluginScripted"));
     nsresult rv = NS_DispatchToCurrentThread(ev);
     if (NS_FAILED(rv)) {
-      NS_NOTREACHED("failed to dispatch PluginScripted event");
+      MOZ_ASSERT_UNREACHABLE("failed to dispatch PluginScripted event");
     }
     mScriptRequested = true;
   } else if (callerIsContentJS && mType == eType_Plugin && !mInstanceOwner &&
              nsContentUtils::IsSafeToRunScript() &&
              InActiveDocument(thisContent)) {
     // If we're configured as a plugin in an active document and it's safe to
     // run scripts right now, try spawning synchronously
     SyncStartPluginInstance();
--- a/dom/base/nsStyleLinkElement.cpp
+++ b/dom/base/nsStyleLinkElement.cpp
@@ -171,17 +171,17 @@ void
 nsStyleLinkElement::GetCharset(nsAString& aCharset)
 {
   aCharset.Truncate();
 }
 
 /* virtual */ void
 nsStyleLinkElement::OverrideBaseURI(nsIURI* aNewBaseURI)
 {
-  NS_NOTREACHED("Base URI can't be overriden in this implementation "
+  MOZ_ASSERT_UNREACHABLE("Base URI can't be overriden in this implementation "
                 "of nsIStyleSheetLinkingElement.");
 }
 
 /* virtual */ void
 nsStyleLinkElement::SetLineNumber(uint32_t aLineNumber)
 {
   mLineNumber = aLineNumber;
 }
--- a/dom/fetch/Fetch.cpp
+++ b/dom/fetch/Fetch.cpp
@@ -907,17 +907,17 @@ ExtractByteStreamFromBody(const fetch::O
 
   if (aBodyInit.IsURLSearchParams()) {
     URLSearchParams& usp = aBodyInit.GetAsURLSearchParams();
     BodyExtractor<const URLSearchParams> body(&usp);
     return body.GetAsStream(aStream, &aContentLength, aContentTypeWithCharset,
                             charset);
   }
 
-  NS_NOTREACHED("Should never reach here");
+  MOZ_ASSERT_UNREACHABLE("Should never reach here");
   return NS_ERROR_FAILURE;
 }
 
 nsresult
 ExtractByteStreamFromBody(const fetch::BodyInit& aBodyInit,
                           nsIInputStream** aStream,
                           nsCString& aContentTypeWithCharset,
                           uint64_t& aContentLength)
@@ -959,17 +959,17 @@ ExtractByteStreamFromBody(const fetch::B
   }
 
   if (aBodyInit.IsURLSearchParams()) {
     BodyExtractor<const URLSearchParams> body(&aBodyInit.GetAsURLSearchParams());
     return body.GetAsStream(aStream, &aContentLength, aContentTypeWithCharset,
                             charset);
   }
 
-  NS_NOTREACHED("Should never reach here");
+  MOZ_ASSERT_UNREACHABLE("Should never reach here");
   return NS_ERROR_FAILURE;
 }
 
 nsresult
 ExtractByteStreamFromBody(const fetch::ResponseBodyInit& aBodyInit,
                           nsIInputStream** aStream,
                           nsCString& aContentTypeWithCharset,
                           uint64_t& aContentLength)
@@ -1015,17 +1015,17 @@ ExtractByteStreamFromBody(const fetch::R
   }
 
   if (aBodyInit.IsURLSearchParams()) {
     BodyExtractor<const URLSearchParams> body(&aBodyInit.GetAsURLSearchParams());
     return body.GetAsStream(aStream, &aContentLength, aContentTypeWithCharset,
                             charset);
   }
 
-  NS_NOTREACHED("Should never reach here");
+  MOZ_ASSERT_UNREACHABLE("Should never reach here");
   return NS_ERROR_FAILURE;
 }
 
 template <class Derived>
 FetchBody<Derived>::FetchBody(nsIGlobalObject* aOwner)
   : mOwner(aOwner)
   , mWorkerPrivate(nullptr)
   , mReadableStreamBody(nullptr)
--- a/dom/fetch/FetchConsumer.cpp
+++ b/dom/fetch/FetchConsumer.cpp
@@ -657,17 +657,17 @@ FetchBodyConsumer<Derived>::ContinueCons
           if (!error.Failed()) {
             localPromise->MaybeResolve(cx, json);
           }
         }
       };
       break;
     }
     default:
-      NS_NOTREACHED("Unexpected consume body type");
+      MOZ_ASSERT_UNREACHABLE("Unexpected consume body type");
   }
 
   error.WouldReportJSException();
   if (error.Failed()) {
     localPromise->MaybeReject(error);
   }
 }
 
--- a/dom/file/uri/BlobURL.cpp
+++ b/dom/file/uri/BlobURL.cpp
@@ -61,17 +61,17 @@ BlobURL::GetPrincipalUri(nsIURI** aUri)
   return NS_OK;
 }
 
 // nsISerializable methods:
 
 NS_IMETHODIMP
 BlobURL::Read(nsIObjectInputStream* aStream)
 {
-  NS_NOTREACHED("Use nsIURIMutator.read() instead");
+  MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 BlobURL::ReadPrivate(nsIObjectInputStream *aStream)
 {
   nsresult rv = mozilla::net::nsSimpleURI::ReadPrivate(aStream);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/dom/html/HTMLFormElement.cpp
+++ b/dom/html/HTMLFormElement.cpp
@@ -2098,46 +2098,46 @@ HTMLFormElement::OnStateChange(nsIWebPro
 NS_IMETHODIMP
 HTMLFormElement::OnProgressChange(nsIWebProgress* aWebProgress,
                                   nsIRequest* aRequest,
                                   int32_t aCurSelfProgress,
                                   int32_t aMaxSelfProgress,
                                   int32_t aCurTotalProgress,
                                   int32_t aMaxTotalProgress)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLFormElement::OnLocationChange(nsIWebProgress* aWebProgress,
                                   nsIRequest* aRequest,
                                   nsIURI* location,
                                   uint32_t aFlags)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLFormElement::OnStatusChange(nsIWebProgress* aWebProgress,
                                 nsIRequest* aRequest,
                                 nsresult aStatus,
                                 const char16_t* aMessage)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLFormElement::OnSecurityChange(nsIWebProgress* aWebProgress,
                                   nsIRequest* aRequest,
                                   uint32_t state)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP_(int32_t)
 HTMLFormElement::IndexOfControl(nsIFormControl* aControl)
 {
   int32_t index = 0;
   return mControls->IndexOfControl(aControl, &index) == NS_OK ? index : 0;
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -1564,17 +1564,17 @@ HTMLInputElement::GetNonFileValueInterna
       if (IsSingleLineTextControl(false)) {
         mInputData.mState->GetValue(aValue, true);
       } else if (!aValue.Assign(mInputData.mValue, fallible)) {
         aValue.Truncate();
       }
       return;
 
     case VALUE_MODE_FILENAME:
-      NS_NOTREACHED("Someone screwed up here");
+      MOZ_ASSERT_UNREACHABLE("Someone screwed up here");
       // We'll just return empty string if someone does screw up.
       aValue.Truncate();
       return;
 
     case VALUE_MODE_DEFAULT:
       // Treat defaultValue as value.
       GetAttr(kNameSpaceID_None, nsGkAtoms::value, aValue);
       return;
--- a/dom/html/HTMLInputElement.h
+++ b/dom/html/HTMLInputElement.h
@@ -1221,17 +1221,17 @@ protected:
       case VALUE_MODE_DEFAULT:
         return true;
       case VALUE_MODE_DEFAULT_ON:
         return GetCheckedChanged();
       case VALUE_MODE_VALUE:
       case VALUE_MODE_FILENAME:
         return mValueChanged;
       default:
-        NS_NOTREACHED("We should not be there: there are no other modes.");
+        MOZ_ASSERT_UNREACHABLE("We should not be there: there are no other modes.");
         return false;
     }
   }
 
   /**
    * Returns the radio group container if the element has one, null otherwise.
    * The radio group container will be the form owner if there is one.
    * The current document otherwise.
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -2468,17 +2468,17 @@ HTMLMediaElement::LoadFromSourceChildren
 
     if (NS_SUCCEEDED(LoadResource())) {
       return;
     }
 
     // If we fail to load, loop back and try loading the next resource.
     DispatchAsyncSourceError(child);
   }
-  NS_NOTREACHED("Execution should not reach here!");
+  MOZ_ASSERT_UNREACHABLE("Execution should not reach here!");
 }
 
 void
 HTMLMediaElement::SuspendLoad()
 {
   mSuspendedForPreloadNone = true;
   ChangeNetworkState(NETWORK_IDLE);
   ChangeDelayLoadStatus(false);
@@ -6704,17 +6704,17 @@ HTMLMediaElement::GetNextSource()
     nsIContent* child = mSourcePointer;
 
     // If child is a <source> element, it is the next candidate.
     if (child && child->IsHTMLElement(nsGkAtoms::source)) {
       mSourceLoadCandidate = child;
       return child->AsElement();
     }
   }
-  NS_NOTREACHED("Execution should not reach here!");
+  MOZ_ASSERT_UNREACHABLE("Execution should not reach here!");
   return nullptr;
 }
 
 void
 HTMLMediaElement::ChangeDelayLoadStatus(bool aDelay)
 {
   if (mDelayingLoadEvent == aDelay)
     return;
--- a/dom/html/PluginDocument.cpp
+++ b/dom/html/PluginDocument.cpp
@@ -85,27 +85,27 @@ PluginStreamListener::OnStartRequest(nsI
 {
   AUTO_PROFILER_LABEL("PluginStreamListener::OnStartRequest", NETWORK);
 
   nsCOMPtr<nsIContent> embed = mPluginDoc->GetPluginContent();
   nsCOMPtr<nsIObjectLoadingContent> objlc = do_QueryInterface(embed);
   nsCOMPtr<nsIStreamListener> objListener = do_QueryInterface(objlc);
 
   if (!objListener) {
-    NS_NOTREACHED("PluginStreamListener without appropriate content node");
+    MOZ_ASSERT_UNREACHABLE("PluginStreamListener without appropriate content node");
     return NS_BINDING_ABORTED;
   }
 
   SetStreamListener(objListener);
 
   // Sets up the ObjectLoadingContent tag as if it is waiting for a
   // channel, so it can proceed with a load normally once it gets OnStartRequest
   nsresult rv = objlc->InitializeFromChannel(request);
   if (NS_FAILED(rv)) {
-    NS_NOTREACHED("InitializeFromChannel failed");
+    MOZ_ASSERT_UNREACHABLE("InitializeFromChannel failed");
     return rv;
   }
 
   // Note that because we're now hooked up to a plugin listener, this will
   // likely spawn a plugin, which may re-enter.
   return MediaDocumentStreamListener::OnStartRequest(request, ctxt);
 }
 
--- a/dom/html/nsHTMLContentSink.cpp
+++ b/dom/html/nsHTMLContentSink.cpp
@@ -79,17 +79,17 @@ using namespace mozilla;
 using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 
 nsGenericHTMLElement*
 NS_NewHTMLNOTUSEDElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
                          FromParser aFromParser)
 {
-  NS_NOTREACHED("The element ctor should never be called");
+  MOZ_ASSERT_UNREACHABLE("The element ctor should never be called");
   return nullptr;
 }
 
 #define HTML_TAG(_tag, _classname, _interfacename) NS_NewHTML##_classname##Element,
 #define HTML_OTHER(_tag) NS_NewHTMLNOTUSEDElement,
 static const HTMLContentCreatorFunction sHTMLContentCreatorFunctions[] = {
   NS_NewHTMLUnknownElement,
 #include "nsHTMLTagList.h"
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -1789,17 +1789,17 @@ DirectionToName(nsITextControlFrame::Sel
   if (dir == nsITextControlFrame::eNone) {
     NS_WARNING("We don't actually support this... how did we get it?");
     aDirection.AssignLiteral("none");
   } else if (dir == nsITextControlFrame::eForward) {
     aDirection.AssignLiteral("forward");
   } else if (dir == nsITextControlFrame::eBackward) {
     aDirection.AssignLiteral("backward");
   } else {
-    NS_NOTREACHED("Invalid SelectionDirection value");
+    MOZ_ASSERT_UNREACHABLE("Invalid SelectionDirection value");
   }
 }
 
 void
 nsTextEditorState::GetSelectionDirectionString(nsAString& aDirection,
                                                ErrorResult& aRv)
 {
   nsITextControlFrame::SelectionDirection dir = GetSelectionDirection(aRv);
--- a/dom/indexedDB/IndexedDatabaseManager.cpp
+++ b/dom/indexedDB/IndexedDatabaseManager.cpp
@@ -1126,23 +1126,23 @@ IndexedDatabaseManager::Observe(nsISuppo
 
     if (data.EqualsLiteral(LOW_DISK_SPACE_DATA_FULL)) {
       sLowDiskSpaceMode = true;
     }
     else if (data.EqualsLiteral(LOW_DISK_SPACE_DATA_FREE)) {
       sLowDiskSpaceMode = false;
     }
     else {
-      NS_NOTREACHED("Unknown data value!");
+      MOZ_ASSERT_UNREACHABLE("Unknown data value!");
     }
 
     return NS_OK;
   }
 
-   NS_NOTREACHED("Unknown topic!");
+   MOZ_ASSERT_UNREACHABLE("Unknown topic!");
    return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
 IndexedDatabaseManager::Notify(nsITimer* aTimer)
 {
   MOZ_ASSERT(IsMainProcess());
   MOZ_ASSERT(NS_IsMainThread());
--- a/dom/indexedDB/Key.cpp
+++ b/dom/indexedDB/Key.cpp
@@ -387,17 +387,17 @@ Key::DecodeJSValInternal(const unsigned 
     if (!binary) {
       IDB_REPORT_INTERNAL_ERR();
       return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
     }
 
     aVal.setObject(*binary);
   }
   else {
-    NS_NOTREACHED("Unknown key type!");
+    MOZ_ASSERT_UNREACHABLE("Unknown key type!");
   }
 
   return NS_OK;
 }
 
 #define ONE_BYTE_LIMIT 0x7E
 #define TWO_BYTE_LIMIT (0x3FFF+0x7F)
 
--- a/dom/indexedDB/KeyPath.cpp
+++ b/dom/indexedDB/KeyPath.cpp
@@ -302,17 +302,17 @@ KeyPath::AppendStringWithValidation(cons
     return true;
   }
 
   if (IsArray()) {
     mStrings.AppendElement(aString);
     return true;
   }
 
-  NS_NOTREACHED("What?!");
+  MOZ_ASSERT_UNREACHABLE("What?!");
   return false;
 }
 
 nsresult
 KeyPath::ExtractKey(JSContext* aCx, const JS::Value& aValue, Key& aKey) const
 {
   uint32_t len = mStrings.Length();
   JS::Rooted<JS::Value> value(aCx);
@@ -424,17 +424,17 @@ KeyPath::SerializeToString(nsAString& aS
     for (uint32_t i = 0; i < len; ++i) {
       aString.Append(',');
       aString.Append(mStrings[i]);
     }
 
     return;
   }
 
-  NS_NOTREACHED("What?");
+  MOZ_ASSERT_UNREACHABLE("What?");
 }
 
 // static
 KeyPath
 KeyPath::DeserializeFromString(const nsAString& aString)
 {
   KeyPath keyPath(0);
 
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -2939,17 +2939,17 @@ ContentChild::RecvDomainSetChanged(const
       break;
     case WHITELIST:
       mPolicy->GetWhitelist(getter_AddRefs(set));
       break;
     case SUPER_WHITELIST:
       mPolicy->GetSuperWhitelist(getter_AddRefs(set));
       break;
     default:
-      NS_NOTREACHED("Unexpected setType");
+      MOZ_ASSERT_UNREACHABLE("Unexpected setType");
       return IPC_FAIL_NO_REASON(this);
   }
 
   MOZ_ASSERT(set);
 
   nsCOMPtr<nsIURI> uri = DeserializeURI(aDomain);
 
   switch(aChangeType) {
@@ -2960,17 +2960,17 @@ ContentChild::RecvDomainSetChanged(const
     case REMOVE_DOMAIN:
       NS_ENSURE_TRUE(uri, IPC_FAIL_NO_REASON(this));
       set->Remove(uri);
       break;
     case CLEAR_DOMAINS:
       set->Clear();
       break;
     default:
-      NS_NOTREACHED("Unexpected changeType");
+      MOZ_ASSERT_UNREACHABLE("Unexpected changeType");
       return IPC_FAIL_NO_REASON(this);
   }
 
   return IPC_OK();
 }
 
 void
 ContentChild::StartForceKillTimer()
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -2533,17 +2533,17 @@ TabParent::RecvSetNativeChildOfShareable
   nsCOMPtr<nsIWidget> widget = GetTopLevelWidget();
   if (widget) {
     // Note that this call will probably cause a sync native message to the
     // process that owns the child window.
     widget->SetNativeData(NS_NATIVE_CHILD_OF_SHAREABLE_WINDOW, aChildWindow);
   }
   return IPC_OK();
 #else
-  NS_NOTREACHED(
+  MOZ_ASSERT_UNREACHABLE(
     "TabParent::RecvSetNativeChildOfShareableWindow not implemented!");
   return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 TabParent::RecvDispatchFocusToTopLevelWindow()
 {
--- a/dom/jsurl/nsJSProtocolHandler.cpp
+++ b/dom/jsurl/nsJSProtocolHandler.cpp
@@ -1283,17 +1283,17 @@ NS_INTERFACE_MAP_BEGIN(nsJSURI)
   else
 NS_INTERFACE_MAP_END_INHERITING(mozilla::net::nsSimpleURI)
 
 // nsISerializable methods:
 
 NS_IMETHODIMP
 nsJSURI::Read(nsIObjectInputStream *aStream)
 {
-    NS_NOTREACHED("Use nsIURIMutator.read() instead");
+    MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 nsJSURI::ReadPrivate(nsIObjectInputStream *aStream)
 {
     nsresult rv = mozilla::net::nsSimpleURI::ReadPrivate(aStream);
     if (NS_FAILED(rv)) return rv;
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -2509,17 +2509,17 @@ MediaCacheStream::GetNextCachedDataInter
 
     // No more cached blocks?
     if (size_t(blockIndex) >= mBlocks.Length())
       return -1;
 
     ++blockIndex;
   }
 
-  NS_NOTREACHED("Should return in loop");
+  MOZ_ASSERT_UNREACHABLE("Should return in loop");
   return -1;
 }
 
 void
 MediaCacheStream::SetReadMode(ReadMode aMode)
 {
   nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction(
     "MediaCacheStream::SetReadMode",
--- a/dom/media/eme/DetailedPromise.cpp
+++ b/dom/media/eme/DetailedPromise.cpp
@@ -53,17 +53,17 @@ DetailedPromise::MaybeReject(nsresult aA
   ErrorResult rv;
   rv.ThrowDOMException(aArg, aReason);
   Promise::MaybeReject(rv);
 }
 
 void
 DetailedPromise::MaybeReject(ErrorResult&, const nsACString& aReason)
 {
-  NS_NOTREACHED("nsresult expected in MaybeReject()");
+  MOZ_ASSERT_UNREACHABLE("nsresult expected in MaybeReject()");
 }
 
 /* static */ already_AddRefed<DetailedPromise>
 DetailedPromise::Create(nsIGlobalObject* aGlobal,
                         ErrorResult& aRv,
                         const nsACString& aName)
 {
   RefPtr<DetailedPromise> promise = new DetailedPromise(aGlobal, aName);
--- a/dom/media/gmp/GMPVideoHost.cpp
+++ b/dom/media/gmp/GMPVideoHost.cpp
@@ -35,17 +35,17 @@ GMPVideoHostImpl::CreateFrame(GMPVideoFr
   switch (aFormat) {
     case kGMPI420VideoFrame:
       *aFrame = new GMPVideoi420FrameImpl(this);
       return GMPNoErr;
     case kGMPEncodedVideoFrame:
       *aFrame = new GMPVideoEncodedFrameImpl(this);
       return GMPNoErr;
     default:
-      NS_NOTREACHED("Unknown frame format!");
+      MOZ_ASSERT_UNREACHABLE("Unknown frame format!");
   }
 
   return GMPGenericErr;
 }
 
 GMPErr
 GMPVideoHostImpl::CreatePlane(GMPPlane** aPlane)
 {
--- a/dom/media/webaudio/AudioNodeEngine.h
+++ b/dom/media/webaudio/AudioNodeEngine.h
@@ -324,17 +324,17 @@ public:
    * Produce the next block of audio samples, before input is provided.
    * ProcessBlock() will be called later, and it then should not change
    * aOutput.  This is used only for DelayNodeEngine in a feedback loop.
    */
   virtual void ProduceBlockBeforeInput(AudioNodeStream* aStream,
                                        GraphTime aFrom,
                                        AudioBlock* aOutput)
   {
-    NS_NOTREACHED("ProduceBlockBeforeInput called on wrong engine\n");
+    MOZ_ASSERT_UNREACHABLE("ProduceBlockBeforeInput called on wrong engine\n");
   }
 
   /**
    * Produce the next block of audio samples, given input samples in the aInput
    * array.  There is one input sample per active port in aInput, in order.
    * This is the multi-input/output version of ProcessBlock.  Only one kind
    * of ProcessBlock is called on each node, depending on whether the
    * number of inputs and outputs are both 1 or not.
--- a/dom/media/webaudio/BiquadFilterNode.cpp
+++ b/dom/media/webaudio/BiquadFilterNode.cpp
@@ -64,17 +64,17 @@ SetParamsOnBiquad(WebCore::Biquad& aBiqu
     break;
   case BiquadFilterType::Notch:
     aBiquad.setNotchParams(normalizedFrequency, aQ);
     break;
   case BiquadFilterType::Allpass:
     aBiquad.setAllpassParams(normalizedFrequency, aQ);
     break;
   default:
-    NS_NOTREACHED("We should never see the alternate names here");
+    MOZ_ASSERT_UNREACHABLE("We should never see the alternate names here");
     break;
   }
 }
 
 class BiquadFilterNodeEngine final : public AudioNodeEngine
 {
 public:
   BiquadFilterNodeEngine(AudioNode* aNode,
--- a/dom/media/webaudio/PannerNode.cpp
+++ b/dom/media/webaudio/PannerNode.cpp
@@ -120,33 +120,33 @@ public:
       switch (PanningModelType(aParam)) {
         case PanningModelType::Equalpower:
           mPanningModelFunction = &PannerNodeEngine::EqualPowerPanningFunction;
           break;
         case PanningModelType::HRTF:
           mPanningModelFunction = &PannerNodeEngine::HRTFPanningFunction;
           break;
         default:
-          NS_NOTREACHED("We should never see the alternate names here");
+          MOZ_ASSERT_UNREACHABLE("We should never see the alternate names here");
           break;
       }
       break;
     case PannerNode::DISTANCE_MODEL:
       switch (DistanceModelType(aParam)) {
         case DistanceModelType::Inverse:
           mDistanceModelFunction = &PannerNodeEngine::InverseGainFunction;
           break;
         case DistanceModelType::Linear:
           mDistanceModelFunction = &PannerNodeEngine::LinearGainFunction;
           break;
         case DistanceModelType::Exponential:
           mDistanceModelFunction = &PannerNodeEngine::ExponentialGainFunction;
           break;
         default:
-          NS_NOTREACHED("We should never see the alternate names here");
+          MOZ_ASSERT_UNREACHABLE("We should never see the alternate names here");
           break;
       }
       break;
     default:
       NS_ERROR("Bad PannerNodeEngine Int32Parameter");
     }
   }
   void SetThreeDPointParameter(uint32_t aIndex, const ThreeDPoint& aParam) override
--- a/dom/media/webaudio/WaveShaperNode.cpp
+++ b/dom/media/webaudio/WaveShaperNode.cpp
@@ -36,17 +36,17 @@ NS_IMPL_RELEASE_INHERITED(WaveShaperNode
 
 static uint32_t ValueOf(OverSampleType aType)
 {
   switch (aType) {
   case OverSampleType::None: return 1;
   case OverSampleType::_2x:  return 2;
   case OverSampleType::_4x:  return 4;
   default:
-    NS_NOTREACHED("We should never reach here");
+    MOZ_ASSERT_UNREACHABLE("We should never reach here");
     return 1;
   }
 }
 
 class Resampler final
 {
 public:
   Resampler()
@@ -278,17 +278,17 @@ public:
         break;
       case OverSampleType::_4x:
         mResampler.Reset(channelCount, aStream->SampleRate(), OverSampleType::_4x);
         sampleBuffer = mResampler.UpSample(i, inputSamples, 4);
         ProcessCurve<4>(sampleBuffer, sampleBuffer);
         mResampler.DownSample(i, outputBuffer, 4);
         break;
       default:
-        NS_NOTREACHED("We should never reach here");
+        MOZ_ASSERT_UNREACHABLE("We should never reach here");
       }
     }
   }
 
   size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
     amount += mCurve.ShallowSizeOfExcludingThis(aMallocSizeOf);
--- a/dom/media/webaudio/blink/PeriodicWave.cpp
+++ b/dom/media/webaudio/blink/PeriodicWave.cpp
@@ -341,17 +341,17 @@ void PeriodicWave::generateBasicWaveform
             a = 0;
             if (n & 1) {
               b = 2 * (2 / (n * piFloat) * 2 / (n * piFloat)) * ((((n - 1) >> 1) & 1) ? -1 : 1);
             } else {
               b = 0;
             }
             break;
         default:
-            NS_NOTREACHED("invalid oscillator type");
+            MOZ_ASSERT_UNREACHABLE("invalid oscillator type");
             a = 0;
             b = 0;
             break;
         }
 
         realP[n] = a;
         imagP[n] = b;
     }
--- a/dom/plugins/base/nsNPAPIPluginInstance.cpp
+++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp
@@ -778,17 +778,17 @@ nsNPAPIPluginInstance::DidComposite()
 
   AutoPluginLibraryCall library(this);
   library->DidComposite(&mNPP);
 }
 
 nsresult
 nsNPAPIPluginInstance::NotifyPainted(void)
 {
-  NS_NOTREACHED("Dead code, shouldn't be called.");
+  MOZ_ASSERT_UNREACHABLE("Dead code, shouldn't be called.");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 nsNPAPIPluginInstance::GetIsOOP(bool* aIsAsync)
 {
   AutoPluginLibraryCall library(this);
   if (!library)
--- a/dom/plugins/base/nsNPAPIPluginStreamListener.cpp
+++ b/dom/plugins/base/nsNPAPIPluginStreamListener.cpp
@@ -411,17 +411,17 @@ nsNPAPIPluginStreamListener::OnDataAvail
       MOZ_ASSERT(bytesToRead > 0);
 
       uint32_t amountRead = 0;
       rv = input->Read(mStreamBuffer + mStreamBufferByteCount, bytesToRead,
                        &amountRead);
       NS_ENSURE_SUCCESS(rv, rv);
 
       if (amountRead == 0) {
-        NS_NOTREACHED("input->Read() returns no data, it's almost impossible "
+        MOZ_ASSERT_UNREACHABLE("input->Read() returns no data, it's almost impossible "
                       "to get here");
 
         break;
       }
 
       mStreamBufferByteCount += amountRead;
       length -= amountRead;
     } else {
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -785,17 +785,17 @@ nsPluginHost::InstantiatePluginInstance(
   MOZ_LOG(nsPluginLogging::gPluginLog, PLUGIN_LOG_NORMAL,
         ("nsPluginHost::InstantiatePlugin Begin mime=%s, url=%s\n",
          PromiseFlatCString(aMimeType).get(), urlSpec.get()));
 
   PR_LogFlush();
 #endif
 
   if (aMimeType.IsEmpty()) {
-    NS_NOTREACHED("Attempting to spawn a plugin with no mime type");
+    MOZ_ASSERT_UNREACHABLE("Attempting to spawn a plugin with no mime type");
     return NS_ERROR_FAILURE;
   }
 
   RefPtr<nsPluginInstanceOwner> instanceOwner = new nsPluginInstanceOwner();
   if (!instanceOwner) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -2819,17 +2819,17 @@ nsresult nsPluginInstanceOwner::Init(nsI
   if (objFrame) {
     SetFrame(objFrame);
     // Some plugins require a specific sequence of shutdown and startup when
     // a page is reloaded. Shutdown happens usually when the last instance
     // is destroyed. Here we make sure the plugin instance in the old
     // document is destroyed before we try to create the new one.
     objFrame->PresContext()->EnsureVisible();
   } else {
-    NS_NOTREACHED("Should not be initializing plugin without a frame");
+    MOZ_ASSERT_UNREACHABLE("Should not be initializing plugin without a frame");
     return NS_ERROR_FAILURE;
   }
 
   // register context menu listener
   mCXMenuListener = new nsPluginDOMContextMenuListener(aContent);
 
   aContent->AddEventListener(NS_LITERAL_STRING("focus"), this, false,
                              false);
--- a/dom/plugins/base/nsPluginsDirWin.cpp
+++ b/dom/plugins/base/nsPluginsDirWin.cpp
@@ -37,17 +37,17 @@ static char* GetKeyValue(void* verbuf, c
                     // we use (currently "FileDescription")
   const WCHAR keyFormat[] = L"\\StringFileInfo\\%04X%04X\\%ls";
   WCHAR *buf = nullptr;
   UINT blen;
 
   if (_snwprintf_s(keybuf, ArrayLength(keybuf), _TRUNCATE,
                    keyFormat, language, codepage, key) < 0)
   {
-    NS_NOTREACHED("plugin info key too long for buffer!");
+    MOZ_ASSERT_UNREACHABLE("plugin info key too long for buffer!");
     return nullptr;
   }
 
   if (::VerQueryValueW(verbuf, keybuf, (void **)&buf, &blen) == 0 ||
       buf == nullptr || blen == 0)
   {
     return nullptr;
   }
--- a/dom/plugins/ipc/NPEventOSX.h
+++ b/dom/plugins/ipc/NPEventOSX.h
@@ -71,17 +71,17 @@ struct ParamTraits<mozilla::plugins::NPR
                 aMsg->WriteDouble(aParam.event.data.draw.y);
                 aMsg->WriteDouble(aParam.event.data.draw.width);
                 aMsg->WriteDouble(aParam.event.data.draw.height);
                 break;
             case NPCocoaEventTextInput:
                 WriteParam(aMsg, aParam.event.data.text.text);
                 break;
             default:
-                NS_NOTREACHED("Attempted to serialize unknown event type.");
+                MOZ_ASSERT_UNREACHABLE("Attempted to serialize unknown event type.");
                 return;
         }
         aMsg->WriteDouble(aParam.contentsScaleFactor);
     }
 
     static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
     {
         int type = 0;
@@ -168,17 +168,17 @@ struct ParamTraits<mozilla::plugins::NPR
                 }
                 break;
             case NPCocoaEventTextInput:
                 if (!ReadParam(aMsg, aIter, &aResult->event.data.text.text)) {
                     return false;
                 }
                 break;
             default:
-                NS_NOTREACHED("Attempted to de-serialize unknown event type.");
+                MOZ_ASSERT_UNREACHABLE("Attempted to de-serialize unknown event type.");
                 return false;
         }
         if (!aMsg->ReadDouble(aIter, &aResult->contentsScaleFactor)) {
             return false;
         }
 
         return true;
     }
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -299,17 +299,17 @@ PluginInstanceChild::InternalGetNPObject
                     NS_ASSERTION(actor, "Null actor!");
                     PluginModuleChild::sBrowserFuncs.retainobject(
                         actor->GetObject(false));
                 }
             }
             break;
 
         default:
-            NS_NOTREACHED("Don't know what to do with this value type!");
+            MOZ_ASSERT_UNREACHABLE("Don't know what to do with this value type!");
     }
 
 #ifdef DEBUG
     {
         NPError currentResult;
         PPluginScriptableObjectChild* currentActor = nullptr;
 
         switch (aValue) {
@@ -521,17 +521,17 @@ PluginInstanceChild::NPN_GetValue(NPNVar
         return NPERR_NO_ERROR;
     }
 #ifdef DEBUG
     case NPNVjavascriptEnabledBool:
     case NPNVasdEnabledBool:
     case NPNVisOfflineBool:
     case NPNVSupportsXEmbedBool:
     case NPNVSupportsWindowless:
-        NS_NOTREACHED("NPNVariable should be handled in PluginModuleChild.");
+        MOZ_ASSERT_UNREACHABLE("NPNVariable should be handled in PluginModuleChild.");
         MOZ_FALLTHROUGH;
 #endif
 
     default:
         MOZ_LOG(GetPluginLog(), LogLevel::Warning,
                ("In PluginInstanceChild::NPN_GetValue: Unhandled NPNVariable %i (%s)",
                 (int) aVar, NPNVariableToString(aVar)));
         return NPERR_GENERIC_ERROR;
@@ -1119,30 +1119,30 @@ PluginInstanceChild::AnswerCreateChildPl
         return IPC_FAIL_NO_REASON(this);
     }
 
     MOZ_ASSERT(mPluginWindowHWND);
 
     *aChildPluginWindow = mPluginWindowHWND;
     return IPC_OK();
 #else
-    NS_NOTREACHED("PluginInstanceChild::CreateChildPluginWindow not implemented!");
+    MOZ_ASSERT_UNREACHABLE("PluginInstanceChild::CreateChildPluginWindow not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 PluginInstanceChild::RecvCreateChildPopupSurrogate(const NativeWindowHandle& aNetscapeWindow)
 {
 #if defined(XP_WIN)
     mCachedWinlessPluginHWND = aNetscapeWindow;
     CreateWinlessPopupSurrogate();
     return IPC_OK();
 #else
-    NS_NOTREACHED("PluginInstanceChild::CreateChildPluginWindow not implemented!");
+    MOZ_ASSERT_UNREACHABLE("PluginInstanceChild::CreateChildPluginWindow not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
 {
     PLUGIN_LOG_DEBUG(("%s (aWindow=<window: 0x%" PRIx64 ", x: %d, y: %d, width: %d, height: %d>)",
@@ -1218,17 +1218,17 @@ PluginInstanceChild::AnswerNPP_SetWindow
               }
               RemoveProp(mPluginWindowHWND, kPluginIgnoreSubclassProperty);
               HookSetWindowLongPtr();
           }
       }
       break;
 
       default:
-          NS_NOTREACHED("Bad plugin window type.");
+          MOZ_ASSERT_UNREACHABLE("Bad plugin window type.");
           return IPC_FAIL_NO_REASON(this);
       break;
     }
 
 #elif defined(XP_MACOSX)
 
     mWindow.x = aWindow.x;
     mWindow.y = aWindow.y;
@@ -1501,17 +1501,17 @@ PluginInstanceChild::PluginWindowProcInt
                                               WPARAM wParam,
                                               LPARAM lParam)
 {
     NS_ASSERTION(!mozilla::ipc::MessageChannel::IsPumpingMessages(),
                  "Failed to prevent a nonqueued message from running!");
     PluginInstanceChild* self = reinterpret_cast<PluginInstanceChild*>(
         GetProp(hWnd, kPluginInstanceChildProperty));
     if (!self) {
-        NS_NOTREACHED("Badness!");
+        MOZ_ASSERT_UNREACHABLE("Badness!");
         return 0;
     }
 
     NS_ASSERTION(self->mPluginWindowHWND == hWnd, "Wrong window!");
     NS_ASSERTION(self->mPluginWndProc != PluginWindowProc, "Self-referential windowproc. Infinite recursion will happen soon.");
 
     bool isIMECompositionMessage = false;
     switch (message) {
@@ -2291,17 +2291,17 @@ LRESULT CALLBACK
 PluginInstanceChild::WinlessHiddenFlashWndProc(HWND hWnd,
                                                UINT message,
                                                WPARAM wParam,
                                                LPARAM lParam)
 {
     PluginInstanceChild* self = reinterpret_cast<PluginInstanceChild*>(
         GetProp(hWnd, kFlashThrottleProperty));
     if (!self) {
-        NS_NOTREACHED("Badness!");
+        MOZ_ASSERT_UNREACHABLE("Badness!");
         return 0;
     }
 
     NS_ASSERTION(self->mWinlessThrottleOldWndProc,
                  "Missing subclass procedure!!");
 
     // Throttle
     if (message == WM_USER+1) {
@@ -2325,17 +2325,17 @@ PluginInstanceChild::WinlessHiddenFlashW
 // Once we find it, sub class it so we can throttle user msgs.
 // static
 BOOL CALLBACK
 PluginInstanceChild::EnumThreadWindowsCallback(HWND hWnd,
                                                LPARAM aParam)
 {
     PluginInstanceChild* self = reinterpret_cast<PluginInstanceChild*>(aParam);
     if (!self) {
-        NS_NOTREACHED("Enum befuddled!");
+        MOZ_ASSERT_UNREACHABLE("Enum befuddled!");
         return FALSE;
     }
 
     wchar_t className[64];
     if (!GetClassNameW(hWnd, className, sizeof(className)/sizeof(char16_t)))
       return TRUE;
 
     if (!wcscmp(className, L"SWFlash_PlaceholderX")) {
@@ -2449,17 +2449,17 @@ PluginInstanceChild::AnswerSetPluginFocu
     // when a button click brings up a full screen window. Since we send
     // this in response to a WM_SETFOCUS event on our parent, the parent
     // should have focus when we receive this. If not, ignore the call.
     if (::GetFocus() == mPluginWindowHWND)
         return IPC_OK();
     ::SetFocus(mPluginWindowHWND);
     return IPC_OK();
 #else
-    NS_NOTREACHED("PluginInstanceChild::AnswerSetPluginFocus not implemented!");
+    MOZ_ASSERT_UNREACHABLE("PluginInstanceChild::AnswerSetPluginFocus not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 PluginInstanceChild::AnswerUpdateWindow()
 {
     MOZ_LOG(GetPluginLog(), LogLevel::Debug, ("%s", FULLFUNCTION));
@@ -2469,17 +2469,17 @@ PluginInstanceChild::AnswerUpdateWindow(
         RECT rect;
         if (GetUpdateRect(GetParent(mPluginWindowHWND), &rect, FALSE)) {
             ::InvalidateRect(mPluginWindowHWND, &rect, FALSE);
         }
         UpdateWindow(mPluginWindowHWND);
     }
     return IPC_OK();
 #else
-    NS_NOTREACHED("PluginInstanceChild::AnswerUpdateWindow not implemented!");
+    MOZ_ASSERT_UNREACHABLE("PluginInstanceChild::AnswerUpdateWindow not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 PluginInstanceChild::RecvNPP_DidComposite()
 {
   if (mPluginIface->didComposite) {
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -1994,17 +1994,17 @@ PluginInstanceParent::RecvSetNetscapeWin
 #if defined(XP_WIN)
     nsPluginInstanceOwner* owner = GetOwner();
     if (!owner || NS_FAILED(owner->SetNetscapeWindowAsParent(childWindow))) {
         NS_WARNING("Failed to set Netscape window as parent.");
     }
 
     return IPC_OK();
 #else
-    NS_NOTREACHED("PluginInstanceParent::RecvSetNetscapeWindowAsParent not implemented!");
+    MOZ_ASSERT_UNREACHABLE("PluginInstanceParent::RecvSetNetscapeWindowAsParent not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 #if defined(OS_WIN)
 
 /*
   plugin focus changes between processes
@@ -2028,17 +2028,17 @@ LRESULT CALLBACK
 PluginInstanceParent::PluginWindowHookProc(HWND hWnd,
                                            UINT message,
                                            WPARAM wParam,
                                            LPARAM lParam)
 {
     PluginInstanceParent* self = reinterpret_cast<PluginInstanceParent*>(
         ::GetPropW(hWnd, kPluginInstanceParentProperty));
     if (!self) {
-        NS_NOTREACHED("PluginInstanceParent::PluginWindowHookProc null this ptr!");
+        MOZ_ASSERT_UNREACHABLE("PluginInstanceParent::PluginWindowHookProc null this ptr!");
         return DefWindowProc(hWnd, message, wParam, lParam);
     }
 
     NS_ASSERTION(self->mPluginHWND == hWnd, "Wrong window!");
 
     switch (message) {
         case WM_SETFOCUS:
         // Let the child plugin window know it should take focus.
@@ -2046,17 +2046,17 @@ PluginInstanceParent::PluginWindowHookPr
         break;
 
         case WM_CLOSE:
         self->UnsubclassPluginWindow();
         break;
     }
 
     if (self->mPluginWndProc == PluginWindowHookProc) {
-      NS_NOTREACHED(
+      MOZ_ASSERT_UNREACHABLE(
         "PluginWindowHookProc invoking mPluginWndProc w/"
         "mPluginWndProc == PluginWindowHookProc????");
         return DefWindowProc(hWnd, message, wParam, lParam);
     }
     return ::CallWindowProc(self->mPluginWndProc, hWnd, message, wParam,
                             lParam);
 }
 
@@ -2225,17 +2225,17 @@ PluginInstanceParent::AnswerPluginFocusC
         owner->GetDOMElement(getter_AddRefs(element));
         if (fm && element) {
           fm->SetFocus(element, 0);
         }
       }
     }
     return IPC_OK();
 #else
-    NS_NOTREACHED("PluginInstanceParent::AnswerPluginFocusChange not implemented!");
+    MOZ_ASSERT_UNREACHABLE("PluginInstanceParent::AnswerPluginFocusChange not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 PluginInstanceParent*
 PluginInstanceParent::Cast(NPP aInstance)
 {
     auto ip = static_cast<PluginInstanceParent*>(aInstance->pdata);
--- a/dom/plugins/ipc/PluginInterposeOSX.mm
+++ b/dom/plugins/ipc/PluginInterposeOSX.mm
@@ -1017,17 +1017,17 @@ static void ExchangeMethods(Class target
   }
 
   if (m1 == m2)
     return;
 
   if (m1 && m2)
     method_exchangeImplementations(m1, m2);
   else
-    NS_NOTREACHED("Cocoa swizzling failed");
+    MOZ_ASSERT_UNREACHABLE("Cocoa swizzling failed");
 }
 
 namespace mac_plugin_interposing {
 namespace child {
 
 void SetUpCocoaInterposing() {
   Class nswindow_class = [NSWindow class];
   ExchangeMethods(nswindow_class, NO, @selector(orderOut:),
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -1123,17 +1123,17 @@ NPError
                 return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);
             }
 
             NS_WARNING("Null NPP!");
             return NPERR_INVALID_INSTANCE_ERROR;
         }
     }
 
-    NS_NOTREACHED("Shouldn't get here!");
+    MOZ_ASSERT_UNREACHABLE("Shouldn't get here!");
     return NPERR_GENERIC_ERROR;
 }
 
 NPError
 _setvalue(NPP aNPP,
           NPPVariable aVariable,
           void* aValue)
 {
@@ -1814,17 +1814,17 @@ PluginModuleChild::InitQuirksModes(const
 
 mozilla::ipc::IPCResult
 PluginModuleChild::AnswerModuleSupportsAsyncRender(bool* aResult)
 {
 #if defined(XP_WIN)
     *aResult = gChromeInstance->mAsyncRenderSupport;
     return IPC_OK();
 #else
-    NS_NOTREACHED("Shouldn't get here!");
+    MOZ_ASSERT_UNREACHABLE("Shouldn't get here!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 PluginModuleChild::RecvPPluginInstanceConstructor(PPluginInstanceChild* aActor,
                                                   const nsCString& aMimeType,
                                                   InfallibleTArray<nsCString>&& aNames,
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -2613,115 +2613,115 @@ PluginModuleParent::AnswerProcessSomeEve
 mozilla::ipc::IPCResult
 PluginModuleParent::RecvProcessNativeEventsInInterruptCall()
 {
     PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
 #if defined(OS_WIN)
     ProcessNativeEventsInInterruptCall();
     return IPC_OK();
 #else
-    NS_NOTREACHED(
+    MOZ_ASSERT_UNREACHABLE(
         "PluginModuleParent::RecvProcessNativeEventsInInterruptCall not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 void
 PluginModuleParent::ProcessRemoteNativeEventsInInterruptCall()
 {
 #if defined(OS_WIN)
     Unused << SendProcessNativeEventsInInterruptCall();
     return;
 #endif
-    NS_NOTREACHED(
+    MOZ_ASSERT_UNREACHABLE(
         "PluginModuleParent::ProcessRemoteNativeEventsInInterruptCall not implemented!");
 }
 
 mozilla::ipc::IPCResult
 PluginModuleParent::RecvPluginShowWindow(const uint32_t& aWindowId, const bool& aModal,
                                          const int32_t& aX, const int32_t& aY,
                                          const size_t& aWidth, const size_t& aHeight)
 {
     PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
 #if defined(XP_MACOSX)
     CGRect windowBound = ::CGRectMake(aX, aY, aWidth, aHeight);
     mac_plugin_interposing::parent::OnPluginShowWindow(aWindowId, windowBound, aModal);
     return IPC_OK();
 #else
-    NS_NOTREACHED(
+    MOZ_ASSERT_UNREACHABLE(
         "PluginInstanceParent::RecvPluginShowWindow not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 PluginModuleParent::RecvPluginHideWindow(const uint32_t& aWindowId)
 {
     PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
 #if defined(XP_MACOSX)
     mac_plugin_interposing::parent::OnPluginHideWindow(aWindowId, OtherPid());
     return IPC_OK();
 #else
-    NS_NOTREACHED(
+    MOZ_ASSERT_UNREACHABLE(
         "PluginInstanceParent::RecvPluginHideWindow not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 PluginModuleParent::RecvSetCursor(const NSCursorInfo& aCursorInfo)
 {
     PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
 #if defined(XP_MACOSX)
     mac_plugin_interposing::parent::OnSetCursor(aCursorInfo);
     return IPC_OK();
 #else
-    NS_NOTREACHED(
+    MOZ_ASSERT_UNREACHABLE(
         "PluginInstanceParent::RecvSetCursor not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 PluginModuleParent::RecvShowCursor(const bool& aShow)
 {
     PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
 #if defined(XP_MACOSX)
     mac_plugin_interposing::parent::OnShowCursor(aShow);
     return IPC_OK();
 #else
-    NS_NOTREACHED(
+    MOZ_ASSERT_UNREACHABLE(
         "PluginInstanceParent::RecvShowCursor not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 PluginModuleParent::RecvPushCursor(const NSCursorInfo& aCursorInfo)
 {
     PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
 #if defined(XP_MACOSX)
     mac_plugin_interposing::parent::OnPushCursor(aCursorInfo);
     return IPC_OK();
 #else
-    NS_NOTREACHED(
+    MOZ_ASSERT_UNREACHABLE(
         "PluginInstanceParent::RecvPushCursor not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 PluginModuleParent::RecvPopCursor()
 {
     PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
 #if defined(XP_MACOSX)
     mac_plugin_interposing::parent::OnPopCursor();
     return IPC_OK();
 #else
-    NS_NOTREACHED(
+    MOZ_ASSERT_UNREACHABLE(
         "PluginInstanceParent::RecvPopCursor not implemented!");
     return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 PluginModuleParent::RecvNPN_SetException(const nsCString& aMessage)
 {
--- a/dom/plugins/ipc/PluginScriptableObjectParent.cpp
+++ b/dom/plugins/ipc/PluginScriptableObjectParent.cpp
@@ -363,17 +363,17 @@ PluginScriptableObjectParent::Scriptable
 
 // static
 bool
 PluginScriptableObjectParent::ScriptableGetProperty(NPObject* aObject,
                                                     NPIdentifier aName,
                                                     NPVariant* aResult)
 {
   // See GetPropertyHelper below.
-  NS_NOTREACHED("Shouldn't ever call this directly!");
+  MOZ_ASSERT_UNREACHABLE("Shouldn't ever call this directly!");
   return false;
 }
 
 // static
 bool
 PluginScriptableObjectParent::ScriptableSetProperty(NPObject* aObject,
                                                     NPIdentifier aName,
                                                     const NPVariant* aValue)
--- a/dom/plugins/ipc/PluginScriptableObjectUtils-inl.h
+++ b/dom/plugins/ipc/PluginScriptableObjectUtils-inl.h
@@ -101,17 +101,17 @@ mozilla::plugins::ConvertToVariant(const
       NS_ASSERTION(object, "Null object?!");
 
       PluginModuleChild::sBrowserFuncs.retainobject(object);
       OBJECT_TO_NPVARIANT(object, aVariant);
       break;
     }
 
     default:
-      NS_NOTREACHED("Shouldn't get here!");
+      MOZ_ASSERT_UNREACHABLE("Shouldn't get here!");
       return false;
   }
 
   return true;
 }
 
 template <class InstanceType>
 bool
@@ -153,14 +153,14 @@ mozilla::plugins::ConvertToRemoteVariant
 
     if (aProtectActors) {
       actor->Protect();
     }
 
     aRemoteVariant = actor;
   }
   else {
-    NS_NOTREACHED("Shouldn't get here!");
+    MOZ_ASSERT_UNREACHABLE("Shouldn't get here!");
     return false;
   }
 
   return true;
 }
--- a/dom/plugins/ipc/PluginScriptableObjectUtils.h
+++ b/dom/plugins/ipc/PluginScriptableObjectUtils.h
@@ -56,17 +56,17 @@ NPObjectFromVariant(const Variant& aRemo
       PluginScriptableObjectChild* actor =
         const_cast<PluginScriptableObjectChild*>(
           reinterpret_cast<const PluginScriptableObjectChild*>(
             aRemoteVariant.get_PPluginScriptableObjectChild()));
       return actor->GetObject(true);
     }
 
     default:
-      NS_NOTREACHED("Shouldn't get here!");
+      MOZ_ASSERT_UNREACHABLE("Shouldn't get here!");
       return nullptr;
   }
 }
 
 inline NPObject*
 NPObjectFromVariant(const NPVariant& aVariant)
 {
   NS_ASSERTION(NPVARIANT_IS_OBJECT(aVariant), "Wrong variant type!");
--- a/dom/presentation/ipc/PresentationChild.cpp
+++ b/dom/presentation/ipc/PresentationChild.cpp
@@ -43,17 +43,17 @@ PresentationChild::ActorDestroy(ActorDes
   mActorDestroyed = true;
   mService->NotifyPresentationChildDestroyed();
   mService = nullptr;
 }
 
 PPresentationRequestChild*
 PresentationChild::AllocPPresentationRequestChild(const PresentationIPCRequest& aRequest)
 {
-  NS_NOTREACHED("We should never be manually allocating PPresentationRequestChild actors");
+  MOZ_ASSERT_UNREACHABLE("We should never be manually allocating PPresentationRequestChild actors");
   return nullptr;
 }
 
 bool
 PresentationChild::DeallocPPresentationRequestChild(PPresentationRequestChild* aActor)
 {
   delete aActor;
   return true;
--- a/dom/presentation/ipc/PresentationParent.cpp
+++ b/dom/presentation/ipc/PresentationParent.cpp
@@ -193,17 +193,17 @@ PresentationParent::DeallocPPresentation
     dont_AddRef(static_cast<PresentationRequestParent*>(aActor));
   return true;
 }
 
 PPresentationBuilderParent*
 PresentationParent::AllocPPresentationBuilderParent(const nsString& aSessionId,
                                                     const uint8_t& aRole)
 {
-  NS_NOTREACHED("We should never be manually allocating AllocPPresentationBuilderParent actors");
+  MOZ_ASSERT_UNREACHABLE("We should never be manually allocating AllocPPresentationBuilderParent actors");
   return nullptr;
 }
 
 bool
 PresentationParent::DeallocPPresentationBuilderParent(
   PPresentationBuilderParent* aActor)
 {
   return true;
--- a/dom/quota/Client.h
+++ b/dom/quota/Client.h
@@ -60,17 +60,17 @@ public:
         break;
 
       case DOMCACHE:
         aText.AssignLiteral(DOMCACHE_DIRECTORY_NAME);
         break;
 
       case TYPE_MAX:
       default:
-        NS_NOTREACHED("Bad id value!");
+        MOZ_ASSERT_UNREACHABLE("Bad id value!");
         return NS_ERROR_UNEXPECTED;
     }
 
     return NS_OK;
   }
 
   static nsresult
   TypeFromText(const nsAString& aText, Type& aType)
--- a/dom/serviceworkers/ServiceWorkerEvents.cpp
+++ b/dom/serviceworkers/ServiceWorkerEvents.cpp
@@ -1062,17 +1062,17 @@ ExtractBytesFromData(const OwningArrayBu
     if (NS_WARN_IF(!PushUtil::CopyArrayBufferToArray(buffer, aBytes))) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
     return NS_OK;
   }
   if (aDataInit.IsUSVString()) {
     return ExtractBytesFromUSVString(aDataInit.GetAsUSVString(), aBytes);
   }
-  NS_NOTREACHED("Unexpected push message data");
+  MOZ_ASSERT_UNREACHABLE("Unexpected push message data");
   return NS_ERROR_FAILURE;
 }
 }
 
 PushMessageData::PushMessageData(nsISupports* aOwner,
                                  nsTArray<uint8_t>&& aBytes)
   : mOwner(aOwner), mBytes(std::move(aBytes)) {}
 
--- a/dom/smil/nsSMILAnimationFunction.cpp
+++ b/dom/smil/nsSMILAnimationFunction.cpp
@@ -605,17 +605,17 @@ nsSMILAnimationFunction::ComputePacedPos
       // values i and i+1.
       aFrom = &aValues[i];
       aTo = &aValues[i+1];
       aIntervalProgress = remainingDist / curIntervalDist;
       return NS_OK;
     }
   }
 
-  NS_NOTREACHED("shouldn't complete loop & get here -- if we do, "
+  MOZ_ASSERT_UNREACHABLE("shouldn't complete loop & get here -- if we do, "
                 "then aSimpleProgress was probably out of bounds");
   return NS_ERROR_FAILURE;
 }
 
 /*
  * Computes the total distance to be travelled by a paced animation.
  *
  * Returns the total distance, or returns COMPUTE_DISTANCE_ERROR if
--- a/dom/smil/nsSMILNullType.cpp
+++ b/dom/smil/nsSMILNullType.cpp
@@ -34,30 +34,30 @@ nsSMILNullType::IsEqual(const nsSMILValu
 
   return true;  // All null-typed values are equivalent.
 }
 
 nsresult
 nsSMILNullType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
                     uint32_t aCount) const
 {
-  NS_NOTREACHED("Adding NULL type");
+  MOZ_ASSERT_UNREACHABLE("Adding NULL type");
   return NS_ERROR_FAILURE;
 }
 
 nsresult
 nsSMILNullType::ComputeDistance(const nsSMILValue& aFrom,
                                 const nsSMILValue& aTo,
                                 double& aDistance) const
 {
-  NS_NOTREACHED("Computing distance for NULL type");
+  MOZ_ASSERT_UNREACHABLE("Computing distance for NULL type");
   return NS_ERROR_FAILURE;
 }
 
 nsresult
 nsSMILNullType::Interpolate(const nsSMILValue& aStartVal,
                             const nsSMILValue& aEndVal,
                             double aUnitDistance,
                             nsSMILValue& aResult) const
 {
-  NS_NOTREACHED("Interpolating NULL type");
+  MOZ_ASSERT_UNREACHABLE("Interpolating NULL type");
   return NS_ERROR_FAILURE;
 }
--- a/dom/smil/nsSMILTimedElement.cpp
+++ b/dom/smil/nsSMILTimedElement.cpp
@@ -1847,17 +1847,17 @@ nsSMILTimedElement::GetNextInterval(cons
 
     if (mRestartMode == RESTART_NEVER) {
       // tempEnd <= 0 so we're going to loop which effectively means restarting
       return false;
     }
 
     beginAfter = tempEnd->Time();
   }
-  NS_NOTREACHED("Hmm... we really shouldn't be here");
+  MOZ_ASSERT_UNREACHABLE("Hmm... we really shouldn't be here");
 
   return false;
 }
 
 nsSMILInstanceTime*
 nsSMILTimedElement::GetNextGreater(const InstanceTimeList& aList,
                                    const nsSMILTimeValue& aBase,
                                    int32_t& aPosition) const
--- a/dom/svg/DOMSVGPathSeg.cpp
+++ b/dom/svg/DOMSVGPathSeg.cpp
@@ -371,14 +371,14 @@ DOMSVGPathSeg::CreateFor(DOMSVGPathSegLi
     return new DOMSVGPathSegCurvetoCubicSmoothAbs(aList, aListIndex, aIsAnimValItem);
   case PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
     return new DOMSVGPathSegCurvetoCubicSmoothRel(aList, aListIndex, aIsAnimValItem);
   case PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
     return new DOMSVGPathSegCurvetoQuadraticSmoothAbs(aList, aListIndex, aIsAnimValItem);
   case PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
     return new DOMSVGPathSegCurvetoQuadraticSmoothRel(aList, aListIndex, aIsAnimValItem);
   default:
-    NS_NOTREACHED("Invalid path segment type");
+    MOZ_ASSERT_UNREACHABLE("Invalid path segment type");
     return nullptr;
   }
 }
 
 } // namespace mozilla
--- a/dom/svg/DOMSVGPathSegList.cpp
+++ b/dom/svg/DOMSVGPathSegList.cpp
@@ -121,17 +121,17 @@ DOMSVGPathSegList::InternalListWillChang
 {
   // When the number of items in our internal counterpart changes, we MUST stay
   // in sync. Everything in the scary comment in
   // DOMSVGLengthList::InternalBaseValListWillChangeTo applies here just as
   // much, but we have the additional issue that failing to stay in sync would
   // mean that - assuming we aren't reading bad memory - we would likely end up
   // decoding command types from argument floats when looking in our
   // SVGPathData's data array! Either way, we'll likely then go down
-  // NS_NOTREACHED code paths, or end up reading/setting more bad memory!!
+  // MOZ_ASSERT_UNREACHABLE code paths, or end up reading/setting more bad memory!!
 
   // The only time that our other DOM list type implementations remove items is
   // if those items become surplus items due to an attribute change or SMIL
   // animation sample shortening the list. In general though, they try to keep
   // their existing DOM items, even when things change. To be consistent, we'd
   // really like to do the same thing. However, because different types of path
   // segment correspond to different DOMSVGPathSeg subclasses, the type of
   // items in our list are generally not the same, which makes this harder for
--- a/dom/svg/SVGContentUtils.cpp
+++ b/dom/svg/SVGContentUtils.cpp
@@ -593,17 +593,17 @@ SVGContentUtils::GetViewBoxTransform(flo
         f = (aViewportHeight - a * aViewboxHeight) / 2.0f;
         break;
       case SVG_PRESERVEASPECTRATIO_XMINYMAX:
       case SVG_PRESERVEASPECTRATIO_XMIDYMAX:
       case SVG_PRESERVEASPECTRATIO_XMAXYMAX:
         f = aViewportHeight - a * aViewboxHeight;
         break;
       default:
-        NS_NOTREACHED("Unknown value for align");
+        MOZ_ASSERT_UNREACHABLE("Unknown value for align");
       }
     }
     else if (
       (meetOrSlice == SVG_MEETORSLICE_MEET &&
       d < a) ||
       (meetOrSlice == SVG_MEETORSLICE_SLICE &&
       a < d)) {
       a = d;
@@ -618,20 +618,20 @@ SVGContentUtils::GetViewBoxTransform(flo
         e = (aViewportWidth - a * aViewboxWidth) / 2.0f;
         break;
       case SVG_PRESERVEASPECTRATIO_XMAXYMIN:
       case SVG_PRESERVEASPECTRATIO_XMAXYMID:
       case SVG_PRESERVEASPECTRATIO_XMAXYMAX:
         e = aViewportWidth - a * aViewboxWidth;
         break;
       default:
-        NS_NOTREACHED("Unknown value for align");
+        MOZ_ASSERT_UNREACHABLE("Unknown value for align");
       }
     }
-    else NS_NOTREACHED("Unknown value for meetOrSlice");
+    else MOZ_ASSERT_UNREACHABLE("Unknown value for meetOrSlice");
   }
 
   if (aViewboxX) e += -a * aViewboxX;
   if (aViewboxY) f += -d * aViewboxY;
 
   return gfx::Matrix(a, 0.0f, 0.0f, d, e, f);
 }
 
--- a/dom/svg/SVGLength.cpp
+++ b/dom/svg/SVGLength.cpp
@@ -161,17 +161,17 @@ SVGLength::GetUserUnitsPerUnit(const nsS
       return (12.0f/POINTS_PER_INCH_FLOAT) * GetUserUnitsPerInch();
     case SVGLengthBinding::SVG_LENGTHTYPE_PERCENTAGE:
       return GetUserUnitsPerPercent(aElement, aAxis);
     case SVGLengthBinding::SVG_LENGTHTYPE_EMS:
       return SVGContentUtils::GetFontSize(const_cast<nsSVGElement*>(aElement));
     case SVGLengthBinding::SVG_LENGTHTYPE_EXS:
       return SVGContentUtils::GetFontXHeight(const_cast<nsSVGElement*>(aElement));
     default:
-      NS_NOTREACHED("Unknown unit type");
+      MOZ_ASSERT_UNREACHABLE("Unknown unit type");
       return std::numeric_limits<float>::quiet_NaN();
   }
 }
 
 /* static */ float
 SVGLength::GetUserUnitsPerPercent(const nsSVGElement *aElement, uint8_t aAxis)
 {
   if (aElement) {
@@ -205,17 +205,17 @@ static void
 GetUnitString(nsAString& unit, uint16_t unitType)
 {
   if (SVGLength::IsValidUnitType(unitType)) {
     if (unitMap[unitType]) {
       (*unitMap[unitType])->ToString(unit);
     }
     return;
   }
-  NS_NOTREACHED("Unknown unit type"); // Someone's using an SVGLength with an invalid unit?
+  MOZ_ASSERT_UNREACHABLE("Unknown unit type"); // Someone's using an SVGLength with an invalid unit?
 }
 
 static uint16_t
 GetUnitTypeForString(const nsAString& unitStr)
 {
   if (unitStr.IsEmpty())
     return SVGLengthBinding::SVG_LENGTHTYPE_NUMBER;
 
--- a/dom/svg/SVGMotionSMILAnimationFunction.cpp
+++ b/dom/svg/SVGMotionSMILAnimationFunction.cpp
@@ -40,17 +40,17 @@ SVGMotionSMILAnimationFunction::MarkStal
   } else if (aAttribute == nsGkAtoms::values) {
     isAffected = (mPathSourceType <= ePathSourceType_ValuesAttr);
   } else if (aAttribute == nsGkAtoms::from ||
              aAttribute == nsGkAtoms::to) {
     isAffected = (mPathSourceType <= ePathSourceType_ToAttr);
   } else if (aAttribute == nsGkAtoms::by) {
     isAffected = (mPathSourceType <= ePathSourceType_ByAttr);
   } else {
-    NS_NOTREACHED("Should only call this method for path-describing attrs");
+    MOZ_ASSERT_UNREACHABLE("Should only call this method for path-describing attrs");
     isAffected = false;
   }
 
   if (isAffected) {
     mIsPathStale = true;
     mHasChanged = true;
   }
 }
--- a/dom/svg/SVGMotionSMILAttr.cpp
+++ b/dom/svg/SVGMotionSMILAttr.cpp
@@ -17,17 +17,17 @@
 namespace mozilla {
 
 nsresult
 SVGMotionSMILAttr::ValueFromString(const nsAString& aStr,
                                    const dom::SVGAnimationElement* aSrcElement,
                                    nsSMILValue& aValue,
                                    bool& aPreventCachingOfSandwich) const
 {
-  NS_NOTREACHED("Shouldn't using nsISMILAttr::ValueFromString for parsing "
+  MOZ_ASSERT_UNREACHABLE("Shouldn't using nsISMILAttr::ValueFromString for parsing "
                 "animateMotion's SMIL values.");
   return NS_ERROR_FAILURE;
 }
 
 nsSMILValue
 SVGMotionSMILAttr::GetBaseValue() const
 {
   return nsSMILValue(&SVGMotionSMILType::sSingleton);
--- a/dom/svg/SVGPathData.cpp
+++ b/dom/svg/SVGPathData.cpp
@@ -481,17 +481,17 @@ SVGPathData::BuildPath(PathBuilder* buil
       tcp2 = cp1 + (segEnd - cp1) / 3;
       if (segEnd != segStart || segEnd != cp1) {
         subpathHasLength = true;
         builder->BezierTo(tcp1, tcp2, segEnd);
       }
       break;
 
     default:
-      NS_NOTREACHED("Bad path segment type");
+      MOZ_ASSERT_UNREACHABLE("Bad path segment type");
       return nullptr; // according to spec we'd use everything up to the bad seg anyway
     }
 
     subpathContainsNonMoveTo = segType != PATHSEG_MOVETO_ABS &&
                                segType != PATHSEG_MOVETO_REL;
     i += argCount;
     prevSegType = segType;
     segStart = segEnd;
--- a/dom/svg/nsSVGAngle.cpp
+++ b/dom/svg/nsSVGAngle.cpp
@@ -55,17 +55,17 @@ GetUnitString(nsAString& unit, uint16_t 
 {
   if (IsValidUnitType(unitType)) {
     if (unitMap[unitType]) {
       (*unitMap[unitType])->ToString(unit);
     }
     return;
   }
 
-  NS_NOTREACHED("Unknown unit type");
+  MOZ_ASSERT_UNREACHABLE("Unknown unit type");
 }
 
 static uint16_t
 GetUnitTypeForString(const nsAString& unitStr)
 {
   if (unitStr.IsEmpty())
     return SVG_ANGLETYPE_UNSPECIFIED;
 
@@ -118,17 +118,17 @@ nsSVGAngle::GetDegreesPerUnit(uint8_t aU
   case SVG_ANGLETYPE_UNSPECIFIED:
   case SVG_ANGLETYPE_DEG:
     return 1;
   case SVG_ANGLETYPE_RAD:
     return static_cast<float>(180.0 / M_PI);
   case SVG_ANGLETYPE_GRAD:
     return 90.0f / 100.0f;
   default:
-    NS_NOTREACHED("Unknown unit type");
+    MOZ_ASSERT_UNREACHABLE("Unknown unit type");
     return 0;
   }
 }
 
 void
 nsSVGAngle::SetBaseValueInSpecifiedUnits(float aValue,
                                          nsSVGElement *aSVGElement)
 {
@@ -351,17 +351,17 @@ UniquePtr<nsISMILAttr>
 nsSVGAngle::ToSMILAttr(nsSVGElement *aSVGElement)
 {
   if (aSVGElement->NodeInfo()->Equals(nsGkAtoms::marker, kNameSpaceID_SVG)) {
     SVGMarkerElement *marker = static_cast<SVGMarkerElement*>(aSVGElement);
     return MakeUnique<SMILOrient>(marker->GetOrientType(), this, aSVGElement);
   }
   // SMILOrient would not be useful for general angle attributes (also,
   // "orient" is the only animatable <angle>-valued attribute in SVG 1.1).
-  NS_NOTREACHED("Trying to animate unknown angle attribute.");
+  MOZ_ASSERT_UNREACHABLE("Trying to animate unknown angle attribute.");
   return nullptr;
 }
 
 nsresult
 nsSVGAngle::SMILOrient::ValueFromString(const nsAString& aStr,
                                         const SVGAnimationElement* /*aSrcElement*/,
                                         nsSMILValue& aValue,
                                         bool& aPreventCachingOfSandwich) const
--- a/dom/svg/nsSVGElement.cpp
+++ b/dom/svg/nsSVGElement.cpp
@@ -1684,17 +1684,17 @@ nsSVGElement::GetAnimatedLengthListValue
 
 SVGAnimatedLengthList*
 nsSVGElement::GetAnimatedLengthList(uint8_t aAttrEnum)
 {
   LengthListAttributesInfo info = GetLengthListInfo();
   if (aAttrEnum < info.mLengthListCount) {
     return &(info.mLengthLists[aAttrEnum]);
   }
-  NS_NOTREACHED("Bad attrEnum");
+  MOZ_ASSERT_UNREACHABLE("Bad attrEnum");
   return nullptr;
 }
 
 
 nsSVGElement::NumberListAttributesInfo
 nsSVGElement::GetNumberListInfo()
 {
   return NumberListAttributesInfo(nullptr, nullptr, 0);
--- a/dom/svg/nsSVGLength2.cpp
+++ b/dom/svg/nsSVGLength2.cpp
@@ -57,17 +57,17 @@ GetUnitString(nsAString& unit, uint16_t 
 {
   if (IsValidUnitType(unitType)) {
     if (unitMap[unitType]) {
       (*unitMap[unitType])->ToString(unit);
     }
     return;
   }
 
-  NS_NOTREACHED("Unknown unit type");
+  MOZ_ASSERT_UNREACHABLE("Unknown unit type");
 }
 
 static uint16_t
 GetUnitTypeForString(const nsAString& unitStr)
 {
   if (unitStr.IsEmpty())
     return SVGLengthBinding::SVG_LENGTHTYPE_NUMBER;
 
@@ -197,17 +197,17 @@ UserSpaceMetricsWithSize::GetAxisLength(
     break;
   case SVGContentUtils::Y:
     length = size.height;
     break;
   case SVGContentUtils::XY:
     length = SVGContentUtils::ComputeNormalizedHypotenuse(size.width, size.height);
     break;
   default:
-    NS_NOTREACHED("Unknown axis type");
+    MOZ_ASSERT_UNREACHABLE("Unknown axis type");
     length = 1;
     break;
   }
   return FixAxisLength(length);
 }
 
 float
 nsSVGLength2::GetPixelsPerUnit(nsSVGElement* aSVGElement,
@@ -258,17 +258,17 @@ nsSVGLength2::GetPixelsPerUnit(const Use
     return 12.0f * DPI / POINTS_PER_INCH_FLOAT;
   case SVGLengthBinding::SVG_LENGTHTYPE_PERCENTAGE:
     return aMetrics.GetAxisLength(mCtxType) / 100.0f;
   case SVGLengthBinding::SVG_LENGTHTYPE_EMS:
     return aMetrics.GetEmLength();
   case SVGLengthBinding::SVG_LENGTHTYPE_EXS:
     return aMetrics.GetExLength();
   default:
-    NS_NOTREACHED("Unknown unit type");
+    MOZ_ASSERT_UNREACHABLE("Unknown unit type");
     return 0;
   }
 }
 
 void
 nsSVGLength2::SetBaseValueInSpecifiedUnits(float aValue,
                                            nsSVGElement *aSVGElement,
                                            bool aDoSetAttr)
--- a/dom/svg/nsSVGTransform.cpp
+++ b/dom/svg/nsSVGTransform.cpp
@@ -185,17 +185,17 @@ SVGTransformSMILData::SVGTransformSMILDa
       break;
 
     case SVG_TRANSFORM_SKEWX:
     case SVG_TRANSFORM_SKEWY:
       mParams[0] = aTransform.Angle();
       break;
 
     default:
-      NS_NOTREACHED("Unexpected transform type");
+      MOZ_ASSERT_UNREACHABLE("Unexpected transform type");
       break;
   }
 }
 
 nsSVGTransform
 SVGTransformSMILData::ToSVGTransform() const
 {
   nsSVGTransform result;
@@ -223,15 +223,15 @@ SVGTransformSMILData::ToSVGTransform() c
       result.SetSkewX(mParams[0]);
       break;
 
     case SVG_TRANSFORM_SKEWY:
       result.SetSkewY(mParams[0]);
       break;
 
     default:
-      NS_NOTREACHED("Unexpected transform type");
+      MOZ_ASSERT_UNREACHABLE("Unexpected transform type");
       break;
   }
   return result;
 }
 
 } // namespace mozilla
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -2600,17 +2600,17 @@ RuntimeService::Observe(nsISupports* aSu
     MemoryPressureAllWorkers();
     return NS_OK;
   }
   if (!strcmp(aTopic, NS_IOSERVICE_OFFLINE_STATUS_TOPIC)) {
     SendOfflineStatusChangeEventToAllWorkers(NS_IsOffline());
     return NS_OK;
   }
 
-  NS_NOTREACHED("Unknown observer topic!");
+  MOZ_ASSERT_UNREACHABLE("Unknown observer topic!");
   return NS_OK;
 }
 
 bool
 LogViolationDetailsRunnable::MainThreadRun()
 {
   AssertIsOnMainThread();
 
--- a/dom/workers/WorkerDebuggerManager.cpp
+++ b/dom/workers/WorkerDebuggerManager.cpp
@@ -167,17 +167,17 @@ NS_IMETHODIMP
 WorkerDebuggerManager::Observe(nsISupports* aSubject, const char* aTopic,
                                const char16_t* aData)
 {
   if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
     Shutdown();
     return NS_OK;
   }
 
-  NS_NOTREACHED("Unknown observer topic!");
+  MOZ_ASSERT_UNREACHABLE("Unknown observer topic!");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 WorkerDebuggerManager::GetWorkerDebuggerEnumerator(
                                                   nsISimpleEnumerator** aResult)
 {
   AssertIsOnMainThread();
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -3410,17 +3410,17 @@ XMLHttpRequestMainThread::MozSystem() co
 {
   return IsSystemXHR();
 }
 
 void
 XMLHttpRequestMainThread::HandleTimeoutCallback()
 {
   if (mState == XMLHttpRequestBinding::DONE) {
-    NS_NOTREACHED("XMLHttpRequestMainThread::HandleTimeoutCallback with completed request");
+    MOZ_ASSERT_UNREACHABLE("XMLHttpRequestMainThread::HandleTimeoutCallback with completed request");
     // do nothing!
     return;
   }
 
   mFlagTimedOut = true;
   CloseRequestWithError(ProgressEventType::timeout);
 }
 
--- a/dom/xml/nsXMLFragmentContentSink.cpp
+++ b/dom/xml/nsXMLFragmentContentSink.cpp
@@ -181,17 +181,17 @@ nsXMLFragmentContentSink::DidBuildModel(
 
   return NS_OK;
 }
 
 void
 nsXMLFragmentContentSink::SetDocumentCharset(
   NotNull<const Encoding*> aEncoding)
 {
-  NS_NOTREACHED("fragments shouldn't set charset");
+  MOZ_ASSERT_UNREACHABLE("fragments shouldn't set charset");
 }
 
 nsISupports *
 nsXMLFragmentContentSink::GetTarget()
 {
   return mTargetDocument;
 }
 
@@ -255,17 +255,17 @@ nsXMLFragmentContentSink::MaybeStartLayo
 
 NS_IMETHODIMP
 nsXMLFragmentContentSink::HandleDoctypeDecl(const nsAString & aSubset,
                                             const nsAString & aName,
                                             const nsAString & aSystemId,
                                             const nsAString & aPublicId,
                                             nsISupports* aCatalogData)
 {
-  NS_NOTREACHED("fragments shouldn't have doctype declarations");
+  MOZ_ASSERT_UNREACHABLE("fragments shouldn't have doctype declarations");
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsXMLFragmentContentSink::HandleProcessingInstruction(const char16_t *aTarget,
                                                       const char16_t *aData)
 {
@@ -281,17 +281,17 @@ nsXMLFragmentContentSink::HandleProcessi
   return AddContentAsLeaf(node);
 }
 
 NS_IMETHODIMP
 nsXMLFragmentContentSink::HandleXMLDeclaration(const char16_t *aVersion,
                                                const char16_t *aEncoding,
                                                int32_t aStandalone)
 {
-  NS_NOTREACHED("fragments shouldn't have XML declarations");
+  MOZ_ASSERT_UNREACHABLE("fragments shouldn't have XML declarations");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsXMLFragmentContentSink::ReportError(const char16_t* aErrorText,
                                       const char16_t* aSourceText,
                                       nsIScriptError *aError,
                                       bool *_retval)
@@ -332,17 +332,17 @@ nsXMLFragmentContentSink::ProcessStyleLi
   const nsAString& aHref,
   bool aAlternate,
   const nsAString& aTitle,
   const nsAString& aType,
   const nsAString& aMedia,
   const nsAString& aReferrerPolicy)
 
 {
-  NS_NOTREACHED("Shouldn't have headers for a fragment sink");
+  MOZ_ASSERT_UNREACHABLE("Shouldn't have headers for a fragment sink");
   return NS_OK;
 }
 
 nsresult
 nsXMLFragmentContentSink::MaybeProcessXSLTLink(
   ProcessingInstruction* aProcessingInstruction,
   const nsAString& aHref,
   bool aAlternate,
@@ -418,17 +418,17 @@ NS_IMETHODIMP
 nsXMLFragmentContentSink::DidProcessATokenImpl()
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsXMLFragmentContentSink::IgnoreFirstContainer()
 {
-  NS_NOTREACHED("XML isn't as broken as HTML");
+  MOZ_ASSERT_UNREACHABLE("XML isn't as broken as HTML");
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 nsXMLFragmentContentSink::SetPreventScriptExecution(bool aPrevent)
 {
   mPreventScriptExecution = aPrevent;
   return NS_OK;
--- a/dom/xslt/xpath/txCoreFunctionCall.cpp
+++ b/dom/xslt/xpath/txCoreFunctionCall.cpp
@@ -708,17 +708,17 @@ txCoreFunctionCall::isSensitiveTo(Contex
         }
         case LANG:
         {
             return (aContext & NODE_CONTEXT) ||
                    argsSensitiveTo(aContext);
         }
     }
 
-    NS_NOTREACHED("how'd we get here?");
+    MOZ_ASSERT_UNREACHABLE("how'd we get here?");
     return true;
 }
 
 // static
 bool
 txCoreFunctionCall::getTypeFromAtom(nsAtom* aName, eType& aType)
 {
     uint32_t i;
--- a/dom/xslt/xpath/txExpr.h
+++ b/dom/xslt/xpath/txExpr.h
@@ -178,17 +178,17 @@ TX_IMPL_EXPR_STUBS_BASE(_class, _ReturnT
 Expr*                                                         \
 _class::getSubExprAt(uint32_t aPos)                           \
 {                                                             \
     return nullptr;                                            \
 }                                                             \
 void                                                          \
 _class::setSubExprAt(uint32_t aPos, Expr* aExpr)              \
 {                                                             \
-    NS_NOTREACHED("setting bad subexpression index");         \
+    MOZ_ASSERT_UNREACHABLE("setting bad subexpression index");         \
 }
 
 #define TX_IMPL_EXPR_STUBS_1(_class, _ReturnType, _Expr1)     \
 TX_IMPL_EXPR_STUBS_BASE(_class, _ReturnType)                  \
 Expr*                                                         \
 _class::getSubExprAt(uint32_t aPos)                           \
 {                                                             \
     if (aPos == 0) {                                          \
--- a/dom/xslt/xpath/txExprLexer.cpp
+++ b/dom/xslt/xpath/txExprLexer.cpp
@@ -38,17 +38,17 @@ txExprLexer::~txExprLexer()
   }
   mCurrentItem = nullptr;
 }
 
 Token*
 txExprLexer::nextToken()
 {
   if (!mCurrentItem) {
-    NS_NOTREACHED("nextToken called on uninitialized lexer");
+    MOZ_ASSERT_UNREACHABLE("nextToken called on uninitialized lexer");
     return nullptr;
   }
 
   if (mCurrentItem->mType == Token::END) {
     // Do not progress beyond the end token
     return mCurrentItem;
   }
 
--- a/dom/xslt/xpath/txExprParser.cpp
+++ b/dom/xslt/xpath/txExprParser.cpp
@@ -243,17 +243,17 @@ txExprParser::createBinaryExpr(nsAutoPtr
                                       RelationalExpr::LESS_OR_EQUAL);
             break;
         case Token::GREATER_OR_EQUAL_OP:
             expr = new RelationalExpr(left, right,
                                       RelationalExpr::GREATER_OR_EQUAL);
             break;
 
         default:
-            NS_NOTREACHED("operator tokens should be already checked");
+            MOZ_ASSERT_UNREACHABLE("operator tokens should be already checked");
             return NS_ERROR_UNEXPECTED;
     }
     NS_ENSURE_TRUE(expr, NS_ERROR_OUT_OF_MEMORY);
 
     left.forget();
     right.forget();
 
     *aResult = expr;
@@ -707,17 +707,17 @@ txExprParser::createPathExpr(txExprLexer
         rv = createLocationStep(lexer, aContext, getter_Transfers(expr));
         NS_ENSURE_SUCCESS(rv, rv);
 
         rv = pathExpr->addExpr(expr, pathOp);
         NS_ENSURE_SUCCESS(rv, rv);
 
         expr.forget();
     }
-    NS_NOTREACHED("internal xpath parser error");
+    MOZ_ASSERT_UNREACHABLE("internal xpath parser error");
     return NS_ERROR_UNEXPECTED;
 }
 
 /**
  * Creates a PathExpr using the given txExprLexer
  * @param lexer the txExprLexer for retrieving Tokens
  */
 nsresult
@@ -841,17 +841,17 @@ txExprParser::parseParameters(FunctionCa
             case Token::COMMA: //-- param separator
                 lexer.nextToken();
                 break;
             default:
                 return NS_ERROR_XPATH_PAREN_EXPECTED;
         }
     }
 
-    NS_NOTREACHED("internal xpath parser error");
+    MOZ_ASSERT_UNREACHABLE("internal xpath parser error");
     return NS_ERROR_UNEXPECTED;
 }
 
 short
 txExprParser::precedence(Token* aToken)
 {
     switch (aToken->mType) {
         case Token::OR_OP:
--- a/dom/xslt/xpath/txLiteralExpr.cpp
+++ b/dom/xslt/xpath/txLiteralExpr.cpp
@@ -34,17 +34,17 @@ txLiteralExpr::getReturnType()
 Expr*
 txLiteralExpr::getSubExprAt(uint32_t aPos)
 {
     return nullptr;
 }
 void
 txLiteralExpr::setSubExprAt(uint32_t aPos, Expr* aExpr)
 {
-    NS_NOTREACHED("setting bad subexpression index");
+    MOZ_ASSERT_UNREACHABLE("setting bad subexpression index");
 }
 
 bool
 txLiteralExpr::isSensitiveTo(ContextSensitivity aContext)
 {
     return false;
 }
 
--- a/dom/xslt/xpath/txNodeTypeTest.cpp
+++ b/dom/xslt/xpath/txNodeTypeTest.cpp
@@ -47,17 +47,17 @@ txNodeTypeTest::matches(const txXPathNod
                 aMatched = !allowed;
             } else {
                 aMatched = true;
             }
             return NS_OK;
         }
     }
 
-    NS_NOTREACHED("Didn't deal with all values of the NodeType enum!");
+    MOZ_ASSERT_UNREACHABLE("Didn't deal with all values of the NodeType enum!");
 
     aMatched = false;
     return NS_OK;
 }
 
 txNodeTest::NodeTestType
 txNodeTypeTest::getType()
 {
--- a/dom/xslt/xpath/txRelationalExpr.cpp
+++ b/dom/xslt/xpath/txRelationalExpr.cpp
@@ -131,17 +131,17 @@ RelationalExpr::compareResults(txIEvalCo
             return (leftDbl > rightDbl);
         }
         case GREATER_OR_EQUAL:
         {
             return (leftDbl >= rightDbl);
         }
         default:
         {
-            NS_NOTREACHED("We should have caught all cases");
+            MOZ_ASSERT_UNREACHABLE("We should have caught all cases");
         }
     }
 
     return false;
 }
 
 nsresult
 RelationalExpr::evaluate(txIEvalContext* aContext, txAExprResult** aResult)
--- a/dom/xslt/xslt/txBufferingHandler.cpp
+++ b/dom/xslt/xslt/txBufferingHandler.cpp
@@ -427,17 +427,17 @@ flushTransaction(txOutputTransaction* aT
             txStartElementTransaction* transaction =
                 static_cast<txStartElementTransaction*>(aTransaction);
             return aHandler->startElement(transaction->mPrefix,
                                           transaction->mLocalName,
                                           transaction->mNsID);
         }
         default:
         {
-            NS_NOTREACHED("Unexpected transaction type");
+            MOZ_ASSERT_UNREACHABLE("Unexpected transaction type");
         }
     }
 
     return NS_ERROR_UNEXPECTED;
 }
 
 nsresult
 txResultBuffer::flushToHandler(txAXMLEventHandler* aHandler)
--- a/dom/xslt/xslt/txEXSLTFunctions.cpp
+++ b/dom/xslt/xslt/txEXSLTFunctions.cpp
@@ -674,17 +674,17 @@ txEXSLTFunctionCall::evaluate(txIEvalCon
         default:
         {
             aContext->receiveError(NS_LITERAL_STRING("Internal error"),
                                    NS_ERROR_UNEXPECTED);
             return NS_ERROR_UNEXPECTED;
         }
     }
 
-    NS_NOTREACHED("Missing return?");
+    MOZ_ASSERT_UNREACHABLE("Missing return?");
     return NS_ERROR_UNEXPECTED;
 }
 
 Expr::ResultType
 txEXSLTFunctionCall::getReturnType()
 {
     return descriptTable[mType].mReturnType;
 }
@@ -789,17 +789,17 @@ txEXSLTRegExFunctionCall::evaluate(txIEv
         default:
         {
             aContext->receiveError(NS_LITERAL_STRING("Internal error"),
                                    NS_ERROR_UNEXPECTED);
             return NS_ERROR_UNEXPECTED;
         }
     }
 
-    NS_NOTREACHED("Missing return?");
+    MOZ_ASSERT_UNREACHABLE("Missing return?");
     return NS_ERROR_UNEXPECTED;
 }
 
 Expr::ResultType
 txEXSLTRegExFunctionCall::getReturnType()
 {
     return descriptTable[mType].mReturnType;
 }
--- a/dom/xslt/xslt/txXSLTPatterns.h
+++ b/dom/xslt/xslt/txXSLTPatterns.h
@@ -107,29 +107,29 @@ public:
 Expr*                                                         \
 _class::getSubExprAt(uint32_t aPos)                           \
 {                                                             \
     return nullptr;                                            \
 }                                                             \
 void                                                          \
 _class::setSubExprAt(uint32_t aPos, Expr* aExpr)              \
 {                                                             \
-    NS_NOTREACHED("setting bad subexpression index");         \
+    MOZ_ASSERT_UNREACHABLE("setting bad subexpression index");         \
 }
 
 #define TX_IMPL_PATTERN_STUBS_NO_SUB_PATTERN(_class)          \
 txPattern*                                                    \
 _class::getSubPatternAt(uint32_t aPos)                        \
 {                                                             \
     return nullptr;                                            \
 }                                                             \
 void                                                          \
 _class::setSubPatternAt(uint32_t aPos, txPattern* aPattern)   \
 {                                                             \
-    NS_NOTREACHED("setting bad subexpression index");         \
+    MOZ_ASSERT_UNREACHABLE("setting bad subexpression index");         \
 }
 
 class txUnionPattern : public txPattern
 {
 public:
     nsresult addPattern(txPattern* aPattern)
     {
         return mLocPathPatterns.AppendElement(aPattern) ?
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -290,24 +290,24 @@ NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHER
 //----------------------------------------------------------------------
 //
 // nsIDocument interface
 //
 
 void
 XULDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup)
 {
-    NS_NOTREACHED("Reset");
+    MOZ_ASSERT_UNREACHABLE("Reset");
 }
 
 void
 XULDocument::ResetToURI(nsIURI* aURI, nsILoadGroup* aLoadGroup,
                         nsIPrincipal* aPrincipal)
 {
-    NS_NOTREACHED("ResetToURI");
+    MOZ_ASSERT_UNREACHABLE("ResetToURI");
 }
 
 void
 XULDocument::SetContentType(const nsAString& aContentType)
 {
     NS_ASSERTION(aContentType.EqualsLiteral("application/vnd.mozilla.xul+xml"),
                  "xul-documents always has content-type application/vnd.mozilla.xul+xml");
     // Don't do anything, xul always has the mimetype
@@ -2559,17 +2559,17 @@ XULDocument::ResumeWalk()
                     // an inline script could have removed the root element
                     rv = CreateAndInsertPI(piProto, parent, nullptr);
                     NS_ENSURE_SUCCESS(rv, rv);
                 }
             }
             break;
 
             default:
-                NS_NOTREACHED("Unexpected nsXULPrototypeNode::Type value");
+                MOZ_ASSERT_UNREACHABLE("Unexpected nsXULPrototypeNode::Type value");
             }
         }
 
         // Once we get here, the context stack will have been
         // depleted. That means that the entire prototype has been
         // walked and content has been constructed.
 
         // If we're not already, mark us as now processing overlays.
@@ -3888,17 +3888,17 @@ XULDocument::CachedChromeStreamListener:
 
 NS_IMETHODIMP
 XULDocument::CachedChromeStreamListener::OnDataAvailable(nsIRequest *request,
                                                          nsISupports* aContext,
                                                          nsIInputStream* aInStr,
                                                          uint64_t aSourceOffset,
                                                          uint32_t aCount)
 {
-    NS_NOTREACHED("CachedChromeStream doesn't receive data");
+    MOZ_ASSERT_UNREACHABLE("CachedChromeStream doesn't receive data");
     return NS_ERROR_UNEXPECTED;
 }
 
 //----------------------------------------------------------------------
 //
 // ParserObserver
 //
 
--- a/dom/xul/XULPopupElement.cpp
+++ b/dom/xul/XULPopupElement.cpp
@@ -208,17 +208,17 @@ XULPopupElement::GetState(nsString& aSta
         break;
       case ePopupHiding:
       case ePopupInvisible:
         aState.AssignLiteral("hiding");
         break;
       case ePopupClosed:
         break;
       default:
-        NS_NOTREACHED("Bad popup state");
+        MOZ_ASSERT_UNREACHABLE("Bad popup state");
         break;
     }
   }
 }
 
 nsINode*
 XULPopupElement::GetTriggerNode() const
 {
--- a/dom/xul/nsXULPrototypeDocument.cpp
+++ b/dom/xul/nsXULPrototypeDocument.cpp
@@ -195,17 +195,17 @@ nsXULPrototypeDocument::Read(nsIObjectIn
             }
         } else if ((nsXULPrototypeNode::Type)type == nsXULPrototypeNode::eType_Element) {
             rv = mRoot->Deserialize(aStream, this, mURI, &nodeInfos);
             if (NS_FAILED(rv)) {
               return rv;
             }
             break;
         } else {
-            NS_NOTREACHED("Unexpected prototype node type");
+            MOZ_ASSERT_UNREACHABLE("Unexpected prototype node type");
             return NS_ERROR_FAILURE;
         }
     }
 
     return NotifyLoadDone();
 }
 
 static nsresult
--- a/editor/composer/nsEditingSession.cpp
+++ b/editor/composer/nsEditingSession.cpp
@@ -750,17 +750,17 @@ nsEditingSession::OnStateChange(nsIWebPr
 NS_IMETHODIMP
 nsEditingSession::OnProgressChange(nsIWebProgress *aWebProgress,
                                    nsIRequest *aRequest,
                                    int32_t aCurSelfProgress,
                                    int32_t aMaxSelfProgress,
                                    int32_t aCurTotalProgress,
                                    int32_t aMaxTotalProgress)
 {
-    NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+    MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
     return NS_OK;
 }
 
 /*---------------------------------------------------------------------------
 
   OnLocationChange
 
 ----------------------------------------------------------------------------*/
@@ -799,30 +799,30 @@ nsEditingSession::OnLocationChange(nsIWe
 
 ----------------------------------------------------------------------------*/
 NS_IMETHODIMP
 nsEditingSession::OnStatusChange(nsIWebProgress *aWebProgress,
                                  nsIRequest *aRequest,
                                  nsresult aStatus,
                                  const char16_t *aMessage)
 {
-    NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+    MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
     return NS_OK;
 }
 
 /*---------------------------------------------------------------------------
 
   OnSecurityChange
 
 ----------------------------------------------------------------------------*/
 NS_IMETHODIMP
 nsEditingSession::OnSecurityChange(nsIWebProgress *aWebProgress,
                                    nsIRequest *aRequest, uint32_t state)
 {
-    NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+    MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
     return NS_OK;
 }
 
 
 /*---------------------------------------------------------------------------
 
   IsProgressForTargetDocument
 
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -2328,17 +2328,17 @@ EditorBase::DebugDumpContent()
   return NS_OK;
 }
 
 NS_IMETHODIMP
 EditorBase::DebugUnitTests(int32_t* outNumTests,
                            int32_t* outNumTestsFailed)
 {
 #ifdef DEBUG
-  NS_NOTREACHED("This should never get called. Overridden by subclasses");
+  MOZ_ASSERT_UNREACHABLE("This should never get called. Overridden by subclasses");
 #endif
   return NS_OK;
 }
 
 bool
 EditorBase::ArePreservingSelection()
 {
   return !(mSavedSel.IsEmpty());
@@ -2921,17 +2921,17 @@ EditorBase::NotifyDocumentListeners(
         rv = listener->NotifyDocumentStateChanged(mDocDirtyState);
         if (NS_FAILED(rv)) {
           break;
         }
       }
       break;
     }
     default:
-      NS_NOTREACHED("Unknown notification");
+      MOZ_ASSERT_UNREACHABLE("Unknown notification");
   }
 
   return rv;
 }
 
 nsresult
 EditorBase::SetTextImpl(Selection& aSelection, const nsAString& aString,
                         Text& aCharData)
@@ -3609,17 +3609,17 @@ EditorBase::FindNextLeafNode(nsINode* aC
     if (IsEditorRoot(parent) ||
         (bNoBlockCrossing && IsBlockNode(parent))) {
       return nullptr;
     }
 
     cur = parent;
   }
 
-  NS_NOTREACHED("What part of for(;;) do you not understand?");
+  MOZ_ASSERT_UNREACHABLE("What part of for(;;) do you not understand?");
   return nullptr;
 }
 
 nsIContent*
 EditorBase::FindNode(nsINode* aCurrentNode,
                      bool aGoForward,
                      bool aEditableNode,
                      bool aFindAnyDataNode,
@@ -3664,17 +3664,17 @@ EditorBase::GetRightmostChild(nsINode* a
     }
     nsIContent* next = cur->GetLastChild();
     if (!next) {
       return cur;
     }
     cur = next;
   }
 
-  NS_NOTREACHED("What part of for(;;) do you not understand?");
+  MOZ_ASSERT_UNREACHABLE("What part of for(;;) do you not understand?");
   return nullptr;
 }
 
 nsIContent*
 EditorBase::GetLeftmostChild(nsINode* aCurrentNode,
                              bool bNoBlockCrossing)
 {
   NS_ENSURE_TRUE(aCurrentNode, nullptr);
@@ -3688,17 +3688,17 @@ EditorBase::GetLeftmostChild(nsINode* aC
     }
     nsIContent *next = cur->GetFirstChild();
     if (!next) {
       return cur;
     }
     cur = next;
   }
 
-  NS_NOTREACHED("What part of for(;;) do you not understand?");
+  MOZ_ASSERT_UNREACHABLE("What part of for(;;) do you not understand?");
   return nullptr;
 }
 
 bool
 EditorBase::IsBlockNode(nsINode* aNode)
 {
   // stub to be overridden in HTMLEditor.
   // screwing around with the class hierarchy here in order
--- a/editor/libeditor/PlaceholderTransaction.cpp
+++ b/editor/libeditor/PlaceholderTransaction.cpp
@@ -103,17 +103,17 @@ PlaceholderTransaction::Merge(nsITransac
                               bool* aDidMerge)
 {
   NS_ENSURE_TRUE(aDidMerge && aTransaction, NS_ERROR_NULL_POINTER);
 
   // set out param default value
   *aDidMerge=false;
 
   if (mForwarding) {
-    NS_NOTREACHED("tried to merge into a placeholder that was in forwarding mode!");
+    MOZ_ASSERT_UNREACHABLE("tried to merge into a placeholder that was in forwarding mode!");
     return NS_ERROR_FAILURE;
   }
 
   // XXX: hack, not safe!  need nsIEditTransaction!
   EditTransactionBase* editTransactionBase = (EditTransactionBase*)aTransaction;
   // determine if this incoming txn is a placeholder txn
   nsCOMPtr<nsIAbsorbingTransaction> absorbingTransaction =
     do_QueryObject(editTransactionBase);
--- a/editor/libeditor/WSRunObject.cpp
+++ b/editor/libeditor/WSRunObject.cpp
@@ -690,17 +690,17 @@ WSRunObject::GetWSNodes()
   if (RefPtr<Text> textNode = mNode->GetAsText()) {
     const nsTextFragment* textFrag = textNode->GetText();
 
     mNodeArray.InsertElementAt(0, textNode);
     if (mOffset) {
       for (int32_t pos = mOffset - 1; pos >= 0; pos--) {
         // sanity bounds check the char position.  bug 136165
         if (uint32_t(pos) >= textFrag->GetLength()) {
-          NS_NOTREACHED("looking beyond end of text fragment");
+          MOZ_ASSERT_UNREACHABLE("looking beyond end of text fragment");
           continue;
         }
         char16_t theChar = textFrag->CharAt(pos);
         if (!nsCRT::IsAsciiSpace(theChar)) {
           if (theChar != kNBSP) {
             mStartNode = textNode;
             mStartOffset = pos + 1;
             mStartReason = WSType::text;
@@ -742,17 +742,17 @@ WSRunObject::GetWSNodes()
         if (len < 1) {
           // Zero length text node. Set start point to it
           // so we can get past it!
           start.Set(priorNode, 0);
         } else {
           for (int32_t pos = len - 1; pos >= 0; pos--) {
             // sanity bounds check the char position.  bug 136165
             if (uint32_t(pos) >= textFrag->GetLength()) {
-              NS_NOTREACHED("looking beyond end of text fragment");
+              MOZ_ASSERT_UNREACHABLE("looking beyond end of text fragment");
               continue;
             }
             char16_t theChar = textFrag->CharAt(pos);
             if (!nsCRT::IsAsciiSpace(theChar)) {
               if (theChar != kNBSP) {
                 mStartNode = textNode;
                 mStartOffset = pos + 1;
                 mStartReason = WSType::text;
@@ -797,17 +797,17 @@ WSRunObject::GetWSNodes()
     // don't need to put it on list. it already is from code above
     const nsTextFragment *textFrag = textNode->GetText();
 
     uint32_t len = textNode->TextLength();
     if (uint16_t(mOffset)<len) {
       for (uint32_t pos = mOffset; pos < len; pos++) {
         // sanity bounds check the char position.  bug 136165
         if (pos >= textFrag->GetLength()) {
-          NS_NOTREACHED("looking beyond end of text fragment");
+          MOZ_ASSERT_UNREACHABLE("looking beyond end of text fragment");
           continue;
         }
         char16_t theChar = textFrag->CharAt(pos);
         if (!nsCRT::IsAsciiSpace(theChar)) {
           if (theChar != kNBSP) {
             mEndNode = textNode;
             mEndOffset = pos;
             mEndReason = WSType::text;
@@ -850,17 +850,17 @@ WSRunObject::GetWSNodes()
         if (len < 1) {
           // Zero length text node. Set end point to it
           // so we can get past it!
           end.Set(textNode, 0);
         } else {
           for (uint32_t pos = 0; pos < len; pos++) {
             // sanity bounds check the char position.  bug 136165
             if (pos >= textFrag->GetLength()) {
-              NS_NOTREACHED("looking beyond end of text fragment");
+              MOZ_ASSERT_UNREACHABLE("looking beyond end of text fragment");
               continue;
             }
             char16_t theChar = textFrag->CharAt(pos);
             if (!nsCRT::IsAsciiSpace(theChar)) {
               if (theChar != kNBSP) {
                 mEndNode = textNode;
                 mEndOffset = pos;
                 mEndReason = WSType::text;
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -3112,17 +3112,17 @@ nsPermissionManager::UpdateDB(OperationT
       if (NS_FAILED(rv)) break;
 
       rv = aStmt->BindInt64ByIndex(4, aModificationTime);
       break;
     }
 
   default:
     {
-      NS_NOTREACHED("need a valid operation in UpdateDB()!");
+      MOZ_ASSERT_UNREACHABLE("need a valid operation in UpdateDB()!");
       rv = NS_ERROR_UNEXPECTED;
       break;
     }
   }
 
   if (NS_FAILED(rv)) {
     NS_WARNING("db change failed!");
     return;
--- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp
@@ -315,17 +315,17 @@ mozInlineSpellStatus::FinishInitOnEvent(
       return FinishNavigationEvent(aWordUtil);
     case eOpSelection:
       // this gets special handling in ResumeCheck
       break;
     case eOpResume:
       // everything should be initialized already in this case
       break;
     default:
-      NS_NOTREACHED("Bad operation");
+      MOZ_ASSERT_UNREACHABLE("Bad operation");
       return NS_ERROR_NOT_INITIALIZED;
   }
   return NS_OK;
 }
 
 // mozInlineSpellStatus::FinishNavigationEvent
 //
 //    This verifies that we need to check the word at the previous caret
--- a/extensions/spellcheck/src/mozSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozSpellChecker.cpp
@@ -496,17 +496,17 @@ mozSpellChecker::SetupDoc(int32_t *outBl
         // TB contains entire S.
         case TextServicesDocument::BlockSelectionStatus::eBlockContains:
           *outBlockOffset = selOffset + selLength;
           break;
 
         // There is no text block (TB) in or before the selection (S).
         case TextServicesDocument::BlockSelectionStatus::eBlockNotFound:
         default:
-          NS_NOTREACHED("Shouldn't ever get this status");
+          MOZ_ASSERT_UNREACHABLE("Shouldn't ever get this status");
       }
     }
     // Failed to get last sel block. Just start at beginning
     else {
       rv = mTextServicesDocument->FirstBlock();
       *outBlockOffset = 0;
     }
 
--- a/gfx/layers/ipc/CompositorBridgeChild.cpp
+++ b/gfx/layers/ipc/CompositorBridgeChild.cpp
@@ -384,17 +384,17 @@ static void CalculatePluginClip(const La
 #endif
 
 mozilla::ipc::IPCResult
 CompositorBridgeChild::RecvUpdatePluginConfigurations(const LayoutDeviceIntPoint& aContentOffset,
                                                       const LayoutDeviceIntRegion& aParentLayerVisibleRegion,
                                                       nsTArray<PluginWindowData>&& aPlugins)
 {
 #if !defined(XP_WIN) && !defined(MOZ_WIDGET_GTK)
-  NS_NOTREACHED("CompositorBridgeChild::RecvUpdatePluginConfigurations calls "
+  MOZ_ASSERT_UNREACHABLE("CompositorBridgeChild::RecvUpdatePluginConfigurations calls "
                 "unexpected on this platform.");
   return IPC_FAIL_NO_REASON(this);
 #else
   // Now that we are on the main thread, update plugin widget config.
   // This should happen a little before we paint to the screen assuming
   // the main thread is running freely.
   DebugOnly<nsresult> rv;
   MOZ_ASSERT(NS_IsMainThread());
@@ -500,17 +500,17 @@ CompositorBridgeChild::RecvCaptureAllPlu
   return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult
 CompositorBridgeChild::RecvHideAllPlugins(const uintptr_t& aParentWidget)
 {
 #if !defined(XP_WIN) && !defined(MOZ_WIDGET_GTK)
-  NS_NOTREACHED("CompositorBridgeChild::RecvHideAllPlugins calls "
+  MOZ_ASSERT_UNREACHABLE("CompositorBridgeChild::RecvHideAllPlugins calls "
                 "unexpected on this platform.");
   return IPC_FAIL_NO_REASON(this);
 #else
   MOZ_ASSERT(NS_IsMainThread());
   nsTArray<uintptr_t> list;
   nsIWidget::UpdateRegisteredPluginWindowVisibility(aParentWidget, list);
   if (!mCanSend) {
     return IPC_OK();
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -1120,17 +1120,17 @@ CompositorBridgeParent::RecvRemotePlugin
   if (mHaveBlockedForPlugins) {
     mHaveBlockedForPlugins = false;
     ForceComposeToTarget(nullptr);
   } else {
     ScheduleComposition();
   }
   return IPC_OK();
 #else
-  NS_NOTREACHED("CompositorBridgeParent::RecvRemotePluginsReady calls "
+  MOZ_ASSERT_UNREACHABLE("CompositorBridgeParent::RecvRemotePluginsReady calls "
                 "unexpected on this platform.");
   return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 void
 CompositorBridgeParent::ForceComposeToTarget(DrawTarget* aTarget, const gfx::IntRect* aRect)
 {
--- a/gfx/layers/opengl/OGLShaderProgram.h
+++ b/gfx/layers/opengl/OGLShaderProgram.h
@@ -153,17 +153,17 @@ public:
     case 16:
       if (memcmp(mValue.f16v, fp, sizeof(float) * cnt) != 0) {
         memcpy(mValue.f16v, fp, sizeof(float) * cnt);
         return true;
       }
       return false;
     }
 
-    NS_NOTREACHED("cnt must be 1 2 3 4 9 or 16");
+    MOZ_ASSERT_UNREACHABLE("cnt must be 1 2 3 4 9 or 16");
     return false;
   }
 
   bool UpdateArrayUniform(int cnt, const float *fp) {
     if (mLocation == -1) return false;
     if (cnt > 16) {
       return false;
     }
@@ -558,17 +558,17 @@ protected:
     if (ku.UpdateUniform(aLength, aFloatValues)) {
       switch (aLength) {
       case 1: mGL->fUniform1fv(ku.mLocation, 1, ku.mValue.f16v); break;
       case 2: mGL->fUniform2fv(ku.mLocation, 1, ku.mValue.f16v); break;
       case 3: mGL->fUniform3fv(ku.mLocation, 1, ku.mValue.f16v); break;
       case 4: mGL->fUniform4fv(ku.mLocation, 1, ku.mValue.f16v); break;
       case 16: mGL->fUniform4fv(ku.mLocation, 4, ku.mValue.f16v); break;
       default:
-        NS_NOTREACHED("Bogus aLength param");
+        MOZ_ASSERT_UNREACHABLE("Bogus aLength param");
       }
     }
   }
 
   void SetArrayUniform(KnownUniform::KnownUniformName aKnownUniform, int aLength, float *aFloatValues)
   {
     ASSERT_THIS_PROGRAM;
     NS_ASSERTION(aKnownUniform >= 0 && aKnownUniform < KnownUniform::KnownUniformCount, "Invalid known uniform");
--- a/gfx/src/nsCoord.h
+++ b/gfx/src/nsCoord.h
@@ -200,17 +200,17 @@ NSCoordSaturatingSubtract(nscoord a, nsc
   VERIFY_COORD(b);
 
   if (b == nscoord_MAX) {
     if (a == nscoord_MAX) {
       // case (a)
       return infMinusInfResult;
     } else {
       // case (b)
-      NS_NOTREACHED("Attempted to subtract [n - nscoord_MAX]");
+      MOZ_ASSERT_UNREACHABLE("Attempted to subtract [n - nscoord_MAX]");
       return 0;
     }
   } else {
 #ifdef NS_COORD_IS_FLOAT
     // case (c) and (d) for floats.  (float math handles both)
     return a - b;
 #else
     if (a == nscoord_MAX) {
--- a/gfx/src/nsDeviceContext.cpp
+++ b/gfx/src/nsDeviceContext.cpp
@@ -13,17 +13,17 @@
 #include "gfxPoint.h"                   // for gfxSize
 #include "mozilla/Attributes.h"         // for final
 #include "mozilla/gfx/PathHelpers.h"
 #include "mozilla/gfx/PrintTarget.h"
 #include "mozilla/Preferences.h"        // for Preferences
 #include "mozilla/Services.h"           // for GetObserverService
 #include "mozilla/mozalloc.h"           // for operator new
 #include "nsCRT.h"                      // for nsCRT
-#include "nsDebug.h"                    // for NS_NOTREACHED, NS_ASSERTION, etc
+#include "nsDebug.h"                    // for NS_ASSERTION, etc
 #include "nsFont.h"                     // for nsFont
 #include "nsFontMetrics.h"              // for nsFontMetrics
 #include "nsAtom.h"                    // for nsAtom, NS_Atomize
 #include "nsID.h"
 #include "nsIDeviceContextSpec.h"       // for nsIDeviceContextSpec
 #include "nsLanguageAtomService.h"      // for nsLanguageAtomService
 #include "nsIObserver.h"                // for nsIObserver, etc
 #include "nsIObserverService.h"         // for nsIObserverService
@@ -697,17 +697,17 @@ bool nsDeviceContext::CheckDPIChange(dou
     return oldDevPixels != mAppUnitsPerDevPixelAtUnitFullZoom ||
         oldInches != mAppUnitsPerPhysicalInch;
 }
 
 bool
 nsDeviceContext::SetFullZoom(float aScale)
 {
     if (aScale <= 0) {
-        NS_NOTREACHED("Invalid full zoom value");
+        MOZ_ASSERT_UNREACHABLE("Invalid full zoom value");
         return false;
     }
     int32_t oldAppUnitsPerDevPixel = mAppUnitsPerDevPixel;
     mFullZoom = aScale;
     UpdateAppUnitsForFullZoom();
     return oldAppUnitsPerDevPixel != mAppUnitsPerDevPixel;
 }
 
--- a/gfx/thebes/gfxASurface.cpp
+++ b/gfx/thebes/gfxASurface.cpp
@@ -561,17 +561,17 @@ gfxASurface::BytesPerPixel(gfxImageForma
     case SurfaceFormat::X8R8G8B8_UINT32:
       return 4;
     case SurfaceFormat::R5G6B5_UINT16:
       return 2;
     case SurfaceFormat::A8:
       return 1;
     case SurfaceFormat::UNKNOWN:
     default:
-      NS_NOTREACHED("Not really sure what you want me to say here");
+      MOZ_ASSERT_UNREACHABLE("Not really sure what you want me to say here");
       return 0;
   }
 }
 
 void
 gfxASurface::SetOpaqueRect(const gfxRect& aRect)
 {
     if (aRect.IsEmpty()) {
--- a/gfx/thebes/gfxAndroidPlatform.cpp
+++ b/gfx/thebes/gfxAndroidPlatform.cpp
@@ -276,33 +276,33 @@ gfxAndroidPlatform::FontHintingEnabled()
     // XXX when gecko-android-java is used as an "app runtime", we may
     // want to re-enable hinting for non-browser processes there.
     return false;
 #endif //  MOZ_WIDGET_ANDROID
 
     // Currently, we don't have any other targets, but if/when we do,
     // decide how to handle them here.
 
-    NS_NOTREACHED("oops, what platform is this?");
+    MOZ_ASSERT_UNREACHABLE("oops, what platform is this?");
     return gfxPlatform::FontHintingEnabled();
 }
 
 bool
 gfxAndroidPlatform::RequiresLinearZoom()
 {
 #ifdef MOZ_WIDGET_ANDROID
     // On Android, we currently only use gecko to render web
     // content that can always be be non-reflow-zoomed.
     //
     // XXX when gecko-android-java is used as an "app runtime", we may
     // want to use linear zoom only for the web browser process, not other apps.
     return true;
 #endif
 
-    NS_NOTREACHED("oops, what platform is this?");
+    MOZ_ASSERT_UNREACHABLE("oops, what platform is this?");
     return gfxPlatform::RequiresLinearZoom();
 }
 
 class AndroidVsyncSource final : public VsyncSource {
 public:
     class JavaVsyncSupport final : public java::VsyncSource::Natives<JavaVsyncSupport>
     {
     public:
--- a/gfx/thebes/gfxDWriteFontList.cpp
+++ b/gfx/thebes/gfxDWriteFontList.cpp
@@ -730,17 +730,17 @@ gfxDWriteFontEntry::CreateFontFace(IDWri
             hr = Factory::GetDWriteFactory()->
                 CreateFontFace(mFaceType,
                                1,
                                &fontFile,
                                0,
                                DWRITE_FONT_SIMULATIONS_NONE,
                                getter_AddRefs(mFontFace));
         } else {
-            NS_NOTREACHED("invalid font entry");
+            MOZ_ASSERT_UNREACHABLE("invalid font entry");
             return NS_ERROR_FAILURE;
         }
         if (FAILED(hr)) {
             return NS_ERROR_FAILURE;
         }
         // Also get the IDWriteFontFace5 interface if we're running on a
         // sufficiently new DWrite version where it is available.
         if (mFontFace) {
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -942,17 +942,17 @@ NS_IMPL_ISUPPORTS(WillShutdownObserver, 
 NS_IMETHODIMP
 WillShutdownObserver::Observe(nsISupports *aSubject,
                               const char *aTopic,
                               const char16_t *aData)
 {
     if (!nsCRT::strcmp(aTopic, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID)) {
         mFontList->WillShutdown();
     } else {
-        NS_NOTREACHED("unexpected notification topic");
+        MOZ_ASSERT_UNREACHABLE("unexpected notification topic");
     }
     return NS_OK;
 }
 
 gfxFT2FontList::gfxFT2FontList()
     : mJarModifiedTime(0)
 {
     nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -1836,17 +1836,17 @@ gfxFcPlatformFontList::GetFontList(nsAto
     else if (aGenericFamily.LowerCaseEqualsLiteral("sans-serif"))
         sansSerif = true;
     else if (aGenericFamily.LowerCaseEqualsLiteral("monospace"))
         monospace = true;
     else if (aGenericFamily.LowerCaseEqualsLiteral("cursive") ||
              aGenericFamily.LowerCaseEqualsLiteral("fantasy"))
         serif = sansSerif = true;
     else
-        NS_NOTREACHED("unexpected CSS generic font family");
+        MOZ_ASSERT_UNREACHABLE("unexpected CSS generic font family");
 
     // The first in the list becomes the default in
     // FontBuilder.readFontSelection() if the preference-selected font is not
     // available, so put system configured defaults first.
     if (monospace)
         aListOfFonts.InsertElementAt(0, NS_LITERAL_STRING("monospace"));
     if (sansSerif)
         aListOfFonts.InsertElementAt(0, NS_LITERAL_STRING("sans-serif"));
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -133,17 +133,17 @@ gfxFontCache::Observer::Observe(nsISuppo
                                 const char16_t *someData)
 {
     if (!nsCRT::strcmp(aTopic, "memory-pressure")) {
         gfxFontCache *fontCache = gfxFontCache::GetCache();
         if (fontCache) {
             fontCache->FlushShapedWordCaches();
         }
     } else {
-        NS_NOTREACHED("unexpected notification topic");
+        MOZ_ASSERT_UNREACHABLE("unexpected notification topic");
     }
     return NS_OK;
 }
 
 nsresult
 gfxFontCache::Init()
 {
     NS_ASSERTION(!gGlobalCache, "Where did this come from?");
--- a/gfx/thebes/gfxFontEntry.cpp
+++ b/gfx/thebes/gfxFontEntry.cpp
@@ -1704,17 +1704,17 @@ gfxFontFamily::FindAllFontsForStyle(cons
             fe = mAvailableFonts[order[trial]];
             if (fe) {
                 aFontEntryList.AppendElement(fe);
                 return;
             }
         }
 
         // this can't happen unless we have totally broken the font-list manager!
-        NS_NOTREACHED("no face found in simple font family!");
+        MOZ_ASSERT_UNREACHABLE("no face found in simple font family!");
     }
 
     // Pick the font(s) that are closest to the desired weight, style, and
     // stretch. Iterate over all fonts, measuring the weight/style distance.
     // Because of unicode-range values, there may be more than one font for a
     // given but the 99% use case is only a single font entry per
     // weight/style/stretch distance value. To optimize this, only add entries
     // to the matched font array when another entry already has the same
--- a/gfx/thebes/gfxFontEntry.h
+++ b/gfx/thebes/gfxFontEntry.h
@@ -501,17 +501,17 @@ protected:
     virtual gfxFont *CreateFontInstance(const gfxFontStyle *aFontStyle) = 0;
 
     virtual void CheckForGraphiteTables();
 
     // Copy a font table into aBuffer.
     // The caller will be responsible for ownership of the data.
     virtual nsresult CopyFontTable(uint32_t aTableTag,
                                    nsTArray<uint8_t>& aBuffer) {
-        NS_NOTREACHED("forgot to override either GetFontTable or CopyFontTable?");
+        MOZ_ASSERT_UNREACHABLE("forgot to override either GetFontTable or CopyFontTable?");
         return NS_ERROR_FAILURE;
     }
 
     // lookup the cmap in cached font data
     virtual already_AddRefed<gfxCharacterMap>
     GetCMAPFromFontInfo(FontInfoData *aFontInfoData,
                         uint32_t& aUVSOffset);
 
--- a/gfx/thebes/gfxFontInfoLoader.cpp
+++ b/gfx/thebes/gfxFontInfoLoader.cpp
@@ -126,17 +126,17 @@ NS_IMPL_ISUPPORTS(gfxFontInfoLoader::Shu
 NS_IMETHODIMP
 gfxFontInfoLoader::ShutdownObserver::Observe(nsISupports *aSubject,
                                              const char *aTopic,
                                              const char16_t *someData)
 {
     if (!nsCRT::strcmp(aTopic, "quit-application")) {
         mLoader->CancelLoader();
     } else {
-        NS_NOTREACHED("unexpected notification topic");
+        MOZ_ASSERT_UNREACHABLE("unexpected notification topic");
     }
     return NS_OK;
 }
 
 void
 gfxFontInfoLoader::StartLoader(uint32_t aDelay, uint32_t aInterval)
 {
     mInterval = aInterval;
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2313,41 +2313,41 @@ gfxPlatform::Optimal2DFormatForContent(g
     switch (GetOffscreenFormat()) {
     case SurfaceFormat::A8R8G8B8_UINT32:
       return mozilla::gfx::SurfaceFormat::B8G8R8A8;
     case SurfaceFormat::X8R8G8B8_UINT32:
       return mozilla::gfx::SurfaceFormat::B8G8R8X8;
     case SurfaceFormat::R5G6B5_UINT16:
       return mozilla::gfx::SurfaceFormat::R5G6B5_UINT16;
     default:
-      NS_NOTREACHED("unknown gfxImageFormat for gfxContentType::COLOR");
+      MOZ_ASSERT_UNREACHABLE("unknown gfxImageFormat for gfxContentType::COLOR");
       return mozilla::gfx::SurfaceFormat::B8G8R8A8;
     }
   case gfxContentType::ALPHA:
     return mozilla::gfx::SurfaceFormat::A8;
   case gfxContentType::COLOR_ALPHA:
     return mozilla::gfx::SurfaceFormat::B8G8R8A8;
   default:
-    NS_NOTREACHED("unknown gfxContentType");
+    MOZ_ASSERT_UNREACHABLE("unknown gfxContentType");
     return mozilla::gfx::SurfaceFormat::B8G8R8A8;
   }
 }
 
 gfxImageFormat
 gfxPlatform::OptimalFormatForContent(gfxContentType aContent)
 {
   switch (aContent) {
   case gfxContentType::COLOR:
     return GetOffscreenFormat();
   case gfxContentType::ALPHA:
     return SurfaceFormat::A8;
   case gfxContentType::COLOR_ALPHA:
     return SurfaceFormat::A8R8G8B8_UINT32;
   default:
-    NS_NOTREACHED("unknown gfxContentType");
+    MOZ_ASSERT_UNREACHABLE("unknown gfxContentType");
     return SurfaceFormat::A8R8G8B8_UINT32;
   }
 }
 
 /**
  * There are a number of layers acceleration (or layers in general) preferences
  * that should be consistent for the lifetime of the application (bug 840967).
  * As such, we will evaluate them all as soon as one of them is evaluated
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -353,17 +353,17 @@ public:
     virtual nsresult UpdateFontList();
 
     /**
      * Create the platform font-list object (gfxPlatformFontList concrete subclass).
      * This function is responsible to create the appropriate subclass of
      * gfxPlatformFontList *and* to call its InitFontList() method.
      */
     virtual gfxPlatformFontList *CreatePlatformFontList() {
-        NS_NOTREACHED("oops, this platform doesn't have a gfxPlatformFontList implementation");
+        MOZ_ASSERT_UNREACHABLE("oops, this platform doesn't have a gfxPlatformFontList implementation");
         return nullptr;
     }
 
     /**
      * Resolving a font name to family name. The result MUST be in the result of GetFontList().
      * If the name doesn't in the system, aFamilyName will be empty string, but not failed.
      */
     virtual nsresult GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName);
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -166,17 +166,17 @@ gfxUserFontEntry::Matches(const nsTArray
            mRangeFlags == aRangeFlags &&
            ((!aUnicodeRanges && !mCharacterMap) ||
             (aUnicodeRanges && mCharacterMap && mCharacterMap->Equals(aUnicodeRanges)));
 }
 
 gfxFont*
 gfxUserFontEntry::CreateFontInstance(const gfxFontStyle* aFontStyle)
 {
-    NS_NOTREACHED("should only be creating a gfxFont"
+    MOZ_ASSERT_UNREACHABLE("should only be creating a gfxFont"
                   " with an actual platform font entry");
 
     // userfont entry is a container, can't create font from the container
     return nullptr;
 }
 
 class MOZ_STACK_CLASS gfxOTSContext : public ots::OTSContext {
 public:
@@ -1142,17 +1142,17 @@ gfxUserFontSet::UserFontCache::Flusher::
                 i.Remove();
             }
         }
     } else if (!strcmp(aTopic, "xpcom-shutdown")) {
         for (auto i = sUserFonts->Iter(); !i.Done(); i.Next()) {
             i.Get()->GetFontEntry()->DisconnectSVG();
         }
     } else {
-        NS_NOTREACHED("unexpected topic");
+        MOZ_ASSERT_UNREACHABLE("unexpected topic");
     }
 
     return NS_OK;
 }
 
 bool
 gfxUserFontSet::UserFontCache::Entry::KeyEquals(const KeyTypePointer aKey) const
 {
--- a/image/MultipartImage.cpp
+++ b/image/MultipartImage.cpp
@@ -306,17 +306,17 @@ MultipartImage::Notify(int32_t aType, co
     mTracker->OnDiscard();
   } else if (aType == imgINotificationObserver::UNLOCKED_DRAW) {
     mTracker->OnUnlockedDraw();
   } else if (aType == imgINotificationObserver::IS_ANIMATED) {
     mTracker->SyncNotifyProgress(FLAG_IS_ANIMATED);
   } else if (aType == imgINotificationObserver::HAS_TRANSPARENCY) {
     mTracker->SyncNotifyProgress(FLAG_HAS_TRANSPARENCY);
   } else {
-    NS_NOTREACHED("Notification list should be exhaustive");
+    MOZ_ASSERT_UNREACHABLE("Notification list should be exhaustive");
   }
 }
 
 void
 MultipartImage::OnLoadComplete(bool aLastPart)
 {
   Progress progress = FLAG_LOAD_COMPLETE;
   if (aLastPart) {
--- a/image/decoders/EXIF.cpp
+++ b/image/decoders/EXIF.cpp
@@ -257,17 +257,17 @@ EXIFParser::MatchUInt16(const uint16_t a
   switch (mByteOrder) {
     case ByteOrder::LittleEndian:
       matched = LittleEndian::readUint16(mCurrent) == aValue;
       break;
     case ByteOrder::BigEndian:
       matched = BigEndian::readUint16(mCurrent) == aValue;
       break;
     default:
-      NS_NOTREACHED("Should know the byte order by now");
+      MOZ_ASSERT_UNREACHABLE("Should know the byte order by now");
       matched = false;
   }
 
   if (matched) {
     Advance(2);
   }
 
   return matched;
@@ -284,17 +284,17 @@ EXIFParser::ReadUInt16(uint16_t& aValue)
   switch (mByteOrder) {
     case ByteOrder::LittleEndian:
       aValue = LittleEndian::readUint16(mCurrent);
       break;
     case ByteOrder::BigEndian:
       aValue = BigEndian::readUint16(mCurrent);
       break;
     default:
-      NS_NOTREACHED("Should know the byte order by now");
+      MOZ_ASSERT_UNREACHABLE("Should know the byte order by now");
       matched = false;
   }
 
   if (matched) {
     Advance(2);
   }
 
   return matched;
@@ -311,17 +311,17 @@ EXIFParser::ReadUInt32(uint32_t& aValue)
   switch (mByteOrder) {
     case ByteOrder::LittleEndian:
       aValue = LittleEndian::readUint32(mCurrent);
       break;
     case ByteOrder::BigEndian:
       aValue = BigEndian::readUint32(mCurrent);
       break;
     default:
-      NS_NOTREACHED("Should know the byte order by now");
+      MOZ_ASSERT_UNREACHABLE("Should know the byte order by now");
       matched = false;
   }
 
   if (matched) {
     Advance(4);
   }
 
   return matched;
--- a/image/decoders/icon/mac/nsIconChannelCocoa.mm
+++ b/image/decoders/icon/mac/nsIconChannelCocoa.mm
@@ -508,17 +508,17 @@ nsIconChannel::GetContentLength(int64_t*
 {
   *aContentLength = 0;
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 nsIconChannel::SetContentLength(int64_t aContentLength)
 {
-  NS_NOTREACHED("nsIconChannel::SetContentLength");
+  MOZ_ASSERT_UNREACHABLE("nsIconChannel::SetContentLength");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsIconChannel::GetLoadGroup(nsILoadGroup** aLoadGroup)
 {
   *aLoadGroup = mLoadGroup;
   NS_IF_ADDREF(*aLoadGroup);
--- a/image/decoders/icon/win/nsIconChannel.cpp
+++ b/image/decoders/icon/win/nsIconChannel.cpp
@@ -733,17 +733,17 @@ nsIconChannel::GetContentLength(int64_t*
 {
   *aContentLength = 0;
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 nsIconChannel::SetContentLength(int64_t aContentLength)
 {
-  NS_NOTREACHED("nsIconChannel::SetContentLength");
+  MOZ_ASSERT_UNREACHABLE("nsIconChannel::SetContentLength");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsIconChannel::GetOwner(nsISupports** aOwner)
 {
   *aOwner = mOwner.get();
   NS_IF_ADDREF(*aOwner);
--- a/image/encoders/bmp/nsBMPEncoder.cpp
+++ b/image/encoders/bmp/nsBMPEncoder.cpp
@@ -251,17 +251,17 @@ nsBMPEncoder::AddImageFrame(const uint8_
     for (int32_t y = 0; y < mBMPInfoHeader.height; y++) {
       if (mBMPInfoHeader.bpp == 24) {
         EncodeImageDataRow24(&aData[y * aStride]);
       } else {
         EncodeImageDataRow32(&aData[y * aStride]);
       }
     }
   } else {
-    NS_NOTREACHED("Bad format type");
+    MOZ_ASSERT_UNREACHABLE("Bad format type");
     return NS_ERROR_INVALID_ARG;
   }
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
--- a/image/encoders/png/nsPNGEncoder.cpp
+++ b/image/encoders/png/nsPNGEncoder.cpp
@@ -294,17 +294,17 @@ nsPNGEncoder::AddImageFrame(const uint8_
   } else if (aInputFormat == INPUT_FORMAT_RGB ||
              aInputFormat == INPUT_FORMAT_RGBA) {
     // simple RBG(A), no conversion needed
     for (uint32_t y = 0; y < aHeight; y++) {
       png_write_row(mPNG, (uint8_t*)&aData[y * aStride]);
     }
 
   } else {
-    NS_NOTREACHED("Bad format type");
+    MOZ_ASSERT_UNREACHABLE("Bad format type");
     return NS_ERROR_INVALID_ARG;
   }
 
 #ifdef PNG_APNG_SUPPORTED
   if (mIsAnimation) {
     png_write_frame_tail(mPNG, mPNGinfo);
   }
 #endif
--- a/image/imgRequestProxy.cpp
+++ b/image/imgRequestProxy.cpp
@@ -1034,17 +1034,17 @@ NotificationTypeToString(int32_t aType)
     case imgINotificationObserver::FRAME_COMPLETE: return "FRAME_COMPLETE";
     case imgINotificationObserver::LOAD_COMPLETE: return "LOAD_COMPLETE";
     case imgINotificationObserver::DECODE_COMPLETE: return "DECODE_COMPLETE";
     case imgINotificationObserver::DISCARD: return "DISCARD";
     case imgINotificationObserver::UNLOCKED_DRAW: return "UNLOCKED_DRAW";
     case imgINotificationObserver::IS_ANIMATED: return "IS_ANIMATED";
     case imgINotificationObserver::HAS_TRANSPARENCY: return "HAS_TRANSPARENCY";
     default:
-      NS_NOTREACHED("Notification list should be exhaustive");
+      MOZ_ASSERT_UNREACHABLE("Notification list should be exhaustive");
       return "(unknown notification)";
   }
 }
 
 void
 imgRequestProxy::Notify(int32_t aType, const mozilla::gfx::IntRect* aRect)
 {
   MOZ_ASSERT(aType != imgINotificationObserver::LOAD_COMPLETE,
--- a/intl/unicharutil/util/nsUnicodeProperties.cpp
+++ b/intl/unicharutil/util/nsUnicodeProperties.cpp
@@ -21,17 +21,17 @@ GetCharProps2(uint32_t aCh)
                               [aCh & ((1 << kCharProp2CharBits) - 1)];
     }
     if (aCh < (kCharProp2MaxPlane + 1) * 0x10000) {
         return sCharProp2Values[sCharProp2Pages[sCharProp2Planes[(aCh >> 16) - 1]]
                                                [(aCh & 0xffff) >> kCharProp2CharBits]]
                                [aCh & ((1 << kCharProp2CharBits) - 1)];
     }
 
-    NS_NOTREACHED("Getting CharProps for codepoint outside Unicode range");
+    MOZ_ASSERT_UNREACHABLE("Getting CharProps for codepoint outside Unicode range");
     // Default values for unassigned
     using namespace mozilla::unicode;
     static const nsCharProps2 undefined = {
         VERTICAL_ORIENTATION_R,
         0 // IdentifierType
     };
     return undefined;
 }
--- a/ipc/glue/Transport_win.cpp
+++ b/ipc/glue/Transport_win.cpp
@@ -80,17 +80,17 @@ OpenDescriptor(const TransportDescriptor
     MOZ_RELEASE_ASSERT(aTd.mDestinationProcessId == base::GetCurrentProcId());
   }
   return MakeUnique<Transport>(aTd.mPipeName, aTd.mServerPipeHandle, aMode, nullptr);
 }
 
 UniquePtr<Transport>
 OpenDescriptor(const FileDescriptor& aFd, Transport::Mode aMode)
 {
-  NS_NOTREACHED("Not implemented!");
+  MOZ_ASSERT_UNREACHABLE("Not implemented!");
   return nullptr;
 }
 
 TransportDescriptor
 DuplicateDescriptor(const TransportDescriptor& aTd)
 {
   // We're duplicating this handle in our own process for bookkeeping purposes.
 
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -866,17 +866,17 @@ NS_IMPL_ISUPPORTS(PresShell, nsIPresShel
                   nsISelectionDisplay, nsIObserver, nsISupportsWeakReference,
                   nsIMutationObserver)
 
 PresShell::~PresShell()
 {
   MOZ_LOG(gLog, LogLevel::Debug, ("PresShell::~PresShell this=%p", this));
 
   if (!mHaveShutDown) {
-    NS_NOTREACHED("Someone did not call nsIPresShell::destroy");
+    MOZ_ASSERT_UNREACHABLE("Someone did not call nsIPresShell::destroy");
     Destroy();
   }
 
   NS_ASSERTION(mCurrentEventContentStack.Count() == 0,
                "Huh, event content left on the stack in pres shell dtor!");
   NS_ASSERTION(mFirstCallbackEventRequest == nullptr &&
                mLastCallbackEventRequest == nullptr,
                "post-reflow queues not empty.  This means we're leaking");
@@ -2626,17 +2626,17 @@ PresShell::VerifyHasDirtyRootAncestor(ns
     if (((aFrame->GetStateBits() & NS_FRAME_REFLOW_ROOT) ||
          !aFrame->GetParent()) &&
         mDirtyRoots.Contains(aFrame)) {
       return;
     }
 
     aFrame = aFrame->GetParent();
   }
-  NS_NOTREACHED("Frame has dirty bits set but isn't scheduled to be "
+  MOZ_ASSERT_UNREACHABLE("Frame has dirty bits set but isn't scheduled to be "
                 "reflowed?");
 }
 #endif
 
 void
 PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
                             nsFrameState aBitToAdd,
                             ReflowRootHandling aRootHandling)
--- a/layout/base/StackArena.cpp
+++ b/layout/base/StackArena.cpp
@@ -90,17 +90,17 @@ StackArena::Push()
     StackMark* newMarks = new StackMark[newLength];
     if (newMarks) {
       if (mMarkLength) {
         memcpy(newMarks, mMarks, sizeof(StackMark)*mMarkLength);
       }
       // Fill in any marks that we couldn't allocate during a prior call
       // to Push().
       for (; mMarkLength < mStackTop; ++mMarkLength) {
-        NS_NOTREACHED("should only hit this on out-of-memory");
+        MOZ_ASSERT_UNREACHABLE("should only hit this on out-of-memory");
         newMarks[mMarkLength].mBlock = mCurBlock;
         newMarks[mMarkLength].mPos = mPos;
       }
       delete [] mMarks;
       mMarks = newMarks;
       mMarkLength = newLength;
     }
   }
@@ -147,17 +147,17 @@ StackArena::Pop()
 {
   // Pop off the mark.
   NS_ASSERTION(mStackTop > 0, "unmatched pop");
   mStackTop--;
 
   if (mStackTop >= mMarkLength) {
     // We couldn't allocate the marks array at the time of the push, so
     // we don't know where we're freeing to.
-    NS_NOTREACHED("out of memory");
+    MOZ_ASSERT_UNREACHABLE("out of memory");
     if (mStackTop == 0) {
       // But we do know if we've completely pushed the stack.
       mCurBlock = mBlocks;
       mPos = 0;
     }
     return;
   }
 
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -564,17 +564,17 @@ static nsContainerFrame*
 GetLastIBSplitSibling(nsIFrame* aFrame)
 {
   for (nsIFrame* frame = aFrame, *next; ; frame = next) {
     next = GetIBSplitSibling(frame);
     if (!next) {
       return static_cast<nsContainerFrame*>(frame);
     }
   }
-  NS_NOTREACHED("unreachable code");
+  MOZ_ASSERT_UNREACHABLE("unreachable code");
   return nullptr;
 }
 
 static void
 SetFrameIsIBSplit(nsContainerFrame* aFrame, nsContainerFrame* aIBSplitSibling)
 {
   MOZ_ASSERT(aFrame, "bad args!");
 
@@ -1809,17 +1809,17 @@ nsCSSFrameConstructor::CreateGeneratedCo
                                            "Submit", temp);
         return CreateGenConTextNode(aState, temp, nullptr, nullptr);
       }
 
       break;
     }
 
     case eStyleContentType_Uninitialized:
-      NS_NOTREACHED("uninitialized content type");
+      MOZ_ASSERT_UNREACHABLE("uninitialized content type");
       return nullptr;
   }
 
   return nullptr;
 }
 
 /*
  * aParentFrame - the frame that should be the parent of the generated
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -4752,17 +4752,17 @@ GetPercentBSize(const nsStyleCoord& aSty
 
   // During reflow, nsHTMLScrollFrame::ReflowScrolledFrame uses
   // SetComputedHeight on the reflow state for its child to propagate its
   // computed height to the scrolled content. So here we skip to the scroll
   // frame that contains this scrolled content in order to get the same
   // behavior as layout when computing percentage heights.
   nsIFrame *f = aFrame->GetContainingBlock(nsIFrame::SKIP_SCROLLED_FRAME);
   if (!f) {
-    NS_NOTREACHED("top of frame tree not a containing block");
+    MOZ_ASSERT_UNREACHABLE("top of frame tree not a containing block");
     return false;
   }
 
   WritingMode wm = f->GetWritingMode();
 
   const nsStylePosition *pos = f->StylePosition();
   const nsStyleCoord& bSizeCoord = pos->BSize(wm);
   nscoord h;
@@ -6214,17 +6214,17 @@ nsLayoutUtils::GetFirstLinePosition(Writ
       aResult->mBEnd = aFrame->BSize(aWM);
       return true;
     }
 
     // For first-line baselines, we have to consider scroll frames.
     if (fType == LayoutFrameType::Scroll) {
       nsIScrollableFrame *sFrame = do_QueryFrame(const_cast<nsIFrame*>(aFrame));
       if (!sFrame) {
-        NS_NOTREACHED("not scroll frame");
+        MOZ_ASSERT_UNREACHABLE("not scroll frame");
       }
       LinePosition kidPosition;
       if (GetFirstLinePosition(aWM,
                                sFrame->GetScrolledFrame(), &kidPosition)) {
         // Consider only the border and padding that contributes to the
         // kid's position, not the scrolling, so we get the initial
         // position.
         *aResult = kidPosition +
@@ -7378,28 +7378,28 @@ nsLayoutUtils::GetTextRunOrientFlagsForS
     switch (aComputedStyle->StyleVisibility()->mTextOrientation) {
     case NS_STYLE_TEXT_ORIENTATION_MIXED:
       return gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_MIXED;
     case NS_STYLE_TEXT_ORIENTATION_UPRIGHT:
       return gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_UPRIGHT;
     case NS_STYLE_TEXT_ORIENTATION_SIDEWAYS:
       return gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT;
     default:
-      NS_NOTREACHED("unknown text-orientation");
+      MOZ_ASSERT_UNREACHABLE("unknown text-orientation");
       return gfx::ShapedTextFlags();
     }
 
   case NS_STYLE_WRITING_MODE_SIDEWAYS_LR:
     return gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_SIDEWAYS_LEFT;
 
   case NS_STYLE_WRITING_MODE_SIDEWAYS_RL:
     return gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT;
 
   default:
-    NS_NOTREACHED("unknown writing-mode");
+    MOZ_ASSERT_UNREACHABLE("unknown writing-mode");
     return gfx::ShapedTextFlags();
   }
 }
 
 /* static */ void
 nsLayoutUtils::GetRectDifferenceStrips(const nsRect& aR1, const nsRect& aR2,
                                        nsRect* aHStrip, nsRect* aVStrip) {
   NS_ASSERTION(aR1.TopLeft() == aR2.TopLeft(),
--- a/layout/generic/BlockReflowInput.h
+++ b/layout/generic/BlockReflowInput.h
@@ -182,17 +182,17 @@ public:
       // See if there's room in the next band.
       *aBCoord += aFloatAvailableSpace.BSize(wm);
     } else {
       if (mReflowInput.AvailableHeight() != NS_UNCONSTRAINEDSIZE) {
         // Stop trying to clear here; we'll just get pushed to the
         // next column or page and try again there.
         return false;
       }
-      NS_NOTREACHED("avail space rect with zero height!");
+      MOZ_ASSERT_UNREACHABLE("avail space rect with zero height!");
       *aBCoord += 1;
     }
     return true;
   }
 
   bool ReplacedBlockFitsInAvailSpace(nsIFrame* aReplacedBlock,
                             const nsFlowAreaRect& aFloatAvailableSpace) const;
 
--- a/layout/generic/FrameChildList.cpp
+++ b/layout/generic/FrameChildList.cpp
@@ -45,15 +45,15 @@ ChildListName(FrameChildListID aListID)
     case kOverflowOutOfFlowList: return "OverflowOutOfFlowList";
     case kFloatList: return "FloatList";
     case kBulletList: return "BulletList";
     case kPushedFloatsList: return "PushedFloatsList";
     case kBackdropList: return "BackdropList";
     case kNoReflowPrincipalList: return "NoReflowPrincipalList";
   }
 
-  NS_NOTREACHED("unknown list");
+  MOZ_ASSERT_UNREACHABLE("unknown list");
   return "UNKNOWN_FRAME_CHILD_LIST";
 }
 #endif
 
 } // namespace layout
 } // namespace mozilla
--- a/layout/generic/WritingModes.h
+++ b/layout/generic/WritingModes.h
@@ -533,17 +533,17 @@ private:
         break;
 
       case NS_STYLE_WRITING_MODE_SIDEWAYS_RL:
         mWritingMode = eOrientationMask |
                        eSidewaysMask;
         break;
 
       default:
-        NS_NOTREACHED("unknown writing mode!");
+        MOZ_ASSERT_UNREACHABLE("unknown writing mode!");
         mWritingMode = 0;
         break;
     }
 
     if (NS_STYLE_DIRECTION_RTL == aStyleVisibility->mDirection) {
       mWritingMode ^= eInlineFlowMask | eBidiMask;
     }
   }
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -7431,17 +7431,17 @@ nsBlockFrame::GetNearestAncestorBlock(ns
     block = nsLayoutUtils::GetAsBlock(aCandidate);
     if (block) {
       // yay, candidate is a block!
       return block;
     }
     // Not a block. Check its parent next.
     aCandidate = aCandidate->GetParent();
   }
-  NS_NOTREACHED("Fell off frame tree looking for ancestor block!");
+  MOZ_ASSERT_UNREACHABLE("Fell off frame tree looking for ancestor block!");
   return nullptr;
 }
 
 void
 nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowInput,
                                 nsReflowStatus*          aStatus,
                                 nscoord                  aContentBSize,
                                 const LogicalMargin&     aBorderPadding,
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -680,17 +680,17 @@ nsColumnSetFrame::ReflowChildren(ReflowO
         }
         break;
       case WritingMode::eBlockRL:
         // XXX not sure how to handle this, so for now just don't attempt
         // the optimization
         skipIncremental = false;
         break;
       default:
-        NS_NOTREACHED("unknown block direction");
+        MOZ_ASSERT_UNREACHABLE("unknown block direction");
         break;
       }
     }
 
     nscoord childContentBEnd = 0;
     if (!reflowNext && skipIncremental) {
       // This child does not need to be reflowed, but we may need to move it
       MoveChildTo(child, childOrigin, wm, containerSize);
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -1798,17 +1798,17 @@ nsContainerFrame::ResolvedOrientationIsV
       return false;
     case StyleOrient::Vertical:
       return true;
     case StyleOrient::Inline:
       return GetWritingMode().IsVertical();
     case StyleOrient::Block:
       return !GetWritingMode().IsVertical();
   }
-  NS_NOTREACHED("unexpected -moz-orient value");
+  MOZ_ASSERT_UNREACHABLE("unexpected -moz-orient value");
   return false;
 }
 
 // static
 bool
 nsContainerFrame::FrameStartsCounterScope(nsIFrame* aFrame)
 {
   nsIContent* content = aFrame->GetContent();
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1686,17 +1686,17 @@ nsIFrame::ComputeBorderRadii(const nsSty
 
     if (c.IsCoordPercentCalcUnit()) {
       aRadii[i] = c.ComputeCoordPercentCalc(axis);
       if (aRadii[i] < 0) {
         // clamp calc()
         aRadii[i] = 0;
       }
     } else {
-      NS_NOTREACHED("ComputeBorderRadii: bad unit");
+      MOZ_ASSERT_UNREACHABLE("ComputeBorderRadii: bad unit");
       aRadii[i] = 0;
     }
   }
 
   if (aSkipSides.Top()) {
     aRadii[eCornerTopLeftX] = 0;
     aRadii[eCornerTopLeftY] = 0;
     aRadii[eCornerTopRightX] = 0;
@@ -6500,17 +6500,17 @@ nsIFrame::IsContentDisabled() const
 
   auto* element = nsGenericHTMLElement::FromNodeOrNull(GetContent());
   return element && element->IsDisabled();
 }
 
 nsresult
 nsFrame::CharacterDataChanged(const CharacterDataChangeInfo&)
 {
-  NS_NOTREACHED("should only be called for text frames");
+  MOZ_ASSERT_UNREACHABLE("should only be called for text frames");
   return NS_OK;
 }
 
 nsresult
 nsFrame::AttributeChanged(int32_t         aNameSpaceID,
                           nsAtom*        aAttribute,
                           int32_t         aModType)
 {
@@ -9077,25 +9077,25 @@ nsView* nsIFrame::GetClosestView(nsPoint
     if (f->HasView()) {
       if (aOffset)
         *aOffset = offset;
       return f->GetView();
     }
     offset += f->GetPosition();
   }
 
-  NS_NOTREACHED("No view on any parent?  How did that happen?");
+  MOZ_ASSERT_UNREACHABLE("No view on any parent?  How did that happen?");
   return nullptr;
 }
 
 
 /* virtual */ void
 nsFrame::ChildIsDirty(nsIFrame* aChild)
 {
-  NS_NOTREACHED("should never be called on a frame that doesn't inherit from "
+  MOZ_ASSERT_UNREACHABLE("should never be called on a frame that doesn't inherit from "
                 "nsContainerFrame");
 }
 
 
 #ifdef ACCESSIBILITY
 a11y::AccType
 nsFrame::AccessibleType()
 {
@@ -9896,17 +9896,17 @@ nsFrame::DoGetParentComputedStyle(nsIFra
     return *aProviderFrame ? (*aProviderFrame)->Style() : nullptr;
   }
 
   // We're an out-of-flow frame.  For out-of-flow frames, we must
   // resolve underneath the placeholder's parent.  The placeholder is
   // reached from the first-in-flow.
   nsPlaceholderFrame* placeholder = FirstInFlow()->GetPlaceholderFrame();
   if (!placeholder) {
-    NS_NOTREACHED("no placeholder frame for out-of-flow frame");
+    MOZ_ASSERT_UNREACHABLE("no placeholder frame for out-of-flow frame");
     *aProviderFrame = GetCorrectedParent(this);
     return *aProviderFrame ? (*aProviderFrame)->Style() : nullptr;
   }
   return placeholder->GetParentComputedStyleForOutOfFlow(aProviderFrame);
 }
 
 void
 nsFrame::GetLastLeaf(nsPresContext* aPresContext, nsIFrame **aFrame)
@@ -10023,17 +10023,17 @@ ConvertSVGDominantBaselineToVerticalAlig
   case NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT:
   case NS_STYLE_DOMINANT_BASELINE_NO_CHANGE:
   case NS_STYLE_DOMINANT_BASELINE_RESET_SIZE:
     // These three should not simply map to 'baseline', but we don't
     // support the complex baseline model that SVG 1.1 has and which
     // css3-linebox now defines.
     return NS_STYLE_VERTICAL_ALIGN_BASELINE;
   default:
-    NS_NOTREACHED("unexpected aDominantBaseline value");
+    MOZ_ASSERT_UNREACHABLE("unexpected aDominantBaseline value");
     return NS_STYLE_VERTICAL_ALIGN_BASELINE;
   }
 }
 
 uint8_t
 nsIFrame::VerticalAlignEnum() const
 {
   if (nsSVGUtils::IsInSVGTextSubtree(this)) {
--- a/layout/generic/nsFrameSelection.cpp
+++ b/layout/generic/nsFrameSelection.cpp
@@ -582,17 +582,17 @@ void printRange(nsRange *aDomRange)
 #endif /* PRINT_RANGE */
 
 static
 nsAtom *GetTag(nsINode *aNode)
 {
   nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
   if (!content)
   {
-    NS_NOTREACHED("bad node passed to GetTag()");
+    MOZ_ASSERT_UNREACHABLE("bad node passed to GetTag()");
     return nullptr;
   }
 
   return content->NodeInfo()->NameAtom();
 }
 
 // Returns the parent
 nsINode*
--- a/layout/generic/nsHTMLCanvasFrame.cpp
+++ b/layout/generic/nsHTMLCanvasFrame.cpp
@@ -259,17 +259,17 @@ nsHTMLCanvasFrame::GetCanvasSize()
   HTMLCanvasElement *canvas =
     HTMLCanvasElement::FromNodeOrNull(GetContent());
   if (canvas) {
     size = canvas->GetSize();
     MOZ_ASSERT(size.width >= 0 && size.height >= 0,
                "we should've required <canvas> width/height attrs to be "
                "unsigned (non-negative) values");
   } else {
-    NS_NOTREACHED("couldn't get canvas size");
+    MOZ_ASSERT_UNREACHABLE("couldn't get canvas size");
   }
 
   return size;
 }
 
 /* virtual */ nscoord
 nsHTMLCanvasFrame::GetMinISize(gfxContext *aRenderingContext)
 {
--- a/layout/generic/nsLeafFrame.cpp
+++ b/layout/generic/nsLeafFrame.cpp
@@ -47,17 +47,17 @@ nsLeafFrame::ComputeAutoSize(gfxContext*
   const WritingMode wm = GetWritingMode();
   LogicalSize result(wm, GetIntrinsicISize(), GetIntrinsicBSize());
   return result.ConvertTo(aWM, wm);
 }
 
 nscoord
 nsLeafFrame::GetIntrinsicBSize()
 {
-  NS_NOTREACHED("Someone didn't override Reflow or ComputeAutoSize");
+  MOZ_ASSERT_UNREACHABLE("Someone didn't override Reflow or ComputeAutoSize");
   return 0;
 }
 
 void
 nsLeafFrame::SizeToAvailSize(const ReflowInput& aReflowInput,
                              ReflowOutput& aDesiredSize)
 {
   WritingMode wm = aReflowInput.GetWritingMode();
--- a/layout/inspector/inDeepTreeWalker.cpp
+++ b/layout/inspector/inDeepTreeWalker.cpp
@@ -419,11 +419,11 @@ inDeepTreeWalker::NextNode(nsINode **_re
       NS_ASSERTION(mCurrentNode == origCurrentNode,
                    "Didn't go back to the right node?");
       *_retval = nullptr;
       return NS_OK;
     }
     ++lastChildCallsToMake;
   }
 
-  NS_NOTREACHED("how did we get here?");
+  MOZ_ASSERT_UNREACHABLE("how did we get here?");
   return NS_OK;
 }
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -2090,17 +2090,17 @@ nsMathMLChar::PaintForeground(nsIFrame* 
       // paint by parts
       if (NS_STRETCH_DIRECTION_VERTICAL == mDirection)
         PaintVertically(presContext, &aRenderingContext, r, fgColor);
       else if (NS_STRETCH_DIRECTION_HORIZONTAL == mDirection)
         PaintHorizontally(presContext, &aRenderingContext, r, fgColor);
       break;
     }
     default:
-      NS_NOTREACHED("Unknown drawing method");
+      MOZ_ASSERT_UNREACHABLE("Unknown drawing method");
       break;
   }
 
   aRenderingContext.Restore();
 }
 
 /* =============================================================================
   Helper routines that actually do the job of painting the char by parts
--- a/layout/mathml/nsMathMLContainerFrame.cpp
+++ b/layout/mathml/nsMathMLContainerFrame.cpp
@@ -1342,17 +1342,17 @@ GetInterFrameSpacingFor(int32_t         
       ComputedStyle* parentContext = aParentFrame->Style();
       nscoord thinSpace = GetThinSpace(parentContext->StyleFont());
       // we are done
       return space * thinSpace;
     }
     childFrame = childFrame->GetNextSibling();
   }
 
-  NS_NOTREACHED("child not in the childlist of its parent");
+  MOZ_ASSERT_UNREACHABLE("child not in the childlist of its parent");
   return 0;
 }
 
 static nscoord
 AddInterFrameSpacingToSize(ReflowOutput&    aDesiredSize,
                            nsMathMLContainerFrame* aFrame)
 {
   nscoord gap = 0;
--- a/layout/mathml/nsMathMLmencloseFrame.cpp
+++ b/layout/mathml/nsMathMLmencloseFrame.cpp
@@ -853,17 +853,17 @@ void nsDisplayNotation::Paint(nsDisplayL
 
       // Draw the angled line
       aDrawTarget.StrokeLine(rect.BottomLeft(),
                              rect.BottomLeft() + Point(w, -H),
                              color, strokeOptions);
       return;
     }
     default:
-      NS_NOTREACHED("This notation can not be drawn using nsDisplayNotation");
+      MOZ_ASSERT_UNREACHABLE("This notation can not be drawn using nsDisplayNotation");
   }
 }
 
 void
 nsMathMLmencloseFrame::DisplayNotation(nsDisplayListBuilder* aBuilder,
                                        nsIFrame* aFrame, const nsRect& aRect,
                                        const nsDisplayListSet& aLists,
                                        nscoord aThickness,
--- a/layout/mathml/nsMathMLmrowFrame.cpp
+++ b/layout/mathml/nsMathMLmrowFrame.cpp
@@ -44,17 +44,17 @@ nsMathMLmrowFrame::AttributeChanged(int3
   // notification to the real mtable
   if (mContent->IsMathMLElement(nsGkAtoms::mtable_)) {
     nsIFrame* frame = mFrames.FirstChild();
     for ( ; frame; frame = frame->PrincipalChildList().FirstChild()) {
       // drill down to the real mtable
       if (frame->IsTableWrapperFrame())
         return frame->AttributeChanged(aNameSpaceID, aAttribute, aModType);
     }
-    NS_NOTREACHED("mtable wrapper without the real table frame");
+    MOZ_ASSERT_UNREACHABLE("mtable wrapper without the real table frame");
   }
 
   return nsMathMLContainerFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
 }
 
 /* virtual */ eMathMLFrameType
 nsMathMLmrowFrame::GetMathMLFrameType()
 {
--- a/layout/painting/nsCSSRenderingBorders.cpp
+++ b/layout/painting/nsCSSRenderingBorders.cpp
@@ -1379,17 +1379,17 @@ nsCSSBorderRenderer::DrawBorderSides(int
     case NS_STYLE_BORDER_STYLE_OUTSET:
       borderColorStyleTopLeft[0] = BorderColorStyleLight;
       borderColorStyleBottomRight[0] = BorderColorStyleDark;
 
       borderColorStyleCount = 1;
       break;
 
     default:
-      NS_NOTREACHED("Unhandled border style!!");
+      MOZ_ASSERT_UNREACHABLE("Unhandled border style!!");
       break;
   }
 
   // The only way to get to here is by having a
   // borderColorStyleCount < 1 or > 3; this should never happen,
   // since -moz-border-colors doesn't get handled here.
   NS_ASSERTION(borderColorStyleCount > 0 && borderColorStyleCount < 4,
                "Non-border-colors case with borderColorStyleCount < 1 or > 3; what happened?");
@@ -3885,17 +3885,17 @@ nsCSSBorderImageRenderer::nsCSSBorderIma
       case eStyleUnit_Percent:
         value = coord.GetPercentValue() * imgDimension;
         break;
       case eStyleUnit_Factor:
         value = nsPresContext::CSSPixelsToAppUnits(
           NS_lround(coord.GetFactorValue()));
         break;
       default:
-        NS_NOTREACHED("unexpected CSS unit for image slice");
+        MOZ_ASSERT_UNREACHABLE("unexpected CSS unit for image slice");
         value = 0;
         break;
     }
     if (value < 0)
       value = 0;
     if (value > imgDimension)
       value = imgDimension;
     mSlice.Side(s) = value;
@@ -3910,17 +3910,17 @@ nsCSSBorderImageRenderer::nsCSSBorderIma
         break;
       case eStyleUnit_Factor:
         value = coord.GetFactorValue() * borderWidths.Side(s);
         break;
       case eStyleUnit_Auto:  // same as the slice value, in CSS pixels
         value = mSlice.Side(s);
         break;
       default:
-        NS_NOTREACHED("unexpected CSS unit for border image area division");
+        MOZ_ASSERT_UNREACHABLE("unexpected CSS unit for border image area division");
         value = 0;
         break;
     }
     // NSToCoordRoundWithClamp rounds towards infinity, but that's OK
     // because we expect value to be non-negative.
     MOZ_ASSERT(value >= 0);
     mWidths.Side(s) = NSToCoordRoundWithClamp(value);
     MOZ_ASSERT(mWidths.Side(s) >= 0);
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -9834,17 +9834,17 @@ nsDisplayFilter::CreateWebRenderCommands
         };
         wrFilters.AppendElement(filterOp);
         break;
       }
       case NS_STYLE_FILTER_DROP_SHADOW: {
         float appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
         nsCSSShadowArray* shadows = filter.GetDropShadow();
         if (!shadows || shadows->Length() != 1) {
-          NS_NOTREACHED("Exactly one drop shadow should have been parsed.");
+          MOZ_ASSERT_UNREACHABLE("Exactly one drop shadow should have been parsed.");
           return false;
         }
 
         nsCSSShadowItem* shadow = shadows->ShadowAt(0);
         nscolor color = shadow->mColor;
         if (!shadow->mHasColor) {
           color = mFrame->StyleColor()->mColor;
         }
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -5026,17 +5026,17 @@ public:
   /**
    * This creates a copy of this item, but wrapping aItem instead of
    * our existing list. Only gets called if this item returned nullptr
    * for GetUnderlyingFrame(). aItem is guaranteed to return non-null from
    * GetUnderlyingFrame().
    */
   virtual nsDisplayWrapList* WrapWithClone(nsDisplayListBuilder* aBuilder,
                                            nsDisplayItem* aItem) {
-    NS_NOTREACHED("We never returned nullptr for GetUnderlyingFrame!");
+    MOZ_ASSERT_UNREACHABLE("We never returned nullptr for GetUnderlyingFrame!");
     return nullptr;
   }
 
   virtual bool CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
                                        mozilla::wr::IpcResourceUpdateQueue& aResources,
                                        const StackingContextHelper& aSc,
                                        mozilla::layers::WebRenderLayerManager* aManager,
                                        nsDisplayListBuilder* aDisplayListBuilder) override;
--- a/layout/painting/nsImageRenderer.cpp
+++ b/layout/painting/nsImageRenderer.cpp
@@ -450,17 +450,17 @@ nsImageRenderer::Draw(nsPresContext*    
                       const nsRect&        aDest,
                       const nsRect&        aFill,
                       const nsPoint&       aAnchor,
                       const nsSize&        aRepeatSize,
                       const CSSIntRect&    aSrc,
                       float                aOpacity)
 {
   if (!IsReady()) {
-    NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
+    MOZ_ASSERT_UNREACHABLE("Ensure PrepareImage() has returned true before calling me");
     return ImgDrawResult::TEMPORARY_ERROR;
   }
   if (aDest.IsEmpty() || aFill.IsEmpty() ||
       mSize.width <= 0 || mSize.height <= 0) {
     return ImgDrawResult::SUCCESS;
   }
 
   SamplingFilter samplingFilter = nsLayoutUtils::GetSamplingFilterForFrame(mForFrame);
@@ -570,17 +570,17 @@ nsImageRenderer::BuildWebRenderDisplayIt
                                             const nsRect& aDest,
                                             const nsRect& aFill,
                                             const nsPoint& aAnchor,
                                             const nsSize& aRepeatSize,
                                             const CSSIntRect& aSrc,
                                             float aOpacity)
 {
   if (!IsReady()) {
-    NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
+    MOZ_ASSERT_UNREACHABLE("Ensure PrepareImage() has returned true before calling me");
     return ImgDrawResult::NOT_READY;
   }
   if (aDest.IsEmpty() || aFill.IsEmpty() ||
       mSize.width <= 0 || mSize.height <= 0) {
     return ImgDrawResult::SUCCESS;
   }
 
   switch (mType) {
@@ -695,17 +695,17 @@ nsImageRenderer::DrawLayer(nsPresContext
                            const nsRect&        aDest,
                            const nsRect&        aFill,
                            const nsPoint&       aAnchor,
                            const nsRect&        aDirty,
                            const nsSize&        aRepeatSize,
                            float                aOpacity)
 {
   if (!IsReady()) {
-    NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
+    MOZ_ASSERT_UNREACHABLE("Ensure PrepareImage() has returned true before calling me");
     return ImgDrawResult::TEMPORARY_ERROR;
   }
   if (aDest.IsEmpty() || aFill.IsEmpty() ||
       mSize.width <= 0 || mSize.height <= 0) {
     return ImgDrawResult::SUCCESS;
   }
 
   return Draw(aPresContext, aRenderingContext,
@@ -726,17 +726,17 @@ nsImageRenderer::BuildWebRenderDisplayIt
                                                     const nsRect&        aDest,
                                                     const nsRect&        aFill,
                                                     const nsPoint&       aAnchor,
                                                     const nsRect&        aDirty,
                                                     const nsSize&        aRepeatSize,
                                                     float                aOpacity)
 {
   if (!IsReady()) {
-    NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
+    MOZ_ASSERT_UNREACHABLE("Ensure PrepareImage() has returned true before calling me");
     return mPrepareResult;
   }
   if (aDest.IsEmpty() || aFill.IsEmpty() ||
       mSize.width <= 0 || mSize.height <= 0) {
     return ImgDrawResult::SUCCESS;
   }
   return BuildWebRenderDisplayItems(aPresContext, aBuilder, aResources, aSc,
                                     aManager, aItem,
@@ -788,17 +788,17 @@ ComputeTile(nsRect&              aFill,
                                                       aFill.width, space);
       tile.x = aFill.x + space;
       tile.width = aUnitSize.width;
       aFill.x = tile.x;
       aFill.width = aFill.width - space * 2;
     }
     break;
   default:
-    NS_NOTREACHED("unrecognized border-image fill style");
+    MOZ_ASSERT_UNREACHABLE("unrecognized border-image fill style");
   }
 
   switch (aVFill) {
   case StyleBorderImageRepeat::Stretch:
     tile.y = aFill.y;
     tile.height = aFill.height;
     aRepeatSize.height = tile.height;
     break;
@@ -821,17 +821,17 @@ ComputeTile(nsRect&              aFill,
                                                       aFill.height, space);
       tile.y = aFill.y + space;
       tile.height = aUnitSize.height;
       aFill.y = tile.y;
       aFill.height = aFill.height - space * 2;
     }
     break;
   default:
-    NS_NOTREACHED("unrecognized border-image fill style");
+    MOZ_ASSERT_UNREACHABLE("unrecognized border-image fill style");
   }
 
   return tile;
 }
 
 /**
  * Returns true if the given set of arguments will require the tiles which fill
  * the dest rect to be scaled from the source tile. See comment on ComputeTile
@@ -860,17 +860,17 @@ nsImageRenderer::DrawBorderImageComponen
                                           StyleBorderImageRepeat aHFill,
                                           StyleBorderImageRepeat aVFill,
                                           const nsSize&        aUnitSize,
                                           uint8_t              aIndex,
                                           const Maybe<nsSize>& aSVGViewportSize,
                                           const bool           aHasIntrinsicRatio)
 {
   if (!IsReady()) {
-    NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
+    MOZ_ASSERT_UNREACHABLE("Ensure PrepareImage() has returned true before calling me");
     return ImgDrawResult::BAD_ARGS;
   }
   if (aFill.IsEmpty() || aSrc.IsEmpty()) {
     return ImgDrawResult::SUCCESS;
   }
 
   if (mType == eStyleImageType_Image || mType == eStyleImageType_Element) {
     nsCOMPtr<imgIContainer> subImage;
@@ -955,17 +955,17 @@ nsImageRenderer::DrawBorderImageComponen
               fillRect, destTile.TopLeft(), repeatSize, aSrc);
 }
 
 ImgDrawResult
 nsImageRenderer::DrawShapeImage(nsPresContext* aPresContext,
                                 gfxContext& aRenderingContext)
 {
   if (!IsReady()) {
-    NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
+    MOZ_ASSERT_UNREACHABLE("Ensure PrepareImage() has returned true before calling me");
     return ImgDrawResult::NOT_READY;
   }
 
   if (mSize.width <= 0 || mSize.height <= 0) {
     return ImgDrawResult::SUCCESS;
   }
 
   ImgDrawResult result = ImgDrawResult::SUCCESS;
--- a/layout/printing/nsPrintJob.cpp
+++ b/layout/printing/nsPrintJob.cpp
@@ -1408,17 +1408,17 @@ nsPrintJob::BuildDocTree(nsIDocShell*   
       nsCOMPtr<nsIContentViewer>  viewer;
       childAsShell->GetContentViewer(getter_AddRefs(viewer));
       if (viewer) {
         nsCOMPtr<nsIDocument> doc = do_GetInterface(childAsShell);
         auto po = MakeUnique<nsPrintObject>();
         po->mParent = aPO.get();
         nsresult rv = po->Init(childAsShell, doc, aPO->mPrintPreview);
         if (NS_FAILED(rv))
-          NS_NOTREACHED("Init failed?");
+          MOZ_ASSERT_UNREACHABLE("Init failed?");
         aPO->mKids.AppendElement(std::move(po));
         aDocList->AppendElement(aPO->mKids.LastElement().get());
         BuildDocTree(childAsShell, aDocList, aPO->mKids.LastElement());
       }
     }
   }
 }
 
@@ -2085,46 +2085,46 @@ nsPrintJob::OnStateChange(nsIWebProgress
 NS_IMETHODIMP
 nsPrintJob::OnProgressChange(nsIWebProgress* aWebProgress,
                              nsIRequest* aRequest,
                              int32_t aCurSelfProgress,
                              int32_t aMaxSelfProgress,
                              int32_t aCurTotalProgress,
                              int32_t aMaxTotalProgress)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPrintJob::OnLocationChange(nsIWebProgress* aWebProgress,
                              nsIRequest* aRequest,
                              nsIURI* aLocation,
                              uint32_t aFlags)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPrintJob::OnStatusChange(nsIWebProgress* aWebProgress,
                            nsIRequest* aRequest,
                            nsresult aStatus,
                            const char16_t* aMessage)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPrintJob::OnSecurityChange(nsIWebProgress* aWebProgress,
                              nsIRequest* aRequest,
                              uint32_t aState)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 //-------------------------------------------------------
 
 void
 nsPrintJob::UpdateZoomRatio(nsPrintObject* aPO, bool aSetPixelScale)
 {
--- a/layout/style/CounterStyleManager.cpp
+++ b/layout/style/CounterStyleManager.cpp
@@ -822,17 +822,17 @@ BuiltinCounterStyle::IsOrdinalInAutoRang
     case NS_STYLE_LIST_STYLE_TRAD_CHINESE_FORMAL:
     case NS_STYLE_LIST_STYLE_TRAD_CHINESE_INFORMAL:
     case NS_STYLE_LIST_STYLE_SIMP_CHINESE_FORMAL:
     case NS_STYLE_LIST_STYLE_SIMP_CHINESE_INFORMAL:
     case NS_STYLE_LIST_STYLE_ETHIOPIC_NUMERIC:
       return IsOrdinalInRange(aOrdinal);
 
     default:
-      NS_NOTREACHED("Unknown counter style");
+      MOZ_ASSERT_UNREACHABLE("Unknown counter style");
       return false;
   }
 }
 
 /* virtual */ void
 BuiltinCounterStyle::GetPad(PadType& aResult)
 {
   aResult.width = 0;
@@ -945,17 +945,17 @@ BuiltinCounterStyle::GetInitialCounterTe
     case NS_STYLE_LIST_STYLE_HEBREW:
       aIsRTL = true;
       return HebrewToText(aOrdinal, aResult);
 
     case NS_STYLE_LIST_STYLE_ETHIOPIC_NUMERIC:
       return EthiopicToText(aOrdinal, aResult);
 
     default:
-      NS_NOTREACHED("Unknown builtin counter style");
+      MOZ_ASSERT_UNREACHABLE("Unknown builtin counter style");
       return false;
   }
 }
 
 static constexpr BuiltinCounterStyle gBuiltinStyleTable[] = {
 #define BUILTIN_COUNTER_STYLE(value_, atom_) \
   { NS_STYLE_LIST_STYLE_ ## value_, &nsGkAtoms::atom_ },
 #include "BuiltinCounterStyleList.h"
@@ -1015,17 +1015,17 @@ DependentBuiltinCounterStyle::GetFallbac
     case NS_STYLE_LIST_STYLE_TRAD_CHINESE_INFORMAL:
     case NS_STYLE_LIST_STYLE_TRAD_CHINESE_FORMAL:
       // These styles all have a larger range than cjk-decimal, so the
       // only case fallback is accessed is that they are extended.
       // Since extending styles will cache the data themselves, we need
       // not cache it here.
       return mManager->BuildCounterStyle(nsGkAtoms::cjkDecimal);
     default:
-      NS_NOTREACHED("Not a valid dependent builtin style");
+      MOZ_ASSERT_UNREACHABLE("Not a valid dependent builtin style");
       return BuiltinCounterStyle::GetFallback();
   }
 }
 
 class CustomCounterStyle final : public CounterStyle
 {
 public:
   CustomCounterStyle(nsAtom* aName,
@@ -1370,17 +1370,17 @@ CustomCounterStyle::IsOrdinalInAutoRange
     case NS_STYLE_COUNTER_SYSTEM_ALPHABETIC:
     case NS_STYLE_COUNTER_SYSTEM_SYMBOLIC:
       return aOrdinal >= 1;
     case NS_STYLE_COUNTER_SYSTEM_ADDITIVE:
       return aOrdinal >= 0;
     case NS_STYLE_COUNTER_SYSTEM_EXTENDS:
       return GetExtendsRoot()->IsOrdinalInAutoRange(aOrdinal);
     default:
-      NS_NOTREACHED("Invalid system for computing auto value.");
+      MOZ_ASSERT_UNREACHABLE("Invalid system for computing auto value.");
       return false;
   }
 }
 
 /* virtual */ void
 CustomCounterStyle::GetPad(PadType& aResult)
 {
   if (!(mFlags & FLAG_PAD_INITED)) {
@@ -1466,17 +1466,17 @@ CustomCounterStyle::GetInitialCounterTex
     case NS_STYLE_COUNTER_SYSTEM_NUMERIC:
       return GetNumericCounterText(aOrdinal, aResult, GetSymbols());
     case NS_STYLE_COUNTER_SYSTEM_ADDITIVE:
       return GetAdditiveCounterText(aOrdinal, aResult, GetAdditiveSymbols());
     case NS_STYLE_COUNTER_SYSTEM_EXTENDS:
       return GetExtendsRoot()->
         GetInitialCounterText(aOrdinal, aWritingMode, aResult, aIsRTL);
     default:
-      NS_NOTREACHED("Invalid system.");
+      MOZ_ASSERT_UNREACHABLE("Invalid system.");
       return false;
   }
 }
 
 const nsTArray<nsString>&
 CustomCounterStyle::GetSymbols()
 {
   if (mSymbols.IsEmpty()) {
@@ -1565,17 +1565,17 @@ CustomCounterStyle::ComputeRawSpeakAs(ui
             aSpeakAs = custom->mSpeakAs;
             aSpeakAsCounter = custom->mSpeakAsCounter;
           }
         }
       }
       break;
     }
     default:
-      NS_NOTREACHED("Invalid speak-as value");
+      MOZ_ASSERT_UNREACHABLE("Invalid speak-as value");
   }
 }
 
 // This method corresponds to the second stage of getting speak-as
 // related values. It will recursively figure out the final value of
 // mSpeakAs and mSpeakAsCounter. This method returns nullptr if the
 // caller is in a loop, and the root counter style in the chain
 // otherwise. It use the same loop detection algorithm as
@@ -1790,17 +1790,17 @@ AnonymousCounterStyle::IsOrdinalInRange(
     case NS_STYLE_COUNTER_SYSTEM_CYCLIC:
     case NS_STYLE_COUNTER_SYSTEM_NUMERIC:
     case NS_STYLE_COUNTER_SYSTEM_FIXED:
       return true;
     case NS_STYLE_COUNTER_SYSTEM_ALPHABETIC:
     case NS_STYLE_COUNTER_SYSTEM_SYMBOLIC:
       return aOrdinal >= 1;
     default:
-      NS_NOTREACHED("Invalid system.");
+      MOZ_ASSERT_UNREACHABLE("Invalid system.");
       return false;
   }
 }
 
 /* virtual */ bool
 AnonymousCounterStyle::IsOrdinalInAutoRange(CounterValue aOrdinal)
 {
   return AnonymousCounterStyle::IsOrdinalInRange(aOrdinal);
@@ -1844,17 +1844,17 @@ AnonymousCounterStyle::GetInitialCounter
       return GetFixedCounterText(aOrdinal, aResult, 1, mSymbols);
     case NS_STYLE_COUNTER_SYSTEM_SYMBOLIC:
       return GetSymbolicCounterText(aOrdinal, aResult, mSymbols);
     case NS_STYLE_COUNTER_SYSTEM_ALPHABETIC:
       return GetAlphabeticCounterText(aOrdinal, aResult, mSymbols);
     case NS_STYLE_COUNTER_SYSTEM_NUMERIC:
       return GetNumericCounterText(aOrdinal, aResult, mSymbols);
     default:
-      NS_NOTREACHED("Invalid system.");
+      MOZ_ASSERT_UNREACHABLE("Invalid system.");
       return false;
   }
 }
 
 bool
 CounterStyle::IsDependentStyle() const
 {
   switch (mStyle) {
@@ -1961,20 +1961,20 @@ CounterStyle::GetSpokenCounterText(Count
     case NS_STYLE_COUNTER_SPEAKAS_SPELL_OUT:
       // we currently do not actually support 'spell-out',
       // so 'words' is used instead.
     case NS_STYLE_COUNTER_SPEAKAS_WORDS:
       GetCounterText(aOrdinal, WritingMode(), aResult, isRTL);
       break;
     case NS_STYLE_COUNTER_SPEAKAS_OTHER:
       // This should be processed by CustomCounterStyle
-      NS_NOTREACHED("Invalid speak-as value");
+      MOZ_ASSERT_UNREACHABLE("Invalid speak-as value");
       break;
     default:
-      NS_NOTREACHED("Unknown speak-as value");
+      MOZ_ASSERT_UNREACHABLE("Unknown speak-as value");
       break;
   }
 }
 
 /* virtual */ void
 CounterStyle::CallFallbackStyle(CounterValue aOrdinal,
                                 WritingMode aWritingMode,
                                 nsAString& aResult,
--- a/layout/style/FontFace.cpp
+++ b/layout/style/FontFace.cpp
@@ -142,17 +142,17 @@ LoadStateToStatus(gfxUserFontEntry::User
     case gfxUserFontEntry::UserFontLoadState::STATUS_LOAD_PENDING:
     case gfxUserFontEntry::UserFontLoadState::STATUS_LOADING:
       return FontFaceLoadStatus::Loading;
     case gfxUserFontEntry::UserFontLoadState::STATUS_LOADED:
       return FontFaceLoadStatus::Loaded;
     case gfxUserFontEntry::UserFontLoadState::STATUS_FAILED:
       return FontFaceLoadStatus::Error;
   }
-  NS_NOTREACHED("invalid aLoadState value");
+  MOZ_ASSERT_UNREACHABLE("invalid aLoadState value");
   return FontFaceLoadStatus::Error;
 }
 
 already_AddRefed<FontFace>
 FontFace::CreateForRule(nsISupports* aGlobal,
                         FontFaceSet* aFontFaceSet,
                         RawServoFontFaceRule* aRule)
 {
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -2548,17 +2548,17 @@ Loader::Stop()
     SheetLoadData* data = mPostedEvents[i];
     data->mIsCancelled = true;
     if (arr.AppendElement(data)) {
       // SheetComplete() calls Release(), so give this an extra ref.
       NS_ADDREF(data);
     }
 #ifdef DEBUG
     else {
-      NS_NOTREACHED("We preallocated this memory... shouldn't really fail, "
+      MOZ_ASSERT_UNREACHABLE("We preallocated this memory... shouldn't really fail, "
                     "except we never check that preallocation succeeds.");
     }
 #endif
   }
   mPostedEvents.Clear();
 
   mDatasToNotifyOn += arr.Length();
   for (i = 0; i < arr.Length(); ++i) {
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -1412,17 +1412,17 @@ nsComputedDOMStyle::DoGetContent()
       case eStyleContentType_NoOpenQuote:
         val->SetIdent(eCSSKeyword_no_open_quote);
         break;
       case eStyleContentType_NoCloseQuote:
         val->SetIdent(eCSSKeyword_no_close_quote);
         break;
       case eStyleContentType_AltContent:
       default:
-        NS_NOTREACHED("unexpected type");
+        MOZ_ASSERT_UNREACHABLE("unexpected type");
         break;
     }
     valueList->AppendCSSValue(val.forget());
   }
 
   return valueList.forget();
 }
 
@@ -2373,31 +2373,31 @@ AppendCSSGradientToBoxPosition(const nsS
     aString.AppendLiteral("to ");
   }
 
   if (xValue == 0.0f) {
     aString.AppendLiteral("left");
   } else if (xValue == 1.0f) {
     aString.AppendLiteral("right");
   } else if (xValue != 0.5f) { // do not write "center" keyword
-    NS_NOTREACHED("invalid box position");
+    MOZ_ASSERT_UNREACHABLE("invalid box position");
   }
 
   if (xValue != 0.5f && yValue != 0.5f) {
     // We're appending both an x-keyword and a y-keyword.
     // Add a space between them here.
     aString.AppendLiteral(" ");
   }
 
   if (yValue == 0.0f) {
     aString.AppendLiteral("top");
   } else if (yValue == 1.0f) {
     aString.AppendLiteral("bottom");
   } else if (yValue != 0.5f) { // do not write "center" keyword
-    NS_NOTREACHED("invalid box position");
+    MOZ_ASSERT_UNREACHABLE("invalid box position");
   }
 
 
   aNeedSep = true;
 }
 
 void
 nsComputedDOMStyle::GetCSSGradientString(const nsStyleGradient* aGradient,
@@ -2610,17 +2610,17 @@ nsComputedDOMStyle::SetValueToStyleImage
     }
     case eStyleImageType_Null:
       aValue->SetIdent(eCSSKeyword_none);
       break;
     case eStyleImageType_URL:
       SetValueToURLValue(aStyleImage.GetURLValue(), aValue);
       break;
     default:
-      NS_NOTREACHED("unexpected image type");
+      MOZ_ASSERT_UNREACHABLE("unexpected image type");
       break;
   }
 }
 
 already_AddRefed<CSSValue>
 nsComputedDOMStyle::DoGetImageLayerImage(const nsStyleImageLayers& aLayers)
 {
   RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(true);
@@ -6533,17 +6533,17 @@ nsComputedDOMStyle::CreatePrimitiveValue
         shapeFunctionString.AppendLiteral(" round ");
         nsAutoString radiiString;
         BasicShapeRadiiToString(radiiString, aStyleBasicShape->GetRadius());
         shapeFunctionString.Append(radiiString);
       }
       break;
     }
     default:
-      NS_NOTREACHED("unexpected type");
+      MOZ_ASSERT_UNREACHABLE("unexpected type");
   }
   shapeFunctionString.Append(')');
   RefPtr<nsROCSSPrimitiveValue> functionValue = new nsROCSSPrimitiveValue;
   functionValue->SetString(shapeFunctionString);
   return functionValue.forget();
 }
 
 template<typename ReferenceBox>
--- a/layout/style/nsFontFaceLoader.cpp
+++ b/layout/style/nsFontFaceLoader.cpp
@@ -169,17 +169,17 @@ nsFontFaceLoader::LoadTimerCallback(nsIT
       }
       break;
     }
     case NS_FONT_DISPLAY_OPTIONAL:
       ufe->mFontDataLoadingState = gfxUserFontEntry::LOADING_TIMED_OUT;
       break;
 
     default:
-      NS_NOTREACHED("strange font-display value");
+      MOZ_ASSERT_UNREACHABLE("strange font-display value");
       break;
   }
 
   // If the font is not 75% loaded, or if we've already timed out once
   // before, we mark this entry as "loading slowly", so the fallback
   // font will be used in the meantime, and tell the context to refresh.
   if (updateUserFontSet) {
     nsTArray<gfxUserFontSet*> fontSets;
--- a/layout/style/nsLayoutStylesheetCache.cpp
+++ b/layout/style/nsLayoutStylesheetCache.cpp
@@ -56,17 +56,17 @@ nsLayoutStylesheetCache::Observe(nsISupp
     InitFromProfile();
   }
   else if (strcmp(aTopic, "chrome-flush-skin-caches") == 0 ||
            strcmp(aTopic, "chrome-flush-caches") == 0) {
     mScrollbarsSheet = nullptr;
     mFormsSheet = nullptr;
   }
   else {
-    NS_NOTREACHED("Unexpected observer topic.");
+    MOZ_ASSERT_UNREACHABLE("Unexpected observer topic.");
   }
   return NS_OK;
 }
 
 StyleSheet*
 nsLayoutStylesheetCache::ScrollbarsSheet()
 {
   if (!mScrollbarsSheet) {
--- a/layout/style/nsStyleCoord.cpp
+++ b/layout/style/nsStyleCoord.cpp
@@ -42,17 +42,17 @@ nsStyleCoord::nsStyleCoord(int32_t aValu
     mValue.mInt = 0;
   }
 }
 
 nsStyleCoord::nsStyleCoord(float aValue, nsStyleUnit aUnit)
   : mUnit(aUnit)
 {
   if (aUnit < eStyleUnit_Percent || aUnit >= eStyleUnit_Coord) {
-    NS_NOTREACHED("not a float value");
+    MOZ_ASSERT_UNREACHABLE("not a float value");
     mUnit = eStyleUnit_Null;
     mValue.mInt = 0;
   } else {
     mValue.mFloat = aValue;
   }
 }
 
 bool nsStyleCoord::operator==(const nsStyleCoord& aOther) const
@@ -128,17 +128,17 @@ void nsStyleCoord::SetAngleValue(float a
   Reset();
   if (aUnit == eStyleUnit_Degree ||
       aUnit == eStyleUnit_Grad ||
       aUnit == eStyleUnit_Radian ||
       aUnit == eStyleUnit_Turn) {
     mUnit = aUnit;
     mValue.mFloat = aValue;
   } else {
-    NS_NOTREACHED("not an angle value");
+    MOZ_ASSERT_UNREACHABLE("not an angle value");
   }
 }
 
 void nsStyleCoord::SetFlexFractionValue(float aValue)
 {
   Reset();
   mUnit = eStyleUnit_FlexFraction;
   mValue.mFloat = aValue;
@@ -188,17 +188,17 @@ nsStyleCoord::GetAngleValueInRadians() c
 
   switch (GetUnit()) {
   case eStyleUnit_Radian: return angle;
   case eStyleUnit_Turn:   return angle * 2 * M_PI;
   case eStyleUnit_Degree: return angle * M_PI / 180.0;
   case eStyleUnit_Grad:   return angle * M_PI / 200.0;
 
   default:
-    NS_NOTREACHED("unrecognized angular unit");
+    MOZ_ASSERT_UNREACHABLE("unrecognized angular unit");
     return 0.0;
   }
 }
 
 nscoord
 nsStyleCoord::ComputeComputedCalc(nscoord aPercentageBasis) const
 {
   Calc* calc = GetCalcValue();
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -384,17 +384,17 @@ nsStyleBorder::GetImageOutset() const
     switch (coord.GetUnit()) {
       case eStyleUnit_Coord:
         value = coord.GetCoordValue();
         break;
       case eStyleUnit_Factor:
         value = coord.GetFactorValue() * mComputedBorder.Side(s);
         break;
       default:
-        NS_NOTREACHED("unexpected CSS unit for image outset");
+        MOZ_ASSERT_UNREACHABLE("unexpected CSS unit for image outset");
         value = 0;
         break;
     }
     outset.Side(s) = value;
   }
   return outset;
 }
 
@@ -984,17 +984,17 @@ StyleBasicShape::GetShapeTypeName() cons
       return eCSSKeyword_polygon;
     case StyleBasicShapeType::Circle:
       return eCSSKeyword_circle;
     case StyleBasicShapeType::Ellipse:
       return eCSSKeyword_ellipse;
     case StyleBasicShapeType::Inset:
       return eCSSKeyword_inset;
   }
-  NS_NOTREACHED("unexpected type");
+  MOZ_ASSERT_UNREACHABLE("unexpected type");
   return eCSSKeyword_UNKNOWN;
 }
 
 // --------------------
 // StyleShapeSource
 
 StyleShapeSource::StyleShapeSource(const StyleShapeSource& aSource)
 {
@@ -2438,17 +2438,17 @@ ConvertToPixelCoord(const nsStyleCoord& 
   switch (aCoord.GetUnit()) {
     case eStyleUnit_Percent:
       pixelValue = aCoord.GetPercentValue() * aPercentScale;
       break;
     case eStyleUnit_Factor:
       pixelValue = aCoord.GetFactorValue();
       break;
     default:
-      NS_NOTREACHED("unexpected unit for image crop rect");
+      MOZ_ASSERT_UNREACHABLE("unexpected unit for image crop rect");
       return 0;
   }
   MOZ_ASSERT(pixelValue >= 0, "we ensured non-negative while parsing");
   pixelValue = std::min(pixelValue, double(INT32_MAX)); // avoid overflow
   return NS_lround(pixelValue);
 }
 
 already_AddRefed<nsIURI>
@@ -2585,17 +2585,17 @@ nsStyleImage::IsComplete() const
         return false;
       }
       uint32_t status = imgIRequest::STATUS_ERROR;
       return NS_SUCCEEDED(req->GetImageStatus(&status)) &&
              (status & imgIRequest::STATUS_SIZE_AVAILABLE) &&
              (status & imgIRequest::STATUS_FRAME_COMPLETE);
     }
     default:
-      NS_NOTREACHED("unexpected image type");
+      MOZ_ASSERT_UNREACHABLE("unexpected image type");
       return false;
   }
 }
 
 bool
 nsStyleImage::IsLoaded() const
 {
   switch (mType) {
@@ -2611,17 +2611,17 @@ nsStyleImage::IsLoaded() const
         return false;
       }
       uint32_t status = imgIRequest::STATUS_ERROR;
       return NS_SUCCEEDED(req->GetImageStatus(&status)) &&
              !(status & imgIRequest::STATUS_ERROR) &&
              (status & imgIRequest::STATUS_LOAD_COMPLETE);
     }
     default:
-      NS_NOTREACHED("unexpected image type");
+      MOZ_ASSERT_UNREACHABLE("unexpected image type");
       return false;
   }
 }
 
 static inline bool
 EqualRects(const UniquePtr<nsStyleSides>& aRect1, const UniquePtr<nsStyleSides>& aRect2)
 {
   return aRect1 == aRect2 || /* handles null== null, and optimize */
@@ -3059,17 +3059,17 @@ nsStyleImageLayers::Size::DependsOnPosit
       }
 
       // Otherwise, rendering depends on frame size when the image dimensions
       // and background-size don't complement each other.
       return !(hasWidth && mHeightType == eLengthPercentage) &&
              !(hasHeight && mWidthType == eLengthPercentage);
     }
   } else {
-    NS_NOTREACHED("missed an enum value");
+    MOZ_ASSERT_UNREACHABLE("missed an enum value");
   }
 
   // Passed the gauntlet: no dependency.
   return false;
 }
 
 void
 nsStyleImageLayers::Size::SetInitialValues()
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -1824,29 +1824,29 @@ struct nsStyleImageOrientation
 
   mozilla::image::Angle Angle() const {
     switch (mOrientation & ORIENTATION_MASK) {
       case ANGLE_0:   return mozilla::image::Angle::D0;
       case ANGLE_90:  return mozilla::image::Angle::D90;
       case ANGLE_180: return mozilla::image::Angle::D180;
       case ANGLE_270: return mozilla::image::Angle::D270;
       default:
-        NS_NOTREACHED("Unexpected angle");
+        MOZ_ASSERT_UNREACHABLE("Unexpected angle");
         return mozilla::image::Angle::D0;
     }
   }
 
   nsStyleCoord AngleAsCoord() const {
     switch (mOrientation & ORIENTATION_MASK) {
       case ANGLE_0:   return nsStyleCoord(0.0f,   eStyleUnit_Degree);
       case ANGLE_90:  return nsStyleCoord(90.0f,  eStyleUnit_Degree);
       case ANGLE_180: return nsStyleCoord(180.0f, eStyleUnit_Degree);
       case ANGLE_270: return nsStyleCoord(270.0f, eStyleUnit_Degree);
       default:
-        NS_NOTREACHED("Unexpected angle");
+        MOZ_ASSERT_UNREACHABLE("Unexpected angle");
         return nsStyleCoord();
     }
   }
 
   bool operator==(const nsStyleImageOrientation& aOther) const {
     return aOther.mOrientation == mOrientation;
   }
 
--- a/layout/style/nsStyleTransformMatrix.cpp
+++ b/layout/style/nsStyleTransformMatrix.cpp
@@ -880,17 +880,17 @@ MatrixForTransformFunction(Matrix4x4& aM
     ProcessMatrixOperator<Accumulate>(aMatrix, aData, aRefBox,
                                       aContains3dTransform);
     break;
   case eCSSKeyword_perspective:
     *aContains3dTransform = true;
     ProcessPerspective(aMatrix, aData);
     break;
   default:
-    NS_NOTREACHED("Unknown transform function!");
+    MOZ_ASSERT_UNREACHABLE("Unknown transform function!");
   }
 }
 
 /**
  * Return the transform function, as an nsCSSKeyword, for the given
  * nsCSSValue::Array from a transform list.
  */
 nsCSSKeyword
--- a/layout/style/nsStyleUtil.cpp
+++ b/layout/style/nsStyleUtil.cpp
@@ -238,17 +238,17 @@ nsStyleUtil::AppendEscapedCSSFontFamilyL
 {
   if (aFamilyList.IsEmpty()) {
     FontFamilyType defaultGeneric = aFamilyList.GetDefaultFontType();
     // If the font list is empty, then serialize the default generic.
     // See also: gfxFontGroup::BuildFontList()
     if (defaultGeneric != eFamily_none) {
       FontFamilyName(defaultGeneric).AppendToString(aResult);
     } else {
-      NS_NOTREACHED("No fonts to serialize");
+      MOZ_ASSERT_UNREACHABLE("No fonts to serialize");
     }
     return;
   }
 
   AppendEscapedCSSFontFamilyList(aFamilyList.GetFontlist().get(), aResult);
 }
 
 
@@ -280,17 +280,17 @@ nsStyleUtil::AppendAngleValue(const nsSt
   AppendCSSNumber(aAngle.GetAngleValue(), aResult);
 
   // Append unit.
   switch (aAngle.GetUnit()) {
     case eStyleUnit_Degree: aResult.AppendLiteral("deg");  break;
     case eStyleUnit_Grad:   aResult.AppendLiteral("grad"); break;
     case eStyleUnit_Radian: aResult.AppendLiteral("rad");  break;
     case eStyleUnit_Turn:   aResult.AppendLiteral("turn"); break;
-    default: NS_NOTREACHED("unrecognized angle unit");
+    default: MOZ_ASSERT_UNREACHABLE("unrecognized angle unit");
   }
 }
 
 /* static */ void
 nsStyleUtil::AppendPaintOrderValue(uint8_t aValue,
                                    nsAString& aResult)
 {
   static_assert
@@ -339,17 +339,17 @@ nsStyleUtil::AppendPaintOrderValue(uint8
         aResult.AppendLiteral("stroke");
         break;
 
       case NS_STYLE_PAINT_ORDER_MARKERS:
         aResult.AppendLiteral("markers");
         break;
 
       default:
-        NS_NOTREACHED("unexpected paint-order component value");
+        MOZ_ASSERT_UNREACHABLE("unexpected paint-order component value");
     }
     aValue >>= NS_STYLE_PAINT_ORDER_BITWIDTH;
   }
 }
 
 /* static */ void
 nsStyleUtil::AppendFontTagAsString(uint32_t aTag, nsAString& aResult)
 {
@@ -533,17 +533,17 @@ nsStyleUtil::ComputeFunctionalAlternates
     // lookup propval
     nsCSSKeyword key = func->Item(0).GetKeywordValue();
     NS_ASSERTION(key != eCSSKeyword_UNKNOWN, "unknown alternate property value");
 
     int32_t alternate;
     if (!nsCSSProps::FindKeyword(key,
                                  nsCSSProps::kFontVariantAlternatesFuncsKTable,
                                  alternate)) {
-      NS_NOTREACHED("keyword not a font-variant-alternates value");
+      MOZ_ASSERT_UNREACHABLE("keyword not a font-variant-alternates value");
       continue;
     }
     v.alternate = alternate;
 
     // other elements are the idents associated with the propval
     // append one alternate value for each one
     uint32_t numElems = func->Count();
     for (uint32_t i = 1; i < numElems; i++) {
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -357,17 +357,17 @@ GetBaselinePosition(nsTextFrame* aFrame,
       return writingMode.IsVerticalLR()
              ? 0 : metrics.mAscent + metrics.mDescent;
 
     case NS_STYLE_DOMINANT_BASELINE_CENTRAL:
     case NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL:
       return (metrics.mAscent + metrics.mDescent) / 2.0;
   }
 
-  NS_NOTREACHED("unexpected dominant-baseline value");
+  MOZ_ASSERT_UNREACHABLE("unexpected dominant-baseline value");
   return aFrame->GetLogicalBaseline(writingMode);
 }
 
 /**
  * For a given text run, returns the range of skipped characters that comprise
  * the ligature group and/or cluster that includes the character represented
  * by the specified gfxSkipCharsIterator.
  *
@@ -1471,17 +1471,17 @@ TextNodeCorrespondenceRecorder::Traverse
                "don't know how to handle negative content indexes");
 
   uint32_t undisplayed = 0;
   if (!mPreviousNode) {
     // Must be the very first text frame.
     NS_ASSERTION(mNodeCharIndex == 0, "incorrect tracking of undisplayed "
                                       "characters in text nodes");
     if (!mNodeIterator.Current()) {
-      NS_NOTREACHED("incorrect tracking of correspondence between text frames "
+      MOZ_ASSERT_UNREACHABLE("incorrect tracking of correspondence between text frames "
                     "and text nodes");
     } else {
       // Each whole nsTextNode we find before we get to the text node for the
       // first text frame must be undisplayed.
       while (mNodeIterator.Current() != node) {
         undisplayed += mNodeIterator.Current()->TextLength();
         NextNode();
       }
@@ -4880,17 +4880,17 @@ ShiftAnchoredChunk(nsTArray<CharPosition
       break;
     case eAnchorMiddle:
       shift -= (aVisIStartEdge + aVisIEndEdge) / 2;
       break;
     case eAnchorRight:
       shift -= aVisIEndEdge;
       break;
     default:
-      NS_NOTREACHED("unexpected value for aAnchorSide");
+      MOZ_ASSERT_UNREACHABLE("unexpected value for aAnchorSide");
   }
 
   if (shift != 0.0) {
     if (aVertical) {
       for (uint32_t i = aChunkStart; i < aChunkEnd; i++) {
         aCharPositions[i].mPosition.y += shift;
       }
     } else {
--- a/layout/svg/nsCSSFilterInstance.cpp
+++ b/layout/svg/nsCSSFilterInstance.cpp
@@ -17,17 +17,17 @@
 using namespace mozilla;
 using namespace mozilla::gfx;
 
 static float ClampFactor(float aFactor)
 {
   if (aFactor > 1) {
     return 1;
   } else if (aFactor < 0) {
-    NS_NOTREACHED("A negative value should not have been parsed.");
+    MOZ_ASSERT_UNREACHABLE("A negative value should not have been parsed.");
     return 0;
   }
 
   return aFactor;
 }
 
 nsCSSFilterInstance::nsCSSFilterInstance(const nsStyleFilter& aFilter,
                                          nscolor aShadowFallbackColor,
@@ -104,17 +104,17 @@ nsCSSFilterInstance::BuildPrimitives(nsT
       break;
     case NS_STYLE_FILTER_SEPIA:
       descr = CreatePrimitiveDescription(PrimitiveType::ColorMatrix,
                                          aPrimitiveDescrs,
                                          aInputIsTainted);
       result = SetAttributesForSepia(descr);
       break;
     default:
-      NS_NOTREACHED("not a valid CSS filter type");
+      MOZ_ASSERT_UNREACHABLE("not a valid CSS filter type");
       return NS_ERROR_FAILURE;
   }
 
   if (NS_FAILED(result)) {
     return result;
   }
 
   // Compute the primitive's bounds now that we've determined its attributes.
@@ -139,17 +139,17 @@ nsCSSFilterInstance::CreatePrimitiveDesc
   return descr;
 }
 
 nsresult
 nsCSSFilterInstance::SetAttributesForBlur(FilterPrimitiveDescription& aDescr)
 {
   const nsStyleCoord& radiusInFrameSpace = mFilter.GetFilterParameter();
   if (radiusInFrameSpace.GetUnit() != eStyleUnit_Coord) {
-    NS_NOTREACHED("unexpected unit");
+    MOZ_ASSERT_UNREACHABLE("unexpected unit");
     return NS_ERROR_FAILURE;
   }
 
   Size radiusInFilterSpace = BlurRadiusToFilterSpace(radiusInFrameSpace.GetCoordValue());
   aDescr.Attributes().Set(eGaussianBlurStdDeviation, radiusInFilterSpace);
   return NS_OK;
 }
 
@@ -204,17 +204,17 @@ nsCSSFilterInstance::SetAttributesForCon
   return NS_OK;
 }
 
 nsresult
 nsCSSFilterInstance::SetAttributesForDropShadow(FilterPrimitiveDescription& aDescr)
 {
   nsCSSShadowArray* shadows = mFilter.GetDropShadow();
   if (!shadows || shadows->Length() != 1) {
-    NS_NOTREACHED("Exactly one drop shadow should have been parsed.");
+    MOZ_ASSERT_UNREACHABLE("Exactly one drop shadow should have been parsed.");
     return NS_ERROR_FAILURE;
   }
 
   nsCSSShadowItem* shadow = shadows->ShadowAt(0);
 
   // Set drop shadow blur radius.
   Size radiusInFilterSpace = BlurRadiusToFilterSpace(shadow->mRadius);
   aDescr.Attributes().Set(eDropShadowStdDeviation, radiusInFilterSpace);
@@ -351,17 +351,17 @@ nsCSSFilterInstance::BlurRadiusToFilterS
                            radiusInFrameSpaceInCSSPx);
   gfxSize frameSpaceInCSSPxToFilterSpaceScale =
     mFrameSpaceInCSSPxToFilterSpaceTransform.ScaleFactors(true);
   radiusInFilterSpace.Scale(frameSpaceInCSSPxToFilterSpaceScale.width,
                             frameSpaceInCSSPxToFilterSpaceScale.height);
 
   // Check the radius limits.
   if (radiusInFilterSpace.width < 0 || radiusInFilterSpace.height < 0) {
-    NS_NOTREACHED("we shouldn't have parsed a negative radius in the style");
+    MOZ_ASSERT_UNREACHABLE("we shouldn't have parsed a negative radius in the style");
     return Size();
   }
   Float maxStdDeviation = (Float)kMaxStdDeviation;
   radiusInFilterSpace.width = std::min(radiusInFilterSpace.width, maxStdDeviation);
   radiusInFilterSpace.height = std::min(radiusInFilterSpace.height, maxStdDeviation);
 
   return radiusInFilterSpace;
 }
--- a/layout/svg/nsSVGFilterInstance.cpp
+++ b/layout/svg/nsSVGFilterInstance.cpp
@@ -46,17 +46,17 @@ nsSVGFilterInstance::nsSVGFilterInstance
   mFilterFrame = GetFilterFrame(aTargetFrame);
   if (!mFilterFrame) {
     return;
   }
 
   // Get the filter element.
   mFilterElement = mFilterFrame->GetFilterContent();
   if (!mFilterElement) {
-    NS_NOTREACHED("filter frame should have a related element");
+    MOZ_ASSERT_UNREACHABLE("filter frame should have a related element");
     return;
   }
 
   mPrimitiveUnits =
     mFilterFrame->GetEnumValue(SVGFilterElement::PRIMITIVEUNITS);
 
   if (!ComputeBounds()) {
     return;
@@ -129,17 +129,17 @@ nsSVGFilterInstance::GetFilterFrame(nsIF
 
   // aTargetFrame can be null if this filter belongs to a
   // CanvasRenderingContext2D.
   nsCOMPtr<nsIURI> url = aTargetFrame
     ? SVGObserverUtils::GetFilterURI(aTargetFrame, mFilter)
     : mFilter.GetURL()->ResolveLocalRef(mTargetContent);
 
   if (!url) {
-    NS_NOTREACHED("an nsStyleFilter of type URL should have a non-null URL");
+    MOZ_ASSERT_UNREACHABLE("an nsStyleFilter of type URL should have a non-null URL");
     return nullptr;
   }
 
   // Look up the filter element by URL.
   IDTracker filterElement;
   bool watch = false;
   filterElement.Reset(mTargetContent, url, watch);
   Element* element = filterElement.get();
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -303,17 +303,17 @@ nsSVGUtils::ObjectSpace(const gfxRect &a
   case SVGContentUtils::Y:
     axis = aRect.Height();
     break;
   case SVGContentUtils::XY:
     axis = float(SVGContentUtils::ComputeNormalizedHypotenuse(
                    aRect.Width(), aRect.Height()));
     break;
   default:
-    NS_NOTREACHED("unexpected ctx type");
+    MOZ_ASSERT_UNREACHABLE("unexpected ctx type");
     axis = 0.0f;
     break;
   }
   if (aLength->IsPercentage()) {
     // Multiply first to avoid precision errors:
     return axis * aLength->GetAnimValInSpecifiedUnits() / 100;
   }
   return aLength->GetAnimValue(static_cast<SVGViewportElement*>(nullptr)) * axis;
@@ -1641,17 +1641,17 @@ nsSVGUtils::GetOpacity(nsStyleSVGOpacity
   case eStyleSVGOpacitySource_ContextStrokeOpacity:
     if (aContextPaint) {
       opacity = aContextPaint->GetStrokeOpacity();
     } else {
       NS_WARNING("Content used context-stroke-opacity when not in a context element");
     }
     break;
   default:
-    NS_NOTREACHED("Unknown object opacity inheritance type for SVG glyph");
+    MOZ_ASSERT_UNREACHABLE("Unknown object opacity inheritance type for SVG glyph");
   }
   return opacity;
 }
 
 bool
 nsSVGUtils::HasStroke(nsIFrame* aFrame, SVGContextPaint* aContextPaint)
 {
   const nsStyleSVG *style = aFrame->StyleSVG();
--- a/layout/tables/BasicTableLayoutStrategy.cpp
+++ b/layout/tables/BasicTableLayoutStrategy.cpp
@@ -166,17 +166,17 @@ GetISizeInfo(gfxContext *aRenderingConte
             case NS_STYLE_WIDTH_MIN_CONTENT:
                 prefCoord = minCoord;
                 break;
             case NS_STYLE_WIDTH_FIT_CONTENT:
             case NS_STYLE_WIDTH_AVAILABLE:
                 // act just like 'inline-size: auto'
                 break;
             default:
-                NS_NOTREACHED("unexpected enumerated value");
+                MOZ_ASSERT_UNREACHABLE("unexpected enumerated value");
         }
     }
 
     nsStyleCoord maxISize(stylePos->MaxISize(aWM));
     if (maxISize.GetUnit() == eStyleUnit_Enumerated) {
         if (!aIsCell || maxISize.GetIntValue() == NS_STYLE_WIDTH_AVAILABLE) {
             maxISize.SetNoneValue();
         } else if (maxISize.GetIntValue() == NS_STYLE_WIDTH_FIT_CONTENT) {
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -336,34 +336,34 @@ nsTableCellMap::GetEffectiveRowSpan(int3
   nsCellMap* map = mFirstMap;
   while (map) {
     if (map->GetRowCount() > rowIndex) {
       return map->GetRowSpan(rowIndex, aColIndex, true);
     }
     rowIndex -= map->GetRowCount();
     map = map->GetNextSibling();
   }
-  NS_NOTREACHED("Bogus row index?");
+  MOZ_ASSERT_UNREACHABLE("Bogus row index?");
   return 0;
 }
 
 int32_t
 nsTableCellMap::GetEffectiveColSpan(int32_t aRowIndex,
                                     int32_t aColIndex) const
 {
   int32_t rowIndex = aRowIndex;
   nsCellMap* map = mFirstMap;
   while (map) {
     if (map->GetRowCount() > rowIndex) {
       return map->GetEffectiveColSpan(*this, rowIndex, aColIndex);
     }
     rowIndex -= map->GetRowCount();
     map = map->GetNextSibling();
   }
-  NS_NOTREACHED("Bogus row index?");
+  MOZ_ASSERT_UNREACHABLE("Bogus row index?");
   return 0;
 }
 
 nsTableCellFrame*
 nsTableCellMap::GetCellFrame(int32_t   aRowIndex,
                              int32_t   aColIndex,
                              CellData& aData,
                              bool      aUseRowIfOverlap) const
@@ -2711,11 +2711,11 @@ nsCellMapColumnIterator::GetNextFrame(in
     ++mFoundCells;
 
     MOZ_ASSERT(cellData == mMap->GetDataAt(*aRow, mCol),
                "Giving caller bogus row?");
 
     return cellFrame;
   }
 
-  NS_NOTREACHED("Can't get here");
+  MOZ_ASSERT_UNREACHABLE("Can't get here");
   return nullptr;
 }
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -2553,17 +2553,17 @@ nsTableFrame::AppendFrames(ChildListID  
       DrainSelfOverflowList(); // ensure the last frame is in mFrames
       // Append the new row group frame to the sibling chain
       mFrames.AppendFrame(nullptr, f);
 
       // insert the row group and its rows into the table
       InsertRowGroups(nsFrameList::Slice(mFrames, f, nullptr));
     } else {
       // Nothing special to do, just add the frame to our child list
-      NS_NOTREACHED("How did we get here?  Frame construction screwed up");
+      MOZ_ASSERT_UNREACHABLE("How did we get here?  Frame construction screwed up");
       mFrames.AppendFrame(nullptr, f);
     }
   }
 
 #ifdef DEBUG_TABLE_CELLMAP
   printf("=== TableFrame::AppendFrames\n");
   Dump(true, true, true);
 #endif
@@ -2728,17 +2728,17 @@ nsTableFrame::HomogenousInsertFrames(Chi
     DrainSelfOverflowList(); // ensure aPrevFrame is in mFrames
     // Insert the frames in the sibling chain
     const nsFrameList::Slice& newRowGroups =
       mFrames.InsertFrames(nullptr, aPrevFrame, aFrameList);
 
     InsertRowGroups(newRowGroups);
   } else {
     NS_ASSERTION(aListID == kPrincipalList, "unexpected child list");
-    NS_NOTREACHED("How did we even get here?");
+    MOZ_ASSERT_UNREACHABLE("How did we even get here?");
     // Just insert the frame and don't worry about reflowing it
     mFrames.InsertFrames(nullptr, aPrevFrame, aFrameList);
     return;
   }
 
   PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
                                 NS_FRAME_HAS_DIRTY_CHILDREN);
   SetGeometryDirty();
@@ -3065,17 +3065,17 @@ nsTableFrame::OrderRowGroups(RowGroupArr
       else {
         foot = rowGroup;
       }
       break;
     case mozilla::StyleDisplay::TableRowGroup:
       aChildren.AppendElement(rowGroup);
       break;
     default:
-      NS_NOTREACHED("How did this produce an nsTableRowGroupFrame?");
+      MOZ_ASSERT_UNREACHABLE("How did this produce an nsTableRowGroupFrame?");
       // Just ignore it
       break;
     }
     // Get the next sibling but skip it if it's also the next-in-flow, since
     // a next-in-flow will not be part of the current table.
     while (kidFrame) {
       nsIFrame* nif = kidFrame->GetNextInFlow();
       kidFrame = kidFrame->GetNextSibling();
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -770,17 +770,17 @@ nsTableRowFrame::ReflowChildren(nsPresCo
   WritingMode wm = aReflowInput.GetWritingMode();
   nsSize containerSize =
     aReflowInput.ComputedSizeAsContainerIfConstrained();
 
   for (nsIFrame* kidFrame : mFrames) {
     nsTableCellFrame *cellFrame = do_QueryFrame(kidFrame);
     if (!cellFrame) {
       // XXXldb nsCSSFrameConstructor needs to enforce this!
-      NS_NOTREACHED("yikes, a non-row child");
+      MOZ_ASSERT_UNREACHABLE("yikes, a non-row child");
 
       // it's an unknown frame type, give it a generic reflow and ignore the results
       TableCellReflowInput
         kidReflowInput(aPresContext, aReflowInput, kidFrame,
                        LogicalSize(kidFrame->GetWritingMode(), 0, 0),
                        ReflowInput::CALLER_WILL_INIT);
       InitChildReflowInput(*aPresContext, LogicalSize(wm), false, kidReflowInput);
       ReflowOutput desiredSize(aReflowInput);
@@ -1419,17 +1419,17 @@ nsTableRowFrame::AccessibleType()
  */
 void nsTableRowFrame::InitHasCellWithStyleBSize(nsTableFrame* aTableFrame)
 {
   WritingMode wm = GetWritingMode();
 
   for (nsIFrame* kidFrame : mFrames) {
     nsTableCellFrame *cellFrame = do_QueryFrame(kidFrame);
     if (!cellFrame) {
-      NS_NOTREACHED("Table row has a non-cell child.");
+      MOZ_ASSERT_UNREACHABLE("Table row has a non-cell child.");
       continue;
     }
     // Ignore row-spanning cells
     const nsStyleCoord &cellBSize = cellFrame->StylePosition()->BSize(wm);
     if (aTableFrame->GetEffectiveRowSpan(*cellFrame) == 1 &&
         cellBSize.GetUnit() != eStyleUnit_Auto &&
          /* calc() with percentages treated like 'auto' */
         (!cellBSize.IsCalcUnit() || !cellBSize.HasPercent())) {
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -371,17 +371,17 @@ nsTableRowGroupFrame::ReflowChildren(nsP
     aReflowInput.reflowInput.ComputedSizeAsContainerIfConstrained();
 
   nsIFrame *prevKidFrame = nullptr;
   for (nsIFrame* kidFrame = mFrames.FirstChild(); kidFrame;
        prevKidFrame = kidFrame, kidFrame = kidFrame->GetNextSibling()) {
     nsTableRowFrame *rowFrame = do_QueryFrame(kidFrame);
     if (!rowFrame) {
       // XXXldb nsCSSFrameConstructor needs to enforce this!
-      NS_NOTREACHED("yikes, a non-row child");
+      MOZ_ASSERT_UNREACHABLE("yikes, a non-row child");
       continue;
     }
     nscoord cellSpacingB = tableFrame->GetRowSpacing(rowFrame->GetRowIndex());
     haveRow = true;
 
     // Reflow the row frame
     if (reflowAllKids ||
         NS_SUBTREE_DIRTY(kidFrame) ||
--- a/layout/tables/nsTableWrapperFrame.cpp
+++ b/layout/tables/nsTableWrapperFrame.cpp
@@ -28,17 +28,17 @@ using namespace mozilla::layout;
 
 #define NO_SIDE 100
 
 /* virtual */ nscoord
 nsTableWrapperFrame::GetLogicalBaseline(WritingMode aWritingMode) const
 {
   nsIFrame* kid = mFrames.FirstChild();
   if (!kid) {
-    NS_NOTREACHED("no inner table");
+    MOZ_ASSERT_UNREACHABLE("no inner table");
     return nsContainerFrame::GetLogicalBaseline(aWritingMode);
   }
 
   return kid->GetLogicalBaseline(aWritingMode) +
          kid->BStart(aWritingMode, mRect.Size());
 }
 
 nsTableWrapperFrame::nsTableWrapperFrame(ComputedStyle* aStyle, ClassID aID)
@@ -666,17 +666,17 @@ nsTableWrapperFrame::GetCaptionOrigin(ui
       aOrigin.B(aWM) = aInnerMargin.BStart(aWM) + aInnerSize.BSize(aWM) +
                        aCaptionMargin.BStart(aWM);
       break;
     case NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE:
     case NS_STYLE_CAPTION_SIDE_TOP:
       aOrigin.B(aWM) = aInnerMargin.BStart(aWM) + aCaptionMargin.BStart(aWM);
       break;
     default:
-      NS_NOTREACHED("Unknown caption alignment type");
+      MOZ_ASSERT_UNREACHABLE("Unknown caption alignment type");
       break;
   }
   return NS_OK;
 }
 
 nsresult
 nsTableWrapperFrame::GetInnerOrigin(uint32_t             aCaptionSide,
                                     const LogicalSize&   aContainBlockSize,
@@ -758,17 +758,17 @@ nsTableWrapperFrame::GetInnerOrigin(uint
       break;
     case NO_SIDE:
     case NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE:
     case NS_STYLE_CAPTION_SIDE_TOP:
       aOrigin.B(aWM) = aInnerMargin.BStart(aWM) + aCaptionSize.BSize(aWM) +
                        aCaptionMargin.BStartEnd(aWM);
       break;
     default:
-      NS_NOTREACHED("Unknown caption alignment type");
+      MOZ_ASSERT_UNREACHABLE("Unknown caption alignment type");
       break;
   }
   return NS_OK;
 }
 
 void
 nsTableWrapperFrame::OuterBeginReflowChild(nsPresContext*            aPresContext,
                                            nsIFrame*                 aChildFrame,
--- a/layout/xul/grid/nsGridLayout2.h
+++ b/layout/xul/grid/nsGridLayout2.h
@@ -32,17 +32,17 @@ public:
 
   NS_IMETHOD XULLayout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
   virtual void IntrinsicISizesDirty(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
 
   virtual nsGridRowGroupLayout* CastToRowGroupLayout() override { return nullptr; }
   virtual nsGridLayout2* CastToGridLayout() override { return this; }
   virtual nsGrid* GetGrid(nsIFrame* aBox, int32_t* aIndex, nsGridRowLayout* aRequestor=nullptr) override;
   virtual nsIGridPart* GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox) override {
-    NS_NOTREACHED("Should not be called"); return nullptr;
+    MOZ_ASSERT_UNREACHABLE("Should not be called"); return nullptr;
   }
   virtual nsSize GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
   virtual nsSize GetXULMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
   virtual nsSize GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
   virtual void CountRowsColumns(nsIFrame* aBox, int32_t& aRowCount, int32_t& aComputedColumnCount) override { aRowCount++; }
   virtual void DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState) override { }
   virtual int32_t BuildRows(nsIFrame* aBox, nsGridRow* aRows) override;
   virtual nsMargin GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal) override;
--- a/layout/xul/nsRootBoxFrame.cpp
+++ b/layout/xul/nsRootBoxFrame.cpp
@@ -219,17 +219,17 @@ nsRootBoxFrame::SetPopupSetFrame(nsPopup
   // frame.  This will cause the popupset to remove itself by calling
   // |SetPopupSetFrame(nullptr)|, and then we'll be able to accept a new
   // popupset.  Since the anonymous content is associated with the
   // nsDocElementBoxFrame, we'll get a new popupset when the new doc
   // element box frame is created.
   if (!mPopupSetFrame || !aPopupSet) {
     mPopupSetFrame = aPopupSet;
   } else {
-    NS_NOTREACHED("Popup set is already defined! Only 1 allowed.");
+    MOZ_ASSERT_UNREACHABLE("Popup set is already defined! Only 1 allowed.");
   }
 }
 
 Element*
 nsRootBoxFrame::GetDefaultTooltip()
 {
   return mDefaultTooltip;
 }
--- a/layout/xul/nsSprocketLayout.cpp
+++ b/layout/xul/nsSprocketLayout.cpp
@@ -296,17 +296,17 @@ nsSprocketLayout::XULLayout(nsIFrame* aB
     nsIFrame* child = nsBox::GetChildXULBox(aBox);
 
     int32_t count = 0;
     while (child || (childBoxSize && childBoxSize->bogus))
     {
       // If for some reason, our lists are not the same length, we guard
       // by bailing out of the loop.
       if (childBoxSize == nullptr) {
-        NS_NOTREACHED("Lists not the same length.");
+        MOZ_ASSERT_UNREACHABLE("Lists not the same length.");
         break;
       }
 
       nscoord width = clientRect.width;
       nscoord height = clientRect.height;
 
       if (!childBoxSize->bogus) {
         // We have a valid box size entry.  This entry already contains information about our
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -249,17 +249,17 @@ nsTreeBodyFrame::CalcMaxRowWidth()
 
   for (int32_t row = 0; row < mRowCount; ++row) {
     rowWidth = 0;
 
     for (col = mColumns->GetFirstColumn(); col; col = col->GetNext()) {
       nscoord desiredWidth, currentWidth;
       nsresult rv = GetCellWidth(row, col, rc, desiredWidth, currentWidth);
       if (NS_FAILED(rv)) {
-        NS_NOTREACHED("invalid column");
+        MOZ_ASSERT_UNREACHABLE("invalid column");
         continue;
       }
       rowWidth += desiredWidth;
     }
 
     if (rowWidth > mStringWidth)
       mStringWidth = rowWidth;
   }
@@ -1607,17 +1607,17 @@ nsTreeBodyFrame::GetCellAt(nscoord aX, n
        currCol = currCol->GetNext()) {
     nsRect cellRect;
     nsresult rv = currCol->GetRect(this,
                                    mInnerBox.y +
                                          mRowHeight * (*aRow - mTopRowIndex),
                                    mRowHeight,
                                    &cellRect);
     if (NS_FAILED(rv)) {
-      NS_NOTREACHED("column has no frame");
+      MOZ_ASSERT_UNREACHABLE("column has no frame");
       continue;
     }
 
     if (!OffsetForHorzScroll(cellRect, false))
       continue;
 
     if (aX >= cellRect.x && aX < cellRect.x + cellRect.width) {
       // We know the column hit now.
@@ -3028,17 +3028,17 @@ nsTreeBodyFrame::PaintRow(int32_t       
 
     nscoord primaryX = rowRect.x;
     nsTreeColumn* primaryCol = mColumns->GetPrimaryColumn();
     if (primaryCol) {
       // Paint the primary cell.
       nsRect cellRect;
       rv = primaryCol->GetRect(this, rowRect.y, rowRect.height, &cellRect);
       if (NS_FAILED(rv)) {
-        NS_NOTREACHED("primary column is invalid");
+        MOZ_ASSERT_UNREACHABLE("primary column is invalid");
         return result;
       }
 
       if (OffsetForHorzScroll(cellRect, false)) {
         cellRect.x += aPt.x;
         nsRect dirtyRect;
         nsRect checkRect(cellRect.x, originalRowRect.y,
                          cellRect.width, originalRowRect.height);
@@ -3053,17 +3053,17 @@ nsTreeBodyFrame::PaintRow(int32_t       
       nscoord currX;
       nsTreeColumn* previousCol = primaryCol->GetPrevious();
       if (previousCol) {
         nsRect prevColRect;
         rv = previousCol->GetRect(this, 0, 0, &prevColRect);
         if (NS_SUCCEEDED(rv)) {
           currX = (prevColRect.x - mHorzPosition) + prevColRect.width + aPt.x;
         } else {
-          NS_NOTREACHED("The column before the primary column is invalid");
+          MOZ_ASSERT_UNREACHABLE("The column before the primary column is invalid");
           currX = rowRect.x;
         }
       } else {
         currX = rowRect.x;
       }
 
       int32_t level;
       mView->GetLevel(aRowIndex, &level);
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -938,17 +938,17 @@ nsJARChannel::Open(nsIInputStream **stre
     mJarFile = nullptr;
 
     nsresult rv = LookupFile();
     if (NS_FAILED(rv))
         return rv;
 
     // If mJarFile was not set by LookupFile, we can't open a channel.
     if (!mJarFile) {
-        NS_NOTREACHED("only file-backed jars are supported");
+        MOZ_ASSERT_UNREACHABLE("only file-backed jars are supported");
         return NS_ERROR_NOT_IMPLEMENTED;
     }
 
     RefPtr<nsJARInputThunk> input;
     rv = CreateJarInput(gJarHandler->JarCache(), getter_AddRefs(input));
     if (NS_FAILED(rv))
         return rv;
 
--- a/modules/libjar/nsJARURI.cpp
+++ b/modules/libjar/nsJARURI.cpp
@@ -102,17 +102,17 @@ nsJARURI::CreateEntryURL(const nsACStrin
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsISerializable methods:
 
 NS_IMETHODIMP
 nsJARURI::Read(nsIObjectInputStream *aStream)
 {
-    NS_NOTREACHED("Use nsIURIMutator.read() instead");
+    MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 nsJARURI::ReadPrivate(nsIObjectInputStream *aInputStream)
 {
     nsresult rv;
 
--- a/modules/libjar/zipwriter/nsZipWriter.cpp
+++ b/modules/libjar/zipwriter/nsZipWriter.cpp
@@ -219,17 +219,17 @@ nsresult nsZipWriter::ReadFile(nsIFile *
             inputStream->Close();
             return NS_ERROR_FILE_CORRUPTED;
         }
 
         // Overlap by the size of the end of cdr
         seek -= (1024 - ZIP_EOCDR_HEADER_SIZE);
     }
     // Will never reach here in reality
-    NS_NOTREACHED("Loop should never complete");
+    MOZ_ASSERT_UNREACHABLE("Loop should never complete");
     return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP nsZipWriter::Open(nsIFile *aFile, int32_t aIoFlags)
 {
     if (mStream)
         return NS_ERROR_ALREADY_INITIALIZED;
 
--- a/netwerk/base/ChannelDiverterParent.cpp
+++ b/netwerk/base/ChannelDiverterParent.cpp
@@ -31,17 +31,17 @@ ChannelDiverterParent::Init(const Channe
   }
   case ChannelDiverterArgs::TPFTPChannelParent:
   {
     mDivertableChannelParent = static_cast<ADivertableParentChannel*>(
       static_cast<FTPChannelParent*>(aArgs.get_PFTPChannelParent()));
     break;
   }
   default:
-    NS_NOTREACHED("unknown ChannelDiverterArgs type");
+    MOZ_ASSERT_UNREACHABLE("unknown ChannelDiverterArgs type");
     return false;
   }
   MOZ_ASSERT(mDivertableChannelParent);
 
   nsresult rv = mDivertableChannelParent->SuspendForDiversion();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return false;
   }
--- a/netwerk/base/nsAsyncStreamCopier.cpp
+++ b/netwerk/base/nsAsyncStreamCopier.cpp
@@ -199,24 +199,24 @@ nsAsyncStreamCopier::Cancel(nsresult sta
         NS_CancelAsyncCopy(copierCtx, status);
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAsyncStreamCopier::Suspend()
 {
-    NS_NOTREACHED("nsAsyncStreamCopier::Suspend");
+    MOZ_ASSERT_UNREACHABLE("nsAsyncStreamCopier::Suspend");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsAsyncStreamCopier::Resume()
 {
-    NS_NOTREACHED("nsAsyncStreamCopier::Resume");
+    MOZ_ASSERT_UNREACHABLE("nsAsyncStreamCopier::Resume");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsAsyncStreamCopier::GetLoadFlags(nsLoadFlags *aLoadFlags)
 {
     *aLoadFlags = LOAD_NORMAL;
     return NS_OK;
--- a/netwerk/base/nsBufferedStreams.cpp
+++ b/netwerk/base/nsBufferedStreams.cpp
@@ -155,17 +155,17 @@ nsBufferedStream::Seek(int32_t whence, i
         absPos = mBufferStartOffset;
         absPos += mCursor;
         absPos += offset;
         break;
       case nsISeekableStream::NS_SEEK_END:
         absPos = -1;
         break;
       default:
-        NS_NOTREACHED("bogus seek whence parameter");
+        MOZ_ASSERT_UNREACHABLE("bogus seek whence parameter");
         return NS_ERROR_UNEXPECTED;
     }
 
     // Let mCursor point into the existing buffer if the new position is
     // between the current cursor and the mFillPoint "fencepost" -- the
     // client may never get around to a Read or Write after this Seek.
     // Read and Write worry about flushing and filling in that event.
     // But if we're at EOF, make sure to pass the seek through to the
--- a/netwerk/base/nsFileStreams.cpp
+++ b/netwerk/base/nsFileStreams.cpp
@@ -267,17 +267,17 @@ nsFileStreamBase::Write(const char *buf,
     }
     *result = cnt;
     return NS_OK;
 }
 
 nsresult
 nsFileStreamBase::WriteFrom(nsIInputStream *inStr, uint32_t count, uint32_t *_retval)
 {
-    NS_NOTREACHED("WriteFrom (see source comment)");
+    MOZ_ASSERT_UNREACHABLE("WriteFrom (see source comment)");
     return NS_ERROR_NOT_IMPLEMENTED;
     // File streams intentionally do not support this method.
     // If you need something like this, then you should wrap
     // the file stream using nsIBufferedOutputStream
 }
 
 nsresult
 nsFileStreamBase::WriteSegments(nsReadSegmentFun reader, void * closure, uint32_t count, uint32_t *_retval)
--- a/netwerk/base/nsInputStreamPump.cpp
+++ b/netwerk/base/nsInputStreamPump.cpp
@@ -432,17 +432,17 @@ nsInputStreamPump::OnInputStreamReady(ns
             nextState = OnStateTransfer();
             break;
         case STATE_STOP:
             mRetargeting = false;
             nextState = OnStateStop();
             break;
         default:
             nextState = 0;
-            NS_NOTREACHED("Unknown enum value.");
+            MOZ_ASSERT_UNREACHABLE("Unknown enum value.");
             return NS_ERROR_UNEXPECTED;
         }
 
         bool stillTransferring = (mState == STATE_TRANSFER &&
                                   nextState == STATE_TRANSFER);
         if (stillTransferring) {
             NS_ASSERTION(NS_SUCCEEDED(mStatus),
                          "Should not have failed status for ongoing transfer");
@@ -573,17 +573,17 @@ nsInputStreamPump::OnStateTransfer()
         //       an infinite loop.  we do our best here to try to catch
         //       such an error.  (see bug 189672)
 
         // in most cases this QI will succeed (mAsyncStream is almost always
         // a nsPipeInputStream, which implements nsISeekableStream::Tell).
         int64_t offsetBefore;
         nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mAsyncStream);
         if (seekable && NS_FAILED(seekable->Tell(&offsetBefore))) {
-            NS_NOTREACHED("Tell failed on readable stream");
+            MOZ_ASSERT_UNREACHABLE("Tell failed on readable stream");
             offsetBefore = 0;
         }
 
         uint32_t odaAvail =
             avail > UINT32_MAX ?
             UINT32_MAX : uint32_t(avail);
 
         LOG(("  calling OnDataAvailable [offset=%" PRIu64 " count=%" PRIu64 "(%u)]\n",
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -2542,17 +2542,17 @@ NS_URIIsLocalFile(nsIURI *aURI)
 
 bool
 NS_RelaxStrictFileOriginPolicy(nsIURI *aTargetURI,
                                nsIURI *aSourceURI,
                                bool aAllowDirectoryTarget /* = false */)
 {
   if (!NS_URIIsLocalFile(aTargetURI)) {
     // This is probably not what the caller intended
-    NS_NOTREACHED("NS_RelaxStrictFileOriginPolicy called with non-file URI");
+    MOZ_ASSERT_UNREACHABLE("NS_RelaxStrictFileOriginPolicy called with non-file URI");
     return false;
   }
 
   if (!NS_URIIsLocalFile(aSourceURI)) {
     // If the source is not also a file: uri then forget it
     // (don't want resource: principals in a file: doc)
     //
     // note: we're not de-nesting jar: uris here, we want to
--- a/netwerk/base/nsProtocolProxyService.cpp
+++ b/netwerk/base/nsProtocolProxyService.cpp
@@ -2446,17 +2446,17 @@ nsProtocolProxyService::PruneProxyInfo(c
     if (!*list)
         return;
 
     LOG(("nsProtocolProxyService::PruneProxyInfo ENTER list=%p", *list));
 
     nsProxyInfo *head = nullptr;
     CallQueryInterface(*list, &head);
     if (!head) {
-        NS_NOTREACHED("nsIProxyInfo must QI to nsProxyInfo");
+        MOZ_ASSERT_UNREACHABLE("nsIProxyInfo must QI to nsProxyInfo");
         return;
     }
     NS_RELEASE(*list);
 
     // Pruning of disabled proxies works like this:
     //   - If all proxies are disabled, return the full list
     //   - Otherwise, remove the disabled proxies.
     //
--- a/netwerk/base/nsRequestObserverProxy.cpp
+++ b/netwerk/base/nsRequestObserverProxy.cpp
@@ -49,17 +49,17 @@ public:
 
     virtual ~nsOnStartRequestEvent() = default;
 
     NS_IMETHOD Run() override
     {
         LOG(("nsOnStartRequestEvent::HandleEvent [req=%p]\n", mRequest.get()));
 
         if (!mProxy->mObserver) {
-            NS_NOTREACHED("already handled onStopRequest event (observer is null)");
+            MOZ_ASSERT_UNREACHABLE("already handled onStopRequest event (observer is null)");
             return NS_OK;
         }
 
         LOG(("handle startevent=%p\n", this));
         nsresult rv = mProxy->mObserver->OnStartRequest(mRequest, mProxy->mContext);
         if (NS_FAILED(rv)) {
             LOG(("OnStartRequest failed [rv=%" PRIx32 "] canceling request!\n",
                  static_cast<uint32_t>(rv)));
@@ -90,17 +90,17 @@ public:
     virtual ~nsOnStopRequestEvent() = default;
 
     NS_IMETHOD Run() override
     {
         LOG(("nsOnStopRequestEvent::HandleEvent [req=%p]\n", mRequest.get()));
 
         nsMainThreadPtrHandle<nsIRequestObserver> observer = mProxy->mObserver;
         if (!observer) {
-            NS_NOTREACHED("already handled onStopRequest event (observer is null)");
+            MOZ_ASSERT_UNREACHABLE("already handled onStopRequest event (observer is null)");
             return NS_OK;
         }
         // Do not allow any more events to be handled after OnStopRequest
         mProxy->mObserver = nullptr;
 
         nsresult status = NS_OK;
         DebugOnly<nsresult> rv = mRequest->GetStatus(&status);
         NS_ASSERTION(NS_SUCCEEDED(rv), "GetStatus failed for request!");
--- a/netwerk/base/nsSimpleNestedURI.cpp
+++ b/netwerk/base/nsSimpleNestedURI.cpp
@@ -75,17 +75,17 @@ nsSimpleNestedURI::SetRef(const nsACStri
     return NS_OK;
 }
 
 // nsISerializable
 
 NS_IMETHODIMP
 nsSimpleNestedURI::Read(nsIObjectInputStream *aStream)
 {
-    NS_NOTREACHED("Use nsIURIMutator.read() instead");
+    MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 nsSimpleNestedURI::ReadPrivate(nsIObjectInputStream *aStream)
 {
     nsresult rv = nsSimpleURI::ReadPrivate(aStream);
     if (NS_FAILED(rv)) return rv;
--- a/netwerk/base/nsSimpleURI.cpp
+++ b/netwerk/base/nsSimpleURI.cpp
@@ -67,17 +67,17 @@ NS_INTERFACE_TABLE_TO_MAP_SEGUE
 NS_INTERFACE_MAP_END
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsISerializable methods:
 
 NS_IMETHODIMP
 nsSimpleURI::Read(nsIObjectInputStream *aStream)
 {
-    NS_NOTREACHED("Use nsIURIMutator.read() instead");
+    MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 nsSimpleURI::ReadPrivate(nsIObjectInputStream *aStream)
 {
     nsresult rv;
 
--- a/netwerk/base/nsSocketTransport2.cpp
+++ b/netwerk/base/nsSocketTransport2.cpp
@@ -1218,17 +1218,17 @@ nsSocketTransport::BuildSocket(PRFileDes
                 rv = provider->NewSocket(mNetAddr.raw.family,
                                          mHttpsProxy ? mProxyHost.get() : socketProviderHost,
                                          mHttpsProxy ? mProxyPort : socketProviderPort,
                                          proxyInfo, mOriginAttributes,
                                          controlFlags, mTlsFlags, &fd,
                                          getter_AddRefs(secinfo));
 
                 if (NS_SUCCEEDED(rv) && !fd) {
-                    NS_NOTREACHED("NewSocket succeeded but failed to create a PRFileDesc");
+                    MOZ_ASSERT_UNREACHABLE("NewSocket succeeded but failed to create a PRFileDesc");
                     rv = NS_ERROR_UNEXPECTED;
                 }
             } else {
                 // the socket has already been allocated,
                 // so we just want the service to add itself
                 // to the stack (such as pushing an io layer)
                 rv = provider->AddToSocket(mNetAddr.raw.family,
                                            host, port, proxyInfo,
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -3209,17 +3209,17 @@ nsStandardURL::Init(uint32_t urlType,
         break;
     case URLTYPE_AUTHORITY:
         mParser = net_GetAuthURLParser();
         break;
     case URLTYPE_NO_AUTHORITY:
         mParser = net_GetNoAuthURLParser();
         break;
     default:
-        NS_NOTREACHED("bad urlType");
+        MOZ_ASSERT_UNREACHABLE("bad urlType");
         return NS_ERROR_INVALID_ARG;
     }
     mDefaultPort = defaultPort;
     mURLType = urlType;
 
     auto encoding =
         charset ? Encoding::ForLabelNoReplacement(MakeStringSpan(charset))
                 : nullptr;
@@ -3268,17 +3268,17 @@ nsStandardURL::SetDefaultPort(int32_t aN
 
 //----------------------------------------------------------------------------
 // nsStandardURL::nsISerializable
 //----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 nsStandardURL::Read(nsIObjectInputStream *stream)
 {
-    NS_NOTREACHED("Use nsIURIMutator.read() instead");
+    MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 nsStandardURL::ReadPrivate(nsIObjectInputStream *stream)
 {
     MOZ_ASSERT(mDisplayHost.IsEmpty(), "Shouldn't have cached unicode host");
 
@@ -3294,17 +3294,17 @@ nsStandardURL::ReadPrivate(nsIObjectInpu
         break;
       case URLTYPE_AUTHORITY:
         mParser = net_GetAuthURLParser();
         break;
       case URLTYPE_NO_AUTHORITY:
         mParser = net_GetNoAuthURLParser();
         break;
       default:
-        NS_NOTREACHED("bad urlType");
+        MOZ_ASSERT_UNREACHABLE("bad urlType");
         return NS_ERROR_FAILURE;
     }
 
     rv = stream->Read32((uint32_t *) &mPort);
     if (NS_FAILED(rv)) return rv;
 
     rv = stream->Read32((uint32_t *) &mDefaultPort);
     if (NS_FAILED(rv)) return rv;
@@ -3554,17 +3554,17 @@ nsStandardURL::Deserialize(const URIPara
             break;
         case URLTYPE_AUTHORITY:
             mParser = net_GetAuthURLParser();
             break;
         case URLTYPE_NO_AUTHORITY:
             mParser = net_GetNoAuthURLParser();
             break;
         default:
-            NS_NOTREACHED("bad urlType");
+            MOZ_ASSERT_UNREACHABLE("bad urlType");
             return false;
     }
 
     mPort = params.port();
     mDefaultPort = params.defaultPort();
     mSpec = params.spec();
     NS_ENSURE_TRUE(mSpec.Length() <= (uint32_t) net_GetURLMaxLength(), false);
     NS_ENSURE_TRUE(FromIPCSegment(mSpec, params.scheme(), mScheme), false);
--- a/netwerk/base/nsStandardURL.h
+++ b/netwerk/base/nsStandardURL.h
@@ -335,17 +335,17 @@ public:
         Deserialize(const mozilla::ipc::URIParams& aParams) override
         {
             return BaseURIMutator<T>::InitFromIPCParams(aParams);
         }
 
         NS_IMETHOD
         Write(nsIObjectOutputStream *aOutputStream) override
         {
-            NS_NOTREACHED("Use nsIURIMutator.read() instead");
+            MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
             return NS_ERROR_NOT_IMPLEMENTED;
         }
 
         MOZ_MUST_USE NS_IMETHOD
         Read(nsIObjectInputStream* aStream) override
         {
             return BaseURIMutator<T>::InitFromInputStream(aStream);
         }
--- a/netwerk/base/nsStreamTransportService.cpp
+++ b/netwerk/base/nsStreamTransportService.cpp
@@ -111,17 +111,17 @@ nsInputStreamTransport::OpenInputStream(
 
 NS_IMETHODIMP
 nsInputStreamTransport::OpenOutputStream(uint32_t flags,
                                          uint32_t segsize,
                                          uint32_t segcount,
                                          nsIOutputStream **result)
 {
     // this transport only supports reading!
-    NS_NOTREACHED("nsInputStreamTransport::OpenOutputStream");
+    MOZ_ASSERT_UNREACHABLE("nsInputStreamTransport::OpenOutputStream");
     return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
 nsInputStreamTransport::Close(nsresult reason)
 {
     if (NS_SUCCEEDED(reason))
         reason = NS_BASE_STREAM_CLOSED;
--- a/netwerk/base/nsURLHelper.cpp
+++ b/netwerk/base/nsURLHelper.cpp
@@ -783,17 +783,17 @@ net_FindStringEnd(const nsCString& flatS
             // Go back to looking for the next escape or the string end
             continue;
         }
 
         return stringEnd;
 
     } while (true);
 
-    NS_NOTREACHED("How did we get here?");
+    MOZ_ASSERT_UNREACHABLE("How did we get here?");
     return flatStr.Length();
 }
 
 
 static uint32_t
 net_FindMediaDelimiter(const nsCString& flatStr,
                        uint32_t searchStart,
                        char delimiter)
@@ -819,17 +819,17 @@ net_FindMediaDelimiter(const nsCString& 
 
         ++searchStart;
 
         // searchStart now points to the first char after the end of the
         // string, so just go back to the top of the loop and look for
         // |delimiter| again.
     } while (true);
 
-    NS_NOTREACHED("How did we get here?");
+    MOZ_ASSERT_UNREACHABLE("How did we get here?");
     return flatStr.Length();
 }
 
 // aOffset should be added to aCharsetStart and aCharsetEnd if this
 // function sets them.
 static void
 net_ParseMediaType(const nsACString &aMediaTypeStr,
                    nsACString       &aContentType,
--- a/netwerk/base/nsURLParsers.cpp
+++ b/netwerk/base/nsURLParsers.cpp
@@ -354,17 +354,17 @@ nsBaseURLParser::ParseFileName(const cha
 
 NS_IMETHODIMP
 nsNoAuthURLParser::ParseAuthority(const char *auth, int32_t authLen,
                                  uint32_t *usernamePos, int32_t *usernameLen,
                                  uint32_t *passwordPos, int32_t *passwordLen,
                                  uint32_t *hostnamePos, int32_t *hostnameLen,
                                  int32_t *port)
 {
-    NS_NOTREACHED("Shouldn't parse auth in a NoAuthURL!");
+    MOZ_ASSERT_UNREACHABLE("Shouldn't parse auth in a NoAuthURL!");
     return NS_ERROR_UNEXPECTED;
 }
 
 void
 nsNoAuthURLParser::ParseAfterScheme(const char *spec, int32_t specLen,
                                     uint32_t *authPos, int32_t *authLen,
                                     uint32_t *pathPos, int32_t *pathLen)
 {
--- a/netwerk/cache/nsDiskCacheMap.cpp
+++ b/netwerk/cache/nsDiskCacheMap.cpp
@@ -503,17 +503,17 @@ nsDiskCacheMap::UpdateRecord( nsDiskCach
 
             InvalidateCache();
 
 NS_ASSERTION(mHeader.mEvictionRank[bucketIndex] == GetBucketRank(bucketIndex, 0),
              "eviction rank out of sync");
             return NS_OK;
         }
     }
-    NS_NOTREACHED("record not found");
+    MOZ_ASSERT_UNREACHABLE("record not found");
     return NS_ERROR_UNEXPECTED;
 }
 
 
 nsresult
 nsDiskCacheMap::FindRecord( uint32_t  hashNumber, nsDiskCacheRecord *  result)
 {
     const uint32_t      bucketIndex = GetBucketIndex(hashNumber);
--- a/netwerk/cache/nsDiskCacheStreams.cpp
+++ b/netwerk/cache/nsDiskCacheStreams.cpp
@@ -664,28 +664,28 @@ nsDiskCacheStreamIO::Flush()
     if (!mOutputStreamIsOpen)  return NS_BASE_STREAM_CLOSED;
     return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsDiskCacheStreamIO::WriteFrom(nsIInputStream *inStream, uint32_t count, uint32_t *bytesWritten)
 {
-    NS_NOTREACHED("WriteFrom");
+    MOZ_ASSERT_UNREACHABLE("WriteFrom");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 
 NS_IMETHODIMP
 nsDiskCacheStreamIO::WriteSegments( nsReadSegmentFun reader,
                                         void *           closure,
                                         uint32_t         count,
                                         uint32_t *       bytesWritten)
 {
-    NS_NOTREACHED("WriteSegments");
+    MOZ_ASSERT_UNREACHABLE("WriteSegments");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 
 NS_IMETHODIMP
 nsDiskCacheStreamIO::IsNonBlocking(bool * nonBlocking)
 {
     *nonBlocking = false;
--- a/netwerk/cache/nsDiskCacheStreams.h
+++ b/netwerk/cache/nsDiskCacheStreams.h
@@ -47,17 +47,17 @@ public:
         : mBinding(nullptr),
           mDevice(nullptr),
           mFD(nullptr),
           mStreamEnd(0),
           mBufSize(0),
           mBuffer(nullptr),
           mOutputStreamIsOpen(false)
     {
-        NS_NOTREACHED("oops");
+        MOZ_ASSERT_UNREACHABLE("oops");
     }
 
 private:
     virtual ~nsDiskCacheStreamIO();
 
     nsresult    OpenCacheFile(int flags, PRFileDesc ** fd);
     nsresult    ReadCacheBlocks(uint32_t bufferSize);
     nsresult    FlushBufferToFile();
--- a/netwerk/cache2/CacheFile.cpp
+++ b/netwerk/cache2/CacheFile.cpp
@@ -2111,17 +2111,17 @@ StatusToTelemetryEnum(nsresult aStatus)
     case NS_ERROR_FILE_NOT_FOUND:
       return 5;
     case NS_BINDING_ABORTED:
       return 6;
     default:
       return 1; // other error
   }
 
-  NS_NOTREACHED("We should never get here");
+  MOZ_ASSERT_UNREACHABLE("We should never get here");
 }
 
 nsresult
 CacheFile::RemoveInput(CacheFileInputStream *aInput, nsresult aStatus)
 {
   CacheFileAutoLock lock(this);
 
   LOG(("CacheFile::RemoveInput() [this=%p, input=%p, status=0x%08" PRIx32 "]", this,
--- a/netwerk/cache2/CacheFileContextEvictor.cpp
+++ b/netwerk/cache2/CacheFileContextEvictor.cpp
@@ -659,14 +659,14 @@ CacheFileContextEvictor::EvictEntries()
       continue;
     }
 
     LOG(("CacheFileContextEvictor::EvictEntries - Removing entry."));
     file->Remove(false);
     CacheIndex::RemoveEntry(&hash);
   }
 
-  NS_NOTREACHED("We should never get here");
+  MOZ_ASSERT_UNREACHABLE("We should never get here");
   return NS_OK;
 }
 
 } // namespace net
 } // namespace mozilla
--- a/netwerk/cache2/CacheFileIOManager.cpp
+++ b/netwerk/cache2/CacheFileIOManager.cpp
@@ -3003,17 +3003,17 @@ CacheFileIOManager::OverLimitEvictionInt
         // but we've reached a sane number of tries. It is likely that another
         // eviction will start soon. And as said earlier, this normally doesn't
         // happen at all.
         return NS_OK;
       }
     }
   }
 
-  NS_NOTREACHED("We should never get here");
+  MOZ_ASSERT_UNREACHABLE("We should never get here");
   return NS_OK;
 }
 
 // static
 nsresult
 CacheFileIOManager::EvictAll()
 {
   LOG(("CacheFileIOManager::EvictAll()"));
@@ -3543,17 +3543,17 @@ CacheFileIOManager::RemoveTrashInternal(
         LOG(("CacheFileIOManager::RemoveTrashInternal() - Found a directory in a trash "
             "directory! It will be removed recursively, but this can block IO "
             "thread for a while! [file=%s]", file->HumanReadablePath().get()));
       }
     }
     file->Remove(isDir);
   }
 
-  NS_NOTREACHED("We should never get here");
+  MOZ_ASSERT_UNREACHABLE("We should never get here");
   return NS_OK;
 }
 
 nsresult
 CacheFileIOManager::FindTrashDirToRemove()
 {
   LOG(("CacheFileIOManager::FindTrashDirToRemove()"));
 
--- a/netwerk/cache2/CacheFileIOManager.h
+++ b/netwerk/cache2/CacheFileIOManager.h
@@ -160,17 +160,17 @@ public:
     explicit HandleHashKey(KeyTypePointer aKey)
     {
       MOZ_COUNT_CTOR(HandleHashKey);
       mHash = MakeUnique<uint8_t[]>(SHA1Sum::kHashSize);
       memcpy(mHash.get(), aKey, sizeof(SHA1Sum::Hash));
     }
     HandleHashKey(const HandleHashKey& aOther)
     {
-      NS_NOTREACHED("HandleHashKey copy constructor is forbidden!");
+      MOZ_ASSERT_UNREACHABLE("HandleHashKey copy constructor is forbidden!");
     }
     ~HandleHashKey()
     {
       MOZ_COUNT_DTOR(HandleHashKey);
     }
 
     bool KeyEquals(KeyTypePointer aKey) const
     {
--- a/netwerk/cache2/CacheIndex.cpp
+++ b/netwerk/cache2/CacheIndex.cpp
@@ -2901,17 +2901,17 @@ CacheIndex::BuildIndex()
       } else {
         LOG(("CacheIndex::BuildIndex() - Added entry to index. [name=%s]",
              leaf.get()));
         entry->Log();
       }
     }
   }
 
-  NS_NOTREACHED("We should never get here");
+  MOZ_ASSERT_UNREACHABLE("We should never get here");
 }
 
 bool
 CacheIndex::StartUpdatingIndexIfNeeded(bool aSwitchingToReadyState)
 {
   // Start updating process when we are in or we are switching to READY state
   // and index needs update, but not during shutdown or when removing all
   // entries.
@@ -3166,17 +3166,17 @@ CacheIndex::UpdateIndex()
       }
     } else {
         LOG(("CacheIndex::UpdateIndex() - Added/updated entry to/in index. "
              "[name=%s]", leaf.get()));
         entry->Log();
     }
   }
 
-  NS_NOTREACHED("We should never get here");
+  MOZ_ASSERT_UNREACHABLE("We should never get here");
 }
 
 void
 CacheIndex::FinishUpdate(bool aSucceeded)
 {
   LOG(("CacheIndex::FinishUpdate() [succeeded=%d]", aSucceeded));
 
   MOZ_ASSERT(mState == UPDATING || mState == BUILDING ||
--- a/netwerk/cache2/CacheIndex.h
+++ b/netwerk/cache2/CacheIndex.h
@@ -115,17 +115,17 @@ public:
   {
     MOZ_COUNT_CTOR(CacheIndexEntry);
     mRec = new CacheIndexRecord();
     LOG(("CacheIndexEntry::CacheIndexEntry() - Created record [rec=%p]", mRec.get()));
     memcpy(&mRec->mHash, aKey, sizeof(SHA1Sum::Hash));
   }
   CacheIndexEntry(const CacheIndexEntry& aOther)
   {
-    NS_NOTREACHED("CacheIndexEntry copy constructor is forbidden!");
+    MOZ_ASSERT_UNREACHABLE("CacheIndexEntry copy constructor is forbidden!");
   }
   ~CacheIndexEntry()
   {
     MOZ_COUNT_DTOR(CacheIndexEntry);
     LOG(("CacheIndexEntry::~CacheIndexEntry() - Deleting record [rec=%p]",
          mRec.get()));
   }
 
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -380,17 +380,17 @@ private:
   ~InsertCookieDBListener() = default;
 
 public:
   NS_DECL_ISUPPORTS
 
   explicit InsertCookieDBListener(DBState* dbState) : DBListenerErrorHandler(dbState) { }
   NS_IMETHOD HandleResult(mozIStorageResultSet*) override
   {
-    NS_NOTREACHED("Unexpected call to InsertCookieDBListener::HandleResult");
+    MOZ_ASSERT_UNREACHABLE("Unexpected call to InsertCookieDBListener::HandleResult");
     return NS_OK;
   }
   NS_IMETHOD HandleCompletion(uint16_t aReason) override
   {
     // If we were rebuilding the db and we succeeded, make our corruptFlag say
     // so.
     if (mDBState->corruptFlag == DBState::REBUILDING &&
         aReason == mozIStorageStatementCallback::REASON_FINISHED) {
@@ -416,17 +416,17 @@ private:
   ~UpdateCookieDBListener() = default;
 
 public:
   NS_DECL_ISUPPORTS
 
   explicit UpdateCookieDBListener(DBState* dbState) : DBListenerErrorHandler(dbState) { }
   NS_IMETHOD HandleResult(mozIStorageResultSet*) override
   {
-    NS_NOTREACHED("Unexpected call to UpdateCookieDBListener::HandleResult");
+    MOZ_ASSERT_UNREACHABLE("Unexpected call to UpdateCookieDBListener::HandleResult");
     return NS_OK;
   }
   NS_IMETHOD HandleCompletion(uint16_t aReason) override
   {
     return NS_OK;
   }
 };
 
@@ -444,17 +444,17 @@ private:
   ~RemoveCookieDBListener() = default;
 
 public:
   NS_DECL_ISUPPORTS
 
   explicit RemoveCookieDBListener(DBState* dbState) : DBListenerErrorHandler(dbState) { }
   NS_IMETHOD HandleResult(mozIStorageResultSet*) override
   {
-    NS_NOTREACHED("Unexpected call to RemoveCookieDBListener::HandleResult");
+    MOZ_ASSERT_UNREACHABLE("Unexpected call to RemoveCookieDBListener::HandleResult");
     return NS_OK;
   }
   NS_IMETHOD HandleCompletion(uint16_t aReason) override
   {
     return NS_OK;
   }
 };
 
--- a/netwerk/cookie/nsCookieService.h
+++ b/netwerk/cookie/nsCookieService.h
@@ -73,17 +73,17 @@ class nsCookieEntry : public nsCookieKey
     explicit nsCookieEntry(KeyTypePointer aKey)
      : nsCookieKey(aKey)
     {}
 
     nsCookieEntry(const nsCookieEntry& toCopy)
     {
       // if we end up here, things will break. nsTHashtable shouldn't
       // allow this, since we set ALLOW_MEMMOVE to true.
-      NS_NOTREACHED("nsCookieEntry copy constructor is forbidden!");
+      MOZ_ASSERT_UNREACHABLE("nsCookieEntry copy constructor is forbidden!");
     }
 
     ~nsCookieEntry() = default;
 
     inline ArrayType& GetCookies() { return mCookies; }
 
     size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
--- a/netwerk/dns/DNSRequestChild.cpp
+++ b/netwerk/dns/DNSRequestChild.cpp
@@ -259,17 +259,17 @@ DNSRequestChild::RecvLookupCompleted(con
     mResultRecord = new ChildDNSRecord(reply.get_DNSRecord(), mFlags);
     break;
   }
   case DNSRequestResponse::Tnsresult: {
     mResultStatus = reply.get_nsresult();
     break;
   }
   default:
-    NS_NOTREACHED("unknown type");
+    MOZ_ASSERT_UNREACHABLE("unknown type");
     return IPC_FAIL_NO_REASON(this);
   }
 
   MOZ_ASSERT(NS_IsMainThread());
 
   bool targetIsMain = false;
   if (!mTarget) {
     targetIsMain = true;
--- a/netwerk/ipc/NeckoChild.cpp
+++ b/netwerk/ipc/NeckoChild.cpp
@@ -71,17 +71,17 @@ void NeckoChild::InitNeckoChild()
 
 PHttpChannelChild*
 NeckoChild::AllocPHttpChannelChild(const PBrowserOrId& browser,
                                    const SerializedLoadContext& loadContext,
                                    const HttpChannelCreationArgs& aOpenArgs)
 {
   // We don't allocate here: instead we always use IPDL constructor that takes
   // an existing HttpChildChannel
-  NS_NOTREACHED("AllocPHttpChannelChild should not be called on child");
+  MOZ_ASSERT_UNREACHABLE("AllocPHttpChannelChild should not be called on child");
   return nullptr;
 }
 
 bool
 NeckoChild::DeallocPHttpChannelChild(PHttpChannelChild* channel)
 {
   MOZ_ASSERT(IsNeckoChild(), "DeallocPHttpChannelChild called by non-child!");
 
@@ -90,17 +90,17 @@ NeckoChild::DeallocPHttpChannelChild(PHt
   return true;
 }
 
 PStunAddrsRequestChild*
 NeckoChild::AllocPStunAddrsRequestChild()
 {
   // We don't allocate here: instead we always use IPDL constructor that takes
   // an existing object
-  NS_NOTREACHED("AllocPStunAddrsRequestChild should not be called on child");
+  MOZ_ASSERT_UNREACHABLE("AllocPStunAddrsRequestChild should not be called on child");
   return nullptr;
 }
 
 bool
 NeckoChild::DeallocPStunAddrsRequestChild(PStunAddrsRequestChild* aActor)
 {
 #ifdef MOZ_WEBRTC
   StunAddrsRequestChild* p = static_cast<StunAddrsRequestChild*>(aActor);
@@ -111,17 +111,17 @@ NeckoChild::DeallocPStunAddrsRequestChil
 
 PAltDataOutputStreamChild*
 NeckoChild::AllocPAltDataOutputStreamChild(
         const nsCString& type,
         const int64_t& predictedSize,
         PHttpChannelChild* channel)
 {
   // We don't allocate here: see HttpChannelChild::OpenAlternativeOutputStream()
-  NS_NOTREACHED("AllocPAltDataOutputStreamChild should not be called");
+  MOZ_ASSERT_UNREACHABLE("AllocPAltDataOutputStreamChild should not be called");
   return nullptr;
 }
 
 bool
 NeckoChild::DeallocPAltDataOutputStreamChild(PAltDataOutputStreamChild* aActor)
 {
   AltDataOutputStreamChild* child = static_cast<AltDataOutputStreamChild*>(aActor);
   child->ReleaseIPDLReference();
@@ -147,17 +147,17 @@ NeckoChild::DeallocPFTPChannelChild(PFTP
   child->ReleaseIPDLReference();
   return true;
 }
 
 PCookieServiceChild*
 NeckoChild::AllocPCookieServiceChild()
 {
   // We don't allocate here: see nsCookieService::GetSingleton()
-  NS_NOTREACHED("AllocPCookieServiceChild should not be called");
+  MOZ_ASSERT_UNREACHABLE("AllocPCookieServiceChild should not be called");
   return nullptr;
 }
 
 bool
 NeckoChild::DeallocPCookieServiceChild(PCookieServiceChild* cs)
 {
   NS_ASSERTION(IsNeckoChild(), "DeallocPCookieServiceChild called by non-child!");
 
@@ -165,17 +165,17 @@ NeckoChild::DeallocPCookieServiceChild(P
   p->Release();
   return true;
 }
 
 PWyciwygChannelChild*
 NeckoChild::AllocPWyciwygChannelChild()
 {
   // We don't allocate here: see nsWyciwygProtocolHandler::NewChannel2()
-  NS_NOTREACHED("AllocPWyciwygChannelChild should not be called");
+  MOZ_ASSERT_UNREACHABLE("AllocPWyciwygChannelChild should not be called");
   return nullptr;
 }
 
 bool
 NeckoChild::DeallocPWyciwygChannelChild(PWyciwygChannelChild* channel)
 {
   MOZ_ASSERT(IsNeckoChild(), "DeallocPWyciwygChannelChild called by non-child!");
 
@@ -184,17 +184,17 @@ NeckoChild::DeallocPWyciwygChannelChild(
   return true;
 }
 
 PWebSocketChild*
 NeckoChild::AllocPWebSocketChild(const PBrowserOrId& browser,
                                  const SerializedLoadContext& aSerialized,
                                  const uint32_t& aSerial)
 {
-  NS_NOTREACHED("AllocPWebSocketChild should not be called");
+  MOZ_ASSERT_UNREACHABLE("AllocPWebSocketChild should not be called");
   return nullptr;
 }
 
 bool
 NeckoChild::DeallocPWebSocketChild(PWebSocketChild* child)
 {
   WebSocketChannelChild* p = static_cast<WebSocketChannelChild*>(child);
   p->ReleaseIPDLReference();
@@ -287,33 +287,33 @@ NeckoChild::DeallocPTCPSocketChild(PTCPS
   return true;
 }
 
 PTCPServerSocketChild*
 NeckoChild::AllocPTCPServerSocketChild(const uint16_t& aLocalPort,
                                   const uint16_t& aBacklog,
                                   const bool& aUseArrayBuffers)
 {
-  NS_NOTREACHED("AllocPTCPServerSocket should not be called");
+  MOZ_ASSERT_UNREACHABLE("AllocPTCPServerSocket should not be called");
   return nullptr;
 }
 
 bool
 NeckoChild::DeallocPTCPServerSocketChild(PTCPServerSocketChild* child)
 {
   TCPServerSocketChild* p = static_cast<TCPServerSocketChild*>(child);
   p->ReleaseIPDLReference();
   return true;
 }
 
 PUDPSocketChild*
 NeckoChild::AllocPUDPSocketChild(const Principal& aPrincipal,
                                  const nsCString& aFilter)
 {
-  NS_NOTREACHED("AllocPUDPSocket should not be called");
+  MOZ_ASSERT_UNREACHABLE("AllocPUDPSocket should not be called");
   return nullptr;
 }
 
 bool
 NeckoChild::DeallocPUDPSocketChild(PUDPSocketChild* child)
 {
 
   UDPSocketChild* p = static_cast<UDPSocketChild*>(child);
@@ -323,17 +323,17 @@ NeckoChild::DeallocPUDPSocketChild(PUDPS
 
 PDNSRequestChild*
 NeckoChild::AllocPDNSRequestChild(const nsCString& aHost,
                                   const OriginAttributes& aOriginAttributes,
                                   const uint32_t& aFlags)
 {
   // We don't allocate here: instead we always use IPDL constructor that takes
   // an existing object
-  NS_NOTREACHED("AllocPDNSRequestChild should not be called on child");
+  MOZ_ASSERT_UNREACHABLE("AllocPDNSRequestChild should not be called on child");
   return nullptr;
 }
 
 bool
 NeckoChild::DeallocPDNSRequestChild(PDNSRequestChild* aChild)
 {
   DNSRequestChild *p = static_cast<DNSRequestChild*>(aChild);
   p->ReleaseIPDLReference();
--- a/netwerk/protocol/about/nsAboutProtocolHandler.cpp
+++ b/netwerk/protocol/about/nsAboutProtocolHandler.cpp
@@ -357,17 +357,17 @@ NS_INTERFACE_MAP_BEGIN(nsNestedAboutURI)
   else
 NS_INTERFACE_MAP_END_INHERITING(nsSimpleNestedURI)
 
 // nsISerializable
 
 NS_IMETHODIMP
 nsNestedAboutURI::Read(nsIObjectInputStream *aStream)
 {
-    NS_NOTREACHED("Use nsIURIMutator.read() instead");
+    MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 nsNestedAboutURI::ReadPrivate(nsIObjectInputStream *aStream)
 {
     nsresult rv = nsSimpleNestedURI::ReadPrivate(aStream);
     if (NS_FAILED(rv)) return rv;
--- a/netwerk/protocol/ftp/FTPChannelParent.cpp
+++ b/netwerk/protocol/ftp/FTPChannelParent.cpp
@@ -104,17 +104,17 @@ FTPChannelParent::Init(const FTPChannelC
                        a.loadInfo(), a.loadFlags());
   }
   case FTPChannelCreationArgs::TFTPChannelConnectArgs:
   {
     const FTPChannelConnectArgs& cArgs = aArgs.get_FTPChannelConnectArgs();
     return ConnectChannel(cArgs.channelId());
   }
   default:
-    NS_NOTREACHED("unknown open type");
+    MOZ_ASSERT_UNREACHABLE("unknown open type");
     return false;
   }
 }
 
 bool
 FTPChannelParent::DoAsyncOpen(const URIParams& aURI,
                               const uint64_t& aStartPos,
                               const nsCString& aEntityID,
--- a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp
+++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp
@@ -404,17 +404,17 @@ nsFtpProtocolHandler::Observe(nsISupport
 	if (NS_SUCCEEDED(rv))
 	    mControlQoSBits = (uint8_t) clamped(val, 0, 0xff);
     } else if (!strcmp(aTopic, "network:offline-about-to-go-offline")) {
         ClearAllConnections();
     } else if (!strcmp(aTopic, "net:clear-active-logins")) {
         ClearAllConnections();
         mSessionId++;
     } else {
-        NS_NOTREACHED("unexpected topic");
+        MOZ_ASSERT_UNREACHABLE("unexpected topic");
     }
 
     return NS_OK;
 }
 
 void
 nsFtpProtocolHandler::ClearAllConnections()
 {
--- a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
+++ b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
@@ -678,17 +678,17 @@ NS_IMETHODIMP
 nsGIOInputStream::ReadSegments(nsWriteSegmentFun aWriter,
                                void             *aClosure,
                                uint32_t          aCount,
                                uint32_t         *aResult)
 {
   // There is no way to implement this using GnomeVFS, but fortunately
   // that doesn't matter.  Because we are a blocking input stream, Necko
   // isn't going to call our ReadSegments method.
-  NS_NOTREACHED("nsGIOInputStream::ReadSegments");
+  MOZ_ASSERT_UNREACHABLE("nsGIOInputStream::ReadSegments");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsGIOInputStream::IsNonBlocking(bool *aResult)
 {
   *aResult = false;
   return NS_OK;
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -157,17 +157,17 @@ HttpChannelParent::Init(const HttpChanne
                        a.forceMainDocumentChannel());
   }
   case HttpChannelCreationArgs::THttpChannelConnectArgs:
   {
     const HttpChannelConnectArgs& cArgs = aArgs.get_HttpChannelConnectArgs();
     return ConnectChannel(cArgs.registrarId(), cArgs.shouldIntercept());
   }
   default:
-    NS_NOTREACHED("unknown open type");
+    MOZ_ASSERT_UNREACHABLE("unknown open type");
     return false;
   }
 }
 
 void
 HttpChannelParent::TryInvokeAsyncOpen(nsresult aRv)
 {
   LOG(("HttpChannelParent::TryInvokeAsyncOpen [this=%p barrier=%u rv=%" PRIx32
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -1760,17 +1760,17 @@ nsHttpChannel::ProcessSingleSecurityHead
     switch (aType) {
         case nsISiteSecurityService::HEADER_HSTS:
             atom = nsHttp::ResolveAtom("Strict-Transport-Security");
             break;
         case nsISiteSecurityService::HEADER_HPKP:
             atom = nsHttp::ResolveAtom("Public-Key-Pins");
             break;
         default:
-            NS_NOTREACHED("Invalid security header type");
+            MOZ_ASSERT_UNREACHABLE("Invalid security header type");
             return NS_ERROR_FAILURE;
     }
 
     nsAutoCString securityHeader;
     nsresult rv = mResponseHead->GetHeader(atom, securityHeader);
     if (NS_SUCCEEDED(rv)) {
         nsISiteSecurityService* sss = gHttpHandler->GetSSService();
         NS_ENSURE_TRUE(sss, NS_ERROR_OUT_OF_MEMORY);
@@ -3135,17 +3135,17 @@ nsHttpChannel::SetupByteRangeRequest(int
     // use strongest validator available...
     nsAutoCString val;
     Unused << mCachedResponseHead->GetHeader(nsHttp::ETag, val);
     if (val.IsEmpty())
         Unused << mCachedResponseHead->GetHeader(nsHttp::Last_Modified, val);
     if (val.IsEmpty()) {
         // if we hit this code it means mCachedResponseHead->IsResumable() is
         // either broken or not being called.
-        NS_NOTREACHED("no cache validator");
+        MOZ_ASSERT_UNREACHABLE("no cache validator");
         mIsPartialRequest = false;
         return NS_ERROR_FAILURE;
     }
 
     char buf[64];
     SprintfLiteral(buf, "bytes=%" PRId64 "-", partialLen);
 
     DebugOnly<nsresult> rv;
@@ -3317,17 +3317,17 @@ nsHttpChannel::OnDoneReadingPartialCache
     // resume the transaction if it exists, otherwise the pipe contained the
     // remaining part of the document and we've now streamed all of the data.
     if (mTransactionPump) {
         rv = mTransactionPump->Resume();
         if (NS_SUCCEEDED(rv))
             *streamDone = false;
     }
     else
-        NS_NOTREACHED("no transaction");
+        MOZ_ASSERT_UNREACHABLE("no transaction");
     return rv;
 }
 
 //-----------------------------------------------------------------------------
 // nsHttpChannel <cache>
 //-----------------------------------------------------------------------------
 
 bool
@@ -6914,17 +6914,17 @@ nsHttpChannel::OnStartRequest(nsIRequest
         mCacheEntry->AsyncDoom(nullptr);
         rv = StartRedirectChannelToURI(mURI, nsIChannelEventSink::REDIRECT_INTERNAL);
         if (NS_SUCCEEDED(rv))
             return NS_OK;
     }
 
     // avoid crashing if mListener happens to be null...
     if (!mListener) {
-        NS_NOTREACHED("mListener is null");
+        MOZ_ASSERT_UNREACHABLE("mListener is null");
         return NS_OK;
     }
 
     // before we start any content load, check for redirectTo being called
     // this code is executed mainly before we start load from the cache
     if (mAPIRedirectToURI && !mCanceled) {
         nsAutoCString redirectToSpec;
         mAPIRedirectToURI->GetAsciiSpec(redirectToSpec);
@@ -7065,17 +7065,17 @@ nsHttpChannel::OnStopRequest(nsIRequest 
                 if (NS_SUCCEEDED(status) && !streamDone)
                     return status;
                 // otherwise, fall through and fire OnStopRequest...
             }
             else if (request == mTransactionPump) {
                 MOZ_ASSERT(mConcurrentCacheAccess);
             }
             else
-                NS_NOTREACHED("unexpected request");
+                MOZ_ASSERT_UNREACHABLE("unexpected request");
         }
         // Do not to leave the transaction in a suspended state in error cases.
         if (NS_FAILED(status) && mTransaction) {
             nsresult rv = gHttpHandler->CancelTransaction(mTransaction, status);
             if (NS_FAILED(rv)) {
                 LOG(("  CancelTransaction failed (%08x)",
                      static_cast<uint32_t>(rv)));
             }
--- a/netwerk/protocol/http/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/nsHttpConnection.cpp
@@ -1589,17 +1589,17 @@ nsHttpConnection::ResumeSend()
             // During TCP Fast Open, poll does not work properly so we will
             // trigger writes manually.
             mForceSendDuringFastOpenPending = true;
             NS_DispatchToCurrentThread(new HttpConnectionForceIO(this, false, true));
         }
         return rv;
     }
 
-    NS_NOTREACHED("no socket output stream");
+    MOZ_ASSERT_UNREACHABLE("no socket output stream");
     return NS_ERROR_UNEXPECTED;
 }
 
 nsresult
 nsHttpConnection::ResumeRecv()
 {
     LOG(("nsHttpConnection::ResumeRecv [this=%p]\n", this));
 
@@ -1617,17 +1617,17 @@ nsHttpConnection::ResumeRecv()
     // with actual read data in OnSocketReadable() we are only measuring
     // the latency between those two acts and not all the processing that
     // may get done before the ResumeRecv() call
     mLastReadTime = PR_IntervalNow();
 
     if (mSocketIn)
         return mSocketIn->AsyncWait(this, 0, 0, nullptr);
 
-    NS_NOTREACHED("no socket input stream");
+    MOZ_ASSERT_UNREACHABLE("no socket input stream");
     return NS_ERROR_UNEXPECTED;
 }
 
 void
 nsHttpConnection::ForceSendIO(nsITimer *aTimer, void *aClosure)
 {
     MOZ_ASSERT(OnSocketThread(), "not on socket thread");
     nsHttpConnection *self = static_cast<nsHttpConnection *>(aClosure);
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -2958,17 +2958,17 @@ nsHttpConnectionMgr::OnMsgUpdateParam(in
         break;
     case THROTTLING_HOLD_TIME:
         mThrottleHoldTime = value;
         break;
     case THROTTLING_MAX_TIME:
         mThrottleMaxTime = TimeDuration::FromMilliseconds(value);
         break;
     default:
-        NS_NOTREACHED("unexpected parameter name");
+        MOZ_ASSERT_UNREACHABLE("unexpected parameter name");
     }
 }
 
 // nsHttpConnectionMgr::nsConnectionEntry
 nsHttpConnectionMgr::nsConnectionEntry::~nsConnectionEntry()
 {
     LOG(("nsConnectionEntry::~nsConnectionEntry this=%p", this));
 
--- a/netwerk/socket/nsSOCKSIOLayer.cpp
+++ b/netwerk/socket/nsSOCKSIOLayer.cpp
@@ -332,17 +332,17 @@ public:
   }
 
   Buffer<Size - sizeof(IPv6Addr)> WriteNetAddr(const NetAddr* aAddr) {
       if (aAddr->raw.family == AF_INET) {
           return Write(aAddr->inet.ip);
       } else if (aAddr->raw.family == AF_INET6) {
           return Write(aAddr->inet6.ip.u8);
       }
-      NS_NOTREACHED("Unknown address family");
+      MOZ_ASSERT_UNREACHABLE("Unknown address family");
       return *this;
   }
 
   template <size_t MaxLength>
   Buffer<Size - MaxLength> WriteString(const nsACString& aStr) {
       if (aStr.Length() > MaxLength) {
           return Buffer<Size - MaxLength>(nullptr);
       }
--- a/netwerk/socket/nsUDPSocketProvider.cpp
+++ b/netwerk/socket/nsUDPSocketProvider.cpp
@@ -38,11 +38,11 @@ nsUDPSocketProvider::AddToSocket(int32_t
                                  nsIProxyInfo *aProxy,
                                  const OriginAttributes &originAttributes,
                                  uint32_t aFlags,
                                  uint32_t aTlsFlags,
                                  struct PRFileDesc * aFileDesc,
                                  nsISupports **aSecurityInfo)
 {
     // does not make sense to strap a UDP socket onto an existing socket
-    NS_NOTREACHED("Cannot layer UDP socket on an existing socket");
+    MOZ_ASSERT_UNREACHABLE("Cannot layer UDP socket on an existing socket");
     return NS_ERROR_UNEXPECTED;
 }
--- a/parser/html/nsHtml5AtomTable.cpp
+++ b/parser/html/nsHtml5AtomTable.cpp
@@ -10,17 +10,17 @@ nsHtml5AtomEntry::nsHtml5AtomEntry(KeyTy
   , mAtom(new nsDynamicAtom(*aStr))
 {
 }
 
 nsHtml5AtomEntry::nsHtml5AtomEntry(const nsHtml5AtomEntry& aOther)
   : nsStringHashKey(aOther)
   , mAtom(nullptr)
 {
-  NS_NOTREACHED("nsHtml5AtomTable is broken and tried to copy an entry");
+  MOZ_ASSERT_UNREACHABLE("nsHtml5AtomTable is broken and tried to copy an entry");
 }
 
 nsHtml5AtomEntry::~nsHtml5AtomEntry()
 {
   delete mAtom;
 }
 
 nsHtml5AtomTable::nsHtml5AtomTable()
--- a/parser/html/nsHtml5Highlighter.cpp
+++ b/parser/html/nsHtml5Highlighter.cpp
@@ -228,17 +228,17 @@ nsHtml5Highlighter::Transition(int32_t a
           EndSpanOrA();
           break;
         case nsHtml5Tokenizer::CONSUME_CHARACTER_REFERENCE:
           StartSpan();
           StartSpan(); // for ampersand itself
           mAmpersand = CurrentNode();
           break;
         default:
-          NS_NOTREACHED("Impossible transition.");
+          MOZ_ASSERT_UNREACHABLE("Impossible transition.");
           break;
       }
       break;
     case nsHtml5Tokenizer::AFTER_ATTRIBUTE_VALUE_QUOTED:
       switch (aState) {
         case nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME:
           break;
         case nsHtml5Tokenizer::SELF_CLOSING_START_TAG:
--- a/parser/html/nsHtml5Parser.cpp
+++ b/parser/html/nsHtml5Parser.cpp
@@ -129,17 +129,17 @@ nsIStreamListener*
 nsHtml5Parser::GetStreamListener()
 {
   return mStreamListener;
 }
 
 NS_IMETHODIMP
 nsHtml5Parser::ContinueInterruptedParsing()
 {
-  NS_NOTREACHED("Don't call. For interface compat only.");
+  MOZ_ASSERT_UNREACHABLE("Don't call. For interface compat only.");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP_(void)
 nsHtml5Parser::BlockParser()
 {
   mBlocked++;
 }
@@ -539,31 +539,31 @@ nsHtml5Parser::ParseFragment(const nsASt
                              nsTArray<nsString>& aTagStack)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsHtml5Parser::BuildModel()
 {
-  NS_NOTREACHED("Don't call this!");
+  MOZ_ASSERT_UNREACHABLE("Don't call this!");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsHtml5Parser::CancelParsingEvents()
 {
-  NS_NOTREACHED("Don't call this!");
+  MOZ_ASSERT_UNREACHABLE("Don't call this!");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 void
 nsHtml5Parser::Reset()
 {
-  NS_NOTREACHED("Don't call this!");
+  MOZ_ASSERT_UNREACHABLE("Don't call this!");
 }
 
 bool
 nsHtml5Parser::IsInsertionPointDefined()
 {
   return !mExecutor->IsFlushing() && !mInsertionPointPermanentlyUndefined &&
          (!GetStreamParser() || mInsertionPointPushLevel);
 }
--- a/parser/html/nsHtml5SpeculativeLoad.cpp
+++ b/parser/html/nsHtml5SpeculativeLoad.cpp
@@ -139,12 +139,12 @@ nsHtml5SpeculativeLoad::Perform(nsHtml5T
         (nsHtml5DocumentMode)
           mTypeOrCharsetSourceOrDocumentModeOrMetaCSPOrSizesOrIntegrity.First();
       aExecutor->SetDocumentMode(mode);
     } break;
     case eSpeculativeLoadPreconnect:
       aExecutor->Preconnect(mUrlOrSizes, mCrossOriginOrMedia);
       break;
     default:
-      NS_NOTREACHED("Bogus speculative load.");
+      MOZ_ASSERT_UNREACHABLE("Bogus speculative load.");
       break;
   }
 }
--- a/parser/html/nsHtml5StreamParser.cpp
+++ b/parser/html/nsHtml5StreamParser.cpp
@@ -1479,17 +1479,17 @@ nsHtml5StreamParser::ParseAvailableData(
                 if (mMode == VIEW_SOURCE_HTML || mMode == VIEW_SOURCE_XML) {
                   mTokenizer->EndViewSource();
                 }
               }
             }
             FlushTreeOpsAndDisarmTimer();
             return; // no more data and not expecting more
           default:
-            NS_NOTREACHED("It should be impossible to reach this.");
+            MOZ_ASSERT_UNREACHABLE("It should be impossible to reach this.");
             return;
         }
       }
       mFirstBuffer = mFirstBuffer->next;
       continue;
     }
 
     // now we have a non-empty buffer
@@ -1567,17 +1567,17 @@ nsHtml5StreamParser::ContinueAfterScript
   }
 #ifdef DEBUG
   mExecutor->AssertStageEmpty();
 #endif
   bool speculationFailed = false;
   {
     mozilla::MutexAutoLock speculationAutoLock(mSpeculationMutex);
     if (mSpeculations.IsEmpty()) {
-      NS_NOTREACHED("ContinueAfterScripts called without speculations.");
+      MOZ_ASSERT_UNREACHABLE("ContinueAfterScripts called without speculations.");
       return;
     }
     nsHtml5Speculation* speculation = mSpeculations.ElementAt(0);
     if (aLastWasCR || !aTokenizer->isInDataState() ||
         !aTreeBuilder->snapshotMatches(speculation->GetSnapshot())) {
       speculationFailed = true;
       // We've got a failed speculation :-(
       MaybeDisableFutureSpeculation();
--- a/parser/html/nsHtml5TreeOpExecutor.cpp
+++ b/parser/html/nsHtml5TreeOpExecutor.cpp
@@ -132,17 +132,17 @@ nsHtml5TreeOpExecutor::~nsHtml5TreeOpExe
   }
   NS_ASSERTION(mOpQueue.IsEmpty(), "Somehow there's stuff in the op queue.");
 }
 
 // nsIContentSink
 NS_IMETHODIMP
 nsHtml5TreeOpExecutor::WillParse()
 {
-  NS_NOTREACHED("No one should call this");
+  MOZ_ASSERT_UNREACHABLE("No one should call this");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsHtml5TreeOpExecutor::WillBuildModel(nsDTDMode aDTDMode)
 {
   mDocument->AddObserver(this);
   WillBuildModelImpl();
@@ -217,24 +217,24 @@ nsHtml5TreeOpExecutor::DidBuildModel(boo
   }
 #endif
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHtml5TreeOpExecutor::WillInterrupt()
 {
-  NS_NOTREACHED("Don't call. For interface compat only.");
+  MOZ_ASSERT_UNREACHABLE("Don't call. For interface compat only.");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsHtml5TreeOpExecutor::WillResume()
 {
-  NS_NOTREACHED("Don't call. For interface compat only.");
+  MOZ_ASSERT_UNREACHABLE("Don't call. For interface compat only.");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsHtml5TreeOpExecutor::SetParser(nsParserBase* aParser)
 {
   mParser = aParser;
   return NS_OK;
--- a/parser/html/nsHtml5TreeOpExecutor.h
+++ b/parser/html/nsHtml5TreeOpExecutor.h
@@ -137,17 +137,17 @@ public:
    */
   virtual void FlushPendingNotifications(mozilla::FlushType aType) override;
 
   /**
    * Don't call. For interface compat only.
    */
   virtual void SetDocumentCharset(NotNull<const Encoding*> aEncoding) override
   {
-    NS_NOTREACHED("No one should call this.");
+    MOZ_ASSERT_UNREACHABLE("No one should call this.");
   }
 
   /**
    * Returns the document.
    */
   virtual nsISupports* GetTarget() override;
 
   virtual void ContinueInterruptedParsingAsync() override;
--- a/storage/FileSystemModule.cpp
+++ b/storage/FileSystemModule.cpp
@@ -247,17 +247,17 @@ int Column(sqlite3_vtab_cursor* aCursor,
     case 1: {
       const nsString& path = cursor->DirectoryPath();
       sqlite3_result_text16(aContext, path.get(),
                             path.Length() * sizeof(char16_t),
                             SQLITE_TRANSIENT);
       break;
     }
     default:
-      NS_NOTREACHED("Unsupported column!");
+      MOZ_ASSERT_UNREACHABLE("Unsupported column!");
   }
 
   return SQLITE_OK;
 }
 
 int RowId(sqlite3_vtab_cursor* aCursor, sqlite3_int64* aRowid)
 {
   VirtualTableCursor* cursor = reinterpret_cast<VirtualTableCursor*>(aCursor);
--- a/storage/VacuumManager.cpp
+++ b/storage/VacuumManager.cpp
@@ -256,17 +256,17 @@ Vacuumer::HandleError(mozIStorageError *
             result, message.get(), mDBFilename.get()));
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 Vacuumer::HandleResult(mozIStorageResultSet *aResultSet)
 {
-  NS_NOTREACHED("Got a resultset from a vacuum?");
+  MOZ_ASSERT_UNREACHABLE("Got a resultset from a vacuum?");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 Vacuumer::HandleCompletion(uint16_t aReason)
 {
   if (aReason == REASON_FINISHED) {
     // Update last vacuum time.
--- a/toolkit/components/find/nsFind.cpp
+++ b/toolkit/components/find/nsFind.cpp
@@ -85,34 +85,34 @@ public:
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(nsFindContentIterator)
 
   // nsIContentIterator
   virtual nsresult Init(nsINode* aRoot) override
   {
-    NS_NOTREACHED("internal error");
+    MOZ_ASSERT_UNREACHABLE("internal error");
     return NS_ERROR_NOT_IMPLEMENTED;
   }
   virtual nsresult Init(nsRange* aRange) override
   {
-    NS_NOTREACHED("internal error");
+    MOZ_ASSERT_UNREACHABLE("internal error");
     return NS_ERROR_NOT_IMPLEMENTED;
   }
   virtual nsresult Init(nsINode* aStartContainer, uint32_t aStartOffset,
                         nsINode* aEndContainer, uint32_t aEndOffset) override
   {
-    NS_NOTREACHED("internal error");
+    MOZ_ASSERT_UNREACHABLE("internal error");
     return NS_ERROR_NOT_IMPLEMENTED;
   }
   virtual nsresult Init(const RawRangeBoundary& aStart,
                         const RawRangeBoundary& aEnd) override
   {
-    NS_NOTREACHED("internal error");
+    MOZ_ASSERT_UNREACHABLE("internal error");
     return NS_ERROR_NOT_IMPLEMENTED;
   }
   // Not a range because one of the endpoints may be anonymous.
   nsresult Init(nsINode* aStartNode, int32_t aStartOffset,
                 nsINode* aEndNode, int32_t aEndOffset);
   virtual void First() override;
   virtual void Last() override;
   virtual void Next() override;
--- a/toolkit/components/places/History.h
+++ b/toolkit/components/places/History.h
@@ -211,17 +211,17 @@ private:
   public:
     explicit KeyClass(const nsIURI* aURI)
     : nsURIHashKey(aURI)
     {
     }
     KeyClass(const KeyClass& aOther)
     : nsURIHashKey(aOther)
     {
-      NS_NOTREACHED("Do not call me!");
+      MOZ_ASSERT_UNREACHABLE("Do not call me!");
     }
     size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
     {
       return array.ShallowSizeOfExcludingThis(aMallocSizeOf);
     }
     ObserverArray array;
     bool mVisited = false;
   };
@@ -235,17 +235,17 @@ private:
   class RecentURIKey : public nsURIHashKey
   {
   public:
     explicit RecentURIKey(const nsIURI* aURI) : nsURIHashKey(aURI)
     {
     }
     RecentURIKey(const RecentURIKey& aOther) : nsURIHashKey(aOther)
     {
-      NS_NOTREACHED("Do not call me!");
+      MOZ_ASSERT_UNREACHABLE("Do not call me!");
     }
     MOZ_INIT_OUTSIDE_CTOR PRTime time;
   };
   nsTHashtable<RecentURIKey> mRecentlyVisitedURIs;
   /**
    * Whether aURI has been visited "recently".
    * See RECENTLY_VISITED_URIS_MAX_AGE.
    */
--- a/toolkit/components/places/nsFaviconService.h
+++ b/toolkit/components/places/nsFaviconService.h
@@ -37,17 +37,17 @@ class UnassociatedIconHashKey : public n
 public:
   explicit UnassociatedIconHashKey(const nsIURI* aURI)
   : nsURIHashKey(aURI)
   {
   }
   UnassociatedIconHashKey(const UnassociatedIconHashKey& aOther)
   : nsURIHashKey(aOther)
   {
-    NS_NOTREACHED("Do not call me!");
+    MOZ_ASSERT_UNREACHABLE("Do not call me!");
   }
   mozilla::places::IconData iconData;
   PRTime created;
 };
 
 class nsFaviconService final : public nsIFaviconService
                              , public nsITimerCallback
                              , public nsINamed
--- a/toolkit/components/places/nsNavHistory.cpp
+++ b/toolkit/components/places/nsNavHistory.cpp
@@ -783,17 +783,17 @@ nsNavHistory::NormalizeTime(uint32_t aRe
       return aOffset;
     case nsINavHistoryQuery::TIME_RELATIVE_TODAY:
       ref = NormalizeTimeRelativeToday(PR_Now());
       break;
     case nsINavHistoryQuery::TIME_RELATIVE_NOW:
       ref = PR_Now();
       break;
     default:
-      NS_NOTREACHED("Invalid relative time");
+      MOZ_ASSERT_UNREACHABLE("Invalid relative time");
       return 0;
   }
   return ref + aOffset;
 }
 
 // nsNavHistory::DomainNameFromURI
 //
 //    This does the www.mozilla.org -> mozilla.org and
@@ -1288,17 +1288,17 @@ PlacesSQLQueryBuilder::Select()
       break;
 
     case nsINavHistoryQueryOptions::RESULTS_AS_LEFT_PANE_QUERY:
       rv = SelectAsLeftPane();
       NS_ENSURE_SUCCESS(rv, rv);
       break;
 
     default:
-      NS_NOTREACHED("Invalid result type");
+      MOZ_ASSERT_UNREACHABLE("Invalid result type");
   }
   return NS_OK;
 }
 
 nsresult
 PlacesSQLQueryBuilder::SelectAsURI()
 {
   nsNavHistory *history = nsNavHistory::GetHistoryService();
@@ -1892,17 +1892,17 @@ PlacesSQLQueryBuilder::OrderBy()
       break; // Sort later in nsNavHistoryQueryResultNode::FillChildren()
     case nsINavHistoryQueryOptions::SORT_BY_FRECENCY_ASCENDING:
         OrderByColumnIndexAsc(nsNavHistory::kGetInfoIndex_Frecency);
       break;
     case nsINavHistoryQueryOptions::SORT_BY_FRECENCY_DESCENDING:
         OrderByColumnIndexDesc(nsNavHistory::kGetInfoIndex_Frecency);
       break;
     default:
-      NS_NOTREACHED("Invalid sorting mode");
+      MOZ_ASSERT_UNREACHABLE("Invalid sorting mode");
   }
   return NS_OK;
 }
 
 void PlacesSQLQueryBuilder::OrderByColumnIndexAsc(int32_t aIndex)
 {
   mQueryString += nsPrintfCString(" ORDER BY %d ASC", aIndex+1);
 }
@@ -3466,17 +3466,17 @@ nsNavHistory::VisitIdToResultNode(int64_
   nsresult rv = statement->BindInt64ByName(NS_LITERAL_CSTRING("visit_id"),
                                            visitId);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool hasMore = false;
   rv = statement->ExecuteStep(&hasMore);
   NS_ENSURE_SUCCESS(rv, rv);
   if (! hasMore) {
-    NS_NOTREACHED("Trying to get a result node for an invalid visit");
+    MOZ_ASSERT_UNREACHABLE("Trying to get a result node for an invalid visit");
     return NS_ERROR_INVALID_ARG;
   }
 
   nsCOMPtr<mozIStorageValueArray> row = do_QueryInterface(statement, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return RowToResult(row, aOptions, aResult);
 }
@@ -3505,17 +3505,17 @@ nsNavHistory::BookmarkIdToResultNode(int
   nsresult rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("item_id"),
                                       aBookmarkId);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool hasMore = false;
   rv = stmt->ExecuteStep(&hasMore);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!hasMore) {
-    NS_NOTREACHED("Trying to get a result node for an invalid bookmark identifier");
+    MOZ_ASSERT_UNREACHABLE("Trying to get a result node for an invalid bookmark identifier");
     return NS_ERROR_INVALID_ARG;
   }
 
   nsCOMPtr<mozIStorageValueArray> row = do_QueryInterface(stmt, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return RowToResult(row, aOptions, aResult);
 }
@@ -3544,17 +3544,17 @@ nsNavHistory::URIToResultNode(nsIURI* aU
 
   nsresult rv = URIBinder::Bind(stmt, NS_LITERAL_CSTRING("page_url"), aURI);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool hasMore = false;
   rv = stmt->ExecuteStep(&hasMore);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!hasMore) {
-    NS_NOTREACHED("Trying to get a result node for an invalid url");
+    MOZ_ASSERT_UNREACHABLE("Trying to get a result node for an invalid url");
     return NS_ERROR_INVALID_ARG;
   }
 
   nsCOMPtr<mozIStorageValueArray> row = do_QueryInterface(stmt, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return RowToResult(row, aOptions, aResult);
 }
--- a/toolkit/components/places/nsNavHistory.h
+++ b/toolkit/components/places/nsNavHistory.h
@@ -584,17 +584,17 @@ protected:
   public:
     explicit VisitHashKey(const nsIURI* aURI)
     : nsURIHashKey(aURI)
     {
     }
     VisitHashKey(const VisitHashKey& aOther)
     : nsURIHashKey(aOther)
     {
-      NS_NOTREACHED("Do not call me!");
+      MOZ_ASSERT_UNREACHABLE("Do not call me!");
     }
     PRTime visitTime;
   };
 
   nsTHashtable<VisitHashKey> mEmbedVisits;
 
   bool CheckIsRecentEvent(RecentEventHash* hashTable,
                             const nsACString& url);
--- a/toolkit/components/places/nsNavHistoryResult.cpp
+++ b/toolkit/components/places/nsNavHistoryResult.cpp
@@ -557,17 +557,17 @@ nsNavHistoryContainerResultNode::OnRemov
 }
 
 
 bool
 nsNavHistoryContainerResultNode::AreChildrenVisible()
 {
   nsNavHistoryResult* result = GetResult();
   if (!result) {
-    NS_NOTREACHED("Invalid result");
+    MOZ_ASSERT_UNREACHABLE("Invalid result");
     return false;
   }
 
   if (!mExpanded)
     return false;
 
   // Now check if any ancestor is closed.
   nsNavHistoryContainerResultNode* ancestor = mParent;
@@ -947,17 +947,17 @@ nsNavHistoryContainerResultNode::GetSort
       return &SortComparison_TagsLess;
     case nsINavHistoryQueryOptions::SORT_BY_TAGS_DESCENDING:
       return &SortComparison_TagsGreater;
     case nsINavHistoryQueryOptions::SORT_BY_FRECENCY_ASCENDING:
       return &SortComparison_FrecencyLess;
     case nsINavHistoryQueryOptions::SORT_BY_FRECENCY_DESCENDING:
       return &SortComparison_FrecencyGreater;
     default:
-      NS_NOTREACHED("Bad sorting type");
+      MOZ_ASSERT_UNREACHABLE("Bad sorting type");
       return nullptr;
   }
 }
 
 
 /**
  * This is used by Result::SetSortingMode and QueryResultNode::FillChildren to
  * sort the child list.
@@ -3443,23 +3443,23 @@ nsNavHistoryFolderResultNode::OnItemAdde
       return NS_OK;
   }
 
   bool excludeItems = mOptions->ExcludeItems();
 
   // here, try to do something reasonable if the bookmark service gives us
   // a bogus index.
   if (aIndex < 0) {
-    NS_NOTREACHED("Invalid index for item adding: <0");
+    MOZ_ASSERT_UNREACHABLE("Invalid index for item adding: <0");
     aIndex = 0;
   }
   else if (aIndex > mChildren.Count()) {
     if (!excludeItems) {
       // Something wrong happened while updating indexes.
-      NS_NOTREACHED("Invalid index for item adding: greater than count");
+      MOZ_ASSERT_UNREACHABLE("Invalid index for item adding: greater than count");
     }
     aIndex = mChildren.Count();
   }
 
   nsresult rv;
 
   // Check for query URIs, which are bookmarks, but treated as containers
   // in results and views.
@@ -3675,17 +3675,17 @@ nsNavHistoryResultNode::OnItemChanged(in
                               NodeLastModifiedChanged(this, aLastModified));
     }
   }
   else if (aProperty.EqualsLiteral("keyword")) {
     if (shouldNotify)
       NOTIFY_RESULT_OBSERVERS(result, NodeKeywordChanged(this, aNewValue));
   }
   else
-    NS_NOTREACHED("Unknown bookmark property changing.");
+    MOZ_ASSERT_UNREACHABLE("Unknown bookmark property changing.");
 
   if (!mParent)
     return NS_OK;
 
   // DO NOT OPTIMIZE THIS TO CHECK aProperty
   // The sorting methods fall back to each other so we need to re-sort the
   // result even if it's not set to sort by the given property.
   int32_t ourIndex = mParent->FindChild(this);
@@ -4019,17 +4019,17 @@ nsNavHistoryResult::AddHistoryObserver(n
 
 
 void
 nsNavHistoryResult::AddAllBookmarksObserver(nsNavHistoryQueryResultNode* aNode)
 {
   if (!mIsAllBookmarksObserver && !mIsBookmarkFolderObserver) {
     nsNavBookmarks* bookmarks = nsNavBookmarks::GetBookmarksService();
     if (!bookmarks) {
-      NS_NOTREACHED("Can't create bookmark service");
+      MOZ_ASSERT_UNREACHABLE("Can't create bookmark service");
       return;
     }
     bookmarks->AddObserver(this, true);
     mIsAllBookmarksObserver = true;
   }
   // Don't add duplicate observers.  In some case we don't unregister when
   // children are cleared (see ClearChildren) and the next FillChildren call
   // will try to add the observer again.
@@ -4059,17 +4059,17 @@ nsNavHistoryResult::AddMobilePrefsObserv
 
 void
 nsNavHistoryResult::AddBookmarkFolderObserver(nsNavHistoryFolderResultNode* aNode,
                                               int64_t aFolder)
 {
   if (!mIsBookmarkFolderObserver && !mIsAllBookmarksObserver) {
     nsNavBookmarks* bookmarks = nsNavBookmarks::GetBookmarksService();
     if (!bookmarks) {
-      NS_NOTREACHED("Can't create bookmark service");
+      MOZ_ASSERT_UNREACHABLE("Can't create bookmark service");
       return;
     }
     bookmarks->AddObserver(this, true);
     mIsBookmarkFolderObserver = true;
   }
   // Don't add duplicate observers.  In some case we don't unregister when
   // children are cleared (see ClearChildren) and the next FillChildren call
   // will try to add the observer again.
@@ -4214,17 +4214,17 @@ nsNavHistoryResult::SetSuppressNotificat
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsNavHistoryResult::GetRoot(nsINavHistoryContainerResultNode** aRoot)
 {
   if (!mRootNode) {
-    NS_NOTREACHED("Root is null");
+    MOZ_ASSERT_UNREACHABLE("Root is null");
     *aRoot = nullptr;
     return NS_ERROR_FAILURE;
   }
   RefPtr<nsNavHistoryContainerResultNode> node(mRootNode);
   node.forget(aRoot);
   return NS_OK;
 }
 
--- a/toolkit/components/printingui/ipc/nsPrintingProxy.cpp
+++ b/toolkit/components/printingui/ipc/nsPrintingProxy.cpp
@@ -206,17 +206,17 @@ nsPrintingProxy::SavePrintSettings(nsIPr
   return rv;
 }
 
 PPrintProgressDialogChild*
 nsPrintingProxy::AllocPPrintProgressDialogChild()
 {
   // The parent process will never initiate the PPrintProgressDialog
   // protocol connection, so no need to provide an allocator here.
-  NS_NOTREACHED("Allocator for PPrintProgressDialogChild should not be "
+  MOZ_ASSERT_UNREACHABLE("Allocator for PPrintProgressDialogChild should not be "
                 "called on nsPrintingProxy.");
   return nullptr;
 }
 
 bool
 nsPrintingProxy::DeallocPPrintProgressDialogChild(PPrintProgressDialogChild* aActor)
 {
   // The PrintProgressDialogChild implements refcounting, and
@@ -224,17 +224,17 @@ nsPrintingProxy::DeallocPPrintProgressDi
   return true;
 }
 
 PPrintSettingsDialogChild*
 nsPrintingProxy::AllocPPrintSettingsDialogChild()
 {
   // The parent process will never initiate the PPrintSettingsDialog
   // protocol connection, so no need to provide an allocator here.
-  NS_NOTREACHED("Allocator for PPrintSettingsDialogChild should not be "
+  MOZ_ASSERT_UNREACHABLE("Allocator for PPrintSettingsDialogChild should not be "
                 "called on nsPrintingProxy.");
   return nullptr;
 }
 
 bool
 nsPrintingProxy::DeallocPPrintSettingsDialogChild(PPrintSettingsDialogChild* aActor)
 {
   // The PrintSettingsDialogChild implements refcounting, and
--- a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp
+++ b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp
@@ -73,56 +73,56 @@ nsBrowserStatusFilter::RemoveProgressLis
     if (aListener == mListener)
         mListener = nullptr;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsBrowserStatusFilter::GetDOMWindow(mozIDOMWindowProxy **aResult)
 {
-    NS_NOTREACHED("nsBrowserStatusFilter::GetDOMWindow");
+    MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetDOMWindow");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsBrowserStatusFilter::GetDOMWindowID(uint64_t *aResult)
 {
     *aResult = 0;
-    NS_NOTREACHED("nsBrowserStatusFilter::GetDOMWindowID");
+    MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetDOMWindowID");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsBrowserStatusFilter::GetInnerDOMWindowID(uint64_t *aResult)
 {
     *aResult = 0;
-    NS_NOTREACHED("nsBrowserStatusFilter::GetInnerDOMWindowID");
+    MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetInnerDOMWindowID");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsBrowserStatusFilter::GetIsTopLevel(bool *aIsTopLevel)
 {
     *aIsTopLevel = false;
-    NS_NOTREACHED("nsBrowserStatusFilter::GetIsTopLevel");
+    MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetIsTopLevel");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsBrowserStatusFilter::GetIsLoadingDocument(bool *aIsLoadingDocument)
 {
-    NS_NOTREACHED("nsBrowserStatusFilter::GetIsLoadingDocument");
+    MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetIsLoadingDocument");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsBrowserStatusFilter::GetLoadType(uint32_t *aLoadType)
 {
     *aLoadType = 0;
-    NS_NOTREACHED("nsBrowserStatusFilter::GetLoadType");
+    MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetLoadType");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsBrowserStatusFilter::GetTarget(nsIEventTarget** aTarget)
 {
     nsCOMPtr<nsIEventTarget> target = mTarget;
     target.forget(aTarget);
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -897,17 +897,17 @@ nsTypeAheadFind::RangeStartsInsideLink(n
   *aIsStartingLink = true;
 
   // ------- Get nsIContent to test -------
   uint32_t startOffset = aRange->StartOffset();
 
   nsCOMPtr<nsIContent> startContent =
     do_QueryInterface(aRange->GetStartContainer());
   if (!startContent) {
-    NS_NOTREACHED("startContent should never be null");
+    MOZ_ASSERT_UNREACHABLE("startContent should never be null");
     return;
   }
   nsCOMPtr<nsIContent> origContent = startContent;
 
   if (startContent->IsElement()) {
     nsIContent *childContent = aRange->GetChildAtStartOffset();
     if (childContent) {
       startContent = childContent;
--- a/toolkit/components/url-classifier/nsUrlClassifierProxies.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierProxies.cpp
@@ -53,17 +53,17 @@ UrlClassifierDBServiceWorkerProxy::GetTa
   mTarget->GetTables(mCB);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 UrlClassifierDBServiceWorkerProxy::SetHashCompleter
   (const nsACString&, nsIUrlClassifierHashCompleter*)
 {
-  NS_NOTREACHED("This method should not be called!");
+  MOZ_ASSERT_UNREACHABLE("This method should not be called!");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 UrlClassifierDBServiceWorkerProxy::BeginUpdate
   (nsIUrlClassifierUpdateObserver* aUpdater,
    const nsACString& aTables)
 {
--- a/toolkit/profile/nsProfileLock.cpp
+++ b/toolkit/profile/nsProfileLock.cpp
@@ -150,17 +150,17 @@ void nsProfileLock::FatalSignalHandler(i
         break;
       case SIGSEGV:
         oldact = &SIGSEGV_oldact;
         break;
       case SIGTERM:
         oldact = &SIGTERM_oldact;
         break;
       default:
-        NS_NOTREACHED("bad signo");
+        MOZ_ASSERT_UNREACHABLE("bad signo");
         break;
     }
 
     if (oldact) {
         if (oldact->sa_handler == SIG_DFL) {
             // Make sure the default sig handler is executed
             // We need it to get Mozilla to dump core.
             sigaction(signo,oldact, nullptr);
--- a/uriloader/base/nsURILoader.cpp
+++ b/uriloader/base/nsURILoader.cpp
@@ -984,9 +984,9 @@ NS_IMETHODIMP nsURILoader::Stop(nsISuppo
 
   NS_ENSURE_ARG_POINTER(aLoadCookie);
 
   docLoader = do_GetInterface(aLoadCookie, &rv);
   if (docLoader) {
     rv = docLoader->Stop();
   }
   return rv;
-}
\ No newline at end of file
+}
--- a/uriloader/exthandler/mac/nsMIMEInfoMac.h
+++ b/uriloader/exthandler/mac/nsMIMEInfoMac.h
@@ -14,17 +14,17 @@ class nsMIMEInfoMac : public nsMIMEInfoI
     nsMIMEInfoMac(const nsACString& aType, HandlerClass aClass) :
       nsMIMEInfoImpl(aType, aClass) {}
 
     NS_IMETHOD LaunchWithFile(nsIFile* aFile) override;
   protected:
     virtual MOZ_MUST_USE nsresult LoadUriInternal(nsIURI *aURI) override;
 #ifdef DEBUG
     virtual MOZ_MUST_USE nsresult LaunchDefaultWithFile(nsIFile* aFile) override {
-      NS_NOTREACHED("do not call this method, use LaunchWithFile");
+      MOZ_ASSERT_UNREACHABLE("do not call this method, use LaunchWithFile");
       return NS_ERROR_UNEXPECTED;
     }
 #endif
     static MOZ_MUST_USE nsresult OpenApplicationWithURI(nsIFile *aApplication,
                                                         const nsCString& aURI);
 
     NS_IMETHOD GetDefaultDescription(nsAString& aDefaultDescription) override;
 };
--- a/uriloader/exthandler/nsExternalProtocolHandler.cpp
+++ b/uriloader/exthandler/nsExternalProtocolHandler.cpp
@@ -311,17 +311,17 @@ NS_IMETHODIMP nsExtProtocolChannel::GetC
 {
   *aContentLength = -1;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsExtProtocolChannel::SetContentLength(int64_t aContentLength)
 {
-  NS_NOTREACHED("SetContentLength");
+  MOZ_ASSERT_UNREACHABLE("SetContentLength");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsExtProtocolChannel::GetOwner(nsISupports * *aPrincipal)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
@@ -366,23 +366,23 @@ NS_IMETHODIMP nsExtProtocolChannel::GetS
 NS_IMETHODIMP nsExtProtocolChannel::Cancel(nsresult status)
 {
   mStatus = status;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsExtProtocolChannel::Suspend()
 {
-  NS_NOTREACHED("Suspend");
+  MOZ_ASSERT_UNREACHABLE("Suspend");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsExtProtocolChannel::Resume()
 {
-  NS_NOTREACHED("Resume");
+  MOZ_ASSERT_UNREACHABLE("Resume");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 ///////////////////////////////////////////////////////////////////////
 // From nsIChildChannel
 //////////////////////////////////////////////////////////////////////
 
 NS_IMETHODIMP nsExtProtocolChannel::ConnectParent(uint32_t registrarId)
--- a/uriloader/exthandler/uikit/nsMIMEInfoUIKit.h
+++ b/uriloader/exthandler/uikit/nsMIMEInfoUIKit.h
@@ -21,17 +21,17 @@ public:
 
   NS_IMETHOD LaunchWithFile(nsIFile* aFile) override;
 
 protected:
   virtual nsresult LoadUriInternal(nsIURI* aURI);
 #ifdef DEBUG
   virtual nsresult LaunchDefaultWithFile(nsIFile* aFile)
   {
-    NS_NOTREACHED("do not call this method, use LaunchWithFile");
+    MOZ_ASSERT_UNREACHABLE("do not call this method, use LaunchWithFile");
     return NS_ERROR_UNEXPECTED;
   }
 #endif
   static nsresult OpenApplicationWithURI(nsIFile* aApplication,
                                          const nsCString& aURI);
 };
 
 #endif
--- a/uriloader/prefetch/OfflineCacheUpdateChild.cpp
+++ b/uriloader/prefetch/OfflineCacheUpdateChild.cpp
@@ -221,28 +221,28 @@ OfflineCacheUpdateChild::Init(nsIURI *aM
 }
 
 NS_IMETHODIMP
 OfflineCacheUpdateChild::InitPartial(nsIURI *aManifestURI,
                                   const nsACString& clientID,
                                   nsIURI *aDocumentURI,
                                   nsIPrincipal *aLoadingPrincipal)
 {
-    NS_NOTREACHED("Not expected to do partial offline cache updates"
+    MOZ_ASSERT_UNREACHABLE("Not expected to do partial offline cache updates"
                   " on the child process");
     // For now leaving this method, we may discover we need it.
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 OfflineCacheUpdateChild::InitForUpdateCheck(nsIURI *aManifestURI,
                                             nsIPrincipal* aLoadingPrincipal,
                                             nsIObserver *aObserver)
 {
-    NS_NOTREACHED("Not expected to do only update checks"
+    MOZ_ASSERT_UNREACHABLE("Not expected to do only update checks"
                   " from the child process");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 OfflineCacheUpdateChild::GetUpdateDomain(nsACString &aUpdateDomain)
 {
     NS_ENSURE_TRUE(mState >= STATE_INITIALIZED, NS_ERROR_NOT_INITIALIZED);
--- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
@@ -133,17 +133,17 @@ NS_IMPL_ISUPPORTS(nsOfflineCachePendingU
 NS_IMETHODIMP
 nsOfflineCachePendingUpdate::OnProgressChange(nsIWebProgress *aProgress,
                                               nsIRequest *aRequest,
                                               int32_t curSelfProgress,
                                               int32_t maxSelfProgress,
                                               int32_t curTotalProgress,
                                               int32_t maxTotalProgress)
 {
-    NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+    MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsOfflineCachePendingUpdate::OnStateChange(nsIWebProgress* aWebProgress,
                                            nsIRequest *aRequest,
                                            uint32_t progressStateFlags,
                                            nsresult aStatus)
@@ -202,36 +202,36 @@ nsOfflineCachePendingUpdate::OnStateChan
 }
 
 NS_IMETHODIMP
 nsOfflineCachePendingUpdate::OnLocationChange(nsIWebProgress* aWebProgress,
                                               nsIRequest* aRequest,
                                               nsIURI *location,
                                               uint32_t aFlags)
 {
-    NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+    MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsOfflineCachePendingUpdate::OnStatusChange(nsIWebProgress* aWebProgress,
                                             nsIRequest* aRequest,
                                             nsresult aStatus,
                                             const char16_t* aMessage)
 {
-    NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+    MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsOfflineCachePendingUpdate::OnSecurityChange(nsIWebProgress *aWebProgress,
                                               nsIRequest *aRequest,
                                               uint32_t state)
 {
-    NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+    MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsOfflineCacheUpdateService::nsISupports
 //-----------------------------------------------------------------------------
 
 NS_IMPL_ISUPPORTS(nsOfflineCacheUpdateService,
--- a/uriloader/prefetch/nsPrefetchService.cpp
+++ b/uriloader/prefetch/nsPrefetchService.cpp
@@ -982,17 +982,17 @@ nsPrefetchService::HasMoreElements(bool 
 NS_IMETHODIMP
 nsPrefetchService::OnProgressChange(nsIWebProgress *aProgress,
                                     nsIRequest *aRequest, 
                                     int32_t curSelfProgress, 
                                     int32_t maxSelfProgress, 
                                     int32_t curTotalProgress, 
                                     int32_t maxTotalProgress)
 {
-    NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+    MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
     return NS_OK;
 }
 
 NS_IMETHODIMP 
 nsPrefetchService::OnStateChange(nsIWebProgress* aWebProgress, 
                                  nsIRequest *aRequest, 
                                  uint32_t progressStateFlags, 
                                  nsresult aStatus)
@@ -1009,36 +1009,36 @@ nsPrefetchService::OnStateChange(nsIWebP
 
 
 NS_IMETHODIMP
 nsPrefetchService::OnLocationChange(nsIWebProgress* aWebProgress,
                                     nsIRequest* aRequest,
                                     nsIURI *location,
                                     uint32_t aFlags)
 {
-    NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+    MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
     return NS_OK;
 }
 
 NS_IMETHODIMP 
 nsPrefetchService::OnStatusChange(nsIWebProgress* aWebProgress,
                                   nsIRequest* aRequest,
                                   nsresult aStatus,
                                   const char16_t* aMessage)
 {
-    NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+    MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
     return NS_OK;
 }
 
 NS_IMETHODIMP 
 nsPrefetchService::OnSecurityChange(nsIWebProgress *aWebProgress, 
                                     nsIRequest *aRequest, 
                                     uint32_t state)
 {
-    NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+    MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsPrefetchService::nsIObserver
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -905,17 +905,17 @@ nsCocoaWindow::Show(bool bState)
         if (mIsAnimationSuppressed) {
           behavior = NSWindowAnimationBehaviorNone;
         } else {
           switch (mAnimationType) {
             case nsIWidget::eDocumentWindowAnimation:
               behavior = NSWindowAnimationBehaviorDocumentWindow;
               break;
             default:
-              NS_NOTREACHED("unexpected mAnimationType value");
+              MOZ_ASSERT_UNREACHABLE("unexpected mAnimationType value");
               // fall through
             case nsIWidget::eGenericWindowAnimation:
               behavior = NSWindowAnimationBehaviorDefault;
               break;
           }
         }
         [mWindow setAnimationBehavior:behavior];
         mWindowAnimationBehavior = behavior;
--- a/widget/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -929,17 +929,17 @@ static float VerticalAlignFactor(nsIFram
       return 0.5f;
 
     case NS_STYLE_VERTICAL_ALIGN_BASELINE:
     case NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM:
     case NS_STYLE_VERTICAL_ALIGN_BOTTOM:
       return 1.0f;
 
     default:
-      NS_NOTREACHED("invalid vertical-align");
+      MOZ_ASSERT_UNREACHABLE("invalid vertical-align");
       return 0.5f;
   }
 }
 
 static void
 ApplyControlParamsToNSCell(nsNativeThemeCocoa::ControlParams aControlParams, NSCell* aCell)
 {
   [aCell setEnabled:!aControlParams.disabled];
--- a/widget/gtk/nsDragService.cpp
+++ b/widget/gtk/nsDragService.cpp
@@ -180,17 +180,17 @@ nsDragService::Observe(nsISupports *aSub
     MOZ_LOG(sDragLm, LogLevel::Debug,
            ("nsDragService::Observe(\"quit-application\")"));
     if (mHiddenWidget) {
       gtk_widget_destroy(mHiddenWidget);
       mHiddenWidget = 0;
     }
     TargetResetData();
   } else {
-    NS_NOTREACHED("unexpected topic");
+    MOZ_ASSERT_UNREACHABLE("unexpected topic");
     return NS_ERROR_UNEXPECTED;
   }
 
   return NS_OK;
 }
 
 // Support for periodic drag events
 
--- a/widget/gtk/nsNativeThemeGTK.cpp
+++ b/widget/gtk/nsNativeThemeGTK.cpp
@@ -114,17 +114,17 @@ nsNativeThemeGTK::~nsNativeThemeGTK() {
 
 NS_IMETHODIMP
 nsNativeThemeGTK::Observe(nsISupports *aSubject, const char *aTopic,
                           const char16_t *aData)
 {
   if (!nsCRT::strcmp(aTopic, "xpcom-shutdown")) {
     moz_gtk_shutdown();
   } else {
-    NS_NOTREACHED("unexpected topic");
+    MOZ_ASSERT_UNREACHABLE("unexpected topic");
     return NS_ERROR_UNEXPECTED;
   }
 
   return NS_OK;
 }
 
 void
 nsNativeThemeGTK::RefreshWidgetWindow(nsIFrame* aFrame)
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -2268,17 +2268,17 @@ nsBaseWidget::NotifyLiveResizeStopped()
     mLiveResizeListeners.Clear();
   }
 }
 
 void
 nsBaseWidget::RegisterPluginWindowForRemoteUpdates()
 {
 #if !defined(XP_WIN) && !defined(MOZ_WIDGET_GTK)
-  NS_NOTREACHED("nsBaseWidget::RegisterPluginWindowForRemoteUpdates not implemented!");
+  MOZ_ASSERT_UNREACHABLE("nsBaseWidget::RegisterPluginWindowForRemoteUpdates not implemented!");
   return;
 #else
   MOZ_ASSERT(NS_IsMainThread());
   void* id = GetNativeData(NS_NATIVE_PLUGIN_ID);
   if (!id) {
     NS_WARNING("This is not a valid native widget!");
     return;
   }
@@ -2286,17 +2286,17 @@ nsBaseWidget::RegisterPluginWindowForRem
   sPluginWidgetList->Put(id, this);
 #endif
 }
 
 void
 nsBaseWidget::UnregisterPluginWindowForRemoteUpdates()
 {
 #if !defined(XP_WIN) && !defined(MOZ_WIDGET_GTK)
-  NS_NOTREACHED("nsBaseWidget::UnregisterPluginWindowForRemoteUpdates not implemented!");
+  MOZ_ASSERT_UNREACHABLE("nsBaseWidget::UnregisterPluginWindowForRemoteUpdates not implemented!");
   return;
 #else
   MOZ_ASSERT(NS_IsMainThread());
   void* id = GetNativeData(NS_NATIVE_PLUGIN_ID);
   if (!id) {
     NS_WARNING("This is not a valid native widget!");
     return;
   }
@@ -2317,32 +2317,32 @@ nsBaseWidget::AsyncEnableDragDrop(bool a
     kAsyncDragDropTimeout);
 }
 
 // static
 nsIWidget*
 nsIWidget::LookupRegisteredPluginWindow(uintptr_t aWindowID)
 {
 #if !defined(XP_WIN) && !defined(MOZ_WIDGET_GTK)
-  NS_NOTREACHED("nsBaseWidget::LookupRegisteredPluginWindow not implemented!");
+  MOZ_ASSERT_UNREACHABLE("nsBaseWidget::LookupRegisteredPluginWindow not implemented!");
   return nullptr;
 #else
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(sPluginWidgetList);
   return sPluginWidgetList->GetWeak((void*)aWindowID);
 #endif
 }
 
 // static
 void
 nsIWidget::UpdateRegisteredPluginWindowVisibility(uintptr_t aOwnerWidget,
                                                   nsTArray<uintptr_t>& aPluginIds)
 {
 #if !defined(XP_WIN) && !defined(MOZ_WIDGET_GTK)
-  NS_NOTREACHED("nsBaseWidget::UpdateRegisteredPluginWindowVisibility not implemented!");
+  MOZ_ASSERT_UNREACHABLE("nsBaseWidget::UpdateRegisteredPluginWindowVisibility not implemented!");
   return;
 #else
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(sPluginWidgetList);
 
   // Our visible list is associated with a compositor which is associated with
   // a specific top level window. We use the parent widget during iteration
   // to skip the plugin widgets owned by other top level windows.
--- a/widget/nsNativeTheme.cpp
+++ b/widget/nsNativeTheme.cpp
@@ -594,17 +594,17 @@ nsNativeTheme::IsVerticalMeter(nsIFrame*
       return false;
     case StyleOrient::Vertical:
       return true;
     case StyleOrient::Inline:
       return aFrame->GetWritingMode().IsVertical();
     case StyleOrient::Block:
       return !aFrame->GetWritingMode().IsVertical();
   }
-  NS_NOTREACHED("unexpected -moz-orient value");
+  MOZ_ASSERT_UNREACHABLE("unexpected -moz-orient value");
   return false;
 }
 
 // menupopup:
 bool
 nsNativeTheme::IsSubmenu(nsIFrame* aFrame, bool* aLeftOfParent)
 {
   if (!aFrame)
--- a/widget/uikit/nsLookAndFeel.mm
+++ b/widget/uikit/nsLookAndFeel.mm
@@ -33,17 +33,17 @@ static nscolor GetColorFromUIColor(UICol
                       (unsigned int)(components[1] * 255.0),
                       (unsigned int)(components[2] * 255.0));
     }
     else if (model == kCGColorSpaceModelMonochrome) {
         unsigned int val = (unsigned int)(components[0] * 255.0);
         return NS_RGBA(val, val, val,
                        (unsigned int)(components[1] * 255.0));
     }
-    NS_NOTREACHED("Unhandled color space!");
+    MOZ_ASSERT_UNREACHABLE("Unhandled color space!");
     return 0;
 }
 
 void
 nsLookAndFeel::NativeInit()
 {
   EnsureInit();
 }
--- a/widget/windows/LSPAnnotator.cpp
+++ b/widget/windows/LSPAnnotator.cpp
@@ -57,17 +57,17 @@ LSPAnnotationGatherer::Run()
   mThread = NS_GetCurrentThread();
 
   DWORD size = 0;
   int err;
   // Get the size of the buffer we need
   if (SOCKET_ERROR != WSCEnumProtocols(nullptr, nullptr, &size, &err) ||
       err != WSAENOBUFS) {
     // Er, what?
-    NS_NOTREACHED("WSCEnumProtocols suceeded when it should have failed ...");
+    MOZ_ASSERT_UNREACHABLE("WSCEnumProtocols suceeded when it should have failed ...");
     return NS_ERROR_FAILURE;
   }
 
   auto byteArray = MakeUnique<char[]>(size);
   WSAPROTOCOL_INFOW* providers =
     reinterpret_cast<WSAPROTOCOL_INFOW*>(byteArray.get());
 
   int n = WSCEnumProtocols(nullptr, providers, &size, &err);
--- a/widget/windows/TaskbarTabPreview.cpp
+++ b/widget/windows/TaskbarTabPreview.cpp
@@ -282,17 +282,17 @@ TaskbarTabPreview::MainWindowHook(void *
                                   WPARAM wParam, LPARAM lParam,
                                   LRESULT *aResult) {
   if (nMsg == WM_WINDOWPOSCHANGED) {
     TaskbarTabPreview *preview = reinterpret_cast<TaskbarTabPreview*>(aContext);
     WINDOWPOS *pos = reinterpret_cast<WINDOWPOS*>(lParam);
     if (SWP_FRAMECHANGED == (pos->flags & SWP_FRAMECHANGED))
       preview->UpdateProxyWindowStyle();
   } else {
-    NS_NOTREACHED("Style changed hook fired on non-style changed message");
+    MOZ_ASSERT_UNREACHABLE("Style changed hook fired on non-style changed message");
   }
   return false;
 }
 
 void
 TaskbarTabPreview::UpdateProxyWindowStyle() {
   if (!mProxyWindow)
     return;
--- a/widget/windows/WinTaskbar.cpp
+++ b/widget/windows/WinTaskbar.cpp
@@ -150,24 +150,24 @@ DefaultController::RequestThumbnail(nsIT
 
 NS_IMETHODIMP
 DefaultController::RequestPreview(nsITaskbarPreviewCallback *aCallback) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DefaultController::OnClose(void) {
-  NS_NOTREACHED("OnClose should not be called for TaskbarWindowPreviews");
+  MOZ_ASSERT_UNREACHABLE("OnClose should not be called for TaskbarWindowPreviews");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DefaultController::OnActivate(bool *rAcceptActivation) {
   *rAcceptActivation = true;
-  NS_NOTREACHED("OnActivate should not be called for TaskbarWindowPreviews");
+  MOZ_ASSERT_UNREACHABLE("OnActivate should not be called for TaskbarWindowPreviews");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DefaultController::OnClick(nsITaskbarPreviewButton *button) {
   return NS_OK;
 }
 
--- a/widget/windows/nsDragService.cpp
+++ b/widget/windows/nsDragService.cpp
@@ -312,17 +312,17 @@ nsDragService::StartInvokingDragSession(
   OpenDragPopup();
 
   RefPtr<IAsyncOperation> pAsyncOp;
   // Offer to do an async drag
   if (SUCCEEDED(aDataObj->QueryInterface(IID_IAsyncOperation,
                                          getter_AddRefs(pAsyncOp)))) {
     pAsyncOp->SetAsyncMode(VARIANT_TRUE);
   } else {
-    NS_NOTREACHED("When did our data object stop being async");
+    MOZ_ASSERT_UNREACHABLE("When did our data object stop being async");
   }
 
   // Call the native D&D method
   HRESULT res = ::DoDragDrop(aDataObj, nativeDragSrc, effects, &winDropRes);
 
   // In  cases where the drop operation completed outside the application, update
   // the source node's DataTransfer dropEffect value so it is up to date.
   if (!mSentLocalDropEvent) {
--- a/widget/windows/nsImageClipboard.cpp
+++ b/widget/windows/nsImageClipboard.cpp
@@ -160,17 +160,17 @@ nsImageToClipboard::CreateFromImage ( im
 #if 0
     // XXXjwatt Bug 995923 - fix |format| and reenable once bug 995807 is fixed.
     case SurfaceFormat::B8G8R8X8:
         format = imgIEncoder::INPUT_FORMAT_RGB;
         options.AppendInt(24);
         break;
 #endif
     default:
-        NS_NOTREACHED("Unexpected surface format");
+        MOZ_ASSERT_UNREACHABLE("Unexpected surface format");
         return NS_ERROR_INVALID_ARG;  
     }
 
     DataSourceSurface::MappedSurface map;
     bool mappedOK = dataSurface->Map(DataSourceSurface::MapType::READ, &map);
     NS_ENSURE_TRUE(mappedOK, NS_ERROR_FAILURE);
 
     rv = encoder->InitFromData(map.mData, 0,
--- a/widget/windows/nsUXThemeData.cpp
+++ b/widget/windows/nsUXThemeData.cpp
@@ -108,17 +108,17 @@ const wchar_t *nsUXThemeData::GetClassNa
       return L"Header";
     case eUXListview:
       return L"Listview";
     case eUXMenu:
       return L"Menu";
     case eUXWindowFrame:
       return L"Window";
     default:
-      NS_NOTREACHED("unknown uxtheme class");
+      MOZ_ASSERT_UNREACHABLE("unknown uxtheme class");
       return L"";
   }
 }
 
 // static
 void
 nsUXThemeData::EnsureCommandButtonMetrics()
 {
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -611,17 +611,17 @@ public:
   // Allow NodePool::NodeBlock's constructor to compile.
   PtrInfo()
     : mPointer{ nullptr }
     , mParticipant{ nullptr }
     , mColor{ 0 }
     , mInternalRefs{ 0 }
     , mRefCount{ 0 }
   {
-    NS_NOTREACHED("should never be called");
+    MOZ_ASSERT_UNREACHABLE("should never be called");
   }
 
   bool IsGrayJS() const
   {
     return mRefCount == 0;
   }
 
   bool IsBlackJS() const
@@ -693,29 +693,29 @@ private:
 
   struct NodeBlock
   {
     // We create and destroy NodeBlock using moz_xmalloc/free rather than new
     // and delete to avoid calling its constructor and destructor.
     NodeBlock()
       : mNext{ nullptr }
     {
-      NS_NOTREACHED("should never be called");
+      MOZ_ASSERT_UNREACHABLE("should never be called");
 
       // Ensure NodeBlock is the right size (see the comment on NodeBlockSize
       // above).
       static_assert(
         sizeof(NodeBlock) ==  81904 ||  // 32-bit; equals 19.996 x 4 KiB pages
         sizeof(NodeBlock) == 131048,    // 64-bit; equals 31.994 x 4 KiB pages
         "ill-sized NodeBlock"
       );
     }
     ~NodeBlock()
     {
-      NS_NOTREACHED("should never be called");
+      MOZ_ASSERT_UNREACHABLE("should never be called");
     }
 
     NodeBlock* mNext;
     PtrInfo mEntries[NodeBlockSize + 1]; // +1 to store last child of last node
   };
 
 public:
   NodePool()
@@ -2035,17 +2035,17 @@ public:
         case CCGraphDescriber::eRoot:
           aHandler->DescribeRoot(d->mAddress,
                                  d->mCnt);
           break;
         case CCGraphDescriber::eGarbage:
           aHandler->DescribeGarbage(d->mAddress);
           break;
         case CCGraphDescriber::eUnknown:
-          NS_NOTREACHED("CCGraphDescriber::eUnknown");
+          MOZ_ASSERT_UNREACHABLE("CCGraphDescriber::eUnknown");
           break;
       }
       delete d;
     }
     if (!(*aCanContinue = !mDescribers.isEmpty())) {
       mCurrentAddress.AssignLiteral("0x");
     }
     return NS_OK;
--- a/xpcom/ds/nsCheapSets.h
+++ b/xpcom/ds/nsCheapSets.h
@@ -40,17 +40,17 @@ public:
         break;
       case ONE:
         GetSingleEntry()->~EntryType();
         break;
       case MANY:
         delete mUnion.table;
         break;
       default:
-        NS_NOTREACHED("bogus state");
+        MOZ_ASSERT_UNREACHABLE("bogus state");
         break;
     }
     mState = ZERO;
   }
 
   void Put(const KeyType aVal);
 
   void Remove(const KeyType aVal);
@@ -60,17 +60,17 @@ public:
     switch (mState) {
       case ZERO:
         return false;
       case ONE:
         return GetSingleEntry()->KeyEquals(EntryType::KeyToPointer(aVal));
       case MANY:
         return !!mUnion.table->GetEntry(aVal);
       default:
-        NS_NOTREACHED("bogus state");
+        MOZ_ASSERT_UNREACHABLE("bogus state");
         return false;
     }
   }
 
   uint32_t EnumerateEntries(Enumerator aEnumFunc, void* aUserArg)
   {
     switch (mState) {
       case ZERO:
@@ -87,17 +87,17 @@ public:
           auto entry = static_cast<EntryType*>(iter.Get());
           if (aEnumFunc(entry, aUserArg) == OpRemove) {
             iter.Remove();
           }
         }
         return n;
       }
       default:
-        NS_NOTREACHED("bogus state");
+        MOZ_ASSERT_UNREACHABLE("bogus state");
         return 0;
     }
   }
 
 private:
   EntryType* GetSingleEntry()
   {
     return reinterpret_cast<EntryType*>(&mUnion.singleEntry[0]);
@@ -136,17 +136,17 @@ nsCheapSet<EntryType>::Put(const KeyType
       mState = MANY;
     }
     MOZ_FALLTHROUGH;
 
     case MANY:
       mUnion.table->PutEntry(aVal);
       return;
     default:
-      NS_NOTREACHED("bogus state");
+      MOZ_ASSERT_UNREACHABLE("bogus state");
       return;
   }
 }
 
 template<typename EntryType>
 void
 nsCheapSet<EntryType>::Remove(const KeyType aVal)
 {
@@ -158,14 +158,14 @@ nsCheapSet<EntryType>::Remove(const KeyT
         GetSingleEntry()->~EntryType();
         mState = ZERO;
       }
       break;
     case MANY:
       mUnion.table->RemoveEntry(aVal);
       break;
     default:
-      NS_NOTREACHED("bogus state");
+      MOZ_ASSERT_UNREACHABLE("bogus state");
       break;
   }
 }
 
 #endif
--- a/xpcom/io/Base64.cpp
+++ b/xpcom/io/Base64.cpp
@@ -90,17 +90,17 @@ Encode(const SrcT* aSrc, uint32_t aSrcLe
       Encode2to4(aSrc, aDest);
       break;
     case 1:
       Encode1to4(aSrc, aDest);
       break;
     case 0:
       break;
     default:
-      NS_NOTREACHED("coding error");
+      MOZ_ASSERT_UNREACHABLE("coding error");
   }
 }
 
 // END base64 encode code copied and modified from NSPR.
 
 template<typename T>
 struct EncodeInputStream_State
 {
--- a/xpcom/io/nsBinaryStream.cpp
+++ b/xpcom/io/nsBinaryStream.cpp
@@ -94,25 +94,25 @@ nsBinaryOutputStream::Write(const char* 
   }
   return mOutputStream->Write(aBuf, aCount, aActualBytes);
 }
 
 NS_IMETHODIMP
 nsBinaryOutputStream::WriteFrom(nsIInputStream* aInStr, uint32_t aCount,
                                 uint32_t* aResult)
 {
-  NS_NOTREACHED("WriteFrom");
+  MOZ_ASSERT_UNREACHABLE("WriteFrom");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsBinaryOutputStream::WriteSegments(nsReadSegmentFun aReader, void* aClosure,
                                     uint32_t aCount, uint32_t* aResult)
 {
-  NS_NOTREACHED("WriteSegments");
+  MOZ_ASSERT_UNREACHABLE("WriteSegments");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsBinaryOutputStream::IsNonBlocking(bool* aNonBlocking)
 {
   if (NS_WARN_IF(!mOutputStream)) {
     return NS_ERROR_UNEXPECTED;
--- a/xpcom/io/nsDirectoryService.cpp
+++ b/xpcom/io/nsDirectoryService.cpp
@@ -122,17 +122,17 @@ const nsStaticAtom* const nsDirectorySer
     nsStaticAtom, mozilla::detail::DirectoryAtoms, \
     mozilla::detail::gDirectoryAtoms, nsDirectoryService, name_)
 #include "nsDirectoryServiceAtomList.h"
 #undef DIR_ATOM
 
 NS_IMETHODIMP
 nsDirectoryService::Init()
 {
-  NS_NOTREACHED("nsDirectoryService::Init() for internal use only!");
+  MOZ_ASSERT_UNREACHABLE("nsDirectoryService::Init() for internal use only!");
   return NS_OK;
 }
 
 void
 nsDirectoryService::RealInit()
 {
   NS_ASSERTION(!gService,
                "nsDirectoryService::RealInit Mustn't initialize twice!");
--- a/xpcom/io/nsEscape.cpp
+++ b/xpcom/io/nsEscape.cpp
@@ -305,17 +305,17 @@ T_EscapeURL(const typename T::char_type*
             T& aResult, bool& aDidAppend)
 {
   typedef nsCharTraits<typename T::char_type> traits;
   typedef typename traits::unsigned_char_type unsigned_char_type;
   static_assert(sizeof(*aPart) == 1 || sizeof(*aPart) == 2,
                 "unexpected char type");
 
   if (!aPart) {
-    NS_NOTREACHED("null pointer");
+    MOZ_ASSERT_UNREACHABLE("null pointer");
     return NS_ERROR_INVALID_ARG;
   }
 
   bool forced = !!(aFlags & esc_Forced);
   bool ignoreNonAscii = !!(aFlags & esc_OnlyASCII);
   bool ignoreAscii = !!(aFlags & esc_OnlyNonASCII);
   bool writing = !!(aFlags & esc_AlwaysCopy);
   bool colon = !!(aFlags & esc_Colon);
@@ -541,17 +541,17 @@ NS_UnescapeURL(const char* aStr, int32_t
 }
 
 nsresult
 NS_UnescapeURL(const char* aStr, int32_t aLen, uint32_t aFlags,
                nsACString& aResult, bool& aDidAppend,
                const mozilla::fallible_t&)
 {
   if (!aStr) {
-    NS_NOTREACHED("null pointer");
+    MOZ_ASSERT_UNREACHABLE("null pointer");
     return NS_ERROR_INVALID_ARG;
   }
 
   MOZ_ASSERT(aResult.IsEmpty(),
              "Passing a non-empty string as an out parameter!");
 
   if (aLen < 0) {
     aLen = strlen(aStr);
--- a/xpcom/io/nsMultiplexInputStream.cpp
+++ b/xpcom/io/nsMultiplexInputStream.cpp
@@ -419,17 +419,17 @@ nsMultiplexInputStream::Read(char* aBuf,
   uint32_t len = mStreams.Length();
   while (mCurrentStream < len && aCount) {
     uint32_t read;
     rv = mStreams[mCurrentStream].mStream->Read(aBuf, aCount, &read);
 
     // XXX some streams return NS_BASE_STREAM_CLOSED to indicate EOF.
     // (This is a bug in those stream implementations)
     if (rv == NS_BASE_STREAM_CLOSED) {
-      NS_NOTREACHED("Input stream's Read method returned NS_BASE_STREAM_CLOSED");
+      MOZ_ASSERT_UNREACHABLE("Input stream's Read method returned NS_BASE_STREAM_CLOSED");
       rv = NS_OK;
       read = 0;
     } else if (NS_FAILED(rv)) {
       break;
     }
 
     if (read == 0) {
       ++mCurrentStream;
@@ -473,17 +473,17 @@ nsMultiplexInputStream::ReadSegments(nsW
   while (mCurrentStream < len && aCount) {
     uint32_t read;
     rv = mStreams[mCurrentStream].mStream->ReadSegments(ReadSegCb, &state,
                                                         aCount, &read);
 
     // XXX some streams return NS_BASE_STREAM_CLOSED to indicate EOF.
     // (This is a bug in those stream implementations)
     if (rv == NS_BASE_STREAM_CLOSED) {
-      NS_NOTREACHED("Input stream's Read method returned NS_BASE_STREAM_CLOSED");
+      MOZ_ASSERT_UNREACHABLE("Input stream's Read method returned NS_BASE_STREAM_CLOSED");
       rv = NS_OK;
       read = 0;
     }
 
     // if |aWriter| decided to stop reading segments...
     if (state.mDone || NS_FAILED(rv)) {
       break;
     }
--- a/xpcom/io/nsPipe3.cpp
+++ b/xpcom/io/nsPipe3.cpp
@@ -1518,17 +1518,17 @@ nsPipeInputStream::AsyncWait(nsIInputStr
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPipeInputStream::Seek(int32_t aWhence, int64_t aOffset)
 {
-  NS_NOTREACHED("nsPipeInputStream::Seek");
+  MOZ_ASSERT_UNREACHABLE("nsPipeInputStream::Seek");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsPipeInputStream::Tell(int64_t* aOffset)
 {
   ReentrantMonitorAutoEnter mon(mPipe->mReentrantMonitor);
 
@@ -1539,17 +1539,17 @@ nsPipeInputStream::Tell(int64_t* aOffset
 
   *aOffset = mLogicalOffset;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPipeInputStream::SetEOF()
 {
-  NS_NOTREACHED("nsPipeInputStream::SetEOF");
+  MOZ_ASSERT_UNREACHABLE("nsPipeInputStream::SetEOF");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 static bool strings_equal(bool aIgnoreCase,
                           const char* aS1, const char* aS2, uint32_t aLen)
 {
   return aIgnoreCase
     ? !nsCRT::strncasecmp(aS1, aS2, aLen) : !strncmp(aS1, aS2, aLen);
@@ -1624,17 +1624,17 @@ nsPipeInputStream::Search(const char* aF
       }
     }
 
     // finally continue with the next buffer
     cursor1 = cursor2;
     limit1 = limit2;
   }
 
-  NS_NOTREACHED("can't get here");
+  MOZ_ASSERT_UNREACHABLE("can't get here");
   return NS_ERROR_UNEXPECTED;    // keep compiler happy
 }
 
 NS_IMETHODIMP
 nsPipeInputStream::GetCloneable(bool* aCloneableOut)
 {
   *aCloneableOut = true;
   return NS_OK;
--- a/xpcom/io/nsStorageStream.cpp
+++ b/xpcom/io/nsStorageStream.cpp
@@ -519,17 +519,17 @@ nsStorageInputStream::Seek(int32_t aWhen
       break;
     case NS_SEEK_CUR:
       pos += mLogicalCursor;
       break;
     case NS_SEEK_END:
       pos += mStorageStream->mLogicalLength;
       break;
     default:
-      NS_NOTREACHED("unexpected whence value");
+      MOZ_ASSERT_UNREACHABLE("unexpected whence value");
       return NS_ERROR_UNEXPECTED;
   }
   if (pos == int64_t(mLogicalCursor)) {
     return NS_OK;
   }
 
   return Seek(pos);
 }
@@ -543,17 +543,17 @@ nsStorageInputStream::Tell(int64_t* aRes
 
   *aResult = mLogicalCursor;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsStorageInputStream::SetEOF()
 {
-  NS_NOTREACHED("nsStorageInputStream::SetEOF");
+  MOZ_ASSERT_UNREACHABLE("nsStorageInputStream::SetEOF");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 nsStorageInputStream::Seek(uint32_t aPosition)
 {
   uint32_t length = mStorageStream->mLogicalLength;
   if (aPosition > length) {
@@ -608,17 +608,17 @@ nsStorageInputStream::ExpectedSerialized
   MOZ_ASSERT(NS_SUCCEEDED(rv));
   return Some(remaining);
 }
 
 bool
 nsStorageInputStream::Deserialize(const InputStreamParams& aParams,
                                   const FileDescriptorArray&)
 {
-  NS_NOTREACHED("We should never attempt to deserialize a storage input stream.");
+  MOZ_ASSERT_UNREACHABLE("We should never attempt to deserialize a storage input stream.");
   return false;
 }
 
 NS_IMETHODIMP
 nsStorageInputStream::GetCloneable(bool* aCloneableOut)
 {
   *aCloneableOut = true;
   return NS_OK;
--- a/xpcom/io/nsStreamUtils.cpp
+++ b/xpcom/io/nsStreamUtils.cpp
@@ -67,17 +67,17 @@ private:
     nsresult rv = mTarget->IsOnCurrentThread(&val);
     if (NS_FAILED(rv) || !val) {
       nsCOMPtr<nsIInputStreamCallback> event =
         NS_NewInputStreamReadyEvent("~nsInputStreamReadyEvent", mCallback, mTarget);
       mCallback = nullptr;
       if (event) {
         rv = event->OnInputStreamReady(nullptr);
         if (NS_FAILED(rv)) {
-          NS_NOTREACHED("leaking stream event");
+          MOZ_ASSERT_UNREACHABLE("leaking stream event");
           nsISupports* sup = event;
           NS_ADDREF(sup);
         }
       }
     }
   }
 
 public:
@@ -158,17 +158,17 @@ private:
     nsresult rv = mTarget->IsOnCurrentThread(&val);
     if (NS_FAILED(rv) || !val) {
       nsCOMPtr<nsIOutputStreamCallback> event =
         NS_NewOutputStreamReadyEvent(mCallback, mTarget);
       mCallback = nullptr;
       if (event) {
         rv = event->OnOutputStreamReady(nullptr);
         if (NS_FAILED(rv)) {
-          NS_NOTREACHED("leaking stream event");
+          MOZ_ASSERT_UNREACHABLE("leaking stream event");
           nsISupports* sup = event;
           NS_ADDREF(sup);
         }
       }
     }
   }
 
 public:
--- a/xpcom/string/nsTSubstring.cpp
+++ b/xpcom/string/nsTSubstring.cpp
@@ -891,34 +891,34 @@ nsTStringRepr<T>::Equals(const substring
 }
 
 template <typename T>
 bool
 nsTStringRepr<T>::Equals(const char_type* aData) const
 {
   // unfortunately, some callers pass null :-(
   if (!aData) {
-    NS_NOTREACHED("null data pointer");
+    MOZ_ASSERT_UNREACHABLE("null data pointer");
     return this->mLength == 0;
   }
 
   // XXX avoid length calculation?
   size_type length = char_traits::length(aData);
   return this->mLength == length &&
          char_traits::compare(this->mData, aData, this->mLength) == 0;
 }
 
 template <typename T>
 bool
 nsTStringRepr<T>::Equals(const char_type* aData,
                          const comparator_type& aComp) const
 {
   // unfortunately, some callers pass null :-(
   if (!aData) {
-    NS_NOTREACHED("null data pointer");
+    MOZ_ASSERT_UNREACHABLE("null data pointer");
     return this->mLength == 0;
   }
 
   // XXX avoid length calculation?
   size_type length = char_traits::length(aData);
   return this->mLength == length && aComp(this->mData, aData, this->mLength, length) == 0;
 }
 
--- a/xpcom/tests/gtest/TestCallTemplates.cpp
+++ b/xpcom/tests/gtest/TestCallTemplates.cpp
@@ -54,17 +54,17 @@ void JustTestingCompilation()
     /*
      * NOTE:  This does NOT demonstrate how these functions are
      * intended to be used.  They are intended for filling in out
      * parameters that need to be |AddRef|ed.  I'm just too lazy
      * to write lots of little getter functions for a test program
      * when I don't need to.
      */
 
-    NS_NOTREACHED("This test is not intended to run, only to compile!");
+    MOZ_ASSERT_UNREACHABLE("This test is not intended to run, only to compile!");
 
     /* Test CallQueryInterface */
 
     nsISupports *mySupportsPtr = reinterpret_cast<nsISupports*>(0x1000);
 
     nsITestService *myITestService = nullptr;
     CallQueryInterface(mySupportsPtr, &myITestService);
 
--- a/xpcom/threads/LazyIdleThread.cpp
+++ b/xpcom/threads/LazyIdleThread.cpp
@@ -498,33 +498,33 @@ LazyIdleThread::Shutdown()
   return NS_OK;
 }
 
 NS_IMETHODIMP
 LazyIdleThread::HasPendingEvents(bool* aHasPendingEvents)
 {
   // This is only supposed to be called from the thread itself so it's not
   // implemented here.
-  NS_NOTREACHED("Shouldn't ever call this!");
+  MOZ_ASSERT_UNREACHABLE("Shouldn't ever call this!");
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
 LazyIdleThread::IdleDispatch(already_AddRefed<nsIRunnable> aEvent)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 LazyIdleThread::ProcessNextEvent(bool aMayWait,
                                  bool* aEventWasProcessed)
 {
   // This is only supposed to be called from the thread itself so it's not
   // implemented here.
-  NS_NOTREACHED("Shouldn't ever call this!");
+  MOZ_ASSERT_UNREACHABLE("Shouldn't ever call this!");
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
 LazyIdleThread::Notify(nsITimer* aTimer)
 {
   ASSERT_OWNING_THREAD();
 
--- a/xpcom/threads/nsIIdleRunnable.h
+++ b/xpcom/threads/nsIIdleRunnable.h
@@ -27,17 +27,17 @@ public:
 
   /**
    * Notify the task of a point in time in the future when the task
    * should stop executing.
    */
   virtual void SetDeadline(mozilla::TimeStamp aDeadline) {};
   virtual void SetTimer(uint32_t aDelay, nsIEventTarget* aTarget)
   {
-    NS_NOTREACHED("The nsIIdleRunnable instance does not support "
+    MOZ_ASSERT_UNREACHABLE("The nsIIdleRunnable instance does not support "
                   "idle dispatch with timeout!");
   };
 protected:
   nsIIdleRunnable() { }
   virtual ~nsIIdleRunnable() {}
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIIdleRunnable,
--- a/xpfe/appshell/nsAppShellService.cpp
+++ b/xpfe/appshell/nsAppShellService.cpp
@@ -251,73 +251,73 @@ NS_IMETHODIMP
 WebBrowserChrome2Stub::SetStatus(uint32_t aStatusType, const char16_t* aStatus)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 WebBrowserChrome2Stub::GetWebBrowser(nsIWebBrowser** aWebBrowser)
 {
-  NS_NOTREACHED("WebBrowserChrome2Stub::GetWebBrowser is not supported");
+  MOZ_ASSERT_UNREACHABLE("WebBrowserChrome2Stub::GetWebBrowser is not supported");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 WebBrowserChrome2Stub::SetWebBrowser(nsIWebBrowser* aWebBrowser)
 {
-  NS_NOTREACHED("WebBrowserChrome2Stub::SetWebBrowser is not supported");
+  MOZ_ASSERT_UNREACHABLE("WebBrowserChrome2Stub::SetWebBrowser is not supported");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 WebBrowserChrome2Stub::GetChromeFlags(uint32_t* aChromeFlags)
 {
   *aChromeFlags = 0;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 WebBrowserChrome2Stub::SetChromeFlags(uint32_t aChromeFlags)
 {
-  NS_NOTREACHED("WebBrowserChrome2Stub::SetChromeFlags is not supported");
+  MOZ_ASSERT_UNREACHABLE("WebBrowserChrome2Stub::SetChromeFlags is not supported");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 WebBrowserChrome2Stub::DestroyBrowserWindow()
 {
-  NS_NOTREACHED("WebBrowserChrome2Stub::DestroyBrowserWindow is not supported");
+  MOZ_ASSERT_UNREACHABLE("WebBrowserChrome2Stub::DestroyBrowserWindow is not supported");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 WebBrowserChrome2Stub::SizeBrowserTo(int32_t aCX, int32_t aCY)
 {
-  NS_NOTREACHED("WebBrowserChrome2Stub::SizeBrowserTo is not supported");
+  MOZ_ASSERT_UNREACHABLE("WebBrowserChrome2Stub::SizeBrowserTo is not supported");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 WebBrowserChrome2Stub::ShowAsModal()
 {
-  NS_NOTREACHED("WebBrowserChrome2Stub::ShowAsModal is not supported");
+  MOZ_ASSERT_UNREACHABLE("WebBrowserChrome2Stub::ShowAsModal is not supported");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 WebBrowserChrome2Stub::IsWindowModal(bool* aResult)
 {
   *aResult = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 WebBrowserChrome2Stub::ExitModalEventLoop(nsresult aStatus)
 {
-  NS_NOTREACHED("WebBrowserChrome2Stub::ExitModalEventLoop is not supported");
+  MOZ_ASSERT_UNREACHABLE("WebBrowserChrome2Stub::ExitModalEventLoop is not supported");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 WebBrowserChrome2Stub::SetStatusWithContext(uint32_t aStatusType,
                                             const nsAString& aStatusText,
                                             nsISupports* aStatusContext)
 {
--- a/xpfe/appshell/nsWebShellWindow.cpp
+++ b/xpfe/appshell/nsWebShellWindow.cpp
@@ -601,17 +601,17 @@ nsWebShellWindow::FirePersistenceTimer()
 NS_IMETHODIMP
 nsWebShellWindow::OnProgressChange(nsIWebProgress *aProgress,
                                    nsIRequest *aRequest,
                                    int32_t aCurSelfProgress,
                                    int32_t aMaxSelfProgress,
                                    int32_t aCurTotalProgress,
                                    int32_t aMaxTotalProgress)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWebShellWindow::OnStateChange(nsIWebProgress *aProgress,
                                 nsIRequest *aRequest,
                                 uint32_t aStateFlags,
                                 nsresult aStatus)
@@ -658,36 +658,36 @@ nsWebShellWindow::OnStateChange(nsIWebPr
 }
 
 NS_IMETHODIMP
 nsWebShellWindow::OnLocationChange(nsIWebProgress *aProgress,
                                    nsIRequest *aRequest,
                                    nsIURI *aURI,
                                    uint32_t aFlags)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWebShellWindow::OnStatusChange(nsIWebProgress* aWebProgress,
                                  nsIRequest* aRequest,
                                  nsresult aStatus,
                                  const char16_t* aMessage)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWebShellWindow::OnSecurityChange(nsIWebProgress *aWebProgress,
                                    nsIRequest *aRequest,
                                    uint32_t state)
 {
-  NS_NOTREACHED("notification excluded in AddProgressListener(...)");
+  MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 
 /**
  * ExecuteCloseHandler - Run the close handler, if any.
  * @return true iff we found a close handler to run.
  */