Bug 1296189 - Replace NS_RUNTIMEABORT("some string literal message") with MOZ_CRASH(). r=froydnj
authorTomislav Jurin <svezauzeto12@hotmail.com>
Fri, 02 Dec 2016 13:46:53 -0800
changeset 325189 afe43384706c6fc527164a746b7a8c8a2762d4ed
parent 325188 deb743b033b70f97af83172d90008da2a5ce7c59
child 325190 d2c5b6581d6ab82d04b6ee8d454bb7debe9f4d0e
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersfroydnj
bugs1296189
milestone53.0a1
Bug 1296189 - Replace NS_RUNTIMEABORT("some string literal message") with MOZ_CRASH(). r=froydnj
dom/base/WebSocket.cpp
dom/base/nsDOMDataChannel.cpp
dom/bindings/BindingUtils.cpp
dom/bindings/BindingUtils.h
dom/canvas/WebGLContext.cpp
dom/canvas/WebGLTexelConversions.cpp
dom/devicestorage/DeviceStorageRequestChild.cpp
dom/devicestorage/DeviceStorageRequestParent.cpp
dom/filesystem/FileSystemRequestParent.cpp
dom/filesystem/GetFileOrDirectoryTask.cpp
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
dom/ipc/PermissionMessageUtils.cpp
dom/ipc/TabChild.cpp
dom/media/webaudio/WebAudioUtils.h
dom/plugins/base/PluginPRLibrary.cpp
dom/plugins/ipc/BrowserStreamChild.cpp
dom/plugins/ipc/BrowserStreamChild.h
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginMessageUtils.h
dom/plugins/ipc/PluginModuleChild.cpp
dom/plugins/ipc/PluginModuleParent.cpp
dom/plugins/ipc/PluginScriptableObjectChild.cpp
dom/plugins/ipc/PluginStreamChild.h
dom/workers/ServiceWorkerPrivate.cpp
dom/xhr/XMLHttpRequestWorker.cpp
dom/xslt/xslt/txMozillaXSLTProcessor.cpp
dom/xslt/xslt/txStylesheetCompiler.cpp
extensions/cookie/nsPermissionManager.cpp
gfx/gl/GLContext.cpp
gfx/layers/basic/BasicCompositor.cpp
gfx/layers/client/ClientLayerManager.cpp
gfx/layers/composite/CanvasLayerComposite.h
gfx/layers/composite/LayerManagerComposite.cpp
gfx/layers/composite/PaintedLayerComposite.h
gfx/layers/d3d11/CompositorD3D11.h
gfx/layers/d3d9/CompositorD3D9.h
gfx/layers/ipc/ImageBridgeChild.cpp
gfx/layers/ipc/ImageBridgeChild.h
gfx/layers/ipc/LayerTransactionChild.cpp
gfx/layers/ipc/LayerTransactionParent.cpp
gfx/layers/ipc/ShadowLayerParent.cpp
gfx/layers/opengl/CompositorOGL.cpp
gfx/tests/gtest/TestLayers.cpp
gfx/thebes/gfxFT2FontList.cpp
gfx/thebes/gfxPlatform.cpp
hal/sandbox/SandboxHal.cpp
ipc/glue/CrossProcessMutex_unimplemented.cpp
ipc/glue/CrossProcessMutex_windows.cpp
ipc/glue/GeckoChildProcessHost.cpp
ipc/glue/IPCMessageUtils.h
ipc/glue/MessageChannel.cpp
ipc/glue/SharedMemory.h
ipc/glue/SharedMemory_posix.cpp
ipc/glue/SharedMemory_windows.cpp
ipc/glue/Shmem.h
ipc/glue/WindowsMessageLoop.cpp
ipc/ipdl/test/cxx/IPDLUnitTests.h
ipc/ipdl/test/cxx/IPDLUnitTests.template.cpp
ipc/ipdl/test/cxx/TestLatency.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/build/nsLayoutModule.cpp
layout/generic/nsFrame.cpp
layout/generic/nsImageFrame.cpp
layout/svg/nsSVGImageFrame.cpp
layout/tables/nsTableFrame.cpp
modules/libpref/nsPrefBranch.cpp
netwerk/cache/nsCacheService.cpp
netwerk/cache/nsDiskCacheStreams.cpp
netwerk/ipc/NeckoChild.cpp
netwerk/ipc/NeckoMessageUtils.h
netwerk/protocol/ftp/FTPChannelChild.cpp
storage/test/gtest/test_async_callbacks_with_spun_event_loops.cpp
toolkit/crashreporter/nsExceptionHandler.cpp
toolkit/xre/nsEmbedFunctions.cpp
widget/gonk/nsScreenManagerGonk.cpp
widget/gonk/nsWindow.cpp
xpcom/base/nsAutoPtr.h
xpcom/build/LateWriteChecks.cpp
xpcom/build/XPCOMInit.cpp
xpcom/glue/BlockingResourceBase.cpp
xpcom/glue/CondVar.h
xpcom/glue/DeadlockDetector.h
xpcom/glue/Mutex.h
xpcom/glue/ReentrantMonitor.h
xpcom/glue/nsTArray.h
xpcom/io/Base64.cpp
xpcom/string/nsTSubstring.cpp
xpcom/threads/HangMonitor.cpp
--- a/dom/base/WebSocket.cpp
+++ b/dom/base/WebSocket.cpp
@@ -1981,17 +1981,17 @@ WebSocket::CreateAndDispatchMessageEvent
       messageType = nsIWebSocketEventListener::TYPE_ARRAYBUFFER;
 
       JS::Rooted<JSObject*> arrayBuf(cx);
       nsresult rv = nsContentUtils::CreateArrayBuffer(cx, aData,
                                                       arrayBuf.address());
       NS_ENSURE_SUCCESS(rv, rv);
       jsData.setObject(*arrayBuf);
     } else {
-      NS_RUNTIMEABORT("Unknown binary type!");
+      MOZ_CRASH("Unknown binary type!");
       return NS_ERROR_UNEXPECTED;
     }
   } else {
     // JS string
     NS_ConvertUTF8toUTF16 utf16Data(aData);
     JSString* jsString;
     jsString = JS_NewUCStringCopyN(cx, utf16Data.get(), utf16Data.Length());
     NS_ENSURE_TRUE(jsString, NS_ERROR_FAILURE);
--- a/dom/base/nsDOMDataChannel.cpp
+++ b/dom/base/nsDOMDataChannel.cpp
@@ -403,17 +403,17 @@ nsDOMDataChannel::DoOnMessageAvailable(c
         return NS_ERROR_FAILURE;
       }
     } else if (mBinaryType == DC_BINARY_TYPE_ARRAYBUFFER) {
       JS::Rooted<JSObject*> arrayBuf(cx);
       rv = nsContentUtils::CreateArrayBuffer(cx, aData, arrayBuf.address());
       NS_ENSURE_SUCCESS(rv, rv);
       jsData.setObject(*arrayBuf);
     } else {
-      NS_RUNTIMEABORT("Unknown binary type!");
+      MOZ_CRASH("Unknown binary type!");
       return NS_ERROR_UNEXPECTED;
     }
   } else {
     NS_ConvertUTF8toUTF16 utf16data(aData);
     JSString* jsString = JS_NewUCStringCopyN(cx, utf16data.get(), utf16data.Length());
     NS_ENSURE_TRUE(jsString, NS_ERROR_FAILURE);
 
     jsData.setString(jsString);
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -2426,17 +2426,17 @@ ReportLenientThisUnwrappingFailure(JSCon
 
 bool
 GetContentGlobalForJSImplementedObject(JSContext* cx, JS::Handle<JSObject*> obj,
                                        nsIGlobalObject** globalObj)
 {
   // Be very careful to not get tricked here.
   MOZ_ASSERT(NS_IsMainThread());
   if (!xpc::AccessCheck::isChrome(js::GetObjectCompartment(obj))) {
-    NS_RUNTIMEABORT("Should have a chrome object here");
+    MOZ_CRASH("Should have a chrome object here");
   }
 
   // Look up the content-side object.
   JS::Rooted<JS::Value> domImplVal(cx);
   if (!JS_GetProperty(cx, obj, "__DOM_IMPL__", &domImplVal)) {
     return false;
   }
 
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -1058,17 +1058,17 @@ WrapNewBindingNonWrapperCachedObject(JSC
                                      nsAutoPtr<T>& value,
                                      JS::MutableHandle<JS::Value> rval,
                                      JS::Handle<JSObject*> givenProto = nullptr)
 {
   static_assert(!IsRefcounted<T>::value, "Only pass owned classes in here.");
   // We do a runtime check on value, because otherwise we might in
   // fact end up wrapping a null and invoking methods on it later.
   if (!value) {
-    NS_RUNTIMEABORT("Don't try to wrap null objects");
+    MOZ_CRASH("Don't try to wrap null objects");
   }
   // We try to wrap in the compartment of the underlying object of "scope"
   JS::Rooted<JSObject*> obj(cx);
   {
     // scope for the JSAutoCompartment so that we restore the compartment
     // before we call JS_WrapValue.
     Maybe<JSAutoCompartment> ac;
     // Maybe<Handle> doesn't so much work, and in any case, adding
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -1283,18 +1283,17 @@ WebGLContext::UpdateLastUseIndex()
 {
     static CheckedInt<uint64_t> sIndex = 0;
 
     sIndex++;
 
     // should never happen with 64-bit; trying to handle this would be riskier than
     // not handling it as the handler code would never get exercised.
     if (!sIndex.isValid())
-        NS_RUNTIMEABORT("Can't believe it's been 2^64 transactions already!");
-
+        MOZ_CRASH("Can't believe it's been 2^64 transactions already!");
     mLastUseIndex = sIndex.value();
 }
 
 static uint8_t gWebGLLayerUserData;
 static uint8_t gWebGLMirrorLayerUserData;
 
 class WebGLContextUserData : public LayerUserData
 {
--- a/dom/canvas/WebGLTexelConversions.cpp
+++ b/dom/canvas/WebGLTexelConversions.cpp
@@ -417,15 +417,15 @@ ConvertImage(size_t width, size_t height
 
     WebGLImageConverter converter(width, height, srcItr, dstItr, srcStride, dstItrStride);
     converter.run(srcFormat, dstFormat, premultOp);
 
     if (!converter.Success()) {
         // the dst image may be left uninitialized, so we better not try to
         // continue even in release builds. This should never happen anyway,
         // and would be a bug in our code.
-        NS_RUNTIMEABORT("programming mistake in WebGL texture conversions");
+        MOZ_CRASH("programming mistake in WebGL texture conversions");
     }
 
     return true;
 }
 
 } // end namespace mozilla
--- a/dom/devicestorage/DeviceStorageRequestChild.cpp
+++ b/dom/devicestorage/DeviceStorageRequestChild.cpp
@@ -134,17 +134,17 @@ DeviceStorageRequestChild::
       }
       request->Continue();
       break;
     }
 
     default:
     {
       DS_LOG_ERROR("unknown %u", mRequest->GetId());
-      NS_RUNTIMEABORT("not reached");
+      MOZ_CRASH("not reached");
       break;
     }
   }
   return IPC_OK();
 }
 
 } // namespace devicestorage
 } // namespace dom
--- a/dom/devicestorage/DeviceStorageRequestParent.cpp
+++ b/dom/devicestorage/DeviceStorageRequestParent.cpp
@@ -175,17 +175,17 @@ DeviceStorageRequestParent::Dispatch()
       RefPtr<DeviceStorageFile> dsf
         = new DeviceStorageFile(p.type(), p.storageName(),
                                 p.rootdir(), NS_LITERAL_STRING(""));
       r = new EnumerateFileEvent(this, dsf.forget(), p.since());
       break;
     }
     default:
     {
-      NS_RUNTIMEABORT("not reached");
+      MOZ_CRASH("not reached");
       return;
     }
   }
 
   if (r) {
     nsCOMPtr<nsIEventTarget> target =
       do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID);
     MOZ_ASSERT(target);
--- a/dom/filesystem/FileSystemRequestParent.cpp
+++ b/dom/filesystem/FileSystemRequestParent.cpp
@@ -52,17 +52,17 @@ FileSystemRequestParent::Initialize(cons
     FILESYSTEM_REQUEST_PARENT_DISPATCH_ENTRY(CreateDirectory)
     FILESYSTEM_REQUEST_PARENT_DISPATCH_ENTRY(CreateFile)
     FILESYSTEM_REQUEST_PARENT_DISPATCH_ENTRY(GetDirectoryListing)
     FILESYSTEM_REQUEST_PARENT_DISPATCH_ENTRY(GetFileOrDirectory)
     FILESYSTEM_REQUEST_PARENT_DISPATCH_ENTRY(GetFiles)
     FILESYSTEM_REQUEST_PARENT_DISPATCH_ENTRY(Remove)
 
     default: {
-      NS_RUNTIMEABORT("not reached");
+      MOZ_CRASH("not reached");
       break;
     }
   }
 
   if (NS_WARN_IF(!mTask || !mFileSystem)) {
     // Should never reach here.
     return false;
   }
--- a/dom/filesystem/GetFileOrDirectoryTask.cpp
+++ b/dom/filesystem/GetFileOrDirectoryTask.cpp
@@ -117,17 +117,17 @@ GetFileOrDirectoryTaskChild::SetSuccessR
       if (NS_WARN_IF(aRv.Failed())) {
         return;
       }
 
       mIsDirectory = true;
       break;
     }
     default: {
-      NS_RUNTIMEABORT("not reached");
+      MOZ_CRASH("not reached");
       break;
     }
   }
 }
 
 void
 GetFileOrDirectoryTaskChild::HandlerCallback()
 {
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -505,23 +505,32 @@ ContentChild::ContentChild()
  , mIsAlive(true)
  , mShuttingDown(false)
 {
   // This process is a content process, so it's clearly running in
   // multiprocess mode!
   nsDebugImpl::SetMultiprocessMode("Child");
 }
 
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4722) /* Silence "destructor never returns" warning */
+#endif
+
 ContentChild::~ContentChild()
 {
 #ifndef NS_FREE_PERMANENT_DATA
-  NS_RUNTIMEABORT("Content Child shouldn't be destroyed.");
+  MOZ_CRASH("Content Child shouldn't be destroyed.");
 #endif
 }
 
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
 NS_INTERFACE_MAP_BEGIN(ContentChild)
   NS_INTERFACE_MAP_ENTRY(nsIContentChild)
   NS_INTERFACE_MAP_ENTRY(nsIWindowProvider)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContentChild)
 NS_INTERFACE_MAP_END
 
 bool
 ContentChild::Init(MessageLoop* aIOLoop,
@@ -2141,30 +2150,30 @@ ContentChild::ProcessingError(Result aCo
     case MsgNotAllowed:
     case MsgPayloadError:
     case MsgProcessingError:
     case MsgRouteError:
     case MsgValueError:
       break;
 
     default:
-      NS_RUNTIMEABORT("not reached");
+      MOZ_CRASH("not reached");
   }
 
 #if defined(MOZ_CRASHREPORTER) && !defined(MOZ_B2G)
   if (PCrashReporterChild* c = LoneManagedOrNullAsserts(ManagedPCrashReporterChild())) {
     CrashReporterChild* crashReporter =
       static_cast<CrashReporterChild*>(c);
     nsDependentCString reason(aReason);
     crashReporter->SendAnnotateCrashReport(
         NS_LITERAL_CSTRING("ipc_channel_error"),
         reason);
   }
 #endif
-  NS_RUNTIMEABORT("Content child abort due to IPC error");
+  MOZ_CRASH("Content child abort due to IPC error");
 }
 
 nsresult
 ContentChild::AddRemoteAlertObserver(const nsString& aData,
                                      nsIObserver* aObserver)
 {
   NS_ASSERTION(aObserver, "Adding a null observer?");
   mAlertObservers.AppendElement(new AlertObserver(aObserver, aData));
@@ -2593,17 +2602,17 @@ ContentChild::RecvUnregisterSheet(const 
 }
 
 POfflineCacheUpdateChild*
 ContentChild::AllocPOfflineCacheUpdateChild(const URIParams& manifestURI,
                                             const URIParams& documentURI,
                                             const PrincipalInfo& aLoadingPrincipalInfo,
                                             const bool& stickDocument)
 {
-  NS_RUNTIMEABORT("unused");
+  MOZ_CRASH("unused");
   return nullptr;
 }
 
 bool
 ContentChild::DeallocPOfflineCacheUpdateChild(POfflineCacheUpdateChild* actor)
 {
   OfflineCacheUpdateChild* offlineCacheUpdate =
     static_cast<OfflineCacheUpdateChild*>(actor);
@@ -2882,17 +2891,17 @@ ContentChild::RecvUpdateWindow(const uin
 #endif
 }
 
 PContentPermissionRequestChild*
 ContentChild::AllocPContentPermissionRequestChild(const InfallibleTArray<PermissionRequest>& aRequests,
                                                   const IPC::Principal& aPrincipal,
                                                   const TabId& aTabId)
 {
-  NS_RUNTIMEABORT("unused");
+  MOZ_CRASH("unused");
   return nullptr;
 }
 
 bool
 ContentChild::DeallocPContentPermissionRequestChild(PContentPermissionRequestChild* actor)
 {
   nsContentPermissionUtils::NotifyRemoveContentPermissionRequestChild(actor);
   auto child = static_cast<RemotePermissionRequest*>(actor);
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -3819,17 +3819,17 @@ ContentParent::RecvRemoveIdleObserver(co
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 ContentParent::RecvBackUpXResources(const FileDescriptor& aXSocketFd)
 {
 #ifndef MOZ_X11
-  NS_RUNTIMEABORT("This message only makes sense on X11 platforms");
+  MOZ_CRASH("This message only makes sense on X11 platforms");
 #else
   MOZ_ASSERT(0 > mChildXSocketFdDup.get(),
              "Already backed up X resources??");
   if (aXSocketFd.IsValid()) {
     auto rawFD = aXSocketFd.ClonePlatformHandle();
     mChildXSocketFdDup.reset(rawFD.release());
   }
 #endif
--- a/dom/ipc/PermissionMessageUtils.cpp
+++ b/dom/ipc/PermissionMessageUtils.cpp
@@ -24,17 +24,17 @@ ParamTraits<Principal>::Write(Message* a
   if (serializable) {
     nsresult rv = NS_SerializeToString(serializable, principalString);
     if (NS_SUCCEEDED(rv)) {
       isSerialized = true;
     }
   }
 
   if (!isSerialized) {
-    NS_RUNTIMEABORT("Unable to serialize principal.");
+    MOZ_CRASH("Unable to serialize principal.");
     return;
   }
 
   WriteParam(aMsg, principalString);
 }
 
 bool
 ParamTraits<Principal>::Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1961,47 +1961,47 @@ TabChild::RecvPDocumentRendererConstruct
       return IPC_FAIL_NO_REASON(this);
     }
     return IPC_OK();
 }
 
 PColorPickerChild*
 TabChild::AllocPColorPickerChild(const nsString&, const nsString&)
 {
-  NS_RUNTIMEABORT("unused");
+  MOZ_CRASH("unused");
   return nullptr;
 }
 
 bool
 TabChild::DeallocPColorPickerChild(PColorPickerChild* aColorPicker)
 {
   nsColorPickerProxy* picker = static_cast<nsColorPickerProxy*>(aColorPicker);
   NS_RELEASE(picker);
   return true;
 }
 
 PDatePickerChild*
 TabChild::AllocPDatePickerChild(const nsString&, const nsString&)
 {
-  NS_RUNTIMEABORT("unused");
+  MOZ_CRASH("unused");
   return nullptr;
 }
 
 bool
 TabChild::DeallocPDatePickerChild(PDatePickerChild* aDatePicker)
 {
   nsDatePickerProxy* picker = static_cast<nsDatePickerProxy*>(aDatePicker);
   NS_RELEASE(picker);
   return true;
 }
 
 PFilePickerChild*
 TabChild::AllocPFilePickerChild(const nsString&, const int16_t&)
 {
-  NS_RUNTIMEABORT("unused");
+  MOZ_CRASH("unused");
   return nullptr;
 }
 
 bool
 TabChild::DeallocPFilePickerChild(PFilePickerChild* actor)
 {
   nsFilePickerProxy* filePicker = static_cast<nsFilePickerProxy*>(actor);
   NS_RELEASE(filePicker);
--- a/dom/media/webaudio/WebAudioUtils.h
+++ b/dom/media/webaudio/WebAudioUtils.h
@@ -182,17 +182,17 @@ namespace WebAudioUtils {
     static_assert(mozilla::IsIntegral<IntType>::value == true,
                   "IntType must be an integral type");
     static_assert(mozilla::IsFloatingPoint<FloatType>::value == true,
                   "FloatType must be a floating point type");
 
     if (mozilla::IsNaN(f)) {
       // It is the responsibility of the caller to deal with NaN values.
       // If we ever get to this point, we have a serious bug to fix.
-      NS_RUNTIMEABORT("We should never see a NaN here");
+      MOZ_CRASH("We should never see a NaN here");
     }
 
     if (f > FloatType(numeric_limits<IntType>::max())) {
       // If the floating point value is outside of the range of maximum
       // integral value for this type, just clamp to the maximum value.
       return numeric_limits<IntType>::max();
     }
 
--- a/dom/plugins/base/PluginPRLibrary.cpp
+++ b/dom/plugins/base/PluginPRLibrary.cpp
@@ -314,17 +314,17 @@ PluginPRLibrary::BeginUpdateBackground(N
   NS_ERROR("Unexpected use of async APIs for in-process plugin.");
   *aDrawTarget = nullptr;
   return NS_OK;
 }
 
 nsresult
 PluginPRLibrary::EndUpdateBackground(NPP instance, const nsIntRect&)
 {
-  NS_RUNTIMEABORT("This should never be called");
+  MOZ_CRASH("This should never be called");
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 #if defined(XP_WIN)
 nsresult
 PluginPRLibrary::GetScrollCaptureContainer(NPP aInstance, ImageContainer** aContainer)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
--- a/dom/plugins/ipc/BrowserStreamChild.cpp
+++ b/dom/plugins/ipc/BrowserStreamChild.cpp
@@ -84,17 +84,17 @@ BrowserStreamChild::RecvWrite(const int3
                               const uint32_t& newlength,
                               const Buffer& data)
 {
   PLUGIN_LOG_DEBUG_FUNCTION;
 
   AssertPluginThread();
 
   if (ALIVE != mState)
-    NS_RUNTIMEABORT("Unexpected state: received data after NPP_DestroyStream?");
+    MOZ_CRASH("Unexpected state: received data after NPP_DestroyStream?");
 
   if (kStreamOpen != mStreamStatus)
     return IPC_OK();
 
   mStream.end = newlength;
 
   NS_ASSERTION(data.Length() > 0, "Empty data");
 
@@ -111,17 +111,17 @@ BrowserStreamChild::RecvWrite(const int3
 mozilla::ipc::IPCResult
 BrowserStreamChild::RecvNPP_StreamAsFile(const nsCString& fname)
 {
   PLUGIN_LOG_DEBUG(("%s (fname=%s)", FULLFUNCTION, fname.get()));
 
   AssertPluginThread();
 
   if (ALIVE != mState)
-    NS_RUNTIMEABORT("Unexpected state: received file after NPP_DestroyStream?");
+    MOZ_CRASH("Unexpected state: received file after NPP_DestroyStream?");
 
   if (kStreamOpen != mStreamStatus)
     return IPC_OK();
 
   mStreamAsFilePending = true;
   mStreamAsFileName = fname;
   EnsureDeliveryPending();
 
@@ -129,34 +129,34 @@ BrowserStreamChild::RecvNPP_StreamAsFile
 }
 
 mozilla::ipc::IPCResult
 BrowserStreamChild::RecvNPP_DestroyStream(const NPReason& reason)
 {
   PLUGIN_LOG_DEBUG_METHOD;
 
   if (ALIVE != mState)
-    NS_RUNTIMEABORT("Unexpected state: recevied NPP_DestroyStream twice?");
+    MOZ_CRASH("Unexpected state: recevied NPP_DestroyStream twice?");
 
   mState = DYING;
   mDestroyPending = DESTROY_PENDING;
   if (NPRES_DONE != reason)
     mStreamStatus = reason;
 
   EnsureDeliveryPending();
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 BrowserStreamChild::Recv__delete__()
 {
   AssertPluginThread();
 
   if (DELETING != mState)
-    NS_RUNTIMEABORT("Bad state, not DELETING");
+    MOZ_CRASH("Bad state, not DELETING");
 
   return IPC_OK();
 }
 
 NPError
 BrowserStreamChild::NPN_RequestRead(NPByteRange* aRangeList)
 {
   PLUGIN_LOG_DEBUG_FUNCTION;
@@ -221,17 +221,17 @@ BrowserStreamChild::Deliver()
       mInstance->mPluginIface->asfile(&mInstance->mData, &mStream,
                                       mStreamAsFileName.get());
     mStreamAsFilePending = false;
   }
 
   if (DESTROY_PENDING == mDestroyPending) {
     mDestroyPending = DESTROYED;
     if (mState != DYING)
-      NS_RUNTIMEABORT("mDestroyPending but state not DYING");
+      MOZ_CRASH("mDestroyPending but state not DYING");
 
     NS_ASSERTION(NPRES_DONE != mStreamStatus, "Success status set too early!");
     if (kStreamOpen == mStreamStatus)
       mStreamStatus = NPRES_DONE;
 
     (void) mInstance->mPluginIface
       ->destroystream(&mInstance->mData, &mStream, mStreamStatus);
   }
@@ -249,17 +249,17 @@ BrowserStreamChild::Deliver()
     mState = DELETING;
   }
 }
 
 bool
 BrowserStreamChild::DeliverPendingData()
 {
   if (mState != ALIVE && mState != DYING)
-    NS_RUNTIMEABORT("Unexpected state");
+    MOZ_CRASH("Unexpected state");
 
   NS_ASSERTION(mPendingData.Length(), "Called from Deliver with empty pending");
 
   while (mPendingData[0].curpos < static_cast<int32_t>(mPendingData[0].data.Length())) {
     int32_t r = mInstance->mPluginIface->writeready(&mInstance->mData, &mStream);
     if (kStreamOpen != mStreamStatus)
       return false;
     if (0 == r) // plugin wants to suspend delivery
--- a/dom/plugins/ipc/BrowserStreamChild.h
+++ b/dom/plugins/ipc/BrowserStreamChild.h
@@ -40,22 +40,22 @@ public:
                                             const Buffer& data) override;
   virtual mozilla::ipc::IPCResult RecvNPP_StreamAsFile(const nsCString& fname) override;
   virtual mozilla::ipc::IPCResult RecvNPP_DestroyStream(const NPReason& reason) override;
   virtual mozilla::ipc::IPCResult Recv__delete__() override;
 
   void EnsureCorrectInstance(PluginInstanceChild* i)
   {
     if (i != mInstance)
-      NS_RUNTIMEABORT("Incorrect stream instance");
+      MOZ_CRASH("Incorrect stream instance");
   }
   void EnsureCorrectStream(NPStream* s)
   {
     if (s != &mStream)
-      NS_RUNTIMEABORT("Incorrect stream data");
+      MOZ_CRASH("Incorrect stream data");
   }
 
   NPError NPN_RequestRead(NPByteRange* aRangeList);
   void NPN_DestroyStream(NPReason reason);
 
   void NotifyPending() {
     NS_ASSERTION(!mNotifyPending, "Pending twice?");
     mNotifyPending = true;
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -119,17 +119,17 @@ static RefPtr<DrawTarget>
 CreateDrawTargetForSurface(gfxASurface *aSurface)
 {
   SurfaceFormat format = aSurface->GetSurfaceFormat();
   RefPtr<DrawTarget> drawTarget =
     Factory::CreateDrawTargetForCairoSurface(aSurface->CairoSurface(),
                                              aSurface->GetSize(),
                                              &format);
   if (!drawTarget) {
-    NS_RUNTIMEABORT("CreateDrawTargetForSurface failed in plugin");
+    MOZ_CRASH("CreateDrawTargetForSurface failed in plugin");
   }
   return drawTarget;
 }
 
 bool PluginInstanceChild::sIsIMEComposing = false;
 
 PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface,
                                          const nsCString& aMimeType,
@@ -1032,17 +1032,17 @@ PluginInstanceChild::AnswerNPP_HandleEve
 
 #else
 mozilla::ipc::IPCResult
 PluginInstanceChild::AnswerNPP_HandleEvent_Shmem(const NPRemoteEvent& event,
                                                  Shmem&& mem,
                                                  int16_t* handled,
                                                  Shmem* rtnmem)
 {
-    NS_RUNTIMEABORT("not reached.");
+    MOZ_CRASH("not reached.");
     *rtnmem = mem;
     return IPC_OK();
 }
 #endif
 
 #ifdef XP_MACOSX
 
 void CallCGDraw(CGContextRef ref, void* aPluginInstance, nsIntRect aUpdateRect) {
@@ -2732,17 +2732,17 @@ PluginInstanceChild::DeallocPBrowserStre
     return true;
 }
 
 PPluginStreamChild*
 PluginInstanceChild::AllocPPluginStreamChild(const nsCString& mimeType,
                                              const nsCString& target,
                                              NPError* result)
 {
-    NS_RUNTIMEABORT("not callable");
+    MOZ_CRASH("not callable");
     return nullptr;
 }
 
 bool
 PluginInstanceChild::DeallocPPluginStreamChild(PPluginStreamChild* stream)
 {
     AssertPluginThread();
     delete stream;
@@ -2753,17 +2753,17 @@ PStreamNotifyChild*
 PluginInstanceChild::AllocPStreamNotifyChild(const nsCString& url,
                                              const nsCString& target,
                                              const bool& post,
                                              const nsCString& buffer,
                                              const bool& file,
                                              NPError* result)
 {
     AssertPluginThread();
-    NS_RUNTIMEABORT("not reached");
+    MOZ_CRASH("not reached");
     return nullptr;
 }
 
 void
 StreamNotifyChild::ActorDestroy(ActorDestroyReason why)
 {
     if (AncestorDeletion == why && mBrowserStream) {
         NS_ERROR("Pending NPP_URLNotify not called when closing an instance.");
@@ -3292,17 +3292,17 @@ PluginInstanceChild::CreateOptSurface(vo
                        mWindow.width, mWindow.height,
                        willHaveTransparentPixels))
             return false;
 
         mCurrentSurface = s;
         return true;
     }
 
-    NS_RUNTIMEABORT("Shared-memory drawing not expected on Windows.");
+    MOZ_CRASH("Shared-memory drawing not expected on Windows.");
 #endif
 
     // Make common shmem implementation working for any platform
     mCurrentSurface =
         gfxSharedImageSurface::CreateUnsafe(this, IntSize(mWindow.width, mWindow.height), format);
     return !!mCurrentSurface;
 }
 
@@ -3490,17 +3490,17 @@ PluginInstanceChild::UpdateWindowAttribu
         }
     }
 #endif // MOZ_X11
 #ifdef XP_WIN
     HDC dc = nullptr;
 
     if (curSurface) {
         if (!SharedDIBSurface::IsSharedDIBSurface(curSurface))
-            NS_RUNTIMEABORT("Expected SharedDIBSurface!");
+            MOZ_CRASH("Expected SharedDIBSurface!");
 
         SharedDIBSurface* dibsurf = static_cast<SharedDIBSurface*>(curSurface.get());
         dc = dibsurf->GetHDC();
     }
     if (mWindow.window != dc) {
         mWindow.window = dc;
         needWindowUpdate = true;
     }
@@ -3613,17 +3613,17 @@ PluginInstanceChild::PaintRectToPlatform
         uintptr_t(&rect)
     };
 
     ::SetViewportOrgEx((HDC) mWindow.window, -mWindow.x, -mWindow.y, nullptr);
     ::SelectClipRgn((HDC) mWindow.window, nullptr);
     ::IntersectClipRect((HDC) mWindow.window, rect.left, rect.top, rect.right, rect.bottom);
     mPluginIface->event(&mData, reinterpret_cast<void*>(&paintEvent));
 #else
-    NS_RUNTIMEABORT("Surface type not implemented.");
+    MOZ_CRASH("Surface type not implemented.");
 #endif
 }
 
 void
 PluginInstanceChild::PaintRectToSurface(const nsIntRect& aRect,
                                         gfxASurface* aSurface,
                                         const Color& aColor)
 {
@@ -3729,17 +3729,17 @@ PluginInstanceChild::PaintRectWithAlphaE
         return;
     }
 
 #ifdef XP_WIN
     // On windows, we need an HDC and so can't paint directly to
     // vanilla image surfaces.  Bifurcate this painting code so that
     // we don't accidentally attempt that.
     if (!SharedDIBSurface::IsSharedDIBSurface(aSurface))
-        NS_RUNTIMEABORT("Expected SharedDIBSurface!");
+        MOZ_CRASH("Expected SharedDIBSurface!");
 
     // Paint the plugin directly onto the target, with a white
     // background and copy the result
     PaintRectToSurface(rect, aSurface, Color(1.f, 1.f, 1.f));
     {
         RefPtr<DrawTarget> dt = CreateDrawTargetForSurface(whiteImage);
         RefPtr<SourceSurface> surface =
             gfxPlatform::GetSourceSurfaceForSurface(dt, aSurface);
@@ -4002,17 +4002,17 @@ PluginInstanceChild::ShowPluginFrame()
         }
         currSurf = mCurrentSurfaceActor;
         s->Flush();
     } else
 #endif
     if (gfxSharedImageSurface::IsSharedImage(mCurrentSurface)) {
         currSurf = static_cast<gfxSharedImageSurface*>(mCurrentSurface.get())->GetShmem();
     } else {
-        NS_RUNTIMEABORT("Surface type is not remotable");
+        MOZ_CRASH("Surface type is not remotable");
         return false;
     }
 
     // Unused, except to possibly return a shmem to us
     SurfaceDescriptor returnSurf;
 
     if (!SendShow(r, currSurf, &returnSurf)) {
         return false;
@@ -4164,17 +4164,17 @@ PluginInstanceChild::RecvUpdateBackgroun
             break;
         }
 #endif
         case SurfaceDescriptor::TShmem: {
             mBackground = gfxSharedImageSurface::Open(aBackground.get_Shmem());
             break;
         }
         default:
-            NS_RUNTIMEABORT("Unexpected background surface descriptor");
+            MOZ_CRASH("Unexpected background surface descriptor");
         }
 
         if (!mBackground) {
             return IPC_FAIL_NO_REASON(this);
         }
 
         IntSize bgSize = mBackground->GetSize();
         mAccumulatedInvalidRect.UnionRect(mAccumulatedInvalidRect,
@@ -4424,17 +4424,17 @@ DeleteObjects(nsTHashtable<DeletingObjec
 
 void
 PluginInstanceChild::Destroy()
 {
     if (mDestroyed) {
         return;
     }
     if (mStackDepth != 0) {
-        NS_RUNTIMEABORT("Destroying plugin instance on the stack.");
+        MOZ_CRASH("Destroying plugin instance on the stack.");
     }
     mDestroyed = true;
 
 #if defined(OS_WIN)
     SetProp(mPluginWindowHWND, kPluginIgnoreSubclassProperty, (HANDLE)1);
 #endif
 
     InfallibleTArray<PBrowserStreamChild*> streams;
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -229,17 +229,17 @@ PluginInstanceParent::IsUsingDirectDrawi
 
 PBrowserStreamParent*
 PluginInstanceParent::AllocPBrowserStreamParent(const nsCString& url,
                                                 const uint32_t& length,
                                                 const uint32_t& lastmodified,
                                                 PStreamNotifyParent* notifyData,
                                                 const nsCString& headers)
 {
-    NS_RUNTIMEABORT("Not reachable");
+    MOZ_CRASH("Not reachable");
     return nullptr;
 }
 
 bool
 PluginInstanceParent::DeallocPBrowserStreamParent(PBrowserStreamParent* stream)
 {
     delete stream;
     return true;
@@ -1313,17 +1313,17 @@ PluginInstanceParent::GetImageContainer(
       mImageContainer = LayerManager::CreateImageContainer();
   }
   return mImageContainer;
 }
 
 PPluginBackgroundDestroyerParent*
 PluginInstanceParent::AllocPPluginBackgroundDestroyerParent()
 {
-    NS_RUNTIMEABORT("'Power-user' ctor is used exclusively");
+    MOZ_CRASH("'Power-user' ctor is used exclusively");
     return nullptr;
 }
 
 bool
 PluginInstanceParent::DeallocPPluginBackgroundDestroyerParent(
     PPluginBackgroundDestroyerParent* aActor)
 {
     delete aActor;
@@ -1827,26 +1827,26 @@ PluginInstanceParent::NPP_DestroyStream(
         // With async plugin init this could happen if async NPP_NewStream
         // returns an error code.
         return NPERR_NO_ERROR;
     }
     if (s->IsBrowserStream()) {
         BrowserStreamParent* sp =
             static_cast<BrowserStreamParent*>(s);
         if (sp->mNPP != this)
-            NS_RUNTIMEABORT("Mismatched plugin data");
+            MOZ_CRASH("Mismatched plugin data");
 
         sp->NPP_DestroyStream(reason);
         return NPERR_NO_ERROR;
     }
     else {
         PluginStreamParent* sp =
             static_cast<PluginStreamParent*>(s);
         if (sp->mInstance != this)
-            NS_RUNTIMEABORT("Mismatched plugin data");
+            MOZ_CRASH("Mismatched plugin data");
 
         return PPluginStreamParent::Call__delete__(sp, reason, false) ?
             NPERR_NO_ERROR : NPERR_GENERIC_ERROR;
     }
 }
 
 void
 PluginInstanceParent::NPP_Print(NPPrint* platformPrint)
@@ -2400,17 +2400,17 @@ PluginInstanceParent::Cast(NPP aInstance
     // aInstance->pdata will be nullptr.
     if (!resolver) {
         return nullptr;
     }
 
     PluginInstanceParent* instancePtr = resolver->GetInstance();
 
     if (instancePtr && aInstance != instancePtr->mNPP) {
-        NS_RUNTIMEABORT("Corrupted plugin data.");
+        MOZ_CRASH("Corrupted plugin data.");
     }
 
     if (aSurrogate) {
         *aSurrogate = resolver->GetAsyncSurrogate();
     }
 
     return instancePtr;
 }
--- a/dom/plugins/ipc/PluginMessageUtils.h
+++ b/dom/plugins/ipc/PluginMessageUtils.h
@@ -580,20 +580,20 @@ struct ParamTraits<NSCursorInfo>
   }
 };
 #else
 template<>
 struct ParamTraits<NSCursorInfo>
 {
   typedef NSCursorInfo paramType;
   static void Write(Message* aMsg, const paramType& aParam) {
-    NS_RUNTIMEABORT("NSCursorInfo isn't meaningful on this platform");
+    MOZ_CRASH("NSCursorInfo isn't meaningful on this platform");
   }
   static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
-    NS_RUNTIMEABORT("NSCursorInfo isn't meaningful on this platform");
+    MOZ_CRASH("NSCursorInfo isn't meaningful on this platform");
     return false;
   }
 };
 #endif // #ifdef XP_MACOSX
 
 template <>
 struct ParamTraits<mozilla::plugins::IPCByteRange>
 {
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -554,17 +554,17 @@ PluginModuleChild::RecvSetParentHangTime
 #endif
     return IPC_OK();
 }
 
 bool
 PluginModuleChild::ShouldContinueFromReplyTimeout()
 {
 #ifdef XP_WIN
-    NS_RUNTIMEABORT("terminating child process");
+    MOZ_CRASH("terminating child process");
 #endif
     return true;
 }
 
 bool
 PluginModuleChild::InitGraphics()
 {
 #if defined(MOZ_WIDGET_GTK)
@@ -2395,17 +2395,17 @@ void
 PluginModuleChild::NPN_GetStringIdentifiers(const NPUTF8** aNames,
                                             int32_t aNameCount,
                                             NPIdentifier* aIdentifiers)
 {
     PLUGIN_LOG_DEBUG_FUNCTION;
     AssertPluginThread();
 
     if (!(aNames && aNameCount > 0 && aIdentifiers)) {
-        NS_RUNTIMEABORT("Bad input! Headed for a crash!");
+        MOZ_CRASH("Bad input! Headed for a crash!");
     }
 
     for (int32_t index = 0; index < aNameCount; ++index) {
         if (!aNames[index]) {
             aIdentifiers[index] = 0;
             continue;
         }
         nsDependentCString name(aNames[index]);
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -692,17 +692,17 @@ PluginModuleParent::PluginModuleParent(b
                                            NS_LITERAL_CSTRING("1") :
                                            NS_LITERAL_CSTRING("0"));
 #endif
 }
 
 PluginModuleParent::~PluginModuleParent()
 {
     if (!OkToCleanup()) {
-        NS_RUNTIMEABORT("unsafe destruction");
+        MOZ_CRASH("unsafe destruction");
     }
 
     if (!mShutdown) {
         NS_WARNING("Plugin host deleted the module without shutting down.");
         NPError err;
         NP_Shutdown(&err);
     }
 }
@@ -759,17 +759,17 @@ PluginModuleChromeParent::PluginModuleCh
 #endif
 
     mozilla::HangMonitor::RegisterAnnotator(*this);
 }
 
 PluginModuleChromeParent::~PluginModuleChromeParent()
 {
     if (!OkToCleanup()) {
-        NS_RUNTIMEABORT("unsafe destruction");
+        MOZ_CRASH("unsafe destruction");
     }
 
 #ifdef MOZ_ENABLE_PROFILER_SPS
     ShutdownPluginProfiling();
 #endif
 
 #ifdef XP_WIN
     // If we registered for audio notifications, stop.
@@ -1598,17 +1598,17 @@ PluginModuleParent::ActorDestroy(ActorDe
                     &PluginModuleParent::NotifyPluginCrashed));
         break;
     }
     case NormalShutdown:
         mShutdown = true;
         break;
 
     default:
-        NS_RUNTIMEABORT("Unexpected shutdown reason for toplevel actor.");
+        MOZ_CRASH("Unexpected shutdown reason for toplevel actor.");
     }
 }
 
 nsresult
 PluginModuleParent::GetRunID(uint32_t* aRunID)
 {
     if (NS_WARN_IF(!aRunID)) {
       return NS_ERROR_INVALID_POINTER;
@@ -1891,17 +1891,17 @@ PluginModuleChromeParent::AnswerNPN_SetV
     return IPC_OK();
 #endif
 }
 
 mozilla::ipc::IPCResult
 PluginModuleParent::RecvBackUpXResources(const FileDescriptor& aXSocketFd)
 {
 #ifndef MOZ_X11
-    NS_RUNTIMEABORT("This message only makes sense on X11 platforms");
+    MOZ_CRASH("This message only makes sense on X11 platforms");
 #else
     MOZ_ASSERT(0 > mPluginXSocketFdDup.get(),
                "Already backed up X resources??");
     if (aXSocketFd.IsValid()) {
       auto rawFD = aXSocketFd.ClonePlatformHandle();
       mPluginXSocketFdDup.reset(rawFD.release());
     }
 #endif
@@ -1926,17 +1926,17 @@ PluginModuleParent::StreamCast(NPP insta
     PluginInstanceParent* ip = PluginInstanceParent::Cast(instance, aSurrogate);
     if (!ip || (aSurrogate && *aSurrogate && ip->UseSurrogate())) {
         return nullptr;
     }
 
     BrowserStreamParent* sp =
         static_cast<BrowserStreamParent*>(static_cast<AStream*>(s->pdata));
     if (sp && (sp->mNPP != ip || s != sp->mStream)) {
-        NS_RUNTIMEABORT("Corrupted plugin stream data.");
+        MOZ_CRASH("Corrupted plugin stream data.");
     }
     return sp;
 }
 
 bool
 PluginModuleParent::HasRequiredFunctions()
 {
     return true;
--- a/dom/plugins/ipc/PluginScriptableObjectChild.cpp
+++ b/dom/plugins/ipc/PluginScriptableObjectChild.cpp
@@ -128,30 +128,30 @@ FromNPIdentifier(NPIdentifier aIdentifie
 // static
 NPObject*
 PluginScriptableObjectChild::ScriptableAllocate(NPP aInstance,
                                                 NPClass* aClass)
 {
   AssertPluginThread();
 
   if (aClass != GetClass()) {
-    NS_RUNTIMEABORT("Huh?! Wrong class!");
+    MOZ_CRASH("Huh?! Wrong class!");
   }
 
   return new ChildNPObject();
 }
 
 // static
 void
 PluginScriptableObjectChild::ScriptableInvalidate(NPObject* aObject)
 {
   AssertPluginThread();
 
   if (aObject->_class != GetClass()) {
-    NS_RUNTIMEABORT("Don't know what kind of object this is!");
+    MOZ_CRASH("Don't know what kind of object this is!");
   }
 
   ChildNPObject* object = reinterpret_cast<ChildNPObject*>(aObject);
   if (object->invalidated) {
     // This can happen more than once, and is just fine.
     return;
   }
 
@@ -160,17 +160,17 @@ PluginScriptableObjectChild::ScriptableI
 
 // static
 void
 PluginScriptableObjectChild::ScriptableDeallocate(NPObject* aObject)
 {
   AssertPluginThread();
 
   if (aObject->_class != GetClass()) {
-    NS_RUNTIMEABORT("Don't know what kind of object this is!");
+    MOZ_CRASH("Don't know what kind of object this is!");
   }
 
   ChildNPObject* object = reinterpret_cast<ChildNPObject*>(aObject);
   PluginScriptableObjectChild* actor = object->parent;
   if (actor) {
     NS_ASSERTION(actor->Type() == Proxy, "Bad type!");
     actor->DropNPObject();
   }
@@ -181,17 +181,17 @@ PluginScriptableObjectChild::ScriptableD
 // static
 bool
 PluginScriptableObjectChild::ScriptableHasMethod(NPObject* aObject,
                                                  NPIdentifier aName)
 {
   AssertPluginThread();
 
   if (aObject->_class != GetClass()) {
-    NS_RUNTIMEABORT("Don't know what kind of object this is!");
+    MOZ_CRASH("Don't know what kind of object this is!");
   }
 
   ChildNPObject* object = reinterpret_cast<ChildNPObject*>(aObject);
   if (object->invalidated) {
     NS_WARNING("Calling method on an invalidated object!");
     return false;
   }
 
@@ -211,17 +211,17 @@ PluginScriptableObjectChild::ScriptableI
                                               NPIdentifier aName,
                                               const NPVariant* aArgs,
                                               uint32_t aArgCount,
                                               NPVariant* aResult)
 {
   AssertPluginThread();
 
   if (aObject->_class != GetClass()) {
-    NS_RUNTIMEABORT("Don't know what kind of object this is!");
+    MOZ_CRASH("Don't know what kind of object this is!");
   }
 
   ChildNPObject* object = reinterpret_cast<ChildNPObject*>(aObject);
   if (object->invalidated) {
     NS_WARNING("Calling method on an invalidated object!");
     return false;
   }
 
@@ -253,17 +253,17 @@ bool
 PluginScriptableObjectChild::ScriptableInvokeDefault(NPObject* aObject,
                                                      const NPVariant* aArgs,
                                                      uint32_t aArgCount,
                                                      NPVariant* aResult)
 {
   AssertPluginThread();
 
   if (aObject->_class != GetClass()) {
-    NS_RUNTIMEABORT("Don't know what kind of object this is!");
+    MOZ_CRASH("Don't know what kind of object this is!");
   }
 
   ChildNPObject* object = reinterpret_cast<ChildNPObject*>(aObject);
   if (object->invalidated) {
     NS_WARNING("Calling method on an invalidated object!");
     return false;
   }
 
@@ -292,17 +292,17 @@ PluginScriptableObjectChild::ScriptableI
 // static
 bool
 PluginScriptableObjectChild::ScriptableHasProperty(NPObject* aObject,
                                                    NPIdentifier aName)
 {
   AssertPluginThread();
 
   if (aObject->_class != GetClass()) {
-    NS_RUNTIMEABORT("Don't know what kind of object this is!");
+    MOZ_CRASH("Don't know what kind of object this is!");
   }
 
   ChildNPObject* object = reinterpret_cast<ChildNPObject*>(aObject);
   if (object->invalidated) {
     NS_WARNING("Calling method on an invalidated object!");
     return false;
   }
 
@@ -320,17 +320,17 @@ PluginScriptableObjectChild::ScriptableH
 bool
 PluginScriptableObjectChild::ScriptableGetProperty(NPObject* aObject,
                                                    NPIdentifier aName,
                                                    NPVariant* aResult)
 {
   AssertPluginThread();
 
   if (aObject->_class != GetClass()) {
-    NS_RUNTIMEABORT("Don't know what kind of object this is!");
+    MOZ_CRASH("Don't know what kind of object this is!");
   }
 
   ChildNPObject* object = reinterpret_cast<ChildNPObject*>(aObject);
   if (object->invalidated) {
     NS_WARNING("Calling method on an invalidated object!");
     return false;
   }
 
@@ -357,17 +357,17 @@ PluginScriptableObjectChild::ScriptableG
 bool
 PluginScriptableObjectChild::ScriptableSetProperty(NPObject* aObject,
                                                    NPIdentifier aName,
                                                    const NPVariant* aValue)
 {
   AssertPluginThread();
 
   if (aObject->_class != GetClass()) {
-    NS_RUNTIMEABORT("Don't know what kind of object this is!");
+    MOZ_CRASH("Don't know what kind of object this is!");
   }
 
   ChildNPObject* object = reinterpret_cast<ChildNPObject*>(aObject);
   if (object->invalidated) {
     NS_WARNING("Calling method on an invalidated object!");
     return false;
   }
 
@@ -391,17 +391,17 @@ PluginScriptableObjectChild::ScriptableS
 // static
 bool
 PluginScriptableObjectChild::ScriptableRemoveProperty(NPObject* aObject,
                                                       NPIdentifier aName)
 {
   AssertPluginThread();
 
   if (aObject->_class != GetClass()) {
-    NS_RUNTIMEABORT("Don't know what kind of object this is!");
+    MOZ_CRASH("Don't know what kind of object this is!");
   }
 
   ChildNPObject* object = reinterpret_cast<ChildNPObject*>(aObject);
   if (object->invalidated) {
     NS_WARNING("Calling method on an invalidated object!");
     return false;
   }
 
@@ -420,17 +420,17 @@ PluginScriptableObjectChild::ScriptableR
 bool
 PluginScriptableObjectChild::ScriptableEnumerate(NPObject* aObject,
                                                  NPIdentifier** aIdentifiers,
                                                  uint32_t* aCount)
 {
   AssertPluginThread();
 
   if (aObject->_class != GetClass()) {
-    NS_RUNTIMEABORT("Don't know what kind of object this is!");
+    MOZ_CRASH("Don't know what kind of object this is!");
   }
 
   ChildNPObject* object = reinterpret_cast<ChildNPObject*>(aObject);
   if (object->invalidated) {
     NS_WARNING("Calling method on an invalidated object!");
     return false;
   }
 
@@ -473,17 +473,17 @@ bool
 PluginScriptableObjectChild::ScriptableConstruct(NPObject* aObject,
                                                  const NPVariant* aArgs,
                                                  uint32_t aArgCount,
                                                  NPVariant* aResult)
 {
   AssertPluginThread();
 
   if (aObject->_class != GetClass()) {
-    NS_RUNTIMEABORT("Don't know what kind of object this is!");
+    MOZ_CRASH("Don't know what kind of object this is!");
   }
 
   ChildNPObject* object = reinterpret_cast<ChildNPObject*>(aObject);
   if (object->invalidated) {
     NS_WARNING("Calling method on an invalidated object!");
     return false;
   }
 
--- a/dom/plugins/ipc/PluginStreamChild.h
+++ b/dom/plugins/ipc/PluginStreamChild.h
@@ -28,22 +28,22 @@ public:
                                                    const bool& artificial) override;
 
   int32_t NPN_Write(int32_t length, void* buffer);
   void NPP_DestroyStream(NPError reason);
 
   void EnsureCorrectInstance(PluginInstanceChild* i)
   {
     if (i != Instance())
-      NS_RUNTIMEABORT("Incorrect stream instance");
+      MOZ_CRASH("Incorrect stream instance");
   }
   void EnsureCorrectStream(NPStream* s)
   {
     if (s != &mStream)
-      NS_RUNTIMEABORT("Incorrect stream data");
+      MOZ_CRASH("Incorrect stream data");
   }
 
 private:
   PluginInstanceChild* Instance();
 
   NPStream mStream;
   bool mClosed;
 };
--- a/dom/workers/ServiceWorkerPrivate.cpp
+++ b/dom/workers/ServiceWorkerPrivate.cpp
@@ -713,17 +713,17 @@ public:
     if (mDone) {
       return;
     }
     mDone = true;
 
     mCallback->SetResult(aResult);
     nsresult rv = mWorkerPrivate->DispatchToMainThread(mCallback);
     if (NS_WARN_IF(NS_FAILED(rv))) {
-      NS_RUNTIMEABORT("Failed to dispatch life cycle event handler.");
+      MOZ_CRASH("Failed to dispatch life cycle event handler.");
     }
 
     ReleaseWorker();
   }
 
   void
   FinishedWithResult(ExtendableEventResult aResult) override
   {
--- a/dom/xhr/XMLHttpRequestWorker.cpp
+++ b/dom/xhr/XMLHttpRequestWorker.cpp
@@ -901,28 +901,28 @@ Proxy::Teardown(bool aSendUnpin)
       rv.SuppressException();
     }
 
     if (mOutstandingSendCount) {
       if (aSendUnpin) {
         RefPtr<XHRUnpinRunnable> runnable =
           new XHRUnpinRunnable(mWorkerPrivate, mXMLHttpRequestPrivate);
         if (!runnable->Dispatch()) {
-          NS_RUNTIMEABORT("We're going to hang at shutdown anyways.");
+          MOZ_CRASH("We're going to hang at shutdown anyways.");
         }
       }
 
       if (mSyncLoopTarget) {
         // We have an unclosed sync loop.  Fix that now.
         RefPtr<MainThreadStopSyncLoopRunnable> runnable =
           new MainThreadStopSyncLoopRunnable(mWorkerPrivate,
                                              mSyncLoopTarget.forget(),
                                              false);
         if (!runnable->Dispatch()) {
-          NS_RUNTIMEABORT("We're going to hang at shutdown anyways.");
+          MOZ_CRASH("We're going to hang at shutdown anyways.");
         }
       }
 
       mOutstandingSendCount = 0;
     }
 
     mWorkerPrivate = nullptr;
     mXHRUpload = nullptr;
--- a/dom/xslt/xslt/txMozillaXSLTProcessor.cpp
+++ b/dom/xslt/xslt/txMozillaXSLTProcessor.cpp
@@ -120,17 +120,17 @@ txToDocHandlerFactory::createHandlerWith
             if (NS_SUCCEEDED(rv)) {
                 *aHandler = handler.forget();
             }
 
             return rv;
         }
     }
 
-    NS_RUNTIMEABORT("Unknown output method");
+    MOZ_CRASH("Unknown output method");
 
     return NS_ERROR_FAILURE;
 }
 
 nsresult
 txToDocHandlerFactory::createHandlerWith(txOutputFormat* aFormat,
                                          const nsSubstring& aName,
                                          int32_t aNsID,
@@ -170,17 +170,17 @@ txToDocHandlerFactory::createHandlerWith
             if (NS_SUCCEEDED(rv)) {
                 *aHandler = handler.forget();
             }
 
             return rv;
         }
     }
 
-    NS_RUNTIMEABORT("Unknown output method");
+    MOZ_CRASH("Unknown output method");
 
     return NS_ERROR_FAILURE;
 }
 
 nsresult
 txToFragmentHandlerFactory::createHandlerWith(txOutputFormat* aFormat,
                                               txAXMLEventHandler** aHandler)
 {
--- a/dom/xslt/xslt/txStylesheetCompiler.cpp
+++ b/dom/xslt/xslt/txStylesheetCompiler.cpp
@@ -671,29 +671,29 @@ txStylesheetCompilerState::pushPtr(void*
     return mOtherStack.push(aPtr);
 }
 
 void*
 txStylesheetCompilerState::popPtr(enumStackType aType)
 {
     uint32_t stacklen = mTypeStack.Length();
     if (stacklen == 0) {
-        NS_RUNTIMEABORT("Attempt to pop when type stack is empty");
+        MOZ_CRASH("Attempt to pop when type stack is empty");
     }
 
     enumStackType type = mTypeStack.ElementAt(stacklen - 1);
     mTypeStack.RemoveElementAt(stacklen - 1);
     void* value = mOtherStack.pop();
     
 #ifdef TX_DEBUG_STACK
     MOZ_LOG(txLog::xslt, LogLevel::Debug, ("popPtr: 0x%x type %u requested %u\n", value, type, aType));
 #endif
     
     if (type != aType) {
-        NS_RUNTIMEABORT("Expected type does not match top element type");
+        MOZ_CRASH("Expected type does not match top element type");
     }
 
     return value;
 }
 
 nsresult
 txStylesheetCompilerState::addToplevelItem(txToplevelItem* aItem)
 {
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -58,17 +58,17 @@ IsChildProcess()
  *          process, nullptr.
  */
 static ContentChild*
 ChildProcess()
 {
   if (IsChildProcess()) {
     ContentChild* cpc = ContentChild::GetSingleton();
     if (!cpc)
-      NS_RUNTIMEABORT("Content Process is nullptr!");
+      MOZ_CRASH("Content Process is nullptr!");
     return cpc;
   }
 
   return nullptr;
 }
 
 static void
 LogToConsole(const nsAString& aMsg)
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -2147,23 +2147,23 @@ GLContext::AssembleOffscreenFBs(const GL
         }
   #endif
         isComplete = false;
     }
 
     if (drawFB_out) {
         *drawFB_out = drawFB;
     } else if (drawFB) {
-        NS_RUNTIMEABORT("drawFB created when not requested!");
+        MOZ_CRASH("drawFB created when not requested!");
     }
 
     if (readFB_out) {
         *readFB_out = readFB;
     } else if (readFB) {
-        NS_RUNTIMEABORT("readFB created when not requested!");
+        MOZ_CRASH("readFB created when not requested!");
     }
 
     return isComplete;
 }
 
 
 void
 GLContext::ClearSafely()
--- a/gfx/layers/basic/BasicCompositor.cpp
+++ b/gfx/layers/basic/BasicCompositor.cpp
@@ -679,17 +679,17 @@ BasicCompositor::DrawQuad(const gfx::Rec
         }
       } else {
         gfxDevCrash(LogReason::IncompatibleBasicTexturedEffect) << "Bad for basic with " << texturedEffect->mTexture->Name() << " and " << gfx::hexa(sourceMask);
       }
 
       break;
     }
     case EffectTypes::YCBCR: {
-      NS_RUNTIMEABORT("Can't (easily) support component alpha with BasicCompositor!");
+      MOZ_CRASH("Can't (easily) support component alpha with BasicCompositor!");
       break;
     }
     case EffectTypes::RENDER_TARGET: {
       EffectRenderTarget* effectRenderTarget =
         static_cast<EffectRenderTarget*>(aEffectChain.mPrimaryEffect.get());
       RefPtr<BasicCompositingRenderTarget> surface
         = static_cast<BasicCompositingRenderTarget*>(effectRenderTarget->mRenderTarget.get());
       RefPtr<SourceSurface> sourceSurf = surface->mDrawTarget->Snapshot();
@@ -698,21 +698,21 @@ BasicCompositor::DrawQuad(const gfx::Rec
                                    sourceSurf,
                                    effectRenderTarget->mTextureCoords,
                                    effectRenderTarget->mSamplingFilter,
                                    DrawOptions(aOpacity, blendMode),
                                    sourceMask, &maskTransform);
       break;
     }
     case EffectTypes::COMPONENT_ALPHA: {
-      NS_RUNTIMEABORT("Can't (easily) support component alpha with BasicCompositor!");
+      MOZ_CRASH("Can't (easily) support component alpha with BasicCompositor!");
       break;
     }
     default: {
-      NS_RUNTIMEABORT("Invalid effect type!");
+      MOZ_CRASH("Invalid effect type!");
       break;
     }
   }
 
   if (!aTransform.Is2D()) {
     dest->Flush();
 
     RefPtr<SourceSurface> destSnapshot = dest->Snapshot();
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -693,17 +693,17 @@ ClientLayerManager::ForwardTransaction(b
           static_cast<ContentClientRemote*>(compositable.get());
         MOZ_ASSERT(contentClient);
 
         contentClient->SwapBuffers(obs.frontUpdatedRegion());
 
         break;
       }
       default:
-        NS_RUNTIMEABORT("not reached");
+        MOZ_CRASH("not reached");
       }
     }
 
     if (sent) {
       mNeedsComposite = false;
     }
   } else if (HasShadowManager()) {
     NS_WARNING("failed to forward Layers transaction");
@@ -825,17 +825,17 @@ ClientLayerManager::GetBackendName(nsASt
       if (DeviceManagerDx::Get()->IsWARP()) {
         aName.AssignLiteral("Direct3D 11 WARP");
       } else {
         aName.AssignLiteral("Direct3D 11");
       }
 #endif
       return;
     }
-    default: NS_RUNTIMEABORT("Invalid backend");
+    default: MOZ_CRASH("Invalid backend");
   }
 }
 
 bool
 ClientLayerManager::AsyncPanZoomEnabled() const
 {
   return mWidget && mWidget->AsyncPanZoomEnabled();
 }
--- a/gfx/layers/composite/CanvasLayerComposite.h
+++ b/gfx/layers/composite/CanvasLayerComposite.h
@@ -31,17 +31,17 @@ public:
 
 protected:
   virtual ~CanvasLayerComposite();
 
 public:
   // CanvasLayer impl
   virtual void Initialize(const Data& aData) override
   {
-    NS_RUNTIMEABORT("Incompatibe surface type");
+    MOZ_CRASH("Incompatibe surface type");
   }
 
   virtual LayerRenderState GetRenderState() override;
 
   virtual bool SetCompositableHost(CompositableHost* aHost) override;
 
   virtual void Disconnect() override
   {
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -503,17 +503,17 @@ LayerManagerComposite::UpdateAndRender()
 
   // Update cached layer tree information.
   mClonedLayerTreeProperties = LayerProperties::CloneFrom(GetRoot());
 }
 
 already_AddRefed<DrawTarget>
 LayerManagerComposite::CreateOptimalMaskDrawTarget(const IntSize &aSize)
 {
-  NS_RUNTIMEABORT("Should only be called on the drawing side");
+  MOZ_CRASH("Should only be called on the drawing side");
   return nullptr;
 }
 
 LayerComposite*
 LayerManagerComposite::RootLayer() const
 {
   if (mDestroyed) {
     NS_WARNING("Call on destroyed layer manager");
--- a/gfx/layers/composite/PaintedLayerComposite.h
+++ b/gfx/layers/composite/PaintedLayerComposite.h
@@ -58,17 +58,17 @@ public:
   virtual void GenEffectChain(EffectChain& aEffect) override;
 
   virtual bool SetCompositableHost(CompositableHost* aHost) override;
 
   virtual HostLayer* AsHostLayer() override { return this; }
 
   virtual void InvalidateRegion(const nsIntRegion& aRegion) override
   {
-    NS_RUNTIMEABORT("PaintedLayerComposites can't fill invalidated regions");
+    MOZ_CRASH("PaintedLayerComposites can't fill invalidated regions");
   }
 
   const virtual gfx::TiledIntRegion& GetInvalidRegion() override;
 
   MOZ_LAYER_DECL_NAME("PaintedLayerComposite", TYPE_PAINTED)
 
 protected:
 
--- a/gfx/layers/d3d11/CompositorD3D11.h
+++ b/gfx/layers/d3d11/CompositorD3D11.h
@@ -80,17 +80,17 @@ public:
 
   /**
    * Declare an offset to use when rendering layers. This will be ignored when
    * rendering to a target instead of the screen.
    */
   virtual void SetScreenRenderOffset(const ScreenPoint& aOffset) override
   {
     if (aOffset.x || aOffset.y) {
-      NS_RUNTIMEABORT("SetScreenRenderOffset not supported by CompositorD3D11.");
+      MOZ_CRASH("SetScreenRenderOffset not supported by CompositorD3D11.");
     }
     // If the offset is 0, 0 that's okay.
   }
 
   virtual void ClearRect(const gfx::Rect& aRect) override;
 
   virtual void DrawQuad(const gfx::Rect &aRect,
                         const gfx::IntRect &aClipRect,
--- a/gfx/layers/d3d9/CompositorD3D9.h
+++ b/gfx/layers/d3d9/CompositorD3D9.h
@@ -108,17 +108,17 @@ public:
 
   /**
    * Declare an offset to use when rendering layers. This will be ignored when
    * rendering to a target instead of the screen.
    */
   virtual void SetScreenRenderOffset(const ScreenPoint& aOffset) override
   {
     if (aOffset.x || aOffset.y) {
-      NS_RUNTIMEABORT("SetScreenRenderOffset not supported by CompositorD3D9.");
+      MOZ_CRASH("SetScreenRenderOffset not supported by CompositorD3D9.");
     }
     // If the offset is 0, 0 that's okay.
   }
 
   virtual already_AddRefed<DataTextureSource>
     CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) override;
 private:
   // ensure mSize is up to date with respect to mWidget
--- a/gfx/layers/ipc/ImageBridgeChild.cpp
+++ b/gfx/layers/ipc/ImageBridgeChild.cpp
@@ -638,17 +638,17 @@ ImageBridgeChild::EndTransaction()
     // If we don't require a swap we can call SendUpdateNoSwap which
     // assumes that aReplies is empty (DEBUG assertion)
     if (!SendUpdateNoSwap(cset, mTxn->mDestroyedActors, GetFwdTransactionId())) {
       NS_WARNING("could not send async texture transaction (no swap)");
       return;
     }
   }
   for (nsTArray<EditReply>::size_type i = 0; i < replies.Length(); ++i) {
-    NS_RUNTIMEABORT("not reached");
+    MOZ_CRASH("not reached");
   }
 }
 
 void
 ImageBridgeChild::SendImageBridgeThreadId()
 {
 }
 
@@ -1092,17 +1092,17 @@ ImageBridgeChild::DeallocPMediaSystemRes
   delete static_cast<mozilla::media::MediaSystemResourceManagerChild*>(aActor);
   return true;
 }
 
 PImageContainerChild*
 ImageBridgeChild::AllocPImageContainerChild()
 {
   // we always use the "power-user" ctor
-  NS_RUNTIMEABORT("not reached");
+  MOZ_CRASH("not reached");
   return nullptr;
 }
 
 bool
 ImageBridgeChild::DeallocPImageContainerChild(PImageContainerChild* actor)
 {
   static_cast<ImageContainerChild*>(actor)->UnregisterFromIPDL();
   return true;
--- a/gfx/layers/ipc/ImageBridgeChild.h
+++ b/gfx/layers/ipc/ImageBridgeChild.h
@@ -298,23 +298,23 @@ public:
   virtual bool DestroyInTransaction(PCompositableChild* aCompositable, bool synchronously) override;
 
   virtual void RemoveTextureFromCompositable(CompositableClient* aCompositable,
                                              TextureClient* aTexture) override;
 
   virtual void UseTiledLayerBuffer(CompositableClient* aCompositable,
                                    const SurfaceDescriptorTiles& aTileLayerDescriptor) override
   {
-    NS_RUNTIMEABORT("should not be called");
+    MOZ_CRASH("should not be called");
   }
 
   virtual void UpdateTextureRegion(CompositableClient* aCompositable,
                                    const ThebesBufferData& aThebesBufferData,
                                    const nsIntRegion& aUpdatedRegion) override {
-    NS_RUNTIMEABORT("should not be called");
+    MOZ_CRASH("should not be called");
   }
 
   // ISurfaceAllocator
 
   /**
    * See ISurfaceAllocator.h
    * Can be used from any thread.
    * If used outside the ImageBridgeChild thread, it will proxy a synchronous
--- a/gfx/layers/ipc/LayerTransactionChild.cpp
+++ b/gfx/layers/ipc/LayerTransactionChild.cpp
@@ -38,17 +38,17 @@ LayerTransactionChild::Destroy()
   SendShutdown();
 }
 
 
 PLayerChild*
 LayerTransactionChild::AllocPLayerChild()
 {
   // we always use the "power-user" ctor
-  NS_RUNTIMEABORT("not reached");
+  MOZ_CRASH("not reached");
   return nullptr;
 }
 
 bool
 LayerTransactionChild::DeallocPLayerChild(PLayerChild* actor)
 {
   delete actor;
   return true;
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -532,17 +532,17 @@ LayerTransactionParent::RecvUpdate(Infal
           return IPC_FAIL_NO_REASON(this);
         }
         const ImageLayerAttributes& attrs = specific.get_ImageLayerAttributes();
         imageLayer->SetSamplingFilter(attrs.samplingFilter());
         imageLayer->SetScaleToSize(attrs.scaleToSize(), attrs.scaleMode());
         break;
       }
       default:
-        NS_RUNTIMEABORT("not reached");
+        MOZ_CRASH("not reached");
       }
 
       updateHitTestingTree = true;
       break;
     }
     case Edit::TOpSetDiagnosticTypes: {
       mLayerManager->GetCompositor()->SetDiagnosticTypes(
         edit.get_OpSetDiagnosticTypes().diagnostics());
@@ -699,17 +699,17 @@ LayerTransactionParent::RecvUpdate(Infal
         return IPC_FAIL_NO_REASON(this);
       }
       if (mLayerManager->GetCompositor()) {
         host->SetCompositorID(mLayerManager->GetCompositor()->GetCompositorID());
       }
       break;
     }
     default:
-      NS_RUNTIMEABORT("not reached");
+      MOZ_CRASH("not reached");
     }
   }
 
   mCompositorBridge->ShadowLayersUpdated(this, aTransactionId, targetConfig,
                                          aPlugins, isFirstPaint, scheduleComposite,
                                          paintSequenceNumber, isRepeatTransaction,
                                          aPaintSyncId, updateHitTestingTree);
 
--- a/gfx/layers/ipc/ShadowLayerParent.cpp
+++ b/gfx/layers/ipc/ShadowLayerParent.cpp
@@ -120,17 +120,17 @@ ShadowLayerParent::AsBorderLayer() const
          : nullptr;
 }
 
 void
 ShadowLayerParent::ActorDestroy(ActorDestroyReason why)
 {
   switch (why) {
   case AncestorDeletion:
-    NS_RUNTIMEABORT("shadow layer deleted out of order!");
+    MOZ_CRASH("shadow layer deleted out of order!");
     return;                     // unreached
 
   case Deletion:
     // See comment near Destroy() above.
     Disconnect();
     break;
 
   case AbnormalShutdown:
@@ -138,17 +138,17 @@ ShadowLayerParent::ActorDestroy(ActorDes
     break;
 
   case NormalShutdown:
     // let IPDL-generated code automatically clean up Shmems and so
     // forth; our channel is disconnected anyway
     break;
 
   case FailedConstructor:
-    NS_RUNTIMEABORT("FailedConstructor isn't possible in PLayerTransaction");
+    MOZ_CRASH("FailedConstructor isn't possible in PLayerTransaction");
     return;                     // unreached
   }
 
   mLayer = nullptr;
 }
 
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -230,17 +230,17 @@ CompositorOGL::Initialize(nsCString* con
   // Do not allow double initialization
   MOZ_ASSERT(mGLContext == nullptr, "Don't reinitialize CompositorOGL");
 
   mGLContext = CreateContext();
 
 #ifdef MOZ_WIDGET_ANDROID
   if (!mGLContext){
     *out_failureReason = "FEATURE_FAILURE_OPENGL_NO_ANDROID_CONTEXT";
-    NS_RUNTIMEABORT("We need a context on Android");
+    MOZ_CRASH("We need a context on Android");
   }
 #endif
 
   if (!mGLContext){
     *out_failureReason = "FEATURE_FAILURE_OPENGL_CREATE_CONTEXT";
     return false;
   }
 
--- a/gfx/tests/gtest/TestLayers.cpp
+++ b/gfx/tests/gtest/TestLayers.cpp
@@ -62,17 +62,17 @@ public:
   virtual already_AddRefed<ContainerLayer> CreateContainerLayer() {
     RefPtr<ContainerLayer> layer = new TestContainerLayer(this);
     return layer.forget();
   }
   virtual void GetBackendName(nsAString& aName) {}
   virtual LayersBackend GetBackendType() { return LayersBackend::LAYERS_BASIC; }
   virtual bool BeginTransaction() { return true; }
   virtual already_AddRefed<ImageLayer> CreateImageLayer() {
-    NS_RUNTIMEABORT("Not implemented.");
+    MOZ_CRASH("Not implemented.");
     return nullptr;
   }
   virtual already_AddRefed<PaintedLayer> CreatePaintedLayer() {
     RefPtr<PaintedLayer> layer = new TestPaintedLayer(this);
     return layer.forget();
   }
   virtual already_AddRefed<ColorLayer> CreateColorLayer() {
     NS_RUNTIMEABORT("Not implemented.");
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -1226,17 +1226,17 @@ gfxFT2FontList::FindFonts()
         root = NS_LITERAL_CSTRING("/system");
     }
     root.AppendLiteral("/fonts");
 
     FindFontsInDir(root, mFontNameCache.get(), FT2FontFamily::kVisible);
 
     if (mFontFamilies.Count() == 0) {
         // if we can't find/read the font directory, we are doomed!
-        NS_RUNTIMEABORT("Could not read the system fonts directory");
+        MOZ_CRASH("Could not read the system fonts directory");
     }
 
     // Look for fonts stored in omnijar, unless we're on a low-memory
     // device where we don't want to spend the RAM to decompress them.
     // (Prefs may disable this, or force-enable it even with low memory.)
     bool lowmem;
     nsCOMPtr<nsIMemory> mem = nsMemory::GetGlobalMemoryService();
     if ((NS_SUCCEEDED(mem->IsLowMemoryPlatform(&lowmem)) && !lowmem &&
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -598,17 +598,17 @@ static uint32_t GetSkiaGlyphCacheSize()
 
 void
 gfxPlatform::Init()
 {
     MOZ_RELEASE_ASSERT(!XRE_IsGPUProcess(), "GFX: Not allowed in GPU process.");
     MOZ_RELEASE_ASSERT(NS_IsMainThread(), "GFX: Not in main thread.");
 
     if (gEverInitialized) {
-        NS_RUNTIMEABORT("Already started???");
+        MOZ_CRASH("Already started???");
     }
     gEverInitialized = true;
 
     // Initialize the preferences by creating the singleton.
     gfxPrefs::GetSingleton();
     MediaPrefs::GetSingleton();
     gfxVars::Initialize();
 
@@ -714,38 +714,38 @@ gfxPlatform::Init()
     bool usePlatformFontList = true;
 #if defined(MOZ_WIDGET_GTK)
     usePlatformFontList = gfxPlatformGtk::UseFcFontList();
 #endif
 
     if (usePlatformFontList) {
         rv = gfxPlatformFontList::Init();
         if (NS_FAILED(rv)) {
-            NS_RUNTIMEABORT("Could not initialize gfxPlatformFontList");
+            MOZ_CRASH("Could not initialize gfxPlatformFontList");
         }
     }
 
     gPlatform->mScreenReferenceSurface =
         gPlatform->CreateOffscreenSurface(IntSize(1, 1),
                                           SurfaceFormat::A8R8G8B8_UINT32);
     if (!gPlatform->mScreenReferenceSurface) {
-        NS_RUNTIMEABORT("Could not initialize mScreenReferenceSurface");
+        MOZ_CRASH("Could not initialize mScreenReferenceSurface");
     }
 
     gPlatform->mScreenReferenceDrawTarget =
         gPlatform->CreateOffscreenContentDrawTarget(IntSize(1, 1),
                                                     SurfaceFormat::B8G8R8A8);
     if (!gPlatform->mScreenReferenceDrawTarget ||
         !gPlatform->mScreenReferenceDrawTarget->IsValid()) {
-      NS_RUNTIMEABORT("Could not initialize mScreenReferenceDrawTarget");
+      MOZ_CRASH("Could not initialize mScreenReferenceDrawTarget");
     }
 
     rv = gfxFontCache::Init();
     if (NS_FAILED(rv)) {
-        NS_RUNTIMEABORT("Could not initialize gfxFontCache");
+        MOZ_CRASH("Could not initialize gfxFontCache");
     }
 
     /* Create and register our CMS Override observer. */
     gPlatform->mSRGBOverrideObserver = new SRGBOverrideObserver();
     Preferences::AddWeakObserver(gPlatform->mSRGBOverrideObserver, GFX_PREF_CMS_FORCE_SRGB);
 
     gPlatform->mFontPrefsObserver = new FontPrefsObserver();
     Preferences::AddStrongObservers(gPlatform->mFontPrefsObserver, kObservedPrefs);
@@ -766,17 +766,17 @@ gfxPlatform::Init()
     if (obs) {
         gPlatform->mMemoryPressureObserver = new MemoryPressureObserver();
         obs->AddObserver(gPlatform->mMemoryPressureObserver, "memory-pressure", false);
     }
 
     // Request the imgITools service, implicitly initializing ImageLib.
     nsCOMPtr<imgITools> imgTools = do_GetService("@mozilla.org/image/tools;1");
     if (!imgTools) {
-      NS_RUNTIMEABORT("Could not initialize ImageLib");
+      MOZ_CRASH("Could not initialize ImageLib");
     }
 
     RegisterStrongMemoryReporter(new GfxMemoryImageReporter());
 
     if (XRE_IsParentProcess()) {
       if (gfxPlatform::ForceSoftwareVsync()) {
         gPlatform->mVsyncSource = (gPlatform)->gfxPlatform::CreateHardwareVsyncSource();
       } else {
@@ -2467,18 +2467,18 @@ gfxPlatform::GetAcceleratedCompositorBac
   }
   else {
     static int tell_me_once = 0;
     if (!tell_me_once) {
       NS_WARNING("OpenGL-accelerated layers are not supported on this system");
       tell_me_once = 1;
     }
 #ifdef MOZ_WIDGET_ANDROID
-    NS_RUNTIMEABORT("OpenGL-accelerated layers are a hard requirement on this platform. "
-                    "Cannot continue without support for them");
+    MOZ_CRASH("OpenGL-accelerated layers are a hard requirement on this platform. "
+              "Cannot continue without support for them");
 #endif
   }
 }
 
 void
 gfxPlatform::GetCompositorBackends(bool useAcceleration, nsTArray<mozilla::layers::LayersBackend>& aBackends)
 {
   if (useAcceleration) {
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -241,29 +241,29 @@ void
 DisableSystemTimezoneChangeNotifications()
 {
   Hal()->SendDisableSystemTimezoneChangeNotifications();
 }
 
 void
 Reboot()
 {
-  NS_RUNTIMEABORT("Reboot() can't be called from sandboxed contexts.");
+  MOZ_CRASH("Reboot() can't be called from sandboxed contexts.");
 }
 
 void
 PowerOff()
 {
-  NS_RUNTIMEABORT("PowerOff() can't be called from sandboxed contexts.");
+  MOZ_CRASH("PowerOff() can't be called from sandboxed contexts.");
 }
 
 void
 StartForceQuitWatchdog(ShutdownMode aMode, int32_t aTimeoutSecs)
 {
-  NS_RUNTIMEABORT("StartForceQuitWatchdog() can't be called from sandboxed contexts.");
+  MOZ_CRASH("StartForceQuitWatchdog() can't be called from sandboxed contexts.");
 }
 
 void
 EnableSensorNotifications(SensorType aSensor) {
   Hal()->SendEnableSensorNotifications(aSensor);
 }
 
 void
@@ -376,45 +376,45 @@ FactoryReset(FactoryResetReason& aReason
   } else if (aReason == FactoryResetReason::Root) {
     Hal()->SendFactoryReset(NS_LITERAL_STRING("root"));
   }
 }
 
 void
 StartDiskSpaceWatcher()
 {
-  NS_RUNTIMEABORT("StartDiskSpaceWatcher() can't be called from sandboxed contexts.");
+  MOZ_CRASH("StartDiskSpaceWatcher() can't be called from sandboxed contexts.");
 }
 
 void
 StopDiskSpaceWatcher()
 {
-  NS_RUNTIMEABORT("StopDiskSpaceWatcher() can't be called from sandboxed contexts.");
+  MOZ_CRASH("StopDiskSpaceWatcher() can't be called from sandboxed contexts.");
 }
 
 bool IsHeadphoneEventFromInputDev()
 {
-  NS_RUNTIMEABORT("IsHeadphoneEventFromInputDev() cannot be called from sandboxed contexts.");
+  MOZ_CRASH("IsHeadphoneEventFromInputDev() cannot be called from sandboxed contexts.");
   return false;
 }
 
 nsresult StartSystemService(const char* aSvcName, const char* aArgs)
 {
-  NS_RUNTIMEABORT("System services cannot be controlled from sandboxed contexts.");
+  MOZ_CRASH("System services cannot be controlled from sandboxed contexts.");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 void StopSystemService(const char* aSvcName)
 {
-  NS_RUNTIMEABORT("System services cannot be controlled from sandboxed contexts.");
+  MOZ_CRASH("System services cannot be controlled from sandboxed contexts.");
 }
 
 bool SystemServiceIsRunning(const char* aSvcName)
 {
-  NS_RUNTIMEABORT("System services cannot be controlled from sandboxed contexts.");
+  MOZ_CRASH("System services cannot be controlled from sandboxed contexts.");
   return false;
 }
 
 class HalParent : public PHalParent
                 , public BatteryObserver
                 , public NetworkObserver
                 , public ISensorObserver
                 , public WakeLockObserver
--- a/ipc/glue/CrossProcessMutex_unimplemented.cpp
+++ b/ipc/glue/CrossProcessMutex_unimplemented.cpp
@@ -7,41 +7,41 @@
 #include "CrossProcessMutex.h"
 
 #include "nsDebug.h"
 
 namespace mozilla {
 
 CrossProcessMutex::CrossProcessMutex(const char*)
 {
-  NS_RUNTIMEABORT("Cross-process mutices not allowed on this platform.");
+  MOZ_CRASH("Cross-process mutices not allowed on this platform.");
 }
 
 CrossProcessMutex::CrossProcessMutex(CrossProcessMutexHandle)
 {
-  NS_RUNTIMEABORT("Cross-process mutices not allowed on this platform.");
+  MOZ_CRASH("Cross-process mutices not allowed on this platform.");
 }
 
 CrossProcessMutex::~CrossProcessMutex()
 {
-  NS_RUNTIMEABORT("Cross-process mutices not allowed on this platform - woah! We should've aborted by now!");
+  MOZ_CRASH("Cross-process mutices not allowed on this platform - woah! We should've aborted by now!");
 }
 
 void
 CrossProcessMutex::Lock()
 {
-  NS_RUNTIMEABORT("Cross-process mutices not allowed on this platform - woah! We should've aborted by now!");
+  MOZ_CRASH("Cross-process mutices not allowed on this platform - woah! We should've aborted by now!");
 }
 
 void
 CrossProcessMutex::Unlock()
 {
-  NS_RUNTIMEABORT("Cross-process mutices not allowed on this platform - woah! We should've aborted by now!");
+  MOZ_CRASH("Cross-process mutices not allowed on this platform - woah! We should've aborted by now!");
 }
 
 CrossProcessMutexHandle
 CrossProcessMutex::ShareToProcess(base::ProcessId aTargetPid)
 {
-  NS_RUNTIMEABORT("Cross-process mutices not allowed on this platform - woah! We should've aborted by now!");
+  MOZ_CRASH("Cross-process mutices not allowed on this platform - woah! We should've aborted by now!");
   return 0;
 }
 
 }
--- a/ipc/glue/CrossProcessMutex_windows.cpp
+++ b/ipc/glue/CrossProcessMutex_windows.cpp
@@ -19,26 +19,26 @@ namespace mozilla {
 
 CrossProcessMutex::CrossProcessMutex(const char*)
 {
   // We explicitly share this using DuplicateHandle, we do -not- want this to
   // be inherited by child processes by default! So no security attributes are
   // given.
   mMutex = ::CreateMutexA(nullptr, FALSE, nullptr);
   if (!mMutex) {
-    NS_RUNTIMEABORT("This shouldn't happen - failed to create mutex!");
+    MOZ_CRASH("This shouldn't happen - failed to create mutex!");
   }
   MOZ_COUNT_CTOR(CrossProcessMutex);
 }
 
 CrossProcessMutex::CrossProcessMutex(CrossProcessMutexHandle aHandle)
 {
   DWORD flags;
   if (!::GetHandleInformation(aHandle, &flags)) {
-    NS_RUNTIMEABORT("Attempt to construct a mutex from an invalid handle!");
+    MOZ_CRASH("Attempt to construct a mutex from an invalid handle!");
   }
   mMutex = aHandle;
   MOZ_COUNT_CTOR(CrossProcessMutex);
 }
 
 CrossProcessMutex::~CrossProcessMutex()
 {
   NS_ASSERTION(mMutex, "Improper construction of mutex or double free.");
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -1192,17 +1192,17 @@ GeckoChildProcessHost::PerformAsyncLaunc
       && !::DuplicateHandle(::GetCurrentProcess(), process,
                             ::GetCurrentProcess(), &mChildProcessHandle,
                             PROCESS_DUP_HANDLE | PROCESS_TERMINATE |
                             PROCESS_QUERY_INFORMATION | PROCESS_VM_READ |
                             SYNCHRONIZE,
                             FALSE, 0)
 #endif
      ) {
-    NS_RUNTIMEABORT("cannot open handle to child process");
+    MOZ_CRASH("cannot open handle to child process");
   }
   MonitorAutoLock lock(mMonitor);
   mProcessState = PROCESS_CREATED;
   lock.Notify();
 
   return true;
 }
 
@@ -1216,17 +1216,17 @@ GeckoChildProcessHost::OpenPrivilegedHan
 
   return base::OpenPrivilegedProcessHandle(aPid, &mChildProcessHandle);
 }
 
 void
 GeckoChildProcessHost::OnChannelConnected(int32_t peer_pid)
 {
   if (!OpenPrivilegedHandle(peer_pid)) {
-    NS_RUNTIMEABORT("can't open handle to child process");
+    MOZ_CRASH("can't open handle to child process");
   }
   MonitorAutoLock lock(mMonitor);
   mProcessState = PROCESS_CONNECTED;
   lock.Notify();
 }
 
 void
 GeckoChildProcessHost::OnMessageReceived(IPC::Message&& aMsg)
--- a/ipc/glue/IPCMessageUtils.h
+++ b/ipc/glue/IPCMessageUtils.h
@@ -264,20 +264,20 @@ struct ParamTraits<uint8_t>
 
 #if !defined(OS_POSIX)
 // See above re: keeping definitions in sync
 template<>
 struct ParamTraits<base::FileDescriptor>
 {
   typedef base::FileDescriptor paramType;
   static void Write(Message* aMsg, const paramType& aParam) {
-    NS_RUNTIMEABORT("FileDescriptor isn't meaningful on this platform");
+    MOZ_CRASH("FileDescriptor isn't meaningful on this platform");
   }
   static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
-    NS_RUNTIMEABORT("FileDescriptor isn't meaningful on this platform");
+    MOZ_CRASH("FileDescriptor isn't meaningful on this platform");
     return false;
   }
 };
 #endif  // !defined(OS_POSIX)
 
 template <>
 struct ParamTraits<nsACString>
 {
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -1734,17 +1734,17 @@ MessageChannel::DispatchSyncMessage(cons
 
 void
 MessageChannel::DispatchAsyncMessage(const Message& aMsg)
 {
     AssertWorkerThread();
     MOZ_RELEASE_ASSERT(!aMsg.is_interrupt() && !aMsg.is_sync());
 
     if (aMsg.routing_id() == MSG_ROUTING_NONE) {
-        NS_RUNTIMEABORT("unhandled special message!");
+        MOZ_CRASH("unhandled special message!");
     }
 
     Result rv;
     {
         int nestedLevel = aMsg.nested_level();
         AutoSetValue<bool> async(mDispatchingAsyncMessage, true);
         AutoSetValue<int> nestedLevelSet(mDispatchingAsyncMessageNestedLevel, nestedLevel);
         rv = mListener->OnMessageReceived(aMsg);
@@ -1778,20 +1778,20 @@ MessageChannel::DispatchInterruptMessage
             winner = "child";
             defer = (mSide == ChildSide);
             break;
           case RIPParentWins:
             winner = "parent";
             defer = (mSide != ChildSide);
             break;
           case RIPError:
-            NS_RUNTIMEABORT("NYI: 'Error' Interrupt race policy");
+            MOZ_CRASH("NYI: 'Error' Interrupt race policy");
             return;
           default:
-            NS_RUNTIMEABORT("not reached");
+            MOZ_CRASH("not reached");
             return;
         }
 
         if (LoggingEnabled()) {
             printf_stderr("  (%s: %s won, so we're%sdeferring)\n",
                           (mSide == ChildSide) ? "child" : "parent",
                           winner,
                           defer ? " " : " not ");
@@ -2062,17 +2062,17 @@ MessageChannel::ReportConnectionError(co
       case ChannelClosing:
         errorMsg = "Channel closing: too late to send/recv, messages will be lost";
         break;
       case ChannelError:
         errorMsg = "Channel error: cannot send/recv";
         break;
 
       default:
-        NS_RUNTIMEABORT("unreached");
+        MOZ_CRASH("unreached");
     }
 
     if (aMsg) {
         char reason[512];
         SprintfLiteral(reason,"(msgtype=0x%X,name=%s) %s",
                        aMsg->type(), aMsg->name(), errorMsg);
 
         PrintErrorMessage(mSide, aChannelName, reason);
@@ -2107,17 +2107,17 @@ MessageChannel::MaybeHandleError(Result 
       case MsgRouteError:
         errorMsg = "Route error: message sent to unknown actor ID";
         break;
       case MsgValueError:
         errorMsg = "Value error: message was deserialized, but contained an illegal value";
         break;
 
     default:
-        NS_RUNTIMEABORT("unknown Result code");
+        MOZ_CRASH("unknown Result code");
         return false;
     }
 
     char reason[512];
     const char* msgname = StringFromIPCMessageType(aMsg.type());
     if (msgname[0] == '?') {
         SprintfLiteral(reason,"(msgtype=0x%X) %s", aMsg.type(), errorMsg);
     } else {
@@ -2147,17 +2147,17 @@ MessageChannel::OnChannelErrorFromLink()
     if (InterruptStackDepth() > 0)
         NotifyWorkerThread();
 
     if (AwaitingSyncReply() || AwaitingIncomingMessage())
         NotifyWorkerThread();
 
     if (ChannelClosing != mChannelState) {
         if (mAbortOnError) {
-            NS_RUNTIMEABORT("Aborting on channel error.");
+            MOZ_CRASH("Aborting on channel error.");
         }
         mChannelState = ChannelError;
         mMonitor->Notify();
     }
 
     PostErrorNotifyTask();
 }
 
@@ -2318,17 +2318,17 @@ MessageChannel::Close()
             mChannelState = ChannelError;
             NotifyMaybeChannelError();
             return;
         }
 
         if (ChannelClosed == mChannelState) {
             // XXX be strict about this until there's a compelling reason
             // to relax
-            NS_RUNTIMEABORT("Close() called on closed channel!");
+            MOZ_CRASH("Close() called on closed channel!");
         }
 
         // Notify the other side that we're about to close our socket. If we've
         // already received a Goodbye from the other side (and our state is
         // ChannelClosing), there's no reason to send one.
         if (ChannelConnected == mChannelState) {
           mLink->SendMessage(new GoodbyeMessage());
         }
@@ -2339,17 +2339,17 @@ MessageChannel::Close()
 }
 
 void
 MessageChannel::NotifyChannelClosed()
 {
     mMonitor->AssertNotCurrentThreadOwns();
 
     if (ChannelClosed != mChannelState)
-        NS_RUNTIMEABORT("channel should have been closed!");
+        MOZ_CRASH("channel should have been closed!");
 
     Clear();
 
     // IPDL assumes these notifications do not fire twice, so we do not let
     // that happen.
     if (mNotifiedChannelDone) {
       return;
     }
--- a/ipc/glue/SharedMemory.h
+++ b/ipc/glue/SharedMemory.h
@@ -63,27 +63,27 @@ public:
   virtual bool ShareHandle(base::ProcessId aProcessId, IPC::Message* aMessage) = 0;
   virtual bool ReadHandle(const IPC::Message* aMessage, PickleIterator* aIter) = 0;
 
   void
   Protect(char* aAddr, size_t aSize, int aRights)
   {
     char* memStart = reinterpret_cast<char*>(memory());
     if (!memStart)
-      NS_RUNTIMEABORT("SharedMemory region points at NULL!");
+      MOZ_CRASH("SharedMemory region points at NULL!");
     char* memEnd = memStart + Size();
 
     char* protStart = aAddr;
     if (!protStart)
-      NS_RUNTIMEABORT("trying to Protect() a NULL region!");
+      MOZ_CRASH("trying to Protect() a NULL region!");
     char* protEnd = protStart + aSize;
 
     if (!(memStart <= protStart
           && protEnd <= memEnd))
-      NS_RUNTIMEABORT("attempt to Protect() a region outside this SharedMemory");
+      MOZ_CRASH("attempt to Protect() a region outside this SharedMemory");
 
     // checks alignment etc.
     SystemProtect(aAddr, aSize, aRights);
   }
 
   // bug 1168843, compositor thread may create shared memory instances that are destroyed by main thread on shutdown, so this must use thread-safe RC to avoid hitting assertion
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SharedMemory)
 
--- a/ipc/glue/SharedMemory_posix.cpp
+++ b/ipc/glue/SharedMemory_posix.cpp
@@ -19,17 +19,17 @@ SharedMemory::SystemProtect(char* aAddr,
   if (aRights & RightsRead)
     flags |= PROT_READ;
   if (aRights & RightsWrite)
     flags |= PROT_WRITE;
   if (RightsNone == aRights)
     flags = PROT_NONE;
 
   if (0 < mprotect(aAddr, aSize, flags))
-    NS_RUNTIMEABORT("can't mprotect()");
+    MOZ_CRASH("can't mprotect()");
 }
 
 size_t
 SharedMemory::SystemPageSize()
 {
   return sysconf(_SC_PAGESIZE);
 }
 
--- a/ipc/glue/SharedMemory_windows.cpp
+++ b/ipc/glue/SharedMemory_windows.cpp
@@ -19,17 +19,17 @@ SharedMemory::SystemProtect(char* aAddr,
     flags = PAGE_READWRITE;
   else if (aRights & RightsRead)
     flags = PAGE_READONLY;
   else
     flags = PAGE_NOACCESS;
 
   DWORD oldflags;
   if (!VirtualProtect(aAddr, aSize, flags, &oldflags))
-    NS_RUNTIMEABORT("can't VirtualProtect()");
+    MOZ_CRASH("can't VirtualProtect()");
 }
 
 size_t
 SharedMemory::SystemPageSize()
 {
   SYSTEM_INFO si;
   GetSystemInfo(&si);
   return si.dwPageSize;
--- a/ipc/glue/Shmem.h
+++ b/ipc/glue/Shmem.h
@@ -231,17 +231,17 @@ public:
   Dealloc(IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead,
           SharedMemory* aSegment);
 
 private:
   template<typename T>
   void AssertAligned() const
   {
     if (0 != (mSize % sizeof(T)))
-      NS_RUNTIMEABORT("shmem is not T-aligned");
+      MOZ_CRASH("shmem is not T-aligned");
   }
 
 #if !defined(DEBUG)
   void AssertInvariants() const
   { }
 
   static uint32_t*
   PtrToSize(SharedMemory* aSegment)
--- a/ipc/glue/WindowsMessageLoop.cpp
+++ b/ipc/glue/WindowsMessageLoop.cpp
@@ -791,17 +791,17 @@ MessageChannel::ProcessNativeEventsInInt
 // enabled for a particular Interrupt frame by the client calling
 // MessageChannel::ProcessNativeEventsInInterrupt().
 // This call can be nested for multiple Interrupt frames in a single plugin or 
 // multiple unrelated plugins.
 void
 MessageChannel::SpinInternalEventLoop()
 {
   if (mozilla::PaintTracker::IsPainting()) {
-    NS_RUNTIMEABORT("Don't spin an event loop while painting.");
+    MOZ_CRASH("Don't spin an event loop while painting.");
   }
 
   NS_ASSERTION(mTopFrame && mTopFrame->mSpinNestedEvents,
                "Spinning incorrectly");
 
   // Nested windows event loop we trigger when the child enters into modal
   // event loops.
   
@@ -1173,17 +1173,17 @@ MessageChannel::WaitForInterruptNotify()
   // Re-use sync notification wait code if this channel does not require
   // Windows message deferral behavior. 
   if (!(mFlags & REQUIRE_DEFERRED_MESSAGE_PROTECTION)) {
     return WaitForSyncNotify(true);
   }
 
   if (!InterruptStackDepth() && !AwaitingIncomingMessage()) {
     // There is currently no way to recover from this condition.
-    NS_RUNTIMEABORT("StackDepth() is 0 in call to MessageChannel::WaitForNotify!");
+    MOZ_CRASH("StackDepth() is 0 in call to MessageChannel::WaitForNotify!");
   }
 
   NS_ASSERTION(mFlags & REQUIRE_DEFERRED_MESSAGE_PROTECTION,
                "Shouldn't be here for channels that don't use message deferral!");
   NS_ASSERTION(mTopFrame && mTopFrame->mInterrupt,
                "Top frame is not a sync frame!");
 
   MonitorAutoUnlock unlock(*mMonitor);
--- a/ipc/ipdl/test/cxx/IPDLUnitTests.h
+++ b/ipc/ipdl/test/cxx/IPDLUnitTests.h
@@ -42,17 +42,17 @@ inline void fail(const char* fmt, ...)
   fprintf(stderr, MOZ_IPDL_TESTFAIL_LABEL " | %s | ", IPDLUnitTestName());
 
   va_start(ap, fmt);
   vfprintf(stderr, fmt, ap);
   va_end(ap);
 
   fputc('\n', stderr);
 
-  NS_RUNTIMEABORT("failed test");
+  MOZ_CRASH("failed test");
 }
 
 inline void passed(const char* fmt, ...)
 {
   va_list ap;
 
   printf(MOZ_IPDL_TESTPASS_LABEL " | %s | ", IPDLUnitTestName());
 
--- a/ipc/ipdl/test/cxx/IPDLUnitTests.template.cpp
+++ b/ipc/ipdl/test/cxx/IPDLUnitTests.template.cpp
@@ -133,17 +133,17 @@ IPDLUnitTestMain(void* aData)
         return;
     }
 
     IPDLUnitTestType test = IPDLUnitTestFromString(testString);
     if (!test) {
         // use this instead of |fail()| because we don't know what the test is
         fprintf(stderr, MOZ_IPDL_TESTFAIL_LABEL "| %s | unknown unit test %s\n",
                 "<--->", testString);
-        NS_RUNTIMEABORT("can't continue");
+        MOZ_CRASH("can't continue");
     }
     gIPDLUnitTestName = testString;
 
     // Check whether this test is enabled for processes:
     switch (test) {
 //-----------------------------------------------------------------------------
 //===== TEMPLATED =====
 ${PARENT_ENABLED_CASES_PROC}
@@ -184,17 +184,17 @@ IPDLUnitTestMain(void* aData)
 void
 IPDLUnitTestThreadMain(char *testString)
 {
     IPDLUnitTestType test = IPDLUnitTestFromString(testString);
     if (!test) {
         // use this instead of |fail()| because we don't know what the test is
         fprintf(stderr, MOZ_IPDL_TESTFAIL_LABEL "| %s | unknown unit test %s\n",
                 "<--->", testString);
-        NS_RUNTIMEABORT("can't continue");
+        MOZ_CRASH("can't continue");
     }
     gIPDLUnitTestName = testString;
 
     // Check whether this test is enabled for threads:
     switch (test) {
 //-----------------------------------------------------------------------------
 //===== TEMPLATED =====
 ${PARENT_ENABLED_CASES_THREAD}
--- a/ipc/ipdl/test/cxx/TestLatency.cpp
+++ b/ipc/ipdl/test/cxx/TestLatency.cpp
@@ -39,17 +39,17 @@ TestLatencyParent::Main()
         Close();
         return;
     }
 
     printf("  timing resolution: %g seconds\n",
            resolution.ToSecondsSigDigits());
 
     if (mozilla::ipc::LoggingEnabled())
-        NS_RUNTIMEABORT("you really don't want to log all IPC messages during this test, trust me");
+        MOZ_CRASH("you really don't want to log all IPC messages during this test, trust me");
 
     PingPongTrial();
 }
 
 void
 TestLatencyParent::PingPongTrial()
 {
     mStart = TimeStamp::Now();
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -9081,17 +9081,17 @@ nsCSSFrameConstructor::CreateContinuingF
     newFrame->Init(content, aParentFrame, aFrame);
   } else if (nsGkAtoms::rubyTextContainerFrame == frameType) {
     newFrame = NS_NewRubyTextContainerFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
   } else if (nsGkAtoms::detailsFrame == frameType) {
     newFrame = NS_NewDetailsFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
   } else {
-    NS_RUNTIMEABORT("unexpected frame type");
+    MOZ_CRASH("unexpected frame type");
   }
 
   // Init() set newFrame to be a fluid continuation of aFrame.
   // If we want a non-fluid continuation, we need to call SetPrevContinuation()
   // to reset NS_FRAME_IS_FLUID_CONTINUATION.
   if (!aIsFluid) {
     newFrame->SetPrevContinuation(aFrame);
   }
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -346,17 +346,17 @@ static bool gInitialized = false;
 
 // Perform our one-time intialization for this module
 
 // static
 nsresult
 Initialize()
 {
   if (gInitialized) {
-    NS_RUNTIMEABORT("Recursive layout module initialization");
+    MOZ_CRASH("Recursive layout module initialization");
     return NS_ERROR_FAILURE;
   }
   if (XRE_GetProcessType() == GeckoProcessType_GPU) {
     // We mark the layout module as being available in the GPU process so that
     // XPCOM's component manager initializes the power manager service, which
     // is needed for nsAppShell. However, we don't actually need anything in
     // the layout module itself.
     return NS_OK;
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -423,17 +423,17 @@ nsFrame::~nsFrame()
 
 NS_IMPL_FRAMEARENA_HELPERS(nsFrame)
 
 // Dummy operator delete.  Will never be called, but must be defined
 // to satisfy some C++ ABIs.
 void
 nsFrame::operator delete(void *, size_t)
 {
-  NS_RUNTIMEABORT("nsFrame::operator delete should never be called");
+  MOZ_CRASH("nsFrame::operator delete should never be called");
 }
 
 NS_QUERYFRAME_HEAD(nsFrame)
   NS_QUERYFRAME_ENTRY(nsIFrame)
 NS_QUERYFRAME_TAIL_INHERITANCE_ROOT
 
 /////////////////////////////////////////////////////////////////////////////
 // nsIFrame
@@ -5818,18 +5818,18 @@ nsIFrame::GetOffsetToCrossDoc(const nsIF
                   "Must have frame for destination coordinate system!");
   NS_ASSERTION(PresContext()->GetRootPresContext() ==
                  aOther->PresContext()->GetRootPresContext(),
                "trying to get the offset between frames in different document "
                "hierarchies?");
   if (PresContext()->GetRootPresContext() !=
         aOther->PresContext()->GetRootPresContext()) {
     // crash right away, we are almost certainly going to crash anyway.
-    NS_RUNTIMEABORT("trying to get the offset between frames in different "
-                    "document hierarchies?");
+    MOZ_CRASH("trying to get the offset between frames in different "
+              "document hierarchies?");
   }
 
   const nsIFrame* root = nullptr;
   // offset will hold the final offset
   // docOffset holds the currently accumulated offset at the current APD, it
   // will be converted and added to offset when the current APD changes.
   nsPoint offset(0, 0), docOffset(0, 0);
   const nsIFrame* f = this;
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -259,17 +259,17 @@ nsImageFrame::Init(nsIContent*       aCo
                    nsIFrame*         aPrevInFlow)
 {
   nsAtomicContainerFrame::Init(aContent, aParent, aPrevInFlow);
 
   mListener = new nsImageListener(this);
 
   nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(aContent);
   if (!imageLoader) {
-    NS_RUNTIMEABORT("Why do we have an nsImageFrame here at all?");
+    MOZ_CRASH("Why do we have an nsImageFrame here at all?");
   }
 
   imageLoader->AddObserver(mListener);
 
   nsPresContext *aPresContext = PresContext();
   
   if (!gIconLoad)
     LoadIcons(aPresContext);
--- a/layout/svg/nsSVGImageFrame.cpp
+++ b/layout/svg/nsSVGImageFrame.cpp
@@ -160,17 +160,17 @@ nsSVGImageFrame::Init(nsIContent*       
     // Non-display frames are likely to be patterns, masks or the like.
     // Treat them as always visible.
     IncApproximateVisibleCount();
   }
 
   mListener = new nsSVGImageListener(this);
   nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
   if (!imageLoader) {
-    NS_RUNTIMEABORT("Why is this not an image loading content?");
+    MOZ_CRASH("Why is this not an image loading content?");
   }
 
   // We should have a PresContext now, so let's notify our image loader that
   // we need to register any image animations with the refresh driver.
   imageLoader->FrameCreated(this);
 
   imageLoader->AddObserver(mListener);
 }
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -3848,17 +3848,17 @@ nsTableFrame*
 nsTableFrame::GetTableFrame(nsIFrame* aFrame)
 {
   for (nsIFrame* ancestor = aFrame->GetParent(); ancestor;
        ancestor = ancestor->GetParent()) {
     if (nsGkAtoms::tableFrame == ancestor->GetType()) {
       return static_cast<nsTableFrame*>(ancestor);
     }
   }
-  NS_RUNTIMEABORT("unable to find table parent");
+  MOZ_CRASH("unable to find table parent");
   return nullptr;
 }
 
 nsTableFrame*
 nsTableFrame::GetTableFramePassingThrough(nsIFrame* aMustPassThrough,
                                           nsIFrame* aFrame,
                                           bool* aDidPassThrough)
 {
--- a/modules/libpref/nsPrefBranch.cpp
+++ b/modules/libpref/nsPrefBranch.cpp
@@ -50,17 +50,17 @@
 using mozilla::dom::ContentChild;
 
 static ContentChild*
 GetContentChild()
 {
   if (XRE_IsContentProcess()) {
     ContentChild* cpc = ContentChild::GetSingleton();
     if (!cpc) {
-      NS_RUNTIMEABORT("Content Protocol is NULL!  We're going to crash!");
+      MOZ_CRASH("Content Protocol is NULL!  We're going to crash!");
     }
     return cpc;
   }
   return nullptr;
 }
 
 /*
  * Constructor/Destructor
@@ -340,17 +340,17 @@ NS_IMETHODIMP nsPrefBranch::GetComplexVa
           do_GetService("@mozilla.org/toolkit/crash-reporter;1");
         if (cr) {
           cr->AnnotateCrashReport(NS_LITERAL_CSTRING("bug836263-size"),
                                   nsPrintfCString("%x", utf8String.Length()));
           cr->RegisterAppMemory(uint64_t(utf8String.BeginReading()),
                                 std::min(0x1000U, utf8String.Length()));
         }
 #endif
-        NS_RUNTIMEABORT("bug836263");
+        MOZ_CRASH("bug836263");
       }
       theString->SetData(wdata);
       theString.forget(reinterpret_cast<nsISupportsString**>(_retval));
     }
     return rv;
   }
 
   NS_WARNING("nsPrefBranch::GetComplexValue - Unsupported interface type");
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -1141,17 +1141,17 @@ nsCacheService::Init()
     nsresult rv;
 
     mStorageService = do_GetService("@mozilla.org/storage/service;1", &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = NS_NewNamedThread("Cache I/O",
                            getter_AddRefs(mCacheIOThread));
     if (NS_FAILED(rv)) {
-        NS_RUNTIMEABORT("Can't create cache IO thread");
+        MOZ_CRASH("Can't create cache IO thread");
     }
 
     rv = nsDeleteDir::Init();
     if (NS_FAILED(rv)) {
         NS_WARNING("Can't initialize nsDeleteDir");
     }
 
     // initialize hashtable for active cache entries
@@ -1175,17 +1175,17 @@ nsCacheService::Init()
 }
 
 void
 nsCacheService::Shutdown()
 {
     // This method must be called on the main thread because mCacheIOThread must
     // only be modified on the main thread.
     if (!NS_IsMainThread()) {
-        NS_RUNTIMEABORT("nsCacheService::Shutdown called off the main thread");
+        MOZ_CRASH("nsCacheService::Shutdown called off the main thread");
     }
 
     nsCOMPtr<nsIThread> cacheIOThread;
     Telemetry::AutoTimer<Telemetry::NETWORK_DISK_CACHE_SHUTDOWN> totalTimer;
 
     bool shouldSanitize = false;
     nsCOMPtr<nsIFile> parentDir;
 
--- a/netwerk/cache/nsDiskCacheStreams.cpp
+++ b/netwerk/cache/nsDiskCacheStreams.cpp
@@ -568,17 +568,17 @@ nsDiskCacheStreamIO::FlushBufferToFile()
         int64_t dataSize = mBinding->mCacheEntry->PredictedDataSize();
         if (dataSize != -1)
             mozilla::fallocate(mFD, std::min<int64_t>(dataSize, kPreallocateLimit));
     }
     
     // write buffer to the file when there is data in it
     if (mStreamEnd > 0) {
         if (!mBuffer) {
-            NS_RUNTIMEABORT("Fix me!");
+            MOZ_CRASH("Fix me!");
         }
         if (PR_Write(mFD, mBuffer, mStreamEnd) != (int32_t)mStreamEnd) {
             NS_WARNING("failed to flush all data");
             return NS_ERROR_UNEXPECTED;     // NS_ErrorAccordingToNSPR()
         }
     }
 
     // buffer is no longer valid
--- a/netwerk/ipc/NeckoChild.cpp
+++ b/netwerk/ipc/NeckoChild.cpp
@@ -108,17 +108,17 @@ NeckoChild::DeallocPAltDataOutputStreamC
 }
 
 PFTPChannelChild*
 NeckoChild::AllocPFTPChannelChild(const PBrowserOrId& aBrowser,
                                   const SerializedLoadContext& aSerialized,
                                   const FTPChannelCreationArgs& aOpenArgs)
 {
   // We don't allocate here: see FTPChannelChild::AsyncOpen()
-  NS_RUNTIMEABORT("AllocPFTPChannelChild should not be called");
+  MOZ_CRASH("AllocPFTPChannelChild should not be called");
   return nullptr;
 }
 
 bool
 NeckoChild::DeallocPFTPChannelChild(PFTPChannelChild* channel)
 {
   MOZ_ASSERT(IsNeckoChild(), "DeallocPFTPChannelChild called by non-child!");
 
--- a/netwerk/ipc/NeckoMessageUtils.h
+++ b/netwerk/ipc/NeckoMessageUtils.h
@@ -92,28 +92,28 @@ struct ParamTraits<mozilla::net::NetAddr
       WriteParam(aMsg, aParam.inet6.port);
       WriteParam(aMsg, aParam.inet6.flowinfo);
       WriteParam(aMsg, aParam.inet6.ip.u64[0]);
       WriteParam(aMsg, aParam.inet6.ip.u64[1]);
       WriteParam(aMsg, aParam.inet6.scope_id);
 #if defined(XP_UNIX)
     } else if (aParam.raw.family == AF_LOCAL) {
       // Train's already off the rails:  let's get a stack trace at least...
-      NS_RUNTIMEABORT("Error: please post stack trace to "
+      MOZ_CRASH("Error: please post stack trace to "
                       "https://bugzilla.mozilla.org/show_bug.cgi?id=661158");
       aMsg->WriteBytes(aParam.local.path, sizeof(aParam.local.path));
 #endif
     } else {
 #ifdef MOZ_CRASHREPORTER
       if (XRE_IsParentProcess()) {
         nsPrintfCString msg("%d", aParam.raw.family);
         CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Unknown NetAddr socket family"), msg);
       }
 #endif
-      NS_RUNTIMEABORT("Unknown socket family");
+      MOZ_CRASH("Unknown socket family");
     }
   }
 
   static bool Read(const Message* aMsg, PickleIterator* aIter, mozilla::net::NetAddr* aResult)
   {
     if (!ReadParam(aMsg, aIter, &aResult->raw.family))
       return false;
 
--- a/netwerk/protocol/ftp/FTPChannelChild.cpp
+++ b/netwerk/protocol/ftp/FTPChannelChild.cpp
@@ -220,17 +220,17 @@ FTPChannelChild::IsPending(bool* result)
   return NS_OK;
 }
 
 nsresult
 FTPChannelChild::OpenContentStream(bool async,
                                    nsIInputStream** stream,
                                    nsIChannel** channel)
 {
-  NS_RUNTIMEABORT("FTPChannel*Child* should never have OpenContentStream called!");
+  MOZ_CRASH("FTPChannel*Child* should never have OpenContentStream called!");
   return NS_OK;
 }
   
 //-----------------------------------------------------------------------------
 // FTPChannelChild::PFTPChannelChild
 //-----------------------------------------------------------------------------
 
 class FTPStartRequestEvent : public ChannelEvent
--- a/storage/test/gtest/test_async_callbacks_with_spun_event_loops.cpp
+++ b/storage/test/gtest/test_async_callbacks_with_spun_event_loops.cpp
@@ -58,27 +58,27 @@ private:
   }
 
 public:
   NS_IMETHOD HandleResult(mozIStorageResultSet* aResultSet) override
   {
     sResult = true;
     spin_events_loop_until_true(&mCompleted);
     if (!sAlive) {
-      NS_RUNTIMEABORT("The statement callback was destroyed prematurely.");
+      MOZ_CRASH("The statement callback was destroyed prematurely.");
     }
     return NS_OK;
   }
 
   NS_IMETHOD HandleError(mozIStorageError* aError) override
   {
     sError = true;
     spin_events_loop_until_true(&mCompleted);
     if (!sAlive) {
-      NS_RUNTIMEABORT("The statement callback was destroyed prematurely.");
+      MOZ_CRASH("The statement callback was destroyed prematurely.");
     }
     return NS_OK;
   }
 
   NS_IMETHOD HandleCompletion(uint16_t aReason) override
   {
     mCompleted = true;
     return NS_OK;
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -3435,17 +3435,17 @@ OOPInit()
     nullptr, nullptr,           // we don't care about process exit here
     nullptr, nullptr,           // we don't care about upload request here
     true,                       // automatically generate dumps
     &dumpPath);
 
 #elif defined(XP_LINUX)
   if (!CrashGenerationServer::CreateReportChannel(&serverSocketFd,
                                                   &clientSocketFd))
-    NS_RUNTIMEABORT("can't create crash reporter socketpair()");
+    MOZ_CRASH("can't create crash reporter socketpair()");
 
   const std::string dumpPath =
       gExceptionHandler->minidump_descriptor().directory();
   crashServer = new CrashGenerationServer(
     serverSocketFd,
     OnChildProcessDumpRequested, nullptr,
     nullptr, nullptr,           // we don't care about process exit here
     true,
@@ -3463,17 +3463,17 @@ OOPInit()
     nullptr,
     OnChildProcessDumpRequested, nullptr,
     nullptr, nullptr,
     true, // automatically generate dumps
     dumpPath);
 #endif
 
   if (!crashServer->Start())
-    NS_RUNTIMEABORT("can't start crash reporter server()");
+    MOZ_CRASH("can't start crash reporter server()");
 
   pidToMinidump = new ChildMinidumpMap();
 
   dumpMapLock = new Mutex("CrashReporter::dumpMapLock");
 
   FindPendingDir();
   UpdateCrashEventsDir();
 }
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -644,17 +644,17 @@ XRE_InitChildProcess(int aArgc,
       nsAutoPtr<ProcessChild> process;
 
 #ifdef XP_WIN
       mozilla::ipc::windows::InitUIThread();
 #endif
 
       switch (XRE_GetProcessType()) {
       case GeckoProcessType_Default:
-        NS_RUNTIMEABORT("This makes no sense");
+        MOZ_CRASH("This makes no sense");
         break;
 
       case GeckoProcessType_Plugin:
         process = new PluginProcessChild(parentPID);
         break;
 
       case GeckoProcessType_Content: {
           process = new ContentProcess(parentPID);
@@ -700,30 +700,30 @@ XRE_InitChildProcess(int aArgc,
           }
         }
         break;
 
       case GeckoProcessType_IPDLUnitTest:
 #ifdef MOZ_IPDL_TESTS
         process = new IPDLUnitTestProcessChild(parentPID);
 #else 
-        NS_RUNTIMEABORT("rebuild with --enable-ipdl-tests");
+        MOZ_CRASH("rebuild with --enable-ipdl-tests");
 #endif
         break;
 
       case GeckoProcessType_GMPlugin:
         process = new gmp::GMPProcessChild(parentPID);
         break;
 
       case GeckoProcessType_GPU:
         process = new gfx::GPUProcessImpl(parentPID);
         break;
 
       default:
-        NS_RUNTIMEABORT("Unknown main thread class");
+        MOZ_CRASH("Unknown main thread class");
       }
 
       if (!process->Init()) {
         return NS_ERROR_FAILURE;
       }
 
 #ifdef MOZ_CRASHREPORTER
 #if defined(XP_WIN) || defined(XP_MACOSX)
--- a/widget/gonk/nsScreenManagerGonk.cpp
+++ b/widget/gonk/nsScreenManagerGonk.cpp
@@ -134,17 +134,17 @@ nsScreenGonk::nsScreenGonk(uint32_t aId,
     , mEGLSurface(EGL_NO_SURFACE)
     , mGLContext(nullptr)
     , mFramebuffer(nullptr)
     , mMappedBuffer(nullptr)
 {
     if (mNativeWindow->query(mNativeWindow.get(), NATIVE_WINDOW_WIDTH, &mVirtualBounds.width) ||
         mNativeWindow->query(mNativeWindow.get(), NATIVE_WINDOW_HEIGHT, &mVirtualBounds.height) ||
         mNativeWindow->query(mNativeWindow.get(), NATIVE_WINDOW_FORMAT, &mSurfaceFormat)) {
-        NS_RUNTIMEABORT("Failed to get native window size, aborting...");
+        MOZ_CRASH("Failed to get native window size, aborting...");
     }
 
     mNaturalBounds = mVirtualBounds;
 
     if (IsPrimaryScreen()) {
         char propValue[PROPERTY_VALUE_MAX];
         property_get("ro.sf.hwrotation", propValue, "0");
         mPhysicalScreenRotation = atoi(propValue) / 90;
--- a/widget/gonk/nsWindow.cpp
+++ b/widget/gonk/nsWindow.cpp
@@ -118,17 +118,17 @@ nsWindow::DoDraw(void)
     }
 
     listener = targetWindow->GetWidgetListener();
     if (listener) {
         LayerManager* lm = targetWindow->GetLayerManager();
         if (mozilla::layers::LayersBackend::LAYERS_CLIENT == lm->GetBackendType()) {
             // No need to do anything, the compositor will handle drawing
         } else {
-            NS_RUNTIMEABORT("Unexpected layer manager type");
+            MOZ_CRASH("Unexpected layer manager type");
         }
 
         listener->DidPaintWindow();
     }
 }
 
 void
 nsWindow::ConfigureAPZControllerThread()
--- a/xpcom/base/nsAutoPtr.h
+++ b/xpcom/base/nsAutoPtr.h
@@ -33,17 +33,17 @@ private:
   }
 
   void
   assign(T* aNewPtr)
   {
     T* oldPtr = mRawPtr;
 
     if (aNewPtr && aNewPtr == oldPtr) {
-      NS_RUNTIMEABORT("Logic flaw in the caller");
+      MOZ_CRASH("Logic flaw in the caller");
     }
 
     mRawPtr = aNewPtr;
     delete oldPtr;
   }
 
   // |class Ptr| helps us prevent implicit "copy construction"
   // through |operator T*() const| from a |const nsAutoPtr<T>|
--- a/xpcom/build/LateWriteChecks.cpp
+++ b/xpcom/build/LateWriteChecks.cpp
@@ -146,23 +146,23 @@ LateWriteObserver::Observe(IOInterposeOb
   do {
     // mkstemp isn't supported so keep trying until we get a file
     int result = _mktemp_s(name, strlen(name) + 1);
     hFile = CreateFileA(name, GENERIC_WRITE, 0, nullptr, CREATE_NEW,
                         FILE_ATTRIBUTE_NORMAL, nullptr);
   } while (GetLastError() == ERROR_FILE_EXISTS);
 
   if (hFile == INVALID_HANDLE_VALUE) {
-    NS_RUNTIMEABORT("Um, how did we get here?");
+    MOZ_CRASH("Um, how did we get here?");
   }
 
   // http://support.microsoft.com/kb/139640
   int fd = _open_osfhandle((intptr_t)hFile, _O_APPEND);
   if (fd == -1) {
-    NS_RUNTIMEABORT("Um, how did we get here?");
+    MOZ_CRASH("Um, how did we get here?");
   }
 
   stream = _fdopen(fd, "w");
 #else
   int fd = mkstemp(name);
   stream = fdopen(fd, "w");
 #endif
 
--- a/xpcom/build/XPCOMInit.cpp
+++ b/xpcom/build/XPCOMInit.cpp
@@ -858,30 +858,30 @@ namespace mozilla {
 
 void
 SetICUMemoryFunctions()
 {
   static bool sICUReporterInitialized = false;
   if (!sICUReporterInitialized) {
     if (!JS_SetICUMemoryFunctions(ICUReporter::Alloc, ICUReporter::Realloc,
                                   ICUReporter::Free)) {
-      NS_RUNTIMEABORT("JS_SetICUMemoryFunctions failed.");
+      MOZ_CRASH("JS_SetICUMemoryFunctions failed.");
     }
     sICUReporterInitialized = true;
   }
 }
 
 nsresult
 ShutdownXPCOM(nsIServiceManager* aServMgr)
 {
   // Make sure the hang monitor is enabled for shutdown.
   HangMonitor::NotifyActivity();
 
   if (!NS_IsMainThread()) {
-    NS_RUNTIMEABORT("Shutdown on wrong thread");
+    MOZ_CRASH("Shutdown on wrong thread");
   }
 
   nsresult rv;
   nsCOMPtr<nsISimpleEnumerator> moduleLoaders;
 
   // Notify observers of xpcom shutting down
   {
     // Block it so that the COMPtr will get deleted before we hit
--- a/xpcom/glue/BlockingResourceBase.cpp
+++ b/xpcom/glue/BlockingResourceBase.cpp
@@ -211,17 +211,17 @@ BlockingResourceBase::BlockingResourceBa
 #else
   , mAcquired()
 #endif
 {
   MOZ_ASSERT(mName, "Name must be nonnull");
   // PR_CallOnce guaranatees that InitStatics is called in a
   // thread-safe way
   if (PR_SUCCESS != PR_CallOnce(&sCallOnce, InitStatics)) {
-    NS_RUNTIMEABORT("can't initialize blocking resource static members");
+    MOZ_CRASH("can't initialize blocking resource static members");
   }
 
   mChainPrev = 0;
   sDeadlockDetector->Add(this);
 }
 
 
 BlockingResourceBase::~BlockingResourceBase()
@@ -246,17 +246,17 @@ BlockingResourceBase::SizeOfDeadlockDete
 
 
 PRStatus
 BlockingResourceBase::InitStatics()
 {
   PR_NewThreadPrivateIndex(&sResourceAcqnChainFrontTPI, 0);
   sDeadlockDetector = new DDT();
   if (!sDeadlockDetector) {
-    NS_RUNTIMEABORT("can't allocate deadlock detector");
+    MOZ_CRASH("can't allocate deadlock detector");
   }
   return PR_SUCCESS;
 }
 
 
 void
 BlockingResourceBase::Shutdown()
 {
--- a/xpcom/glue/CondVar.h
+++ b/xpcom/glue/CondVar.h
@@ -41,17 +41,17 @@ public:
   CondVar(Mutex& aLock, const char* aName)
     : BlockingResourceBase(aName, eCondVar)
     , mLock(&aLock)
   {
     MOZ_COUNT_CTOR(CondVar);
     // |aLock| must necessarily already be known to the deadlock detector
     mCvar = PR_NewCondVar(mLock->mLock);
     if (!mCvar) {
-      NS_RUNTIMEABORT("Can't allocate mozilla::CondVar");
+      MOZ_CRASH("Can't allocate mozilla::CondVar");
     }
   }
 
   /**
    * ~CondVar
    * Clean up after this CondVar, but NOT its associated Mutex.
    **/
   ~CondVar()
--- a/xpcom/glue/DeadlockDetector.h
+++ b/xpcom/glue/DeadlockDetector.h
@@ -125,17 +125,17 @@ public:
    * @param aNumResourcesGuess Guess at approximate number of resources
    *        that will be checked.
    */
   explicit DeadlockDetector(uint32_t aNumResourcesGuess = kDefaultNumBuckets)
     : mOrdering(aNumResourcesGuess)
   {
     mLock = PR_NewLock();
     if (!mLock) {
-      NS_RUNTIMEABORT("couldn't allocate deadlock detector lock");
+      MOZ_CRASH("couldn't allocate deadlock detector lock");
     }
   }
 
   /**
    * ~DeadlockDetector
    *
    * *NOT* thread safe.
    */
@@ -239,17 +239,17 @@ public:
 
     // this is the crux of the deadlock detector algorithm
 
     if (current == proposed) {
       // reflexive deadlock.  fastpath b/c InTransitiveClosure is
       // not applicable here.
       ResourceAcquisitionArray* cycle = new ResourceAcquisitionArray();
       if (!cycle) {
-        NS_RUNTIMEABORT("can't allocate dep. cycle array");
+        MOZ_CRASH("can't allocate dep. cycle array");
       }
       cycle->AppendElement(current->mResource);
       cycle->AppendElement(aProposed);
       return cycle;
     }
     if (InTransitiveClosure(current, proposed)) {
       // we've already established |aLast < aProposed|.  all is well.
       return 0;
@@ -315,17 +315,17 @@ public:
    *
    * @precondition |aStart != aTarget|
    */
   ResourceAcquisitionArray* GetDeductionChain(const OrderingEntry* aStart,
                                               const OrderingEntry* aTarget)
   {
     ResourceAcquisitionArray* chain = new ResourceAcquisitionArray();
     if (!chain) {
-      NS_RUNTIMEABORT("can't allocate dep. cycle array");
+      MOZ_CRASH("can't allocate dep. cycle array");
     }
     chain->AppendElement(aStart->mResource);
 
     NS_ASSERTION(GetDeductionChain_Helper(aStart, aTarget, chain),
                  "GetDeductionChain called when there's no deadlock");
     return chain;
   }
 
--- a/xpcom/glue/Mutex.h
+++ b/xpcom/glue/Mutex.h
@@ -43,17 +43,17 @@ public:
    *          If success, a valid Mutex* which must be destroyed
    *          by Mutex::DestroyMutex()
    **/
   explicit OffTheBooksMutex(const char* aName)
     : BlockingResourceBase(aName, eMutex)
   {
     mLock = PR_NewLock();
     if (!mLock) {
-      NS_RUNTIMEABORT("Can't allocate mozilla::Mutex");
+      MOZ_CRASH("Can't allocate mozilla::Mutex");
     }
   }
 
   ~OffTheBooksMutex()
   {
     NS_ASSERTION(mLock,
                  "improperly constructed Lock or double free");
     // NSPR does consistency checks for us
--- a/xpcom/glue/ReentrantMonitor.h
+++ b/xpcom/glue/ReentrantMonitor.h
@@ -45,17 +45,17 @@ public:
     : BlockingResourceBase(aName, eReentrantMonitor)
 #ifdef DEBUG
     , mEntryCount(0)
 #endif
   {
     MOZ_COUNT_CTOR(ReentrantMonitor);
     mReentrantMonitor = PR_NewMonitor();
     if (!mReentrantMonitor) {
-      NS_RUNTIMEABORT("Can't allocate mozilla::ReentrantMonitor");
+      MOZ_CRASH("Can't allocate mozilla::ReentrantMonitor");
     }
   }
 
   /**
    * ~ReentrantMonitor
    **/
   ~ReentrantMonitor()
   {
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -169,24 +169,24 @@ struct nsTArrayInfallibleAllocatorBase
   typedef nsTArrayInfallibleResult ResultTypeProxy;
 
   static ResultType Result(ResultTypeProxy aResult) {}
   static bool Successful(ResultTypeProxy) { return true; }
   static ResultTypeProxy SuccessResult() { return ResultTypeProxy(); }
 
   static ResultTypeProxy FailureResult()
   {
-    NS_RUNTIMEABORT("Infallible nsTArray should never fail");
+    MOZ_CRASH("Infallible nsTArray should never fail");
     return ResultTypeProxy();
   }
 
   static ResultType ConvertBoolToResultType(bool aValue)
   {
     if (!aValue) {
-      NS_RUNTIMEABORT("infallible nsTArray should never convert false to ResultType");
+      MOZ_CRASH("infallible nsTArray should never convert false to ResultType");
     }
   }
 };
 
 struct nsTArrayFallibleAllocator : nsTArrayFallibleAllocatorBase
 {
   static void* Malloc(size_t aSize) { return malloc(aSize); }
   static void* Realloc(void* aPtr, size_t aSize)
--- a/xpcom/io/Base64.cpp
+++ b/xpcom/io/Base64.cpp
@@ -195,20 +195,20 @@ EncodeInputStream(nsIInputStream* aInput
     uint32_t read = 0;
 
     rv = aInputStream->ReadSegments(&EncodeInputStream_Encoder<T>,
                                     (void*)&state,
                                     aCount,
                                     &read);
     if (NS_FAILED(rv)) {
       if (rv == NS_BASE_STREAM_WOULD_BLOCK) {
-        NS_RUNTIMEABORT("Not implemented for async streams!");
+        MOZ_CRASH("Not implemented for async streams!");
       }
       if (rv == NS_ERROR_NOT_IMPLEMENTED) {
-        NS_RUNTIMEABORT("Requires a stream that implements ReadSegments!");
+        MOZ_CRASH("Requires a stream that implements ReadSegments!");
       }
       return rv;
     }
 
     if (!read) {
       break;
     }
   }
--- a/xpcom/string/nsTSubstring.cpp
+++ b/xpcom/string/nsTSubstring.cpp
@@ -913,27 +913,27 @@ nsTSubstring_CharT::AppendFunc(void* aAr
 
 void
 nsTSubstring_CharT::AppendPrintf(const char* aFormat, ...)
 {
   va_list ap;
   va_start(ap, aFormat);
   uint32_t r = PR_vsxprintf(AppendFunc, this, aFormat, ap);
   if (r == (uint32_t)-1) {
-    NS_RUNTIMEABORT("Allocation or other failure in PR_vsxprintf");
+    MOZ_CRASH("Allocation or other failure in PR_vsxprintf");
   }
   va_end(ap);
 }
 
 void
 nsTSubstring_CharT::AppendPrintf(const char* aFormat, va_list aAp)
 {
   uint32_t r = PR_vsxprintf(AppendFunc, this, aFormat, aAp);
   if (r == (uint32_t)-1) {
-    NS_RUNTIMEABORT("Allocation or other failure in PR_vsxprintf");
+    MOZ_CRASH("Allocation or other failure in PR_vsxprintf");
   }
 }
 
 /* hack to make sure we define FormatWithoutTrailingZeros only once */
 #ifdef CharT_is_PRUnichar
 // Returns the length of the formatted aDouble in aBuf.
 static int
 FormatWithoutTrailingZeros(char (&aBuf)[40], double aDouble,
--- a/xpcom/threads/HangMonitor.cpp
+++ b/xpcom/threads/HangMonitor.cpp
@@ -115,17 +115,17 @@ Crash()
   // If you change this, you must also deal with the threadsafety of AnnotateCrashReport in
   // non-chrome processes!
   if (GeckoProcessType_Default == XRE_GetProcessType()) {
     CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Hang"),
                                        NS_LITERAL_CSTRING("1"));
   }
 #endif
 
-  NS_RUNTIMEABORT("HangMonitor triggered");
+  MOZ_CRASH("HangMonitor triggered");
 }
 
 #ifdef REPORT_CHROME_HANGS
 
 static void
 ChromeStackWalker(uint32_t aFrameNumber, void* aPC, void* aSP, void* aClosure)
 {
   MOZ_ASSERT(aClosure);