Skip to content

Commit

Permalink
Bug 802686 - s/MOZ_NOT_REACHED/MOZ_CRASH/ in Gecko. r=(see below)
Browse files Browse the repository at this point in the history
r=tbsaunde for accessible
r=jmuizelaar for gfx
r=roc for layout
r=glandium for mozglue
r=jduell for netwerk
r=khuey for everything else

This is a mechanical change made with sed.  Later patches in this queue
clean up the whitespace errors and so on.
  • Loading branch information
jlebar committed Jun 29, 2013
1 parent d97ce09 commit 2fa4677
Show file tree
Hide file tree
Showing 126 changed files with 318 additions and 318 deletions.
2 changes: 1 addition & 1 deletion accessible/src/atk/AccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ getRoleCB(AtkObject *aAtkObj)
switch (accWrap->Role()) {
#include "RoleMap.h"
default:
MOZ_NOT_REACHED("Unknown role.");
MOZ_CRASH("Unknown role.");
aAtkObj->role = ATK_ROLE_UNKNOWN;
};

Expand Down
2 changes: 1 addition & 1 deletion accessible/src/base/nsTextEquivUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ nsTextEquivUtils::GetRoleRule(role aRole)
switch (aRole) {
#include "RoleMap.h"
default:
MOZ_NOT_REACHED("Unknown role.");
MOZ_CRASH("Unknown role.");
}

#undef ROLE
Expand Down
4 changes: 2 additions & 2 deletions accessible/src/windows/msaa/AccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ AccessibleWrap::get_accRole(
switch (geckoRole) {
#include "RoleMap.h"
default:
MOZ_NOT_REACHED("Unknown role.");
MOZ_CRASH("Unknown role.");
};

#undef ROLE
Expand Down Expand Up @@ -1181,7 +1181,7 @@ AccessibleWrap::role(long *aRole)
switch (geckoRole) {
#include "RoleMap.h"
default:
MOZ_NOT_REACHED("Unknown role.");
MOZ_CRASH("Unknown role.");
};

#undef ROLE
Expand Down
2 changes: 1 addition & 1 deletion caps/src/nsPrincipal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ nsExpandedPrincipal::CheckMayLoad(nsIURI* uri, bool aReport, bool aAllowIfInheri
NS_IMETHODIMP
nsExpandedPrincipal::GetHashValue(uint32_t* result)
{
MOZ_NOT_REACHED("extended principal should never be used as key in a hash map");
MOZ_CRASH("extended principal should never be used as key in a hash map");
return NS_ERROR_FAILURE;
}

Expand Down
2 changes: 1 addition & 1 deletion content/base/src/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2708,7 +2708,7 @@ class StringBuilder
EncodeTextFragment(u.mTextFragment, aOut);
break;
default:
MOZ_NOT_REACHED("Unknown unit type?");
MOZ_CRASH("Unknown unit type?");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsAttrValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ nsAttrValue::SetTo(const nsAttrValue& aOther)
}
case eCSSStyleRule:
{
MOZ_NOT_REACHED("These should be refcounted!");
MOZ_CRASH("These should be refcounted!");
break;
}
case eURL:
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsContentIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1452,5 +1452,5 @@ nsContentSubtreeIterator::GetTopAncestorInRange(nsINode* aNode)
content = parent;
}

MOZ_NOT_REACHED("This should only be possible if aNode was null");
MOZ_CRASH("This should only be possible if aNode was null");
}
4 changes: 2 additions & 2 deletions content/base/src/nsDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8475,7 +8475,7 @@ nsDocument::MaybePreLoadImage(nsIURI* uri, const nsAString &aCrossOriginAttr)
break;
default:
/* should never happen */
MOZ_NOT_REACHED("Unknown CORS mode!");
MOZ_CRASH("Unknown CORS mode!");
}

// Image not in cache - trigger preload
Expand Down Expand Up @@ -11148,7 +11148,7 @@ nsDocument::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
// nsDocuments can only appear at the top of the DOM tree, and we use the
// specialized DocSizeOfExcludingThis() in that case. So this should never
// be called.
MOZ_NOT_REACHED("nsDocument::SizeOfExcludingThis");
MOZ_CRASH("nsDocument::SizeOfExcludingThis");
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsObjectLoadingContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2993,7 +2993,7 @@ nsObjectLoadingContent::ShouldPlay(FallbackType &aReason, bool aIgnoreCurrentTyp
case nsIPluginTag::STATE_CLICKTOPLAY:
return false;
}
MOZ_NOT_REACHED("Unexpected enabledState");
MOZ_CRASH("Unexpected enabledState");
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions content/canvas/src/CanvasRenderingContext2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ WrapStyle(JSContext* cx, JSObject* objArg,
break;
}
default:
MOZ_NOT_REACHED("unexpected CanvasMultiGetterType");
MOZ_CRASH("unexpected CanvasMultiGetterType");
}
if (!ok) {
error.Throw(NS_ERROR_FAILURE);
Expand Down Expand Up @@ -2638,7 +2638,7 @@ CanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText,
anchorY = -fontMetrics.emDescent;
break;
default:
MOZ_NOT_REACHED("unexpected TextBaseline");
MOZ_CRASH("unexpected TextBaseline");
}

processor.mPt.y += anchorY;
Expand Down
4 changes: 2 additions & 2 deletions content/canvas/src/WebGLContextGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5509,15 +5509,15 @@ WebGLTexelFormat mozilla::GetWebGLTexelFormat(GLenum format, GLenum type)
case LOCAL_GL_UNSIGNED_INT:
return WebGLTexelConversions::D32;
default:
MOZ_NOT_REACHED("Invalid WebGL texture format/type?");
MOZ_CRASH("Invalid WebGL texture format/type?");
return WebGLTexelConversions::BadFormat;
}
} else if (format == LOCAL_GL_DEPTH_STENCIL) {
switch (type) {
case LOCAL_GL_UNSIGNED_INT_24_8_EXT:
return WebGLTexelConversions::D24S8;
default:
MOZ_NOT_REACHED("Invalid WebGL texture format/type?");
MOZ_CRASH("Invalid WebGL texture format/type?");
NS_ABORT_IF_FALSE(false, "Coding mistake?! Should never reach this point.");
return WebGLTexelConversions::BadFormat;
}
Expand Down
4 changes: 2 additions & 2 deletions content/canvas/src/WebGLFramebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ WebGLFramebuffer::Attachment::IsComplete() const {
format == LOCAL_GL_RGB ||
format == LOCAL_GL_RGBA);
}
MOZ_NOT_REACHED("Invalid WebGL attachment poin?");
MOZ_CRASH("Invalid WebGL attachment poin?");
}

if (mRenderbufferPtr) {
Expand All @@ -139,7 +139,7 @@ WebGLFramebuffer::Attachment::IsComplete() const {
format == LOCAL_GL_RGB5_A1 ||
format == LOCAL_GL_RGBA4);
}
MOZ_NOT_REACHED("Invalid WebGL attachment poin?");
MOZ_CRASH("Invalid WebGL attachment poin?");
}

NS_ABORT(); // should never get there
Expand Down
2 changes: 1 addition & 1 deletion content/events/src/TextComposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ TextComposition::CompositionEventDispatcher::Run()
break;
}
default:
MOZ_NOT_REACHED("Unsupported event");
MOZ_CRASH("Unsupported event");
break;
}
return NS_OK;
Expand Down
4 changes: 2 additions & 2 deletions content/events/src/nsDOMMouseEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ nsDOMMouseEvent::InitMouseEvent(const nsAString& aType,
static_cast<nsInputEvent*>(mEvent)->modifiers = modifiers;
return NS_OK;
default:
MOZ_NOT_REACHED("There is no space to store the modifiers");
MOZ_CRASH("There is no space to store the modifiers");
return NS_ERROR_FAILURE;
}
}
Expand Down Expand Up @@ -242,7 +242,7 @@ nsDOMMouseEvent::Buttons()
case NS_SIMPLE_GESTURE_EVENT:
return static_cast<nsMouseEvent_base*>(mEvent)->buttons;
default:
MOZ_NOT_REACHED("Tried to get mouse buttons for non-mouse event!");
MOZ_CRASH("Tried to get mouse buttons for non-mouse event!");
return 0;
}
}
Expand Down
2 changes: 1 addition & 1 deletion content/events/src/nsDOMUIEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ nsDOMUIEvent::IsChar() const
default:
return false;
}
MOZ_NOT_REACHED("Switch handles all cases.");
MOZ_CRASH("Switch handles all cases.");
}

NS_IMETHODIMP
Expand Down
8 changes: 4 additions & 4 deletions content/events/src/nsEventStateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,7 @@ nsEventStateManager::DispatchCrossProcessEvent(nsEvent* aEvent,
return remote->SendRealTouchEvent(*touchEvent);
}
default: {
MOZ_NOT_REACHED("Attempt to send non-whitelisted event?");
MOZ_CRASH("Attempt to send non-whitelisted event?");
return false;
}
}
Expand Down Expand Up @@ -2520,7 +2520,7 @@ nsEventStateManager::DispatchLegacyMouseScrollEvents(nsIFrame* aTargetFrame,
break;

default:
MOZ_NOT_REACHED("Invalid deltaMode value comes");
MOZ_CRASH("Invalid deltaMode value comes");
return;
}

Expand Down Expand Up @@ -2847,7 +2847,7 @@ nsEventStateManager::DoScrollText(nsIScrollableFrame* aScrollableFrame,
origin = nsGkAtoms::pixels;
break;
default:
MOZ_NOT_REACHED("Invalid deltaMode value comes");
MOZ_CRASH("Invalid deltaMode value comes");
return;
}

Expand Down Expand Up @@ -2892,7 +2892,7 @@ nsEventStateManager::DoScrollText(nsIScrollableFrame* aScrollableFrame,
mode = nsIScrollableFrame::SMOOTH;
break;
default:
MOZ_NOT_REACHED("Invalid scrollType value comes");
MOZ_CRASH("Invalid scrollType value comes");
return;
}

Expand Down
6 changes: 3 additions & 3 deletions content/events/src/nsIMEStateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,10 @@ nsIMEStateManager::NotifyIME(NotificationToIME aNotification,
case REQUEST_TO_CANCEL_COMPOSITION:
return composition ? aWidget->NotifyIME(aNotification) : NS_OK;
default:
MOZ_NOT_REACHED("Unsupported notification");
MOZ_CRASH("Unsupported notification");
return NS_ERROR_INVALID_ARG;
}
MOZ_NOT_REACHED(
MOZ_CRASH(
"Failed to handle the notification for non-synthesized composition");
}

Expand Down Expand Up @@ -1049,7 +1049,7 @@ nsIMEStateManager::IsEditableIMEState(nsIWidget* aWidget)
case widget::IMEState::DISABLED:
return false;
default:
MOZ_NOT_REACHED("Unknown IME enable state");
MOZ_CRASH("Unknown IME enable state");
return false;
}
}
Expand Down
28 changes: 14 additions & 14 deletions content/html/document/src/nsHTMLContentSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,21 +662,21 @@ SinkContext::OpenContainer(const nsIParserNode& aNode)
// Special handling for certain tags
switch (nodeType) {
case eHTMLTag_form:
MOZ_NOT_REACHED("Must not use HTMLContentSink for forms.");
MOZ_CRASH("Must not use HTMLContentSink for forms.");
break;

case eHTMLTag_frameset:
MOZ_NOT_REACHED("Must not use HTMLContentSink for frames.");
MOZ_CRASH("Must not use HTMLContentSink for frames.");
break;

case eHTMLTag_noembed:
case eHTMLTag_noframes:
MOZ_NOT_REACHED("Must not use HTMLContentSink for noembed/noframes.");
MOZ_CRASH("Must not use HTMLContentSink for noembed/noframes.");
break;

case eHTMLTag_script:
case eHTMLTag_style:
MOZ_NOT_REACHED("Must not use HTMLContentSink for styles and scripts.");
MOZ_CRASH("Must not use HTMLContentSink for styles and scripts.");
break;

case eHTMLTag_button:
Expand Down Expand Up @@ -783,11 +783,11 @@ SinkContext::CloseContainer(const nsHTMLTag aTag)
switch (nodeType) {
case eHTMLTag_noembed:
case eHTMLTag_noframes:
MOZ_NOT_REACHED("Must not use HTMLContentSink for noembed/noframes.");
MOZ_CRASH("Must not use HTMLContentSink for noembed/noframes.");
break;

case eHTMLTag_form:
MOZ_NOT_REACHED("Must not use HTMLContentSink for forms.");
MOZ_CRASH("Must not use HTMLContentSink for forms.");
break;

case eHTMLTag_video:
Expand All @@ -801,12 +801,12 @@ SinkContext::CloseContainer(const nsHTMLTag aTag)
break;

case eHTMLTag_script:
MOZ_NOT_REACHED("Must not use HTMLContentSink to run scripts.");
MOZ_CRASH("Must not use HTMLContentSink to run scripts.");
result = NS_ERROR_NOT_IMPLEMENTED;
break;

case eHTMLTag_style:
MOZ_NOT_REACHED("Must not use HTMLContentSink for styles.");
MOZ_CRASH("Must not use HTMLContentSink for styles.");
result = NS_ERROR_NOT_IMPLEMENTED;
break;

Expand Down Expand Up @@ -855,7 +855,7 @@ SinkContext::AddLeaf(const nsIParserNode& aNode)
// Additional processing needed once the element is in the tree
switch (nodeType) {
case eHTMLTag_meta:
MOZ_NOT_REACHED("Must not use HTMLContentSink for metas.");
MOZ_CRASH("Must not use HTMLContentSink for metas.");
rv = NS_ERROR_NOT_IMPLEMENTED;
break;

Expand Down Expand Up @@ -1751,7 +1751,7 @@ HTMLContentSink::OpenContainer(const nsIParserNode& aNode)

switch (aNode.GetNodeType()) {
case eHTMLTag_frameset:
MOZ_NOT_REACHED("Must not use HTMLContentSink for frames.");
MOZ_CRASH("Must not use HTMLContentSink for frames.");
rv = NS_ERROR_NOT_IMPLEMENTED;
break;
case eHTMLTag_head:
Expand All @@ -1776,7 +1776,7 @@ HTMLContentSink::OpenContainer(const nsIParserNode& aNode)
}
break;
case eHTMLTag_form:
MOZ_NOT_REACHED("Must not use HTMLContentSink for forms.");
MOZ_CRASH("Must not use HTMLContentSink for forms.");
rv = NS_ERROR_NOT_IMPLEMENTED;
break;
default:
Expand All @@ -1794,7 +1794,7 @@ HTMLContentSink::CloseContainer(const eHTMLTags aTag)

switch (aTag) {
case eHTMLTag_frameset:
MOZ_NOT_REACHED("Must not use HTMLContentSink for frames.");
MOZ_CRASH("Must not use HTMLContentSink for frames.");
rv = NS_ERROR_NOT_IMPLEMENTED;
break;
case eHTMLTag_head:
Expand All @@ -1807,7 +1807,7 @@ HTMLContentSink::CloseContainer(const eHTMLTags aTag)
rv = CloseHTML();
break;
case eHTMLTag_form:
MOZ_NOT_REACHED("Must not use HTMLContentSink for forms.");
MOZ_CRASH("Must not use HTMLContentSink for forms.");
rv = NS_ERROR_NOT_IMPLEMENTED;
break;
default:
Expand All @@ -1833,7 +1833,7 @@ HTMLContentSink::AddLeaf(const nsIParserNode& aNode)
switch (nodeType) {
case eHTMLTag_link:
rv = NS_ERROR_NOT_IMPLEMENTED;
MOZ_NOT_REACHED("Must not use HTMLContentSink for links.");
MOZ_CRASH("Must not use HTMLContentSink for links.");

break;
default:
Expand Down
2 changes: 1 addition & 1 deletion content/media/DOMMediaStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ DOMMediaStream::CreateDOMTrack(TrackID aTrackID, MediaSegment::Type aType)
mTrackTypesAvailable |= HINT_CONTENTS_VIDEO;
break;
default:
MOZ_NOT_REACHED("Unhandled track type");
MOZ_CRASH("Unhandled track type");
return nullptr;
}
mTracks.AppendElement(track);
Expand Down
2 changes: 1 addition & 1 deletion content/media/MediaStreamGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1837,7 +1837,7 @@ MediaStream::ApplyTrackDisabling(TrackID aTrackID, MediaSegment* aSegment)
break;
}
default:
MOZ_NOT_REACHED("Unknown track type");
MOZ_CRASH("Unknown track type");
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion content/media/encoder/MediaEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ MediaEncoder::GetEncodedData(nsTArray<nsTArray<uint8_t> >* aOutputBufs,
break;

default:
MOZ_NOT_REACHED("Invalid encode state");
MOZ_CRASH("Invalid encode state");
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion content/media/encoder/OpusTrackEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ OpusTrackEncoder::GetHeader(nsTArray<uint8_t>* aOutput)
// No more headers.
break;
default:
MOZ_NOT_REACHED("Invalid state");
MOZ_CRASH("Invalid state");
break;
}
return NS_OK;
Expand Down
2 changes: 1 addition & 1 deletion content/media/webaudio/MediaBufferDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ MediaDecodeTask::RunNextPhase()
break;
case PhaseEnum::Decode:
case PhaseEnum::Done:
MOZ_NOT_REACHED("Invalid phase Decode");
MOZ_CRASH("Invalid phase Decode");
break;
}
}
Expand Down
Loading

0 comments on commit 2fa4677

Please sign in to comment.