Bug 1416164 - Replace NS_ABORT with MOZ_ASSERT_UNREACHABLE. r?froydnj
MozReview-Commit-ID: DRdYlOYqZpN
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -1279,18 +1279,18 @@ nsINode::RemoveEventListener(const nsASt
return NS_OK;
}
NS_IMPL_REMOVE_SYSTEM_EVENT_LISTENER(nsINode)
nsresult
nsINode::GetEventTargetParent(EventChainPreVisitor& aVisitor)
{
- // This is only here so that we can use the NS_DECL_NSIDOMTARGET macro
- NS_ABORT();
+ MOZ_ASSERT_UNREACHABLE("GetEventTargetParent is only here so that we can "
+ "use the NS_DECL_NSIDOMTARGET macro");
return NS_ERROR_NOT_IMPLEMENTED;
}
void
nsINode::GetBoxQuads(const BoxQuadOptions& aOptions,
nsTArray<RefPtr<DOMQuad> >& aResult,
CallerType aCallerType,
mozilla::ErrorResult& aRv)
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -3477,17 +3477,17 @@ TabChild::RecvSetWidgetNativeData(const
}
mozilla::plugins::PPluginWidgetChild*
TabChild::AllocPPluginWidgetChild()
{
#ifdef XP_WIN
return new mozilla::plugins::PluginWidgetChild();
#else
- MOZ_ASSERT_UNREACHABLE();
+ MOZ_ASSERT_UNREACHABLE("AllocPPluginWidgetChild only supports Windows");
return nullptr;
#endif
}
bool
TabChild::DeallocPPluginWidgetChild(mozilla::plugins::PPluginWidgetChild* aActor)
{
delete aActor;
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -3134,17 +3134,17 @@ TabParent::RecvRemoteIsReadyToHandleInpu
}
mozilla::plugins::PPluginWidgetParent*
TabParent::AllocPPluginWidgetParent()
{
#ifdef XP_WIN
return new mozilla::plugins::PluginWidgetParent();
#else
- MOZ_ASSERT_UNREACHABLE();
+ MOZ_ASSERT_UNREACHABLE("AllocPPluginWidgetParent only supports Windows");
return nullptr;
#endif
}
bool
TabParent::DeallocPPluginWidgetParent(mozilla::plugins::PPluginWidgetParent* aActor)
{
delete aActor;
--- a/gfx/gl/GLContextProviderGLX.cpp
+++ b/gfx/gl/GLContextProviderGLX.cpp
@@ -469,17 +469,17 @@ GLXLibrary::AfterGLXCall() const
char buffer[2048];
XGetErrorText(DefaultXDisplay(), sErrorEvent.mError.error_code, buffer, sizeof(buffer));
printf_stderr("X ERROR: %s (%i) - Request: %i.%i, Serial: %lu",
buffer,
sErrorEvent.mError.error_code,
sErrorEvent.mError.request_code,
sErrorEvent.mError.minor_code,
sErrorEvent.mError.serial);
- NS_ABORT();
+ MOZ_ASSERT_UNREACHABLE("AfterGLXCall sErrorEvent");
}
XSetErrorHandler(sOldErrorHandler);
}
}
already_AddRefed<GLContextGLX>
GLContextGLX::CreateGLContext(CreateContextFlags flags, const SurfaceCaps& caps,
bool isOffscreen, Display* display, GLXDrawable drawable,
@@ -1082,9 +1082,8 @@ GLContextProviderGLX::GetGlobalContext()
/*static*/ void
GLContextProviderGLX::Shutdown()
{
}
} /* namespace gl */
} /* namespace mozilla */
-
--- a/gfx/layers/SyncObject.cpp
+++ b/gfx/layers/SyncObject.cpp
@@ -36,15 +36,15 @@ SyncObjectClient::CreateSyncObjectClient
{
if (!aHandle) {
return nullptr;
}
#ifdef XP_WIN
return MakeAndAddRef<SyncObjectD3D11Client>(aHandle, aDevice);
#else
- MOZ_ASSERT_UNREACHABLE();
+ MOZ_ASSERT_UNREACHABLE("CreateSyncObjectClient only supports Windows");
return nullptr;
#endif
}
} // namespace layers
} // namespace mozilla
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -2562,11 +2562,11 @@ nsListEventListener::HandleEvent(nsIDOME
return mFrame->nsListControlFrame::MouseUp(aEvent);
}
if (eventType.EqualsLiteral("mousemove")) {
// I don't think we want to honor defaultPrevented on mousemove
// in general, and it would only prevent highlighting here.
return mFrame->nsListControlFrame::MouseMove(aEvent);
}
- NS_ABORT();
+ MOZ_ASSERT_UNREACHABLE("Unexpected eventType");
return NS_OK;
}
--- a/layout/mathml/nsMathMLmactionFrame.cpp
+++ b/layout/mathml/nsMathMLmactionFrame.cpp
@@ -269,17 +269,17 @@ nsMathMLmactionFrame::MouseListener::Han
}
else if (eventType.EqualsLiteral("click")) {
mOwner->MouseClick();
}
else if (eventType.EqualsLiteral("mouseout")) {
mOwner->MouseOut();
}
else {
- NS_ABORT();
+ MOZ_ASSERT_UNREACHABLE("Unexpected eventType");
}
return NS_OK;
}
void
nsMathMLmactionFrame::MouseOver()
{
--- a/layout/xul/nsButtonBoxFrame.cpp
+++ b/layout/xul/nsButtonBoxFrame.cpp
@@ -37,18 +37,17 @@ nsButtonBoxFrame::nsButtonBoxListener::H
nsAutoString eventType;
aEvent->GetType(eventType);
if (eventType.EqualsLiteral("blur")) {
mButtonBoxFrame->Blurred();
return NS_OK;
}
- NS_ABORT();
-
+ MOZ_ASSERT_UNREACHABLE("Unexpected eventType");
return NS_OK;
}
//
// NS_NewXULButtonFrame
//
// Creates a new Button frame and returns it
//
--- a/layout/xul/nsMenuBarListener.cpp
+++ b/layout/xul/nsMenuBarListener.cpp
@@ -539,12 +539,11 @@ nsMenuBarListener::HandleEvent(nsIDOMEve
}
if (eventType.EqualsLiteral("mousedown")) {
return MouseDown(aEvent);
}
if (eventType.EqualsLiteral("MozDOMFullscreen:Entered")) {
return Fullscreen(aEvent);
}
- NS_ABORT();
-
+ MOZ_ASSERT_UNREACHABLE("Unexpected eventType");
return NS_OK;
}
--- a/layout/xul/nsSplitterFrame.cpp
+++ b/layout/xul/nsSplitterFrame.cpp
@@ -584,17 +584,17 @@ nsSplitterFrameInner::HandleEvent(nsIDOM
if (eventType.EqualsLiteral("mouseup"))
return MouseUp(aEvent);
if (eventType.EqualsLiteral("mousedown"))
return MouseDown(aEvent);
if (eventType.EqualsLiteral("mousemove") ||
eventType.EqualsLiteral("mouseout"))
return MouseMove(aEvent);
- NS_ABORT();
+ MOZ_ASSERT_UNREACHABLE("Unexpected eventType");
return NS_OK;
}
nsresult
nsSplitterFrameInner::MouseUp(nsIDOMEvent* aMouseEvent)
{
NS_ENSURE_TRUE(mOuter, NS_OK);
mPressed = false;
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -2607,18 +2607,17 @@ nsXULPopupManager::HandleEvent(nsIDOMEve
}
if (eventType.EqualsLiteral("keydown")) {
return KeyDown(keyEvent);
}
if (eventType.EqualsLiteral("keypress")) {
return KeyPress(keyEvent);
}
- NS_ABORT();
-
+ MOZ_ASSERT_UNREACHABLE("Unexpected eventType");
return NS_OK;
}
nsresult
nsXULPopupManager::UpdateIgnoreKeys(bool aIgnoreKeys)
{
nsMenuChainItem* item = GetTopVisibleMenu();
if (item) {
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3837,20 +3837,21 @@ nsWindow::Create(nsIWidget* aParent,
gdk_window_input_shape_combine_region(mGdkWindow, region, 0, 0);
cairo_region_destroy(region);
#endif
}
}
}
break;
+
case eWindowType_plugin:
case eWindowType_plugin_ipc_chrome:
case eWindowType_plugin_ipc_content:
- MOZ_ASSERT_UNREACHABLE();
+ MOZ_ASSERT_UNREACHABLE("Unexpected eWindowType_plugin*");
return NS_ERROR_FAILURE;
case eWindowType_child: {
if (parentMozContainer) {
mGdkWindow = CreateGdkWindow(parentGdkWindow, parentMozContainer);
mHasMappedToplevel = parentnsWindow->mHasMappedToplevel;
}
else if (parentGtkContainer) {
--- a/xpcom/base/nsDebug.h
+++ b/xpcom/base/nsDebug.h
@@ -158,31 +158,16 @@ inline void MOZ_PretendNoReturn()
#ifdef DEBUG
#define NS_WARNING(str) \
NS_DebugBreak(NS_DEBUG_WARNING, str, nullptr, __FILE__, __LINE__)
#else
#define NS_WARNING(str) do { /* nothing */ } while(0)
#endif
/**
- * Trigger an debug-only abort.
- *
- * @see MOZ_RELEASE_ASSERT or MOZ_CRASH for release-mode asserts.
- */
-#ifdef DEBUG
-#define NS_ABORT() \
- do { \
- NS_DebugBreak(NS_DEBUG_ABORT, nullptr, nullptr, __FILE__, __LINE__); \
- MOZ_PretendNoReturn(); \
- } while(0)
-#else
-#define NS_ABORT() do { /* nothing */ } while(0)
-#endif
-
-/**
* Trigger a debugger breakpoint, only in debug builds.
*/
#ifdef DEBUG
#define NS_BREAK() \
do { \
NS_DebugBreak(NS_DEBUG_BREAK, nullptr, nullptr, __FILE__, __LINE__); \
MOZ_PretendNoReturn(); \
} while(0)