Bug 1127201 (attempt 2, part 1) - Replace most NS_ABORT_IF_FALSE calls with MOZ_ASSERT. r=Waldo.

This commit is contained in:
Nicholas Nethercote
2015-02-09 14:34:50 -08:00
parent 1aac214090
commit 0247de46d8
347 changed files with 2974 additions and 3007 deletions

View File

@@ -516,10 +516,10 @@ PluginModuleChild::DetectNestedEventLoop(gpointer data)
{
PluginModuleChild* pmc = static_cast<PluginModuleChild*>(data);
NS_ABORT_IF_FALSE(0 != pmc->mNestedLoopTimerId,
"callback after descheduling");
NS_ABORT_IF_FALSE(pmc->mTopLoopDepth < g_main_depth(),
"not canceled before returning to main event loop!");
MOZ_ASSERT(0 != pmc->mNestedLoopTimerId,
"callback after descheduling");
MOZ_ASSERT(pmc->mTopLoopDepth < g_main_depth(),
"not canceled before returning to main event loop!");
PLUGIN_LOG_DEBUG(("Detected nested glib event loop"));
@@ -542,8 +542,8 @@ PluginModuleChild::ProcessBrowserEvents(gpointer data)
{
PluginModuleChild* pmc = static_cast<PluginModuleChild*>(data);
NS_ABORT_IF_FALSE(pmc->mTopLoopDepth < g_main_depth(),
"not canceled before returning to main event loop!");
MOZ_ASSERT(pmc->mTopLoopDepth < g_main_depth(),
"not canceled before returning to main event loop!");
pmc->CallProcessSomeEvents();
@@ -553,8 +553,8 @@ PluginModuleChild::ProcessBrowserEvents(gpointer data)
void
PluginModuleChild::EnteredCxxStack()
{
NS_ABORT_IF_FALSE(0 == mNestedLoopTimerId,
"previous timer not descheduled");
MOZ_ASSERT(0 == mNestedLoopTimerId,
"previous timer not descheduled");
mNestedLoopTimerId =
g_timeout_add_full(kNestedLoopDetectorPriority,
@@ -571,8 +571,8 @@ PluginModuleChild::EnteredCxxStack()
void
PluginModuleChild::ExitedCxxStack()
{
NS_ABORT_IF_FALSE(0 < mNestedLoopTimerId,
"nested loop timeout not scheduled");
MOZ_ASSERT(0 < mNestedLoopTimerId,
"nested loop timeout not scheduled");
g_source_remove(mNestedLoopTimerId);
mNestedLoopTimerId = 0;
@@ -582,8 +582,8 @@ PluginModuleChild::ExitedCxxStack()
void
PluginModuleChild::EnteredCxxStack()
{
NS_ABORT_IF_FALSE(mNestedLoopTimerObject == nullptr,
"previous timer not descheduled");
MOZ_ASSERT(mNestedLoopTimerObject == nullptr,
"previous timer not descheduled");
mNestedLoopTimerObject = new NestedLoopTimer(this);
QTimer::singleShot(kNestedLoopDetectorIntervalMs,
mNestedLoopTimerObject, SLOT(timeOut()));
@@ -592,8 +592,8 @@ PluginModuleChild::EnteredCxxStack()
void
PluginModuleChild::ExitedCxxStack()
{
NS_ABORT_IF_FALSE(mNestedLoopTimerObject != nullptr,
"nested loop timeout not scheduled");
MOZ_ASSERT(mNestedLoopTimerObject != nullptr,
"nested loop timeout not scheduled");
delete mNestedLoopTimerObject;
mNestedLoopTimerObject = nullptr;
}
@@ -636,8 +636,8 @@ PluginModuleChild::InitGraphics()
// called. (Toggle references wouldn't detect if the reference count
// might be higher.)
GObjectDisposeFn* dispose = &G_OBJECT_CLASS(gtk_plug_class)->dispose;
NS_ABORT_IF_FALSE(*dispose != wrap_gtk_plug_dispose,
"InitGraphics called twice");
MOZ_ASSERT(*dispose != wrap_gtk_plug_dispose,
"InitGraphics called twice");
real_gtk_plug_dispose = *dispose;
*dispose = wrap_gtk_plug_dispose;
@@ -1088,7 +1088,7 @@ const NPNetscapeFuncs PluginModuleChild::sBrowserFuncs = {
PluginInstanceChild*
InstCast(NPP aNPP)
{
NS_ABORT_IF_FALSE(!!(aNPP->ndata), "nil instance");
MOZ_ASSERT(!!(aNPP->ndata), "nil instance");
return static_cast<PluginInstanceChild*>(aNPP->ndata);
}