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 dc468b5918
commit ee41df7dc2
347 changed files with 2974 additions and 3007 deletions

View File

@ -22,8 +22,8 @@ nsChromeRegistryContent::RegisterRemoteChrome(
const nsACString& aLocale,
bool aReset)
{
NS_ABORT_IF_FALSE(aReset || mLocale.IsEmpty(),
"RegisterChrome twice?");
MOZ_ASSERT(aReset || mLocale.IsEmpty(),
"RegisterChrome twice?");
if (aReset) {
mPackagesHash.Clear();

View File

@ -27,7 +27,7 @@ ComputedTimingFunction::Init(const nsTimingFunction &aFunction)
static inline double
StepEnd(uint32_t aSteps, double aPortion)
{
NS_ABORT_IF_FALSE(0.0 <= aPortion && aPortion <= 1.0, "out of range");
MOZ_ASSERT(0.0 <= aPortion && aPortion <= 1.0, "out of range");
uint32_t step = uint32_t(aPortion * aSteps); // floor
return double(step) / double(aSteps);
}
@ -47,7 +47,7 @@ ComputedTimingFunction::GetValue(double aPortion) const
// really meant it.
return 1.0 - StepEnd(mSteps, 1.0 - aPortion);
default:
NS_ABORT_IF_FALSE(false, "bad type");
MOZ_ASSERT(false, "bad type");
// fall through
case nsTimingFunction::StepEnd:
return StepEnd(mSteps, aPortion);

View File

@ -42,7 +42,7 @@ private: //data
NS_IMETHODIMP
ArchiveRequestEvent::Run()
{
NS_ABORT_IF_FALSE(mRequest, "the request is not longer valid");
MOZ_ASSERT(mRequest, "the request is not longer valid");
mRequest->Run();
return NS_OK;
}

View File

@ -48,9 +48,9 @@ Attr::Attr(nsDOMAttributeMap *aAttrMap,
const nsAString &aValue, bool aNsAware)
: nsIAttribute(aAttrMap, aNodeInfo, aNsAware), mValue(aValue)
{
NS_ABORT_IF_FALSE(mNodeInfo, "We must get a nodeinfo here!");
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::ATTRIBUTE_NODE,
"Wrong nodeType");
MOZ_ASSERT(mNodeInfo, "We must get a nodeinfo here!");
MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::ATTRIBUTE_NODE,
"Wrong nodeType");
// We don't add a reference to our content. It will tell us
// to drop our reference when it goes away.

View File

@ -19,8 +19,8 @@ class Comment MOZ_FINAL : public nsGenericDOMDataNode,
private:
void Init()
{
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE,
"Bad NodeType in aNodeInfo");
MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE,
"Bad NodeType in aNodeInfo");
}
virtual ~Comment();

View File

@ -56,7 +56,7 @@ Crypto::GetRandomValues(JSContext* aCx, const ArrayBufferView& aArray,
JS::MutableHandle<JSObject*> aRetval,
ErrorResult& aRv)
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Called on the wrong thread");
MOZ_ASSERT(NS_IsMainThread(), "Called on the wrong thread");
JS::Rooted<JSObject*> view(aCx, aArray.Obj());

View File

@ -27,11 +27,10 @@ class DocumentFragment : public FragmentOrElement,
private:
void Init()
{
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() ==
nsIDOMNode::DOCUMENT_FRAGMENT_NODE &&
mNodeInfo->Equals(nsGkAtoms::documentFragmentNodeName,
kNameSpaceID_None),
"Bad NodeType in aNodeInfo");
MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_FRAGMENT_NODE &&
mNodeInfo->Equals(nsGkAtoms::documentFragmentNodeName,
kNameSpaceID_None),
"Bad NodeType in aNodeInfo");
}
public:

View File

@ -74,8 +74,8 @@ DocumentType::DocumentType(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
mSystemId(aSystemId),
mInternalSubset(aInternalSubset)
{
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_TYPE_NODE,
"Bad NodeType in aNodeInfo");
MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_TYPE_NODE,
"Bad NodeType in aNodeInfo");
}
DocumentType::~DocumentType()

View File

@ -204,9 +204,9 @@ Element::NotifyStateChange(EventStates aStates)
void
Element::UpdateLinkState(EventStates aState)
{
NS_ABORT_IF_FALSE(!aState.HasAtLeastOneOfStates(~(NS_EVENT_STATE_VISITED |
NS_EVENT_STATE_UNVISITED)),
"Unexpected link state bits");
MOZ_ASSERT(!aState.HasAtLeastOneOfStates(~(NS_EVENT_STATE_VISITED |
NS_EVENT_STATE_UNVISITED)),
"Unexpected link state bits");
mState =
(mState & ~(NS_EVENT_STATE_VISITED | NS_EVENT_STATE_UNVISITED)) |
aState;

View File

@ -152,8 +152,8 @@ public:
FragmentOrElement(aNodeInfo),
mState(NS_EVENT_STATE_MOZ_READONLY)
{
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::ELEMENT_NODE,
"Bad NodeType in aNodeInfo");
MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::ELEMENT_NODE,
"Bad NodeType in aNodeInfo");
SetIsElement();
}
#endif // MOZILLA_INTERNAL_API

View File

@ -580,9 +580,9 @@ EventSource::AsyncOnChannelRedirect(nsIChannel *aOldChannel,
nsresult
EventSource::OnRedirectVerifyCallback(nsresult aResult)
{
NS_ABORT_IF_FALSE(mRedirectCallback, "mRedirectCallback not set in callback");
NS_ABORT_IF_FALSE(mNewRedirectChannel,
"mNewRedirectChannel not set in callback");
MOZ_ASSERT(mRedirectCallback, "mRedirectCallback not set in callback");
MOZ_ASSERT(mNewRedirectChannel,
"mNewRedirectChannel not set in callback");
NS_ENSURE_SUCCESS(aResult, aResult);

View File

@ -29,7 +29,7 @@ Link::Link(Element *aElement)
, mNeedsRegistration(false)
, mRegistered(false)
{
NS_ABORT_IF_FALSE(mElement, "Must have an element");
MOZ_ASSERT(mElement, "Must have an element");
}
Link::~Link()
@ -58,9 +58,9 @@ Link::SetLinkState(nsLinkState aState)
// Per IHistory interface documentation, we are no longer registered.
mRegistered = false;
NS_ABORT_IF_FALSE(LinkState() == NS_EVENT_STATE_VISITED ||
LinkState() == NS_EVENT_STATE_UNVISITED,
"Unexpected state obtained from LinkState()!");
MOZ_ASSERT(LinkState() == NS_EVENT_STATE_VISITED ||
LinkState() == NS_EVENT_STATE_UNVISITED,
"Unexpected state obtained from LinkState()!");
// Tell the element to update its visited state
mElement->UpdateState(true);

View File

@ -48,7 +48,7 @@ NodeInfo::NodeInfo(nsIAtom *aName, nsIAtom *aPrefix, int32_t aNamespaceID,
nsNodeInfoManager *aOwnerManager)
{
CheckValidNodeInfo(aNodeType, aName, aNamespaceID, aExtraName);
NS_ABORT_IF_FALSE(aOwnerManager, "Invalid aOwnerManager");
MOZ_ASSERT(aOwnerManager, "Invalid aOwnerManager");
// Initialize mInner
NS_ADDREF(mInner.mName = aName);
@ -104,8 +104,7 @@ NodeInfo::NodeInfo(nsIAtom *aName, nsIAtom *aPrefix, int32_t aNamespaceID,
SetDOMStringToNull(mLocalName);
break;
default:
NS_ABORT_IF_FALSE(aNodeType == UINT16_MAX,
"Unknown node type");
MOZ_ASSERT(aNodeType == UINT16_MAX, "Unknown node type");
}
}

View File

@ -75,42 +75,42 @@ inline void
CheckValidNodeInfo(uint16_t aNodeType, nsIAtom *aName, int32_t aNamespaceID,
nsIAtom* aExtraName)
{
NS_ABORT_IF_FALSE(aNodeType == nsIDOMNode::ELEMENT_NODE ||
aNodeType == nsIDOMNode::ATTRIBUTE_NODE ||
aNodeType == nsIDOMNode::TEXT_NODE ||
aNodeType == nsIDOMNode::CDATA_SECTION_NODE ||
aNodeType == nsIDOMNode::PROCESSING_INSTRUCTION_NODE ||
aNodeType == nsIDOMNode::COMMENT_NODE ||
aNodeType == nsIDOMNode::DOCUMENT_NODE ||
aNodeType == nsIDOMNode::DOCUMENT_TYPE_NODE ||
aNodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE ||
aNodeType == UINT16_MAX,
"Invalid nodeType");
NS_ABORT_IF_FALSE((aNodeType == nsIDOMNode::PROCESSING_INSTRUCTION_NODE ||
aNodeType == nsIDOMNode::DOCUMENT_TYPE_NODE) ==
!!aExtraName,
"Supply aExtraName for and only for PIs and doctypes");
NS_ABORT_IF_FALSE(aNodeType == nsIDOMNode::ELEMENT_NODE ||
aNodeType == nsIDOMNode::ATTRIBUTE_NODE ||
aNodeType == UINT16_MAX ||
aNamespaceID == kNameSpaceID_None,
"Only attributes and elements can be in a namespace");
NS_ABORT_IF_FALSE(aName && aName != nsGkAtoms::_empty, "Invalid localName");
NS_ABORT_IF_FALSE(((aNodeType == nsIDOMNode::TEXT_NODE) ==
(aName == nsGkAtoms::textTagName)) &&
((aNodeType == nsIDOMNode::CDATA_SECTION_NODE) ==
(aName == nsGkAtoms::cdataTagName)) &&
((aNodeType == nsIDOMNode::COMMENT_NODE) ==
(aName == nsGkAtoms::commentTagName)) &&
((aNodeType == nsIDOMNode::DOCUMENT_NODE) ==
(aName == nsGkAtoms::documentNodeName)) &&
((aNodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE) ==
(aName == nsGkAtoms::documentFragmentNodeName)) &&
((aNodeType == nsIDOMNode::DOCUMENT_TYPE_NODE) ==
(aName == nsGkAtoms::documentTypeNodeName)) &&
((aNodeType == nsIDOMNode::PROCESSING_INSTRUCTION_NODE) ==
(aName == nsGkAtoms::processingInstructionTagName)),
"Wrong localName for nodeType");
MOZ_ASSERT(aNodeType == nsIDOMNode::ELEMENT_NODE ||
aNodeType == nsIDOMNode::ATTRIBUTE_NODE ||
aNodeType == nsIDOMNode::TEXT_NODE ||
aNodeType == nsIDOMNode::CDATA_SECTION_NODE ||
aNodeType == nsIDOMNode::PROCESSING_INSTRUCTION_NODE ||
aNodeType == nsIDOMNode::COMMENT_NODE ||
aNodeType == nsIDOMNode::DOCUMENT_NODE ||
aNodeType == nsIDOMNode::DOCUMENT_TYPE_NODE ||
aNodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE ||
aNodeType == UINT16_MAX,
"Invalid nodeType");
MOZ_ASSERT((aNodeType == nsIDOMNode::PROCESSING_INSTRUCTION_NODE ||
aNodeType == nsIDOMNode::DOCUMENT_TYPE_NODE) ==
!!aExtraName,
"Supply aExtraName for and only for PIs and doctypes");
MOZ_ASSERT(aNodeType == nsIDOMNode::ELEMENT_NODE ||
aNodeType == nsIDOMNode::ATTRIBUTE_NODE ||
aNodeType == UINT16_MAX ||
aNamespaceID == kNameSpaceID_None,
"Only attributes and elements can be in a namespace");
MOZ_ASSERT(aName && aName != nsGkAtoms::_empty, "Invalid localName");
MOZ_ASSERT(((aNodeType == nsIDOMNode::TEXT_NODE) ==
(aName == nsGkAtoms::textTagName)) &&
((aNodeType == nsIDOMNode::CDATA_SECTION_NODE) ==
(aName == nsGkAtoms::cdataTagName)) &&
((aNodeType == nsIDOMNode::COMMENT_NODE) ==
(aName == nsGkAtoms::commentTagName)) &&
((aNodeType == nsIDOMNode::DOCUMENT_NODE) ==
(aName == nsGkAtoms::documentNodeName)) &&
((aNodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE) ==
(aName == nsGkAtoms::documentFragmentNodeName)) &&
((aNodeType == nsIDOMNode::DOCUMENT_TYPE_NODE) ==
(aName == nsGkAtoms::documentTypeNodeName)) &&
((aNodeType == nsIDOMNode::PROCESSING_INSTRUCTION_NODE) ==
(aName == nsGkAtoms::processingInstructionTagName)),
"Wrong localName for nodeType");
}
#endif /* mozilla_dom_NodeInfoInlines_h___ */
#endif /* mozilla_dom_NodeInfoInlines_h___ */

View File

@ -1482,7 +1482,7 @@ WebSocketImpl::Init(JSContext* aCx,
void
WebSocketImpl::AsyncOpen(ErrorResult& aRv)
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread");
nsCString asciiOrigin;
aRv = nsContentUtils::GetASCIIOrigin(mPrincipal, asciiOrigin);
@ -1527,7 +1527,7 @@ nsresult
WebSocketImpl::InitializeConnection()
{
AssertIsOnMainThread();
NS_ABORT_IF_FALSE(!mChannel, "mChannel should be null");
MOZ_ASSERT(!mChannel, "mChannel should be null");
nsCOMPtr<nsIWebSocketChannel> wsChannel;
nsAutoCloseWS autoClose(this);

View File

@ -1032,8 +1032,7 @@ nsAttrValue::Equals(const nsAttrValue& aOther) const
// If that changes then we probably want to add methods to the
// corresponding SVG types to compare their base values.
// As a shortcut, however, we can begin by comparing the pointers.
NS_ABORT_IF_FALSE(false, "Comparing nsAttrValues that point to SVG "
"data");
MOZ_ASSERT(false, "Comparing nsAttrValues that point to SVG data");
return false;
}
NS_NOTREACHED("unknown type stored in MiscContainer");
@ -1754,7 +1753,7 @@ nsAttrValue::ResetMiscAtomOrString()
void
nsAttrValue::SetSVGType(ValueType aType, const void* aValue,
const nsAString* aSerialized) {
NS_ABORT_IF_FALSE(IsSVGType(aType), "Not an SVG type");
MOZ_ASSERT(IsSVGType(aType), "Not an SVG type");
MiscContainer* cont = EnsureEmptyMiscContainer();
// All SVG types are just pointers to classes so just setting any of them

View File

@ -4277,7 +4277,7 @@ nsContentUtils::ParseFragmentXML(const nsAString& aSourceBuffer,
// sXMLFragmentSink now owns the sink
}
nsCOMPtr<nsIContentSink> contentsink = do_QueryInterface(sXMLFragmentSink);
NS_ABORT_IF_FALSE(contentsink, "Sink doesn't QI to nsIContentSink!");
MOZ_ASSERT(contentsink, "Sink doesn't QI to nsIContentSink!");
sXMLFragmentParser->SetContentSink(contentsink);
sXMLFragmentSink->SetTargetDocument(aDocument);

View File

@ -1765,7 +1765,7 @@ GetXPCProto(nsIXPConnect *aXPConnect, JSContext *cx, nsGlobalWindow *aWin,
nsCOMPtr<nsIClassInfo> ci;
if (aNameStruct->mType == nsGlobalNameStruct::eTypeClassConstructor) {
int32_t id = aNameStruct->mDOMClassInfoID;
NS_ABORT_IF_FALSE(id >= 0, "Negative DOM classinfo?!?");
MOZ_ASSERT(id >= 0, "Negative DOM classinfo?!?");
nsDOMClassInfoID ci_id = (nsDOMClassInfoID)id;

View File

@ -269,7 +269,7 @@ nsDOMDataChannel::Send(const nsAString& aData, ErrorResult& aRv)
void
nsDOMDataChannel::Send(File& aData, ErrorResult& aRv)
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread");
nsCOMPtr<nsIInputStream> msgStream;
nsresult rv = aData.GetInternalStream(getter_AddRefs(msgStream));
@ -296,7 +296,7 @@ nsDOMDataChannel::Send(File& aData, ErrorResult& aRv)
void
nsDOMDataChannel::Send(const ArrayBuffer& aData, ErrorResult& aRv)
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread");
aData.ComputeLengthAndData();
@ -312,7 +312,7 @@ nsDOMDataChannel::Send(const ArrayBuffer& aData, ErrorResult& aRv)
void
nsDOMDataChannel::Send(const ArrayBufferView& aData, ErrorResult& aRv)
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread");
aData.ComputeLengthAndData();

View File

@ -182,7 +182,7 @@ void
nsDOMTokenList::RemoveInternal(const nsAttrValue* aAttr,
const nsTArray<nsString>& aTokens)
{
NS_ABORT_IF_FALSE(aAttr, "Need an attribute");
MOZ_ASSERT(aAttr, "Need an attribute");
nsAutoString input;
aAttr->ToString(input);
@ -204,7 +204,7 @@ nsDOMTokenList::RemoveInternal(const nsAttrValue* aAttr,
if (iter == end) {
// At this point we're sure the last seen token (if any) wasn't to be
// removed. So the trailing spaces will need to be kept.
NS_ABORT_IF_FALSE(!lastTokenRemoved, "How did this happen?");
MOZ_ASSERT(!lastTokenRemoved, "How did this happen?");
output.Append(Substring(copyStart, end));
break;
@ -227,8 +227,8 @@ nsDOMTokenList::RemoveInternal(const nsAttrValue* aAttr,
} else {
if (lastTokenRemoved && !output.IsEmpty()) {
NS_ABORT_IF_FALSE(!nsContentUtils::IsHTMLWhitespace(
output.Last()), "Invalid last output token");
MOZ_ASSERT(!nsContentUtils::IsHTMLWhitespace(output.Last()),
"Invalid last output token");
output.Append(char16_t(' '));
}
lastTokenRemoved = false;

View File

@ -1716,9 +1716,9 @@ CanvasToDataSourceSurface(nsIDOMHTMLCanvasElement* aCanvas)
return nullptr;
}
NS_ABORT_IF_FALSE(node->IsElement(),
"An nsINode that implements nsIDOMHTMLCanvasElement should "
"be an element.");
MOZ_ASSERT(node->IsElement(),
"An nsINode that implements nsIDOMHTMLCanvasElement should "
"be an element.");
nsLayoutUtils::SurfaceFromElementResult result =
nsLayoutUtils::SurfaceFromElement(node->AsElement());
return result.mSourceSurface->GetDataSurface();
@ -2309,7 +2309,7 @@ nsDOMWindowUtils::GetClassName(JS::Handle<JS::Value> aObject, JSContext* aCx,
}
*aName = NS_strdup(JS_GetClass(aObject.toObjectOrNull())->name);
NS_ABORT_IF_FALSE(*aName, "NS_strdup should be infallible.");
MOZ_ASSERT(*aName, "NS_strdup should be infallible.");
return NS_OK;
}
@ -2698,9 +2698,9 @@ nsDOMWindowUtils::ComputeAnimationDistance(nsIDOMElement* aElement,
property = eCSSProperty_UNKNOWN;
}
NS_ABORT_IF_FALSE(property == eCSSProperty_UNKNOWN ||
!nsCSSProps::IsShorthand(property),
"should not have shorthand");
MOZ_ASSERT(property == eCSSProperty_UNKNOWN ||
!nsCSSProps::IsShorthand(property),
"should not have shorthand");
StyleAnimationValue v1, v2;
if (property == eCSSProperty_UNKNOWN ||

View File

@ -1056,8 +1056,8 @@ void
TransferZoomLevels(nsIDocument* aFromDoc,
nsIDocument* aToDoc)
{
NS_ABORT_IF_FALSE(aFromDoc && aToDoc,
"transferring zoom levels from/to null doc");
MOZ_ASSERT(aFromDoc && aToDoc,
"transferring zoom levels from/to null doc");
nsIPresShell* fromShell = aFromDoc->GetShell();
if (!fromShell)
@ -1083,8 +1083,8 @@ TransferZoomLevels(nsIDocument* aFromDoc,
void
TransferShowingState(nsIDocument* aFromDoc, nsIDocument* aToDoc)
{
NS_ABORT_IF_FALSE(aFromDoc && aToDoc,
"transferring showing state from/to null doc");
MOZ_ASSERT(aFromDoc && aToDoc,
"transferring showing state from/to null doc");
if (aFromDoc->IsShowing()) {
aToDoc->OnPageShow(true, nullptr);
@ -1624,8 +1624,8 @@ ClearAllBoxObjects(nsIContent* aKey, nsPIBoxObject* aBoxObject, void* aUserArg)
nsIDocument::~nsIDocument()
{
NS_ABORT_IF_FALSE(PR_CLIST_IS_EMPTY(&mDOMMediaQueryLists),
"must not have media query lists left");
MOZ_ASSERT(PR_CLIST_IS_EMPTY(&mDOMMediaQueryLists),
"must not have media query lists left");
if (mNodeInfoManager) {
mNodeInfoManager->DropDocumentReference();
@ -2211,8 +2211,8 @@ nsDocument::Init()
// mNodeInfo keeps NodeInfoManager alive!
mNodeInfo = mNodeInfoManager->GetDocumentNodeInfo();
NS_ENSURE_TRUE(mNodeInfo, NS_ERROR_OUT_OF_MEMORY);
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_NODE,
"Bad NodeType in aNodeInfo");
MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_NODE,
"Bad NodeType in aNodeInfo");
NS_ASSERTION(OwnerDoc() == this, "Our nodeinfo is busted!");
@ -4672,11 +4672,11 @@ nsDocument::SetScriptGlobalObject(nsIScriptGlobalObject *aScriptGlobalObject)
"Script global object must be an inner window!");
}
#endif
NS_ABORT_IF_FALSE(aScriptGlobalObject || !mAnimationController ||
mAnimationController->IsPausedByType(
nsSMILTimeContainer::PAUSE_PAGEHIDE |
nsSMILTimeContainer::PAUSE_BEGIN),
"Clearing window pointer while animations are unpaused");
MOZ_ASSERT(aScriptGlobalObject || !mAnimationController ||
mAnimationController->IsPausedByType(
nsSMILTimeContainer::PAUSE_PAGEHIDE |
nsSMILTimeContainer::PAUSE_BEGIN),
"Clearing window pointer while animations are unpaused");
if (mScriptGlobalObject && !aScriptGlobalObject) {
// We're detaching from the window. We need to grab a pointer to
@ -10406,8 +10406,8 @@ nsDocument::RemoveImage(imgIRequest* aImage, uint32_t aFlags)
// Get the old count. It should exist and be > 0.
uint32_t count = 0;
DebugOnly<bool> found = mImageTracker.Get(aImage, &count);
NS_ABORT_IF_FALSE(found, "Removing image that wasn't in the tracker!");
NS_ABORT_IF_FALSE(count > 0, "Entry in the cache tracker with count 0!");
MOZ_ASSERT(found, "Removing image that wasn't in the tracker!");
MOZ_ASSERT(count > 0, "Entry in the cache tracker with count 0!");
// We're removing, so decrement the count.
count--;

View File

@ -42,25 +42,23 @@ using namespace mozilla::dom;
nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsIContent(aNodeInfo)
{
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::CDATA_SECTION_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE ||
mNodeInfo->NodeType() ==
nsIDOMNode::PROCESSING_INSTRUCTION_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_TYPE_NODE,
"Bad NodeType in aNodeInfo");
MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::CDATA_SECTION_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::PROCESSING_INSTRUCTION_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_TYPE_NODE,
"Bad NodeType in aNodeInfo");
}
nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsIContent(aNodeInfo)
{
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::CDATA_SECTION_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE ||
mNodeInfo->NodeType() ==
nsIDOMNode::PROCESSING_INSTRUCTION_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_TYPE_NODE,
"Bad NodeType in aNodeInfo");
MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::CDATA_SECTION_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::PROCESSING_INSTRUCTION_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_TYPE_NODE,
"Bad NodeType in aNodeInfo");
}
nsGenericDOMDataNode::~nsGenericDOMDataNode()

View File

@ -1524,7 +1524,7 @@ nsGlobalWindow::CleanUp()
}
if (mCleanMessageManager) {
NS_ABORT_IF_FALSE(mIsChrome, "only chrome should have msg manager cleaned");
MOZ_ASSERT(mIsChrome, "only chrome should have msg manager cleaned");
nsGlobalChromeWindow *asChrome = static_cast<nsGlobalChromeWindow*>(this);
if (asChrome->mMessageManager) {
static_cast<nsFrameMessageManager*>(
@ -8113,10 +8113,10 @@ PopulateMessagePortList(MessagePortBase* aKey, MessagePortBase* aValue, void* aC
NS_IMETHODIMP
PostMessageEvent::Run()
{
NS_ABORT_IF_FALSE(mTargetWindow->IsOuterWindow(),
"should have been passed an outer window!");
NS_ABORT_IF_FALSE(!mSource || mSource->IsOuterWindow(),
"should have been passed an outer window!");
MOZ_ASSERT(mTargetWindow->IsOuterWindow(),
"should have been passed an outer window!");
MOZ_ASSERT(!mSource || mSource->IsOuterWindow(),
"should have been passed an outer window!");
AutoJSAPI jsapi;
jsapi.Init();
@ -8131,8 +8131,8 @@ PostMessageEvent::Run()
targetWindow->IsClosedOrClosing())
return NS_OK;
NS_ABORT_IF_FALSE(targetWindow->IsInnerWindow(),
"we ordered an inner window!");
MOZ_ASSERT(targetWindow->IsInnerWindow(),
"we ordered an inner window!");
JSAutoCompartment ac(cx, targetWindow->GetWrapperPreserveColor());
// Ensure that any origin which might have been provided is the origin of this
@ -8229,8 +8229,8 @@ nsGlobalWindow::PostMessageMoz(JSContext* aCx, JS::Handle<JS::Value> aMessage,
nsRefPtr<nsGlobalWindow> callerInnerWin = CallerInnerWindow();
nsIPrincipal* callerPrin;
if (callerInnerWin) {
NS_ABORT_IF_FALSE(callerInnerWin->IsInnerWindow(),
"should have gotten an inner window here");
MOZ_ASSERT(callerInnerWin->IsInnerWindow(),
"should have gotten an inner window here");
// Compute the caller's origin either from its principal or, in the case the
// principal doesn't carry a URI (e.g. the system principal), the caller's

View File

@ -1718,8 +1718,8 @@ protected:
~nsGlobalChromeWindow()
{
NS_ABORT_IF_FALSE(mCleanMessageManager,
"chrome windows may always disconnect the msg manager");
MOZ_ASSERT(mCleanMessageManager,
"chrome windows may always disconnect the msg manager");
mGroupMessageManagers.EnumerateRead(DisconnectGroupMessageManager, nullptr);
mGroupMessageManagers.Clear();

View File

@ -94,8 +94,7 @@ nsHostObjectURI::CloneInternal(nsSimpleURI::RefHandlingEnum aRefHandlingMode,
#ifdef DEBUG
nsRefPtr<nsHostObjectURI> uriCheck;
rv = simpleClone->QueryInterface(kHOSTOBJECTURICID, getter_AddRefs(uriCheck));
NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv) && uriCheck,
"Unexpected!");
MOZ_ASSERT(NS_SUCCEEDED(rv) && uriCheck);
#endif
nsHostObjectURI* u = static_cast<nsHostObjectURI*>(simpleClone.get());

View File

@ -1062,7 +1062,7 @@ nsINode::IsEqualNode(nsINode* aOther)
break;
}
default:
NS_ABORT_IF_FALSE(false, "Unknown node type");
MOZ_ASSERT(false, "Unknown node type");
}
nsINode* nextNode = node1->GetFirstChild();
@ -1357,7 +1357,7 @@ nsINode::Traverse(nsINode *tmp, nsCycleCollectionTraversalCallback &cb)
// return early.
nsIContent* parent = tmp->GetParent();
if (parent && !parent->UnoptimizableCCNode() && parent->IsBlack()) {
NS_ABORT_IF_FALSE(parent->IndexOf(tmp) >= 0, "Parent doesn't own us?");
MOZ_ASSERT(parent->IndexOf(tmp) >= 0, "Parent doesn't own us?");
return false;
}
}
@ -2584,7 +2584,7 @@ FindMatchingElements(nsINode* aRoot, nsCSSSelectorList* aSelectorList, T &aList,
struct ElementHolder {
ElementHolder() : mElement(nullptr) {}
void AppendElement(Element* aElement) {
NS_ABORT_IF_FALSE(!mElement, "Should only get one element");
MOZ_ASSERT(!mElement, "Should only get one element");
mElement = aElement;
}
void SetCapacity(uint32_t aCapacity) { MOZ_CRASH("Don't call me!"); }

View File

@ -136,7 +136,7 @@ nsImageLoadingContent::Notify(imgIRequest* aRequest,
if (aType == imgINotificationObserver::LOAD_COMPLETE) {
// We should definitely have a request here
NS_ABORT_IF_FALSE(aRequest, "no request?");
MOZ_ASSERT(aRequest, "no request?");
NS_PRECONDITION(aRequest == mCurrentRequest || aRequest == mPendingRequest,
"Unknown request");
@ -227,8 +227,8 @@ nsImageLoadingContent::OnLoadComplete(imgIRequest* aRequest, nsresult aStatus)
if (aRequest == mPendingRequest) {
MakePendingRequestCurrent();
}
NS_ABORT_IF_FALSE(aRequest == mCurrentRequest,
"One way or another, we should be current by now");
MOZ_ASSERT(aRequest == mCurrentRequest,
"One way or another, we should be current by now");
// We just loaded all the data we're going to get. If we're visible and
// haven't done an initial paint (*), we want to make sure the image starts
@ -890,9 +890,9 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI,
// time. It should always be the same as the principal of this node.
#ifdef DEBUG
nsCOMPtr<nsIContent> thisContent = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
NS_ABORT_IF_FALSE(thisContent &&
thisContent->NodePrincipal() == aDocument->NodePrincipal(),
"Principal mismatch?");
MOZ_ASSERT(thisContent &&
thisContent->NodePrincipal() == aDocument->NodePrincipal(),
"Principal mismatch?");
#endif
// Are we blocked?
@ -1219,7 +1219,7 @@ void
nsImageLoadingContent::SetBlockedRequest(nsIURI* aURI, int16_t aContentDecision)
{
// Sanity
NS_ABORT_IF_FALSE(!NS_CP_ACCEPTED(aContentDecision), "Blocked but not?");
MOZ_ASSERT(!NS_CP_ACCEPTED(aContentDecision), "Blocked but not?");
// We do some slightly illogical stuff here to maintain consistency with
// old behavior that people probably depend on. Even in the case where the
@ -1347,8 +1347,8 @@ nsImageLoadingContent::ClearCurrentRequest(nsresult aReason,
mCurrentRequestFlags = 0;
return;
}
NS_ABORT_IF_FALSE(!mCurrentURI,
"Shouldn't have both mCurrentRequest and mCurrentURI!");
MOZ_ASSERT(!mCurrentURI,
"Shouldn't have both mCurrentRequest and mCurrentURI!");
// Deregister this image from the refresh driver so it no longer receives
// notifications.

View File

@ -605,8 +605,8 @@ nsPerformance::PerformanceEntryComparator::Equals(
const PerformanceEntry* aElem1,
const PerformanceEntry* aElem2) const
{
NS_ABORT_IF_FALSE(aElem1 && aElem2,
"Trying to compare null performance entries");
MOZ_ASSERT(aElem1 && aElem2,
"Trying to compare null performance entries");
return aElem1->StartTime() == aElem2->StartTime();
}
@ -615,8 +615,8 @@ nsPerformance::PerformanceEntryComparator::LessThan(
const PerformanceEntry* aElem1,
const PerformanceEntry* aElem2) const
{
NS_ABORT_IF_FALSE(aElem1 && aElem2,
"Trying to compare null performance entries");
MOZ_ASSERT(aElem1 && aElem2,
"Trying to compare null performance entries");
return aElem1->StartTime() < aElem2->StartTime();
}

View File

@ -18,7 +18,7 @@ void
nsReferencedElement::Reset(nsIContent* aFromContent, nsIURI* aURI,
bool aWatch, bool aReferenceImage)
{
NS_ABORT_IF_FALSE(aFromContent, "Reset() expects non-null content pointer");
MOZ_ASSERT(aFromContent, "Reset() expects non-null content pointer");
Unlink();

View File

@ -26,8 +26,8 @@ class nsTextNode : public mozilla::dom::Text,
private:
void Init()
{
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE,
"Bad NodeType in aNodeInfo");
MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE,
"Bad NodeType in aNodeInfo");
}
public:

View File

@ -1103,8 +1103,8 @@ nsTreeSanitizer::SanitizeStyleSheet(const nsAString& aOriginal,
aDocument->NodePrincipal(), 0, false);
NS_ENSURE_SUCCESS(rv, true);
// Mark the sheet as complete.
NS_ABORT_IF_FALSE(!sheet->IsModified(),
"should not get marked modified during parsing");
MOZ_ASSERT(!sheet->IsModified(),
"should not get marked modified during parsing");
sheet->SetComplete();
// Loop through all the rules found in the CSS text
int32_t ruleCount = sheet->StyleRuleCount();

View File

@ -321,7 +321,7 @@ nsXMLHttpRequest::~nsXMLHttpRequest()
Abort();
}
NS_ABORT_IF_FALSE(!(mState & XML_HTTP_REQUEST_SYNCLOOPING), "we rather crash than hang");
MOZ_ASSERT(!(mState & XML_HTTP_REQUEST_SYNCLOOPING), "we rather crash than hang");
mState &= ~XML_HTTP_REQUEST_SYNCLOOPING;
mResultJSON.setUndefined();
@ -1915,7 +1915,7 @@ nsXMLHttpRequest::OnDataAvailable(nsIRequest *request,
{
NS_ENSURE_ARG_POINTER(inStr);
NS_ABORT_IF_FALSE(mContext.get() == ctxt,"start context different from OnDataAvailable context");
MOZ_ASSERT(mContext.get() == ctxt,"start context different from OnDataAvailable context");
mProgressSinceLastProgressEvent = true;
@ -3236,8 +3236,8 @@ nsXMLHttpRequest::SetTimeout(uint32_t aTimeout, ErrorResult& aRv)
void
nsXMLHttpRequest::StartTimeoutTimer()
{
NS_ABORT_IF_FALSE(mRequestSentTime,
"StartTimeoutTimer mustn't be called before the request was sent!");
MOZ_ASSERT(mRequestSentTime,
"StartTimeoutTimer mustn't be called before the request was sent!");
if (mState & XML_HTTP_REQUEST_DONE) {
// do nothing!
return;

View File

@ -251,9 +251,8 @@ static uint32_t CountNewlinesInXPLength(nsIContent* aContent,
return 0;
}
// For automated tests, we should abort on debug build.
NS_ABORT_IF_FALSE(
(aXPLength == UINT32_MAX || aXPLength <= text->GetLength()),
"aXPLength is out-of-bounds");
MOZ_ASSERT(aXPLength == UINT32_MAX || aXPLength <= text->GetLength(),
"aXPLength is out-of-bounds");
const uint32_t length = std::min(aXPLength, text->GetLength());
uint32_t newlines = 0;
for (uint32_t i = 0; i < length; ++i) {
@ -283,7 +282,7 @@ static uint32_t CountNewlinesInNativeLength(nsIContent* aContent,
i < xpLength && nativeOffset < aNativeLength;
++i, ++nativeOffset) {
// For automated tests, we should abort on debug build.
NS_ABORT_IF_FALSE(i < text->GetLength(), "i is out-of-bounds");
MOZ_ASSERT(i < text->GetLength(), "i is out-of-bounds");
if (text->CharAt(i) == '\n') {
++newlines;
++nativeOffset;

View File

@ -401,8 +401,8 @@ HTMLImageElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
(aName == nsGkAtoms::name || aName == nsGkAtoms::id) &&
aValue && !aValue->IsEmptyString()) {
// add the image to the hashtable as needed
NS_ABORT_IF_FALSE(aValue->Type() == nsAttrValue::eAtom,
"Expected atom value for name/id");
MOZ_ASSERT(aValue->Type() == nsAttrValue::eAtom,
"Expected atom value for name/id");
mForm->AddImageElementToTable(this,
nsDependentAtomString(aValue->GetAtomValue()));
}

View File

@ -275,7 +275,7 @@ public:
: mElement(aElement),
mLoadID(aElement->GetCurrentLoadID())
{
NS_ABORT_IF_FALSE(mElement, "Must pass an element to call back");
MOZ_ASSERT(mElement, "Must pass an element to call back");
}
private:

View File

@ -712,8 +712,8 @@ nsGenericHTMLElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
{
if (aNamespaceID == kNameSpaceID_None) {
if (IsEventAttributeName(aName) && aValue) {
NS_ABORT_IF_FALSE(aValue->Type() == nsAttrValue::eString,
"Expected string value for script body");
MOZ_ASSERT(aValue->Type() == nsAttrValue::eString,
"Expected string value for script body");
nsresult rv = SetEventHandler(aName, aValue->GetStringValue());
NS_ENSURE_SUCCESS(rv, rv);
}
@ -2152,8 +2152,8 @@ nsGenericHTMLFormElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
if (mForm && (aName == nsGkAtoms::name || aName == nsGkAtoms::id) &&
aValue && !aValue->IsEmptyString()) {
NS_ABORT_IF_FALSE(aValue->Type() == nsAttrValue::eAtom,
"Expected atom value for name/id");
MOZ_ASSERT(aValue->Type() == nsAttrValue::eAtom,
"Expected atom value for name/id");
mForm->AddElementToTable(this,
nsDependentAtomString(aValue->GetAtomValue()));
}

View File

@ -1899,8 +1899,8 @@ nsHTMLDocument::WriteCommon(JSContext *cx,
if (NS_FAILED(rv) || !mParser) {
return rv;
}
NS_ABORT_IF_FALSE(!JS_IsExceptionPending(cx),
"Open() succeeded but JS exception is pending");
MOZ_ASSERT(!JS_IsExceptionPending(cx),
"Open() succeeded but JS exception is pending");
}
static NS_NAMED_LITERAL_STRING(new_line, "\n");
@ -2773,7 +2773,7 @@ nsHTMLDocument::EditingStateChanged()
// We might already have an editor if it was set up for mail, let's see
// if this is actually the case.
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(existingEditor);
NS_ABORT_IF_FALSE(htmlEditor, "If we have an editor, it must be an HTML editor");
MOZ_ASSERT(htmlEditor, "If we have an editor, it must be an HTML editor");
uint32_t flags = 0;
existingEditor->GetFlags(&flags);
if (flags & nsIPlaintextEditor::eEditorMailMask) {

View File

@ -2107,7 +2107,7 @@ nsTextEditorState::UpdatePlaceholderVisibility(bool aNotify)
void
nsTextEditorState::HideSelectionIfBlurred()
{
NS_ABORT_IF_FALSE(mSelCon, "Should have a selection controller if we have a frame!");
MOZ_ASSERT(mSelCon, "Should have a selection controller if we have a frame!");
nsCOMPtr<nsIContent> content = do_QueryInterface(mTextCtrlElement);
if (!nsContentUtils::IsFocusedContent(content)) {
mSelCon->SetDisplaySelection(nsISelectionController::SELECTION_HIDDEN);

View File

@ -1964,8 +1964,8 @@ ContentChild::RecvAddPermission(const IPC::Permission& permission)
services::GetPermissionManager();
nsPermissionManager* permissionManager =
static_cast<nsPermissionManager*>(permissionManagerIface.get());
NS_ABORT_IF_FALSE(permissionManager,
"We have no permissionManager in the Content process !");
MOZ_ASSERT(permissionManager,
"We have no permissionManager in the Content process !");
nsCOMPtr<nsIURI> uri;
NS_NewURI(getter_AddRefs(uri), NS_LITERAL_CSTRING("http://") + nsCString(permission.host));

View File

@ -2425,12 +2425,12 @@ ContentParent::RecvReadPermissions(InfallibleTArray<IPC::Permission>* aPermissio
services::GetPermissionManager();
nsPermissionManager* permissionManager =
static_cast<nsPermissionManager*>(permissionManagerIface.get());
NS_ABORT_IF_FALSE(permissionManager,
"We have no permissionManager in the Chrome process !");
MOZ_ASSERT(permissionManager,
"We have no permissionManager in the Chrome process !");
nsCOMPtr<nsISimpleEnumerator> enumerator;
DebugOnly<nsresult> rv = permissionManager->GetEnumerator(getter_AddRefs(enumerator));
NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv), "Could not get enumerator!");
MOZ_ASSERT(NS_SUCCEEDED(rv), "Could not get enumerator!");
while(1) {
bool hasMore;
enumerator->HasMoreElements(&hasMore);
@ -4425,8 +4425,8 @@ ContentParent::RecvBackUpXResources(const FileDescriptor& aXSocketFd)
#ifndef MOZ_X11
NS_RUNTIMEABORT("This message only makes sense on X11 platforms");
#else
NS_ABORT_IF_FALSE(0 > mChildXSocketFdDup.get(),
"Already backed up X resources??");
MOZ_ASSERT(0 > mChildXSocketFdDup.get(),
"Already backed up X resources??");
mChildXSocketFdDup.forget();
if (aXSocketFd.IsValid()) {
mChildXSocketFdDup.reset(aXSocketFd.PlatformHandle());

View File

@ -3179,8 +3179,8 @@ TabChild::InitRenderingState(const ScrollingBehavior& aScrolling,
ShadowLayerForwarder* lf =
mWidget->GetLayerManager(shadowManager, mTextureFactoryIdentifier.mParentBackend)
->AsShadowForwarder();
NS_ABORT_IF_FALSE(lf && lf->HasShadowManager(),
"PuppetWidget should have shadow manager");
MOZ_ASSERT(lf && lf->HasShadowManager(),
"PuppetWidget should have shadow manager");
lf->IdentifyTextureHost(mTextureFactoryIdentifier);
ImageBridgeChild::IdentifyCompositorTextureHost(mTextureFactoryIdentifier);

View File

@ -2182,8 +2182,8 @@ TabParent::RecvGetDPI(float* aValue)
{
TryCacheDPIAndScale();
NS_ABORT_IF_FALSE(mDPI > 0,
"Must not ask for DPI before OwnerElement is received!");
MOZ_ASSERT(mDPI > 0,
"Must not ask for DPI before OwnerElement is received!");
*aValue = mDPI;
return true;
}
@ -2193,8 +2193,8 @@ TabParent::RecvGetDefaultScale(double* aValue)
{
TryCacheDPIAndScale();
NS_ABORT_IF_FALSE(mDefaultScale.scale > 0,
"Must not ask for scale before OwnerElement is received!");
MOZ_ASSERT(mDefaultScale.scale > 0,
"Must not ask for scale before OwnerElement is received!");
*aValue = mDefaultScale.scale;
return true;
}

View File

@ -645,7 +645,7 @@ nsJSONListener::ConsumeConverted(const char* aBuffer, uint32_t aByteLength)
rv = mDecoder->Convert(aBuffer, &srcLen, endelems, &unicharLength);
if (NS_FAILED(rv))
return rv;
NS_ABORT_IF_FALSE(preLength >= unicharLength, "GetMaxLength lied");
MOZ_ASSERT(preLength >= unicharLength, "GetMaxLength lied");
if (preLength > unicharLength)
mBufferedChars.TruncateLength(mBufferedChars.Length() - (preLength - unicharLength));
return NS_OK;

View File

@ -371,7 +371,7 @@ AudioStream::Init(int32_t aNumChannels, int32_t aRate,
// selected based on the observed behaviour of the existing AudioStream
// implementations.
uint32_t bufferLimit = FramesToBytes(aRate);
NS_ABORT_IF_FALSE(bufferLimit % mBytesPerFrame == 0, "Must buffer complete frames");
MOZ_ASSERT(bufferLimit % mBytesPerFrame == 0, "Must buffer complete frames");
mBuffer.SetCapacity(bufferLimit);
if (aLatencyRequest == LowLatency) {
@ -632,8 +632,8 @@ AudioStream::Write(const AudioDataValue* aBuf, uint32_t aFrames, TimeStamp *aTim
while (bytesToCopy > 0) {
uint32_t available = std::min(bytesToCopy, mBuffer.Available());
NS_ABORT_IF_FALSE(available % mBytesPerFrame == 0,
"Must copy complete frames.");
MOZ_ASSERT(available % mBytesPerFrame == 0,
"Must copy complete frames.");
mBuffer.AppendElements(src, available);
src += available;
@ -678,14 +678,14 @@ uint32_t
AudioStream::Available()
{
MonitorAutoLock mon(mMonitor);
NS_ABORT_IF_FALSE(mBuffer.Length() % mBytesPerFrame == 0, "Buffer invariant violated.");
MOZ_ASSERT(mBuffer.Length() % mBytesPerFrame == 0, "Buffer invariant violated.");
return BytesToFrames(mBuffer.Available());
}
void
AudioStream::SetVolume(double aVolume)
{
NS_ABORT_IF_FALSE(aVolume >= 0.0 && aVolume <= 1.0, "Invalid volume");
MOZ_ASSERT(aVolume >= 0.0 && aVolume <= 1.0, "Invalid volume");
if (cubeb_stream_set_volume(mCubebStream.get(), aVolume * CubebUtils::GetVolumeScale()) != CUBEB_OK) {
NS_WARNING("Could not change volume on cubeb stream.");
@ -1035,7 +1035,7 @@ AudioStream::Reset()
// selected based on the observed behaviour of the existing AudioStream
// implementations.
uint32_t bufferLimit = FramesToBytes(mInRate);
NS_ABORT_IF_FALSE(bufferLimit % mBytesPerFrame == 0, "Must buffer complete frames");
MOZ_ASSERT(bufferLimit % mBytesPerFrame == 0, "Must buffer complete frames");
mBuffer.Reset();
mBuffer.SetCapacity(bufferLimit);
@ -1054,7 +1054,7 @@ AudioStream::DataCallback(void* aBuffer, long aFrames)
MonitorAutoLock mon(mMonitor);
MOZ_ASSERT(mState != SHUTDOWN, "No data callback after shutdown");
uint32_t available = std::min(static_cast<uint32_t>(FramesToBytes(aFrames)), mBuffer.Length());
NS_ABORT_IF_FALSE(available % mBytesPerFrame == 0, "Must copy complete frames");
MOZ_ASSERT(available % mBytesPerFrame == 0, "Must copy complete frames");
AudioDataValue* output = reinterpret_cast<AudioDataValue*>(aBuffer);
uint32_t underrunFrames = 0;
uint32_t servicedFrames = 0;
@ -1113,7 +1113,7 @@ AudioStream::DataCallback(void* aBuffer, long aFrames)
servicedFrames = GetTimeStretched(output, aFrames, insertTime);
}
NS_ABORT_IF_FALSE(mBuffer.Length() % mBytesPerFrame == 0, "Must copy complete frames");
MOZ_ASSERT(mBuffer.Length() % mBytesPerFrame == 0, "Must copy complete frames");
// Notify any blocked Write() call that more space is available in mBuffer.
mon.NotifyAll();

View File

@ -88,7 +88,7 @@ public:
// Set the capacity of the buffer in bytes. Must be called before any
// call to append or pop elements.
void SetCapacity(uint32_t aCapacity) {
NS_ABORT_IF_FALSE(!mBuffer, "Buffer allocated.");
MOZ_ASSERT(!mBuffer, "Buffer allocated.");
mCapacity = aCapacity;
mBuffer = new uint8_t[mCapacity];
}
@ -108,8 +108,8 @@ public:
// Append aLength bytes from aSrc to the buffer. Caller must check that
// sufficient space is available.
void AppendElements(const uint8_t* aSrc, uint32_t aLength) {
NS_ABORT_IF_FALSE(mBuffer && mCapacity, "Buffer not initialized.");
NS_ABORT_IF_FALSE(aLength <= Available(), "Buffer full.");
MOZ_ASSERT(mBuffer && mCapacity, "Buffer not initialized.");
MOZ_ASSERT(aLength <= Available(), "Buffer full.");
uint32_t end = (mStart + mCount) % mCapacity;
@ -124,8 +124,8 @@ public:
// must not specify an aSize larger than Length().
void PopElements(uint32_t aSize, void** aData1, uint32_t* aSize1,
void** aData2, uint32_t* aSize2) {
NS_ABORT_IF_FALSE(mBuffer && mCapacity, "Buffer not initialized.");
NS_ABORT_IF_FALSE(aSize <= Length(), "Request too large.");
MOZ_ASSERT(mBuffer && mCapacity, "Buffer not initialized.");
MOZ_ASSERT(aSize <= Length(), "Request too large.");
*aData1 = &mBuffer[mStart];
*aSize1 = std::min(mCapacity - mStart, aSize);
@ -139,7 +139,7 @@ public:
// Throw away all but aSize bytes from the buffer. Returns new size, which
// may be less than aSize
uint32_t ContractTo(uint32_t aSize) {
NS_ABORT_IF_FALSE(mBuffer && mCapacity, "Buffer not initialized.");
MOZ_ASSERT(mBuffer && mCapacity, "Buffer not initialized.");
if (aSize >= mCount) {
return mCount;
}

View File

@ -212,8 +212,9 @@ nsresult FileBlockCache::Run()
// mDataMonitor to take mFileMonitor.
int32_t blockIndex = mChangeIndexList.PopFront();
nsRefPtr<BlockChange> change = mBlockChanges[blockIndex];
NS_ABORT_IF_FALSE(change,
"Change index list should only contain entries for blocks with changes");
MOZ_ASSERT(change,
"Change index list should only contain entries for blocks "
"with changes");
{
MonitorAutoUnlock unlock(mDataMonitor);
MonitorAutoLock lock(mFileMonitor);

View File

@ -2264,7 +2264,7 @@ MediaCacheStream::Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes)
int64_t bytes = std::min<int64_t>(size, streamWithPartialBlock->mChannelOffset - mStreamOffset);
// Clamp bytes until 64-bit file size issues are fixed.
bytes = std::min(bytes, int64_t(INT32_MAX));
NS_ABORT_IF_FALSE(bytes >= 0 && bytes <= aCount, "Bytes out of range.");
MOZ_ASSERT(bytes >= 0 && bytes <= aCount, "Bytes out of range.");
memcpy(aBuffer,
reinterpret_cast<char*>(streamWithPartialBlock->mPartialBlockBuffer.get()) + offsetInStreamBlock, bytes);
if (mCurrentMode == MODE_METADATA) {
@ -2289,7 +2289,7 @@ MediaCacheStream::Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes)
int64_t offset = cacheBlock*BLOCK_SIZE + offsetInStreamBlock;
int32_t bytes;
NS_ABORT_IF_FALSE(size >= 0 && size <= INT32_MAX, "Size out of range.");
MOZ_ASSERT(size >= 0 && size <= INT32_MAX, "Size out of range.");
nsresult rv = gMediaCache->ReadCacheFile(offset, aBuffer + count, int32_t(size), &bytes);
if (NS_FAILED(rv)) {
if (count == 0)
@ -2361,7 +2361,7 @@ MediaCacheStream::ReadFromCache(char* aBuffer, int64_t aOffset, int64_t aCount)
// Clamp bytes until 64-bit file size issues are fixed.
int64_t toCopy = std::min<int64_t>(size, mChannelOffset - streamOffset);
bytes = std::min(toCopy, int64_t(INT32_MAX));
NS_ABORT_IF_FALSE(bytes >= 0 && bytes <= toCopy, "Bytes out of range.");
MOZ_ASSERT(bytes >= 0 && bytes <= toCopy, "Bytes out of range.");
memcpy(aBuffer + count,
reinterpret_cast<char*>(mPartialBlockBuffer.get()) + offsetInStreamBlock, bytes);
} else {
@ -2370,7 +2370,7 @@ MediaCacheStream::ReadFromCache(char* aBuffer, int64_t aOffset, int64_t aCount)
return NS_ERROR_FAILURE;
}
int64_t offset = cacheBlock*BLOCK_SIZE + offsetInStreamBlock;
NS_ABORT_IF_FALSE(size >= 0 && size <= INT32_MAX, "Size out of range.");
MOZ_ASSERT(size >= 0 && size <= INT32_MAX, "Size out of range.");
nsresult rv = gMediaCache->ReadCacheFile(offset, aBuffer + count, int32_t(size), &bytes);
if (NS_FAILED(rv)) {
return rv;

View File

@ -718,7 +718,7 @@ nsresult MediaDecoder::Seek(double aTime, SeekTarget::Type aSeekType)
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
UpdateDormantState(false /* aDormantTimeout */, true /* aActivity */);
NS_ABORT_IF_FALSE(aTime >= 0.0, "Cannot seek to a negative value.");
MOZ_ASSERT(aTime >= 0.0, "Cannot seek to a negative value.");
int64_t timeUsecs = 0;
nsresult rv = SecondsToUsecs(aTime, timeUsecs);

View File

@ -979,7 +979,7 @@ MediaRecorder::Constructor(const GlobalObject& aGlobal,
nsresult
MediaRecorder::CreateAndDispatchBlobEvent(already_AddRefed<nsIDOMBlob>&& aBlob)
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread");
if (!CheckPrincipal()) {
// Media is not same-origin, don't allow the data out.
nsRefPtr<nsIDOMBlob> blob = aBlob;
@ -1003,7 +1003,7 @@ MediaRecorder::CreateAndDispatchBlobEvent(already_AddRefed<nsIDOMBlob>&& aBlob)
void
MediaRecorder::DispatchSimpleEvent(const nsAString & aStr)
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread");
nsresult rv = CheckInnerWindowCorrectness();
if (NS_FAILED(rv)) {
return;
@ -1034,7 +1034,7 @@ MediaRecorder::DispatchSimpleEvent(const nsAString & aStr)
void
MediaRecorder::NotifyError(nsresult aRv)
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread");
nsresult rv = CheckInnerWindowCorrectness();
if (NS_FAILED(rv)) {
return;
@ -1070,7 +1070,7 @@ MediaRecorder::NotifyError(nsresult aRv)
bool MediaRecorder::CheckPrincipal()
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread");
if (!mDOMStream && !mAudioNode) {
return false;
}

View File

@ -36,12 +36,12 @@ GMPProcessChild::Init()
// (after the binary name) here is indeed the plugin module path.
// Keep in sync with dom/plugins/PluginModuleParent.
std::vector<std::string> values = CommandLine::ForCurrentProcess()->argv();
NS_ABORT_IF_FALSE(values.size() >= 3, "not enough args");
MOZ_ASSERT(values.size() >= 3, "not enough args");
pluginFilename = values[1];
voucherFilename = values[2];
#elif defined(OS_WIN)
std::vector<std::wstring> values = CommandLine::ForCurrentProcess()->GetLooseValues();
NS_ABORT_IF_FALSE(values.size() >= 2, "not enough loose args");
MOZ_ASSERT(values.size() >= 2, "not enough loose args");
pluginFilename = WideToUTF8(values[0]);
voucherFilename = WideToUTF8(values[1]);
#else

View File

@ -338,8 +338,8 @@ WaveReader::LoadRIFFChunk()
char riffHeader[RIFF_INITIAL_SIZE];
const char* p = riffHeader;
NS_ABORT_IF_FALSE(mDecoder->GetResource()->Tell() == 0,
"LoadRIFFChunk called when resource in invalid state");
MOZ_ASSERT(mDecoder->GetResource()->Tell() == 0,
"LoadRIFFChunk called when resource in invalid state");
if (!ReadAll(riffHeader, sizeof(riffHeader))) {
return false;
@ -371,8 +371,8 @@ WaveReader::LoadFormatChunk(uint32_t aChunkSize)
const char* p = waveFormat;
// RIFF chunks are always word (two byte) aligned.
NS_ABORT_IF_FALSE(mDecoder->GetResource()->Tell() % 2 == 0,
"LoadFormatChunk called with unaligned resource");
MOZ_ASSERT(mDecoder->GetResource()->Tell() % 2 == 0,
"LoadFormatChunk called with unaligned resource");
if (!ReadAll(waveFormat, sizeof(waveFormat))) {
return false;
@ -433,8 +433,8 @@ WaveReader::LoadFormatChunk(uint32_t aChunkSize)
}
// RIFF chunks are always word (two byte) aligned.
NS_ABORT_IF_FALSE(mDecoder->GetResource()->Tell() % 2 == 0,
"LoadFormatChunk left resource unaligned");
MOZ_ASSERT(mDecoder->GetResource()->Tell() % 2 == 0,
"LoadFormatChunk left resource unaligned");
// Make sure metadata is fairly sane. The rate check is fairly arbitrary,
// but the channels check is intentionally limited to mono or stereo
@ -467,8 +467,8 @@ bool
WaveReader::FindDataOffset(uint32_t aChunkSize)
{
// RIFF chunks are always word (two byte) aligned.
NS_ABORT_IF_FALSE(mDecoder->GetResource()->Tell() % 2 == 0,
"FindDataOffset called with unaligned resource");
MOZ_ASSERT(mDecoder->GetResource()->Tell() % 2 == 0,
"FindDataOffset called with unaligned resource");
int64_t offset = mDecoder->GetResource()->Tell();
if (offset <= 0 || offset > UINT32_MAX) {
@ -485,21 +485,21 @@ WaveReader::FindDataOffset(uint32_t aChunkSize)
double
WaveReader::BytesToTime(int64_t aBytes) const
{
NS_ABORT_IF_FALSE(aBytes >= 0, "Must be >= 0");
MOZ_ASSERT(aBytes >= 0, "Must be >= 0");
return float(aBytes) / mSampleRate / mFrameSize;
}
int64_t
WaveReader::TimeToBytes(double aTime) const
{
NS_ABORT_IF_FALSE(aTime >= 0.0f, "Must be >= 0");
MOZ_ASSERT(aTime >= 0.0f, "Must be >= 0");
return RoundDownToFrame(int64_t(aTime * mSampleRate * mFrameSize));
}
int64_t
WaveReader::RoundDownToFrame(int64_t aBytes) const
{
NS_ABORT_IF_FALSE(aBytes >= 0, "Must be >= 0");
MOZ_ASSERT(aBytes >= 0, "Must be >= 0");
return aBytes - (aBytes % mFrameSize);
}
@ -527,10 +527,10 @@ WaveReader::GetPosition()
bool
WaveReader::GetNextChunk(uint32_t* aChunk, uint32_t* aChunkSize)
{
NS_ABORT_IF_FALSE(aChunk, "Must have aChunk");
NS_ABORT_IF_FALSE(aChunkSize, "Must have aChunkSize");
NS_ABORT_IF_FALSE(mDecoder->GetResource()->Tell() % 2 == 0,
"GetNextChunk called with unaligned resource");
MOZ_ASSERT(aChunk, "Must have aChunk");
MOZ_ASSERT(aChunkSize, "Must have aChunkSize");
MOZ_ASSERT(mDecoder->GetResource()->Tell() % 2 == 0,
"GetNextChunk called with unaligned resource");
char chunkHeader[CHUNK_HEADER_SIZE];
const char* p = chunkHeader;
@ -552,8 +552,8 @@ WaveReader::LoadListChunk(uint32_t aChunkSize,
nsAutoPtr<dom::HTMLMediaElement::MetadataTags> &aTags)
{
// List chunks are always word (two byte) aligned.
NS_ABORT_IF_FALSE(mDecoder->GetResource()->Tell() % 2 == 0,
"LoadListChunk called with unaligned resource");
MOZ_ASSERT(mDecoder->GetResource()->Tell() % 2 == 0,
"LoadListChunk called with unaligned resource");
static const unsigned int MAX_CHUNK_SIZE = 1 << 16;
static_assert(uint64_t(MAX_CHUNK_SIZE) < UINT_MAX / sizeof(char),
@ -628,8 +628,8 @@ bool
WaveReader::LoadAllChunks(nsAutoPtr<dom::HTMLMediaElement::MetadataTags> &aTags)
{
// Chunks are always word (two byte) aligned.
NS_ABORT_IF_FALSE(mDecoder->GetResource()->Tell() % 2 == 0,
"LoadAllChunks called with unaligned resource");
MOZ_ASSERT(mDecoder->GetResource()->Tell() % 2 == 0,
"LoadAllChunks called with unaligned resource");
bool loadFormatChunk = false;
bool findDataOffset = false;

View File

@ -1508,8 +1508,9 @@ _evaluate(NPP npp, NPObject* npobj, NPString *script, NPVariant *result)
}
obj = JS_ObjectToInnerObject(cx, obj);
NS_ABORT_IF_FALSE(obj,
"JS_ObjectToInnerObject should never return null with non-null input.");
MOZ_ASSERT(obj,
"JS_ObjectToInnerObject should never return null with non-null "
"input.");
if (result) {
// Initialize the out param to void

View File

@ -2669,8 +2669,8 @@ PluginInstanceChild::DoAsyncSetWindow(const gfxSurfaceType& aSurfaceType,
bool
PluginInstanceChild::CreateOptSurface(void)
{
NS_ABORT_IF_FALSE(mSurfaceType != gfxSurfaceType::Max,
"Need a valid surface type here");
MOZ_ASSERT(mSurfaceType != gfxSurfaceType::Max,
"Need a valid surface type here");
NS_ASSERTION(!mCurrentSurface, "mCurrentSurfaceActor can get out of sync.");
nsRefPtr<gfxASurface> retsurf;
@ -3099,8 +3099,8 @@ void
PluginInstanceChild::PaintRectWithAlphaExtraction(const nsIntRect& aRect,
gfxASurface* aSurface)
{
NS_ABORT_IF_FALSE(aSurface->GetContentType() == gfxContentType::COLOR_ALPHA,
"Refusing to pointlessly recover alpha");
MOZ_ASSERT(aSurface->GetContentType() == gfxContentType::COLOR_ALPHA,
"Refusing to pointlessly recover alpha");
nsIntRect rect(aRect);
// If |aSurface| can be used to paint and can have alpha values
@ -3179,7 +3179,7 @@ PluginInstanceChild::PaintRectWithAlphaExtraction(const nsIntRect& aRect,
PaintRectToSurface(rect, blackImage, gfxRGBA(0.0, 0.0, 0.0));
#endif
NS_ABORT_IF_FALSE(whiteImage && blackImage, "Didn't paint enough!");
MOZ_ASSERT(whiteImage && blackImage, "Didn't paint enough!");
// Extract alpha from black and white image and store to black
// image
@ -3543,7 +3543,7 @@ bool
PluginInstanceChild::RecvUpdateBackground(const SurfaceDescriptor& aBackground,
const nsIntRect& aRect)
{
NS_ABORT_IF_FALSE(mIsTransparent, "Only transparent plugins use backgrounds");
MOZ_ASSERT(mIsTransparent, "Only transparent plugins use backgrounds");
if (!mBackground) {
// XXX refactor me

View File

@ -745,7 +745,7 @@ PluginInstanceParent::SetBackgroundUnknown()
if (mBackground) {
DestroyBackground();
NS_ABORT_IF_FALSE(!mBackground, "Background not destroyed");
MOZ_ASSERT(!mBackground, "Background not destroyed");
}
return NS_OK;
@ -764,8 +764,8 @@ PluginInstanceParent::BeginUpdateBackground(const nsIntRect& aRect,
// update, there's no guarantee that later updates will be for
// the entire background area until successful. We might want
// to fix that eventually.
NS_ABORT_IF_FALSE(aRect.TopLeft() == nsIntPoint(0, 0),
"Expecting rect for whole frame");
MOZ_ASSERT(aRect.TopLeft() == nsIntPoint(0, 0),
"Expecting rect for whole frame");
if (!CreateBackground(aRect.Size())) {
*aCtx = nullptr;
return NS_OK;
@ -774,8 +774,8 @@ PluginInstanceParent::BeginUpdateBackground(const nsIntRect& aRect,
gfxIntSize sz = mBackground->GetSize();
#ifdef DEBUG
NS_ABORT_IF_FALSE(nsIntRect(0, 0, sz.width, sz.height).Contains(aRect),
"Update outside of background area");
MOZ_ASSERT(nsIntRect(0, 0, sz.width, sz.height).Contains(aRect),
"Update outside of background area");
#endif
RefPtr<gfx::DrawTarget> dt = gfxPlatform::GetPlatform()->
@ -821,7 +821,7 @@ PluginInstanceParent::GetAsyncSurrogate()
bool
PluginInstanceParent::CreateBackground(const nsIntSize& aSize)
{
NS_ABORT_IF_FALSE(!mBackground, "Already have a background");
MOZ_ASSERT(!mBackground, "Already have a background");
// XXX refactor me
@ -866,7 +866,7 @@ PluginInstanceParent::DestroyBackground()
mozilla::plugins::SurfaceDescriptor
PluginInstanceParent::BackgroundDescriptor()
{
NS_ABORT_IF_FALSE(mBackground, "Need a background here");
MOZ_ASSERT(mBackground, "Need a background here");
// XXX refactor me
@ -876,8 +876,8 @@ PluginInstanceParent::BackgroundDescriptor()
#endif
#ifdef XP_WIN
NS_ABORT_IF_FALSE(gfxSharedImageSurface::IsSharedImage(mBackground),
"Expected shared image surface");
MOZ_ASSERT(gfxSharedImageSurface::IsSharedImage(mBackground),
"Expected shared image surface");
gfxSharedImageSurface* shmem =
static_cast<gfxSharedImageSurface*>(mBackground.get());
return shmem->GetShmem();

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);
}

View File

@ -1512,8 +1512,8 @@ PluginModuleParent::RecvBackUpXResources(const FileDescriptor& aXSocketFd)
#ifndef MOZ_X11
NS_RUNTIMEABORT("This message only makes sense on X11 platforms");
#else
NS_ABORT_IF_FALSE(0 > mPluginXSocketFdDup.get(),
"Already backed up X resources??");
MOZ_ASSERT(0 > mPluginXSocketFdDup.get(),
"Already backed up X resources??");
mPluginXSocketFdDup.forget();
if (aXSocketFd.IsValid()) {
mPluginXSocketFdDup.reset(aXSocketFd.PlatformHandle());

View File

@ -109,14 +109,14 @@ PluginProcessChild::Init()
// (after the binary name) here is indeed the plugin module path.
// Keep in sync with dom/plugins/PluginModuleParent.
std::vector<std::string> values = CommandLine::ForCurrentProcess()->argv();
NS_ABORT_IF_FALSE(values.size() >= 2, "not enough args");
MOZ_ASSERT(values.size() >= 2, "not enough args");
pluginFilename = UnmungePluginDsoPath(values[1]);
#elif defined(OS_WIN)
std::vector<std::wstring> values =
CommandLine::ForCurrentProcess()->GetLooseValues();
NS_ABORT_IF_FALSE(values.size() >= 1, "not enough loose args");
MOZ_ASSERT(values.size() >= 1, "not enough loose args");
if (ShouldProtectPluginCurrentDirectory(values[0].c_str())) {
SanitizeEnvironmentVariables();

View File

@ -13,7 +13,7 @@ namespace mozilla {
void
SMILIntegerType::Init(nsSMILValue& aValue) const
{
NS_ABORT_IF_FALSE(aValue.IsNull(), "Unexpected value type");
MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
aValue.mU.mInt = 0;
aValue.mType = this;
}

View File

@ -32,7 +32,7 @@ nsSMILAnimationController::nsSMILAnimationController(nsIDocument* aDoc)
mRegisteredWithRefreshDriver(false),
mDocument(aDoc)
{
NS_ABORT_IF_FALSE(aDoc, "need a non-null document");
MOZ_ASSERT(aDoc, "need a non-null document");
nsRefreshDriver* refreshDriver = GetRefreshDriver();
if (refreshDriver) {
@ -57,9 +57,9 @@ nsSMILAnimationController::~nsSMILAnimationController()
void
nsSMILAnimationController::Disconnect()
{
NS_ABORT_IF_FALSE(mDocument, "disconnecting when we weren't connected...?");
NS_ABORT_IF_FALSE(mRefCnt.get() == 1,
"Expecting to disconnect when doc is sole remaining owner");
MOZ_ASSERT(mDocument, "disconnecting when we weren't connected...?");
MOZ_ASSERT(mRefCnt.get() == 1,
"Expecting to disconnect when doc is sole remaining owner");
NS_ASSERTION(mPauseState & nsSMILTimeContainer::PAUSE_PAGEHIDE,
"Expecting to be paused for pagehide before disconnect");
@ -170,9 +170,9 @@ nsSMILAnimationController::RegisterAnimationElement(
mDeferredStartSampling = false;
if (mChildContainerTable.Count()) {
// mAnimationElementTable was empty, but now we've added its 1st element
NS_ABORT_IF_FALSE(mAnimationElementTable.Count() == 1,
"we shouldn't have deferred sampling if we already had "
"animations registered");
MOZ_ASSERT(mAnimationElementTable.Count() == 1,
"we shouldn't have deferred sampling if we already had "
"animations registered");
StartSampling(GetRefreshDriver());
Sample(); // Run the first sample manually
} // else, don't sample until a time container is registered (via AddChild)
@ -265,9 +265,8 @@ nsSMILAnimationController::StartSampling(nsRefreshDriver* aRefreshDriver)
if (aRefreshDriver) {
MOZ_ASSERT(!mRegisteredWithRefreshDriver,
"Redundantly registering with refresh driver");
NS_ABORT_IF_FALSE(!GetRefreshDriver() ||
aRefreshDriver == GetRefreshDriver(),
"Starting sampling with wrong refresh driver");
MOZ_ASSERT(!GetRefreshDriver() || aRefreshDriver == GetRefreshDriver(),
"Starting sampling with wrong refresh driver");
// We're effectively resuming from a pause so update our current sample time
// or else it will confuse our "average time between samples" calculations.
mCurrentSampleTime = mozilla::TimeStamp::Now();
@ -282,9 +281,8 @@ nsSMILAnimationController::StopSampling(nsRefreshDriver* aRefreshDriver)
if (aRefreshDriver && mRegisteredWithRefreshDriver) {
// NOTE: The document might already have been detached from its PresContext
// (and RefreshDriver), which would make GetRefreshDriver() return null.
NS_ABORT_IF_FALSE(!GetRefreshDriver() ||
aRefreshDriver == GetRefreshDriver(),
"Stopping sampling with wrong refresh driver");
MOZ_ASSERT(!GetRefreshDriver() || aRefreshDriver == GetRefreshDriver(),
"Stopping sampling with wrong refresh driver");
aRefreshDriver->RemoveRefreshObserver(this, Flush_Style);
mRegisteredWithRefreshDriver = false;
}
@ -482,8 +480,8 @@ nsSMILAnimationController::RewindElements()
nsSMILAnimationController::RewindNeeded(TimeContainerPtrKey* aKey,
void* aData)
{
NS_ABORT_IF_FALSE(aData,
"Null data pointer during time container enumeration");
MOZ_ASSERT(aData,
"Null data pointer during time container enumeration");
bool* rewindNeeded = static_cast<bool*>(aData);
nsSMILTimeContainer* container = aKey->GetKey();
@ -569,7 +567,7 @@ nsSMILAnimationController::DoMilestoneSamples()
for (uint32_t i = 0; i < length; ++i) {
SVGAnimationElement* elem = params.mElements[i].get();
NS_ABORT_IF_FALSE(elem, "nullptr animation element in list");
MOZ_ASSERT(elem, "nullptr animation element in list");
nsSMILTimeContainer* container = elem->GetTimeContainer();
if (!container)
// The container may be nullptr if the element has been detached from its
@ -597,10 +595,10 @@ nsSMILAnimationController::DoMilestoneSamples()
nsSMILAnimationController::GetNextMilestone(TimeContainerPtrKey* aKey,
void* aData)
{
NS_ABORT_IF_FALSE(aKey, "Null hash key for time container hash table");
NS_ABORT_IF_FALSE(aKey->GetKey(), "Null time container key in hash table");
NS_ABORT_IF_FALSE(aData,
"Null data pointer during time container enumeration");
MOZ_ASSERT(aKey, "Null hash key for time container hash table");
MOZ_ASSERT(aKey->GetKey(), "Null time container key in hash table");
MOZ_ASSERT(aData,
"Null data pointer during time container enumeration");
nsSMILMilestone* nextMilestone = static_cast<nsSMILMilestone*>(aData);
@ -622,10 +620,10 @@ nsSMILAnimationController::GetNextMilestone(TimeContainerPtrKey* aKey,
nsSMILAnimationController::GetMilestoneElements(TimeContainerPtrKey* aKey,
void* aData)
{
NS_ABORT_IF_FALSE(aKey, "Null hash key for time container hash table");
NS_ABORT_IF_FALSE(aKey->GetKey(), "Null time container key in hash table");
NS_ABORT_IF_FALSE(aData,
"Null data pointer during time container enumeration");
MOZ_ASSERT(aKey, "Null hash key for time container hash table");
MOZ_ASSERT(aKey->GetKey(), "Null time container key in hash table");
MOZ_ASSERT(aData,
"Null data pointer during time container enumeration");
GetMilestoneElementsParams* params =
static_cast<GetMilestoneElementsParams*>(aData);
@ -702,8 +700,8 @@ nsSMILAnimationController::SampleTimedElement(
nsSMILTime containerTime = timeContainer->GetCurrentTime();
NS_ABORT_IF_FALSE(!timeContainer->IsSeeking(),
"Doing a regular sample but the time container is still seeking");
MOZ_ASSERT(!timeContainer->IsSeeking(),
"Doing a regular sample but the time container is still seeking");
aElement->TimedElement().SampleAt(containerTime);
}

View File

@ -220,10 +220,10 @@ nsSMILAnimationFunction::ComposeResult(const nsISMILAttr& aSMILAttr,
return;
// If this interval is active, we must have a non-negative mSampleTime
NS_ABORT_IF_FALSE(mSampleTime >= 0 || !mIsActive,
"Negative sample time for active animation");
NS_ABORT_IF_FALSE(mSimpleDuration.IsResolved() || mLastValue,
"Unresolved simple duration for active or frozen animation");
MOZ_ASSERT(mSampleTime >= 0 || !mIsActive,
"Negative sample time for active animation");
MOZ_ASSERT(mSimpleDuration.IsResolved() || mLastValue,
"Unresolved simple duration for active or frozen animation");
// If we want to add but don't have a base value then just fail outright.
// This can happen when we skipped getting the base value because there's an
@ -303,8 +303,8 @@ nsSMILAnimationFunction::CompareTo(const nsSMILAnimationFunction* aOther) const
// Animations that appear later in the document sort after those earlier in
// the document
NS_ABORT_IF_FALSE(mAnimationElement != aOther->mAnimationElement,
"Two animations cannot have the same animation content element!");
MOZ_ASSERT(mAnimationElement != aOther->mAnimationElement,
"Two animations cannot have the same animation content element!");
return (nsContentUtils::PositionIsBefore(mAnimationElement, aOther->mAnimationElement))
? -1 : 1;
@ -368,8 +368,8 @@ nsSMILAnimationFunction::InterpolateResult(const nsSMILValueArray& aValues,
if (mSimpleDuration.IsDefinite()) {
nsSMILTime dur = mSimpleDuration.GetMillis();
NS_ABORT_IF_FALSE(dur >= 0, "Simple duration should not be negative");
NS_ABORT_IF_FALSE(mSampleTime >= 0, "Sample time should not be negative");
MOZ_ASSERT(dur >= 0, "Simple duration should not be negative");
MOZ_ASSERT(mSampleTime >= 0, "Sample time should not be negative");
if (mSampleTime >= dur || mSampleTime < 0) {
NS_ERROR("Animation sampled outside interval");
@ -388,7 +388,7 @@ nsSMILAnimationFunction::InterpolateResult(const nsSMILValueArray& aValues,
const nsSMILValue* from = nullptr;
const nsSMILValue* to = nullptr;
// Init to -1 to make sure that if we ever forget to set this, the
// NS_ABORT_IF_FALSE that tests that intervalProgress is in range will fail.
// MOZ_ASSERT that tests that intervalProgress is in range will fail.
double intervalProgress = -1.f;
if (IsToAnimation()) {
from = &aBaseValue;
@ -421,10 +421,10 @@ nsSMILAnimationFunction::InterpolateResult(const nsSMILValueArray& aValues,
}
if (NS_SUCCEEDED(rv)) {
NS_ABORT_IF_FALSE(from, "NULL from-value during interpolation");
NS_ABORT_IF_FALSE(to, "NULL to-value during interpolation");
NS_ABORT_IF_FALSE(0.0f <= intervalProgress && intervalProgress < 1.0f,
"Interval progress should be in the range [0, 1)");
MOZ_ASSERT(from, "NULL from-value during interpolation");
MOZ_ASSERT(to, "NULL to-value during interpolation");
MOZ_ASSERT(0.0f <= intervalProgress && intervalProgress < 1.0f,
"Interval progress should be in the range [0, 1)");
rv = from->Interpolate(*to, intervalProgress, aResult);
}
}
@ -502,7 +502,7 @@ nsSMILAnimationFunction::ComputePacedPosition(const nsSMILValueArray& aValues,
"aSimpleProgress is out of bounds");
NS_ASSERTION(GetCalcMode() == CALC_PACED,
"Calling paced-specific function, but not in paced mode");
NS_ABORT_IF_FALSE(aValues.Length() >= 2, "Unexpected number of values");
MOZ_ASSERT(aValues.Length() >= 2, "Unexpected number of values");
// Trivial case: If we have just 2 values, then there's only one interval
// for us to traverse, and our progress across that interval is the exact
@ -548,9 +548,9 @@ nsSMILAnimationFunction::ComputePacedPosition(const nsSMILValueArray& aValues,
nsresult rv =
#endif
aValues[i].ComputeDistance(aValues[i+1], curIntervalDist);
NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv),
"If we got through ComputePacedTotalDistance, we should "
"be able to recompute each sub-distance without errors");
MOZ_ASSERT(NS_SUCCEEDED(rv),
"If we got through ComputePacedTotalDistance, we should "
"be able to recompute each sub-distance without errors");
NS_ASSERTION(curIntervalDist >= 0, "distance values must be non-negative");
// Clamp distance value at 0, just in case ComputeDistance is evil.
@ -604,7 +604,7 @@ nsSMILAnimationFunction::ComputePacedTotalDistance(
// Clamp distance value to 0, just in case we have an evil ComputeDistance
// implementation somewhere
NS_ABORT_IF_FALSE(tmpDist >= 0.0f, "distance values must be non-negative");
MOZ_ASSERT(tmpDist >= 0.0f, "distance values must be non-negative");
tmpDist = std::max(tmpDist, 0.0);
totalDistance += tmpDist;
@ -634,9 +634,9 @@ nsSMILAnimationFunction::ScaleSimpleProgress(double aProgress,
// needn't be 1. So check if we're in the last 'interval', that is, the
// space between the final value and 1.0.
if (aProgress >= mKeyTimes[i+1]) {
NS_ABORT_IF_FALSE(i == numTimes - 2,
"aProgress is not in range of the current interval, yet the current"
" interval is not the last bounded interval either.");
MOZ_ASSERT(i == numTimes - 2,
"aProgress is not in range of the current interval, yet the "
"current interval is not the last bounded interval either.");
++i;
}
return (double)i / numTimes;
@ -663,8 +663,8 @@ nsSMILAnimationFunction::ScaleIntervalProgress(double aProgress,
if (!HasAttr(nsGkAtoms::keySplines))
return aProgress;
NS_ABORT_IF_FALSE(aIntervalIndex < mKeySplines.Length(),
"Invalid interval index");
MOZ_ASSERT(aIntervalIndex < mKeySplines.Length(),
"Invalid interval index");
nsSMILKeySpline const &spline = mKeySplines[aIntervalIndex];
return spline.GetSplineValue(aProgress);

View File

@ -206,10 +206,10 @@ public:
*/
void ClearHasChanged()
{
NS_ABORT_IF_FALSE(HasChanged(),
"clearing mHasChanged flag, when it's already false");
NS_ABORT_IF_FALSE(!IsActiveOrFrozen(),
"clearing mHasChanged flag for active animation");
MOZ_ASSERT(HasChanged(),
"clearing mHasChanged flag, when it's already false");
MOZ_ASSERT(!IsActiveOrFrozen(),
"clearing mHasChanged flag for active animation");
mHasChanged = false;
}

View File

@ -22,10 +22,10 @@ GetCSSComputedValue(Element* aElem,
nsCSSProperty aPropID,
nsAString& aResult)
{
NS_ABORT_IF_FALSE(!nsCSSProps::IsShorthand(aPropID),
"Can't look up computed value of shorthand property");
NS_ABORT_IF_FALSE(nsSMILCSSProperty::IsPropertyAnimatable(aPropID),
"Shouldn't get here for non-animatable properties");
MOZ_ASSERT(!nsCSSProps::IsShorthand(aPropID),
"Can't look up computed value of shorthand property");
MOZ_ASSERT(nsSMILCSSProperty::IsPropertyAnimatable(aPropID),
"Shouldn't get here for non-animatable properties");
nsIDocument* doc = aElem->GetCurrentDoc();
if (!doc) {
@ -53,9 +53,9 @@ nsSMILCSSProperty::nsSMILCSSProperty(nsCSSProperty aPropID,
Element* aElement)
: mPropID(aPropID), mElement(aElement)
{
NS_ABORT_IF_FALSE(IsPropertyAnimatable(mPropID),
"Creating a nsSMILCSSProperty for a property "
"that's not supported for animation");
MOZ_ASSERT(IsPropertyAnimatable(mPropID),
"Creating a nsSMILCSSProperty for a property "
"that's not supported for animation");
}
nsSMILValue

View File

@ -45,8 +45,8 @@ GetZeroValueForUnit(StyleAnimationValue::Unit aUnit)
static const StyleAnimationValue
sZeroColor(NS_RGB(0,0,0), StyleAnimationValue::ColorConstructor);
NS_ABORT_IF_FALSE(aUnit != StyleAnimationValue::eUnit_Null,
"Need non-null unit for a zero value");
MOZ_ASSERT(aUnit != StyleAnimationValue::eUnit_Null,
"Need non-null unit for a zero value");
switch (aUnit) {
case StyleAnimationValue::eUnit_Coord:
return &sZeroCoord;
@ -75,8 +75,8 @@ static const bool
FinalizeStyleAnimationValues(const StyleAnimationValue*& aValue1,
const StyleAnimationValue*& aValue2)
{
NS_ABORT_IF_FALSE(aValue1 || aValue2,
"expecting at least one non-null value");
MOZ_ASSERT(aValue1 || aValue2,
"expecting at least one non-null value");
// Are we missing either val? (If so, it's an implied 0 in other val's units)
if (!aValue1) {
@ -142,7 +142,7 @@ ExtractValueWrapper(const nsSMILValue& aValue)
void
nsSMILCSSValueType::Init(nsSMILValue& aValue) const
{
NS_ABORT_IF_FALSE(aValue.IsNull(), "Unexpected SMIL value type");
MOZ_ASSERT(aValue.IsNull(), "Unexpected SMIL value type");
aValue.mU.mPtr = nullptr;
aValue.mType = this;
@ -151,7 +151,7 @@ nsSMILCSSValueType::Init(nsSMILValue& aValue) const
void
nsSMILCSSValueType::Destroy(nsSMILValue& aValue) const
{
NS_ABORT_IF_FALSE(aValue.mType == this, "Unexpected SMIL value type");
MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value type");
delete static_cast<ValueWrapper*>(aValue.mU.mPtr);
aValue.mType = nsSMILNullType::Singleton();
}
@ -159,8 +159,8 @@ nsSMILCSSValueType::Destroy(nsSMILValue& aValue) const
nsresult
nsSMILCSSValueType::Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const
{
NS_ABORT_IF_FALSE(aDest.mType == aSrc.mType, "Incompatible SMIL types");
NS_ABORT_IF_FALSE(aDest.mType == this, "Unexpected SMIL value type");
MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value type");
const ValueWrapper* srcWrapper = ExtractValueWrapper(aSrc);
ValueWrapper* destWrapper = ExtractValueWrapper(aDest);
@ -185,8 +185,8 @@ bool
nsSMILCSSValueType::IsEqual(const nsSMILValue& aLeft,
const nsSMILValue& aRight) const
{
NS_ABORT_IF_FALSE(aLeft.mType == aRight.mType, "Incompatible SMIL types");
NS_ABORT_IF_FALSE(aLeft.mType == this, "Unexpected SMIL value");
MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
MOZ_ASSERT(aLeft.mType == this, "Unexpected SMIL value");
const ValueWrapper* leftWrapper = ExtractValueWrapper(aLeft);
const ValueWrapper* rightWrapper = ExtractValueWrapper(aRight);
@ -213,14 +213,14 @@ nsresult
nsSMILCSSValueType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
uint32_t aCount) const
{
NS_ABORT_IF_FALSE(aValueToAdd.mType == aDest.mType,
"Trying to add invalid types");
NS_ABORT_IF_FALSE(aValueToAdd.mType == this, "Unexpected source type");
MOZ_ASSERT(aValueToAdd.mType == aDest.mType,
"Trying to add invalid types");
MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
ValueWrapper* destWrapper = ExtractValueWrapper(aDest);
const ValueWrapper* valueToAddWrapper = ExtractValueWrapper(aValueToAdd);
NS_ABORT_IF_FALSE(destWrapper || valueToAddWrapper,
"need at least one fully-initialized value");
MOZ_ASSERT(destWrapper || valueToAddWrapper,
"need at least one fully-initialized value");
nsCSSProperty property = (valueToAddWrapper ? valueToAddWrapper->mPropID :
destWrapper->mPropID);
@ -260,13 +260,13 @@ nsSMILCSSValueType::ComputeDistance(const nsSMILValue& aFrom,
const nsSMILValue& aTo,
double& aDistance) const
{
NS_ABORT_IF_FALSE(aFrom.mType == aTo.mType,
"Trying to compare different types");
NS_ABORT_IF_FALSE(aFrom.mType == this, "Unexpected source type");
MOZ_ASSERT(aFrom.mType == aTo.mType,
"Trying to compare different types");
MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
const ValueWrapper* fromWrapper = ExtractValueWrapper(aFrom);
const ValueWrapper* toWrapper = ExtractValueWrapper(aTo);
NS_ABORT_IF_FALSE(toWrapper, "expecting non-null endpoint");
MOZ_ASSERT(toWrapper, "expecting non-null endpoint");
const StyleAnimationValue* fromCSSValue = fromWrapper ?
&fromWrapper->mCSSValue : nullptr;
@ -287,18 +287,18 @@ nsSMILCSSValueType::Interpolate(const nsSMILValue& aStartVal,
double aUnitDistance,
nsSMILValue& aResult) const
{
NS_ABORT_IF_FALSE(aStartVal.mType == aEndVal.mType,
"Trying to interpolate different types");
NS_ABORT_IF_FALSE(aStartVal.mType == this,
"Unexpected types for interpolation");
NS_ABORT_IF_FALSE(aResult.mType == this, "Unexpected result type");
NS_ABORT_IF_FALSE(aUnitDistance >= 0.0 && aUnitDistance <= 1.0,
"unit distance value out of bounds");
NS_ABORT_IF_FALSE(!aResult.mU.mPtr, "expecting barely-initialized outparam");
MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
"Trying to interpolate different types");
MOZ_ASSERT(aStartVal.mType == this,
"Unexpected types for interpolation");
MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
MOZ_ASSERT(aUnitDistance >= 0.0 && aUnitDistance <= 1.0,
"unit distance value out of bounds");
MOZ_ASSERT(!aResult.mU.mPtr, "expecting barely-initialized outparam");
const ValueWrapper* startWrapper = ExtractValueWrapper(aStartVal);
const ValueWrapper* endWrapper = ExtractValueWrapper(aEndVal);
NS_ABORT_IF_FALSE(endWrapper, "expecting non-null endpoint");
MOZ_ASSERT(endWrapper, "expecting non-null endpoint");
const StyleAnimationValue* startCSSValue = startWrapper ?
&startWrapper->mCSSValue : nullptr;
@ -370,9 +370,8 @@ ValueFromStringHelper(nsCSSProperty aPropID,
if (aPropID == eCSSProperty_font_size) {
// Divide out text-zoom, since SVG is supposed to ignore it
NS_ABORT_IF_FALSE(aStyleAnimValue.GetUnit() ==
StyleAnimationValue::eUnit_Coord,
"'font-size' value with unexpected style unit");
MOZ_ASSERT(aStyleAnimValue.GetUnit() == StyleAnimationValue::eUnit_Coord,
"'font-size' value with unexpected style unit");
aStyleAnimValue.SetCoordValue(aStyleAnimValue.GetCoordValue() /
aPresContext->TextZoom());
}
@ -387,7 +386,7 @@ nsSMILCSSValueType::ValueFromString(nsCSSProperty aPropID,
nsSMILValue& aValue,
bool* aIsContextSensitive)
{
NS_ABORT_IF_FALSE(aValue.IsNull(), "Outparam should be null-typed");
MOZ_ASSERT(aValue.IsNull(), "Outparam should be null-typed");
nsPresContext* presContext = GetPresContextForElement(aTargetElement);
if (!presContext) {
NS_WARNING("Not parsing animation value; unable to get PresContext");
@ -415,8 +414,8 @@ bool
nsSMILCSSValueType::ValueToString(const nsSMILValue& aValue,
nsAString& aString)
{
NS_ABORT_IF_FALSE(aValue.mType == &nsSMILCSSValueType::sSingleton,
"Unexpected SMIL value type");
MOZ_ASSERT(aValue.mType == &nsSMILCSSValueType::sSingleton,
"Unexpected SMIL value type");
const ValueWrapper* wrapper = ExtractValueWrapper(aValue);
return !wrapper ||
StyleAnimationValue::UncomputeValue(wrapper->mPropID,

View File

@ -47,11 +47,11 @@ nsSMILInstanceTime::nsSMILInstanceTime(const nsSMILTimeValue& aTime,
nsSMILInstanceTime::~nsSMILInstanceTime()
{
NS_ABORT_IF_FALSE(!mBaseInterval,
"Destroying instance time without first calling Unlink()");
NS_ABORT_IF_FALSE(mFixedEndpointRefCnt == 0,
"Destroying instance time that is still used as the fixed endpoint of an "
"interval");
MOZ_ASSERT(!mBaseInterval,
"Destroying instance time without first calling Unlink()");
MOZ_ASSERT(mFixedEndpointRefCnt == 0,
"Destroying instance time that is still used as the fixed "
"endpoint of an interval");
}
void
@ -78,7 +78,7 @@ nsSMILInstanceTime::HandleChangedInterval(
if (!mBaseInterval)
return;
NS_ABORT_IF_FALSE(mCreator, "Base interval is set but creator is not.");
MOZ_ASSERT(mCreator, "Base interval is set but creator is not.");
if (mVisited) {
// Break the cycle here
@ -100,9 +100,10 @@ nsSMILInstanceTime::HandleChangedInterval(
void
nsSMILInstanceTime::HandleDeletedInterval()
{
NS_ABORT_IF_FALSE(mBaseInterval,
"Got call to HandleDeletedInterval on an independent instance time");
NS_ABORT_IF_FALSE(mCreator, "Base interval is set but creator is not");
MOZ_ASSERT(mBaseInterval,
"Got call to HandleDeletedInterval on an independent instance "
"time");
MOZ_ASSERT(mCreator, "Base interval is set but creator is not");
mBaseInterval = nullptr;
mFlags &= ~kMayUpdate; // Can't update without a base interval
@ -115,8 +116,9 @@ nsSMILInstanceTime::HandleDeletedInterval()
void
nsSMILInstanceTime::HandleFilteredInterval()
{
NS_ABORT_IF_FALSE(mBaseInterval,
"Got call to HandleFilteredInterval on an independent instance time");
MOZ_ASSERT(mBaseInterval,
"Got call to HandleFilteredInterval on an independent instance "
"time");
mBaseInterval = nullptr;
mFlags &= ~kMayUpdate; // Can't update without a base interval
@ -138,8 +140,8 @@ nsSMILInstanceTime::UnmarkShouldPreserve()
void
nsSMILInstanceTime::AddRefFixedEndpoint()
{
NS_ABORT_IF_FALSE(mFixedEndpointRefCnt < UINT16_MAX,
"Fixed endpoint reference count upper limit reached");
MOZ_ASSERT(mFixedEndpointRefCnt < UINT16_MAX,
"Fixed endpoint reference count upper limit reached");
++mFixedEndpointRefCnt;
mFlags &= ~kMayUpdate; // Once fixed, always fixed
}
@ -147,7 +149,7 @@ nsSMILInstanceTime::AddRefFixedEndpoint()
void
nsSMILInstanceTime::ReleaseFixedEndpoint()
{
NS_ABORT_IF_FALSE(mFixedEndpointRefCnt > 0, "Duplicate release");
MOZ_ASSERT(mFixedEndpointRefCnt > 0, "Duplicate release");
--mFixedEndpointRefCnt;
if (mFixedEndpointRefCnt == 0 && IsDynamic()) {
mFlags |= kWasDynamicEndpoint;
@ -179,7 +181,7 @@ nsSMILInstanceTime::GetBaseTime() const
return nullptr;
}
NS_ABORT_IF_FALSE(mCreator, "Base interval is set but there is no creator.");
MOZ_ASSERT(mCreator, "Base interval is set but there is no creator.");
if (!mCreator) {
return nullptr;
}
@ -191,13 +193,14 @@ nsSMILInstanceTime::GetBaseTime() const
void
nsSMILInstanceTime::SetBaseInterval(nsSMILInterval* aBaseInterval)
{
NS_ABORT_IF_FALSE(!mBaseInterval,
"Attempting to reassociate an instance time with a different interval.");
MOZ_ASSERT(!mBaseInterval,
"Attempting to reassociate an instance time with a different "
"interval.");
if (aBaseInterval) {
NS_ABORT_IF_FALSE(mCreator,
"Attempting to create a dependent instance time without reference "
"to the creating nsSMILTimeValueSpec object.");
MOZ_ASSERT(mCreator,
"Attempting to create a dependent instance time without "
"reference to the creating nsSMILTimeValueSpec object.");
if (!mCreator)
return;

View File

@ -77,8 +77,8 @@ public:
void DependentUpdate(const nsSMILTimeValue& aNewTime)
{
NS_ABORT_IF_FALSE(!IsFixedTime(),
"Updating an instance time that is not expected to be updated");
MOZ_ASSERT(!IsFixedTime(),
"Updating an instance time that is not expected to be updated");
mTime = aNewTime;
}

View File

@ -19,23 +19,23 @@ nsSMILInterval::nsSMILInterval(const nsSMILInterval& aOther)
mBeginFixed(false),
mEndFixed(false)
{
NS_ABORT_IF_FALSE(aOther.mDependentTimes.IsEmpty(),
"Attempting to copy-construct an interval with dependent times, "
"this will lead to instance times being shared between intervals.");
MOZ_ASSERT(aOther.mDependentTimes.IsEmpty(),
"Attempt to copy-construct an interval with dependent times; this "
"will lead to instance times being shared between intervals.");
// For the time being we don't allow intervals with fixed endpoints to be
// copied since we only ever copy-construct to establish a new current
// interval. If we ever need to copy historical intervals we may need to move
// the ReleaseFixedEndpoint calls from Unlink to the dtor.
NS_ABORT_IF_FALSE(!aOther.mBeginFixed && !aOther.mEndFixed,
"Attempting to copy-construct an interval with fixed endpoints");
MOZ_ASSERT(!aOther.mBeginFixed && !aOther.mEndFixed,
"Attempt to copy-construct an interval with fixed endpoints");
}
nsSMILInterval::~nsSMILInterval()
{
NS_ABORT_IF_FALSE(mDependentTimes.IsEmpty(),
"Destroying interval without disassociating dependent instance times. "
"Unlink was not called");
MOZ_ASSERT(mDependentTimes.IsEmpty(),
"Destroying interval without disassociating dependent instance "
"times. Unlink was not called");
}
void
@ -62,31 +62,31 @@ nsSMILInterval::Unlink(bool aFiltered)
nsSMILInstanceTime*
nsSMILInterval::Begin()
{
NS_ABORT_IF_FALSE(mBegin && mEnd,
"Requesting Begin() on un-initialized interval.");
MOZ_ASSERT(mBegin && mEnd,
"Requesting Begin() on un-initialized interval.");
return mBegin;
}
nsSMILInstanceTime*
nsSMILInterval::End()
{
NS_ABORT_IF_FALSE(mBegin && mEnd,
"Requesting End() on un-initialized interval.");
MOZ_ASSERT(mBegin && mEnd,
"Requesting End() on un-initialized interval.");
return mEnd;
}
void
nsSMILInterval::SetBegin(nsSMILInstanceTime& aBegin)
{
NS_ABORT_IF_FALSE(aBegin.Time().IsDefinite(),
"Attempting to set unresolved or indefinite begin time on interval");
NS_ABORT_IF_FALSE(!mBeginFixed,
"Attempting to set begin time but the begin point is fixed");
MOZ_ASSERT(aBegin.Time().IsDefinite(),
"Attempt to set unresolved or indefinite begin time on interval");
MOZ_ASSERT(!mBeginFixed,
"Attempt to set begin time but the begin point is fixed");
// Check that we're not making an instance time dependent on itself. Such an
// arrangement does not make intuitive sense and should be detected when
// creating or updating intervals.
NS_ABORT_IF_FALSE(!mBegin || aBegin.GetBaseTime() != mBegin,
"Attempting to make self-dependent instance time");
MOZ_ASSERT(!mBegin || aBegin.GetBaseTime() != mBegin,
"Attempt to make self-dependent instance time");
mBegin = &aBegin;
}
@ -94,12 +94,12 @@ nsSMILInterval::SetBegin(nsSMILInstanceTime& aBegin)
void
nsSMILInterval::SetEnd(nsSMILInstanceTime& aEnd)
{
NS_ABORT_IF_FALSE(!mEndFixed,
"Attempting to set end time but the end point is fixed");
MOZ_ASSERT(!mEndFixed,
"Attempt to set end time but the end point is fixed");
// As with SetBegin, check we're not making an instance time dependent on
// itself.
NS_ABORT_IF_FALSE(!mEnd || aEnd.GetBaseTime() != mEnd,
"Attempting to make self-dependent instance time");
MOZ_ASSERT(!mEnd || aEnd.GetBaseTime() != mEnd,
"Attempting to make self-dependent instance time");
mEnd = &aEnd;
}
@ -107,9 +107,9 @@ nsSMILInterval::SetEnd(nsSMILInstanceTime& aEnd)
void
nsSMILInterval::FixBegin()
{
NS_ABORT_IF_FALSE(mBegin && mEnd,
"Fixing begin point on un-initialized interval");
NS_ABORT_IF_FALSE(!mBeginFixed, "Duplicate calls to FixBegin()");
MOZ_ASSERT(mBegin && mEnd,
"Fixing begin point on un-initialized interval");
MOZ_ASSERT(!mBeginFixed, "Duplicate calls to FixBegin()");
mBeginFixed = true;
mBegin->AddRefFixedEndpoint();
}
@ -117,11 +117,11 @@ nsSMILInterval::FixBegin()
void
nsSMILInterval::FixEnd()
{
NS_ABORT_IF_FALSE(mBegin && mEnd,
"Fixing end point on un-initialized interval");
NS_ABORT_IF_FALSE(mBeginFixed,
"Fixing the end of an interval without a fixed begin");
NS_ABORT_IF_FALSE(!mEndFixed, "Duplicate calls to FixEnd()");
MOZ_ASSERT(mBegin && mEnd,
"Fixing end point on un-initialized interval");
MOZ_ASSERT(mBeginFixed,
"Fixing the end of an interval without a fixed begin");
MOZ_ASSERT(!mEndFixed, "Duplicate calls to FixEnd()");
mEndFixed = true;
mEnd->AddRefFixedEndpoint();
}
@ -143,7 +143,7 @@ nsSMILInterval::RemoveDependentTime(const nsSMILInstanceTime& aTime)
bool found =
#endif
mDependentTimes.RemoveElementSorted(&aTime);
NS_ABORT_IF_FALSE(found, "Couldn't find instance time to delete.");
MOZ_ASSERT(found, "Couldn't find instance time to delete.");
}
void

View File

@ -28,16 +28,16 @@ public:
const nsSMILInstanceTime* Begin() const
{
NS_ABORT_IF_FALSE(mBegin && mEnd,
"Requesting Begin() on un-initialized instance time");
MOZ_ASSERT(mBegin && mEnd,
"Requesting Begin() on un-initialized instance time");
return mBegin;
}
nsSMILInstanceTime* Begin();
const nsSMILInstanceTime* End() const
{
NS_ABORT_IF_FALSE(mBegin && mEnd,
"Requesting End() on un-initialized instance time");
MOZ_ASSERT(mBegin && mEnd,
"Requesting End() on un-initialized instance time");
return mEnd;
}
nsSMILInstanceTime* End();

View File

@ -271,16 +271,15 @@ ParseOptionalOffset(RangedPtr<const char16_t>& aIter,
bool
ParseAccessKey(const nsAString& aSpec, nsSMILTimeValueSpecParams& aResult)
{
NS_ABORT_IF_FALSE(StringBeginsWith(aSpec, ACCESSKEY_PREFIX_CC) ||
StringBeginsWith(aSpec, ACCESSKEY_PREFIX_LC),
"Calling ParseAccessKey on non-accesskey-type spec");
MOZ_ASSERT(StringBeginsWith(aSpec, ACCESSKEY_PREFIX_CC) ||
StringBeginsWith(aSpec, ACCESSKEY_PREFIX_LC),
"Calling ParseAccessKey on non-accesskey-type spec");
nsSMILTimeValueSpecParams result;
result.mType = nsSMILTimeValueSpecParams::ACCESSKEY;
NS_ABORT_IF_FALSE(
ACCESSKEY_PREFIX_LC.Length() == ACCESSKEY_PREFIX_CC.Length(),
"Case variations for accesskey prefix differ in length");
MOZ_ASSERT(ACCESSKEY_PREFIX_LC.Length() == ACCESSKEY_PREFIX_CC.Length(),
"Case variations for accesskey prefix differ in length");
RangedPtr<const char16_t> iter(SVGContentUtils::GetStartRangedPtr(aSpec));
RangedPtr<const char16_t> end(SVGContentUtils::GetEndRangedPtr(aSpec));
@ -371,7 +370,7 @@ ConvertTokenToAtom(const nsAString& aToken,
bool escape = false;
while (read != end) {
NS_ABORT_IF_FALSE(write <= read, "Writing past where we've read");
MOZ_ASSERT(write <= read, "Writing past where we've read");
if (!escape && *read == '\\') {
escape = true;
++read;

View File

@ -254,9 +254,9 @@ nsSMILTimeContainer::PopMilestoneElementsAtMilestone(
nsSMILMilestone containerMilestone(containerTime.GetMillis(),
aMilestone.mIsEnd);
NS_ABORT_IF_FALSE(mMilestoneEntries.Top().mMilestone >= containerMilestone,
"Trying to pop off earliest times but we have earlier ones that were "
"overlooked");
MOZ_ASSERT(mMilestoneEntries.Top().mMilestone >= containerMilestone,
"Trying to pop off earliest times but we have earlier ones that "
"were overlooked");
bool gotOne = false;
while (!mMilestoneEntries.IsEmpty() &&
@ -291,7 +291,7 @@ nsSMILTimeContainer::UpdateCurrentTime()
{
nsSMILTime now = IsPaused() ? mPauseStart : GetParentTime();
mCurrentTime = now - mParentOffset;
NS_ABORT_IF_FALSE(mCurrentTime >= 0, "Container has negative time");
MOZ_ASSERT(mCurrentTime >= 0, "Container has negative time");
}
void
@ -313,9 +313,9 @@ nsSMILTimeContainer::NotifyTimeChange()
while (p < mMilestoneEntries.Elements() + mMilestoneEntries.Length()) {
mozilla::dom::SVGAnimationElement* elem = p->mTimebase.get();
elem->TimedElement().HandleContainerTimeChange();
NS_ABORT_IF_FALSE(queueLength == mMilestoneEntries.Length(),
"Call to HandleContainerTimeChange resulted in a change to the "
"queue of milestones");
MOZ_ASSERT(queueLength == mMilestoneEntries.Length(),
"Call to HandleContainerTimeChange resulted in a change to the "
"queue of milestones");
++p;
}
}

View File

@ -88,8 +88,8 @@ public:
bool IsDefinite() const { return mState == STATE_DEFINITE; }
nsSMILTime GetMillis() const
{
NS_ABORT_IF_FALSE(mState == STATE_DEFINITE,
"GetMillis() called for unresolved or indefinite time");
MOZ_ASSERT(mState == STATE_DEFINITE,
"GetMillis() called for unresolved or indefinite time");
return mState == STATE_DEFINITE ? mMilliseconds : kUnresolvedMillis;
}

View File

@ -92,8 +92,8 @@ nsSMILTimeValueSpec::ResolveReferences(nsIContent* aContextNode)
if (mParams.mType != nsSMILTimeValueSpecParams::SYNCBASE && !IsEventBased())
return;
NS_ABORT_IF_FALSE(aContextNode,
"null context node for resolving timing references against");
MOZ_ASSERT(aContextNode,
"null context node for resolving timing references against");
// If we're not bound to the document yet, don't worry, we'll get called again
// when that happens
@ -113,10 +113,10 @@ nsSMILTimeValueSpec::ResolveReferences(nsIContent* aContextNode)
mReferencedElement.ResetWithElement(target);
} else if (mParams.mType == nsSMILTimeValueSpecParams::ACCESSKEY) {
nsIDocument* doc = aContextNode->GetCurrentDoc();
NS_ABORT_IF_FALSE(doc, "We are in the document but current doc is null");
MOZ_ASSERT(doc, "We are in the document but current doc is null");
mReferencedElement.ResetWithElement(doc->GetRootElement());
} else {
NS_ABORT_IF_FALSE(false, "Syncbase or repeat spec without ID");
MOZ_ASSERT(false, "Syncbase or repeat spec without ID");
}
UpdateReferencedElement(oldReferencedElement, mReferencedElement.get());
}
@ -297,11 +297,12 @@ nsSMILTimeValueSpec::IsWhitelistedEvent()
void
nsSMILTimeValueSpec::RegisterEventListener(Element* aTarget)
{
NS_ABORT_IF_FALSE(IsEventBased(),
"Attempting to register event-listener for unexpected nsSMILTimeValueSpec"
" type");
NS_ABORT_IF_FALSE(mParams.mEventSymbol,
"Attempting to register event-listener but there is no event name");
MOZ_ASSERT(IsEventBased(),
"Attempting to register event-listener for unexpected "
"nsSMILTimeValueSpec type");
MOZ_ASSERT(mParams.mEventSymbol,
"Attempting to register event-listener but there is no event "
"name");
if (!aTarget)
return;
@ -343,7 +344,7 @@ nsSMILTimeValueSpec::UnregisterEventListener(Element* aTarget)
EventListenerManager*
nsSMILTimeValueSpec::GetEventListenerManager(Element* aTarget)
{
NS_ABORT_IF_FALSE(aTarget, "null target; can't get EventListenerManager");
MOZ_ASSERT(aTarget, "null target; can't get EventListenerManager");
nsCOMPtr<EventTarget> target;
@ -367,10 +368,10 @@ nsSMILTimeValueSpec::GetEventListenerManager(Element* aTarget)
void
nsSMILTimeValueSpec::HandleEvent(nsIDOMEvent* aEvent)
{
NS_ABORT_IF_FALSE(mEventListener, "Got event without an event listener");
NS_ABORT_IF_FALSE(IsEventBased(),
"Got event for non-event nsSMILTimeValueSpec");
NS_ABORT_IF_FALSE(aEvent, "No event supplied");
MOZ_ASSERT(mEventListener, "Got event without an event listener");
MOZ_ASSERT(IsEventBased(),
"Got event for non-event nsSMILTimeValueSpec");
MOZ_ASSERT(aEvent, "No event supplied");
// XXX In the long run we should get the time from the event itself which will
// store the time in global document time which we'll need to convert to our
@ -509,8 +510,8 @@ nsSMILTimeValueSpec::ConvertBetweenTimeContainers(
// time. Just return the indefinite time.
return docTime;
NS_ABORT_IF_FALSE(docTime.IsDefinite(),
"ContainerToParentTime gave us an unresolved or indefinite time");
MOZ_ASSERT(docTime.IsDefinite(),
"ContainerToParentTime gave us an unresolved or indefinite time");
return dstContainer->ParentToContainerTime(docTime.GetMillis());
}

View File

@ -48,12 +48,12 @@ nsSMILTimedElement::InstanceTimeComparator::Equals(
const nsSMILInstanceTime* aElem1,
const nsSMILInstanceTime* aElem2) const
{
NS_ABORT_IF_FALSE(aElem1 && aElem2,
"Trying to compare null instance time pointers");
NS_ABORT_IF_FALSE(aElem1->Serial() && aElem2->Serial(),
"Instance times have not been assigned serial numbers");
NS_ABORT_IF_FALSE(aElem1 == aElem2 || aElem1->Serial() != aElem2->Serial(),
"Serial numbers are not unique");
MOZ_ASSERT(aElem1 && aElem2,
"Trying to compare null instance time pointers");
MOZ_ASSERT(aElem1->Serial() && aElem2->Serial(),
"Instance times have not been assigned serial numbers");
MOZ_ASSERT(aElem1 == aElem2 || aElem1->Serial() != aElem2->Serial(),
"Serial numbers are not unique");
return aElem1->Serial() == aElem2->Serial();
}
@ -63,10 +63,10 @@ nsSMILTimedElement::InstanceTimeComparator::LessThan(
const nsSMILInstanceTime* aElem1,
const nsSMILInstanceTime* aElem2) const
{
NS_ABORT_IF_FALSE(aElem1 && aElem2,
"Trying to compare null instance time pointers");
NS_ABORT_IF_FALSE(aElem1->Serial() && aElem2->Serial(),
"Instance times have not been assigned serial numbers");
MOZ_ASSERT(aElem1 && aElem2,
"Trying to compare null instance time pointers");
MOZ_ASSERT(aElem1->Serial() && aElem2->Serial(),
"Instance times have not been assigned serial numbers");
int8_t cmp = aElem1->Time().CompareTo(aElem2->Time());
return cmp == 0 ? aElem1->Serial() < aElem2->Serial() : cmp < 0;
@ -195,9 +195,8 @@ nsSMILTimedElement::RemoveInstanceTimes(InstanceTimeList& aArray,
// However, when filtering instance times, we sometimes need to drop even
// instance times marked as "ShouldPreserve". In that case we take special
// care not to delete the end instance time of the previous interval.
NS_ABORT_IF_FALSE(!GetPreviousInterval() ||
item != GetPreviousInterval()->End(),
"Removing end instance time of previous interval");
MOZ_ASSERT(!GetPreviousInterval() || item != GetPreviousInterval()->End(),
"Removing end instance time of previous interval");
item->Unlink();
} else {
newArray.AppendElement(item);
@ -282,19 +281,19 @@ nsSMILTimedElement::~nsSMILTimedElement()
// correct behavior) but also because AutoIntervalUpdateBatcher holds pointers
// to class so if they fail there's the possibility we might have dangling
// pointers.
NS_ABORT_IF_FALSE(!mDeferIntervalUpdates,
"Interval updates should no longer be blocked when an nsSMILTimedElement "
"disappears");
NS_ABORT_IF_FALSE(!mDoDeferredUpdate,
"There should no longer be any pending updates when an "
"nsSMILTimedElement disappears");
MOZ_ASSERT(!mDeferIntervalUpdates,
"Interval updates should no longer be blocked when an "
"nsSMILTimedElement disappears");
MOZ_ASSERT(!mDoDeferredUpdate,
"There should no longer be any pending updates when an "
"nsSMILTimedElement disappears");
}
void
nsSMILTimedElement::SetAnimationElement(SVGAnimationElement* aElement)
{
NS_ABORT_IF_FALSE(aElement, "NULL owner element");
NS_ABORT_IF_FALSE(!mAnimationElement, "Re-setting owner");
MOZ_ASSERT(aElement, "NULL owner element");
MOZ_ASSERT(!mAnimationElement, "Re-setting owner");
mAnimationElement = aElement;
}
@ -385,7 +384,7 @@ void
nsSMILTimedElement::AddInstanceTime(nsSMILInstanceTime* aInstanceTime,
bool aIsBegin)
{
NS_ABORT_IF_FALSE(aInstanceTime, "Attempting to add null instance time");
MOZ_ASSERT(aInstanceTime, "Attempting to add null instance time");
// Event-sensitivity: If an element is not active (but the parent time
// container is), then events are only handled for begin specifications.
@ -394,9 +393,9 @@ nsSMILTimedElement::AddInstanceTime(nsSMILInstanceTime* aInstanceTime,
{
// No need to call Unlink here--dynamic instance times shouldn't be linked
// to anything that's going to miss them
NS_ABORT_IF_FALSE(!aInstanceTime->GetBaseInterval(),
"Dynamic instance time has a base interval--we probably need to unlink"
" it if we're not going to use it");
MOZ_ASSERT(!aInstanceTime->GetBaseInterval(),
"Dynamic instance time has a base interval--we probably need "
"to unlink it if we're not going to use it");
return;
}
@ -417,7 +416,7 @@ nsSMILTimedElement::UpdateInstanceTime(nsSMILInstanceTime* aInstanceTime,
nsSMILTimeValue& aUpdatedTime,
bool aIsBegin)
{
NS_ABORT_IF_FALSE(aInstanceTime, "Attempting to update null instance time");
MOZ_ASSERT(aInstanceTime, "Attempting to update null instance time");
// The reason we update the time here and not in the nsSMILTimeValueSpec is
// that it means we *could* re-sort more efficiently by doing a sorted remove
@ -449,7 +448,7 @@ void
nsSMILTimedElement::RemoveInstanceTime(nsSMILInstanceTime* aInstanceTime,
bool aIsBegin)
{
NS_ABORT_IF_FALSE(aInstanceTime, "Attempting to remove null instance time");
MOZ_ASSERT(aInstanceTime, "Attempting to remove null instance time");
// If the instance time should be kept (because it is or was the fixed end
// point of an interval) then just disassociate it from the creator.
@ -461,7 +460,7 @@ nsSMILTimedElement::RemoveInstanceTime(nsSMILInstanceTime* aInstanceTime,
InstanceTimeList& instanceList = aIsBegin ? mBeginInstances : mEndInstances;
mozilla::DebugOnly<bool> found =
instanceList.RemoveElementSorted(aInstanceTime, InstanceTimeComparator());
NS_ABORT_IF_FALSE(found, "Couldn't find instance time to delete");
MOZ_ASSERT(found, "Couldn't find instance time to delete");
UpdateCurrentInterval();
}
@ -498,7 +497,7 @@ void
nsSMILTimedElement::RemoveInstanceTimesForCreator(
const nsSMILTimeValueSpec* aCreator, bool aIsBegin)
{
NS_ABORT_IF_FALSE(aCreator, "Creator not set");
MOZ_ASSERT(aCreator, "Creator not set");
InstanceTimeList& instances = aIsBegin ? mBeginInstances : mEndInstances;
RemoveByCreator removeByCreator(aCreator);
@ -560,10 +559,10 @@ nsSMILTimedElement::SampleEndAt(nsSMILTime aContainerTime)
void
nsSMILTimedElement::DoSampleAt(nsSMILTime aContainerTime, bool aEndOnly)
{
NS_ABORT_IF_FALSE(mAnimationElement,
"Got sample before being registered with an animation element");
NS_ABORT_IF_FALSE(GetTimeContainer(),
"Got sample without being registered with a time container");
MOZ_ASSERT(mAnimationElement,
"Got sample before being registered with an animation element");
MOZ_ASSERT(GetTimeContainer(),
"Got sample without being registered with a time container");
// This could probably happen if we later implement externalResourcesRequired
// (bug 277955) and whilst waiting for those resources (and the animation to
@ -604,11 +603,12 @@ nsSMILTimedElement::DoSampleAt(nsSMILTime aContainerTime, bool aEndOnly)
#ifdef DEBUG
// Check invariant
if (mElementState == STATE_STARTUP || mElementState == STATE_POSTACTIVE) {
NS_ABORT_IF_FALSE(!mCurrentInterval,
"Shouldn't have current interval in startup or postactive states");
MOZ_ASSERT(!mCurrentInterval,
"Shouldn't have current interval in startup or postactive "
"states");
} else {
NS_ABORT_IF_FALSE(mCurrentInterval,
"Should have current interval in waiting and active states");
MOZ_ASSERT(mCurrentInterval,
"Should have current interval in waiting and active states");
}
#endif
@ -694,8 +694,8 @@ nsSMILTimedElement::DoSampleAt(nsSMILTime aContainerTime, bool aEndOnly)
FilterHistory();
stateChanged = true;
} else {
NS_ABORT_IF_FALSE(!didApplyEarlyEnd,
"We got an early end, but didn't end");
MOZ_ASSERT(!didApplyEarlyEnd,
"We got an early end, but didn't end");
nsSMILTime beginTime = mCurrentInterval->Begin()->Time().GetMillis();
NS_ASSERTION(aContainerTime >= beginTime,
"Sample time should not precede current interval");
@ -771,9 +771,8 @@ namespace
// Generally dynamically-generated instance times (DOM calls, event-based
// times) are not associated with their creator nsSMILTimeValueSpec since
// they may outlive them.
NS_ABORT_IF_FALSE(!aInstanceTime->IsDynamic() ||
!aInstanceTime->GetCreator(),
"Dynamic instance time should be unlinked from its creator");
MOZ_ASSERT(!aInstanceTime->IsDynamic() || !aInstanceTime->GetCreator(),
"Dynamic instance time should be unlinked from its creator");
return !aInstanceTime->IsDynamic() && !aInstanceTime->ShouldPreserve();
}
}
@ -781,8 +780,9 @@ namespace
void
nsSMILTimedElement::Rewind()
{
NS_ABORT_IF_FALSE(mAnimationElement,
"Got rewind request before being attached to an animation element");
MOZ_ASSERT(mAnimationElement,
"Got rewind request before being attached to an animation "
"element");
// It's possible to get a rewind request whilst we're already in the middle of
// a backwards seek. This can happen when we're performing tree surgery and
@ -799,15 +799,15 @@ nsSMILTimedElement::Rewind()
SEEK_BACKWARD_FROM_ACTIVE :
SEEK_BACKWARD_FROM_INACTIVE;
}
NS_ABORT_IF_FALSE(mSeekState == SEEK_BACKWARD_FROM_INACTIVE ||
mSeekState == SEEK_BACKWARD_FROM_ACTIVE,
"Rewind in the middle of a forwards seek?");
MOZ_ASSERT(mSeekState == SEEK_BACKWARD_FROM_INACTIVE ||
mSeekState == SEEK_BACKWARD_FROM_ACTIVE,
"Rewind in the middle of a forwards seek?");
ClearTimingState(RemoveNonDynamic);
RebuildTimingState(RemoveNonDynamic);
NS_ABORT_IF_FALSE(!mCurrentInterval,
"Current interval is set at end of rewind");
MOZ_ASSERT(!mCurrentInterval,
"Current interval is set at end of rewind");
}
namespace
@ -972,8 +972,8 @@ nsSMILTimedElement::SetSimpleDuration(const nsAString& aDurSpec)
}
// mSimpleDur should never be unresolved. ParseClockValue will either set
// duration to resolved or will return false.
NS_ABORT_IF_FALSE(duration.IsResolved(),
"Setting unresolved simple duration");
MOZ_ASSERT(duration.IsResolved(),
"Setting unresolved simple duration");
mSimpleDur = duration;
@ -1005,7 +1005,7 @@ nsSMILTimedElement::SetMin(const nsAString& aMinSpec)
}
}
NS_ABORT_IF_FALSE(duration.GetMillis() >= 0L, "Invalid duration");
MOZ_ASSERT(duration.GetMillis() >= 0L, "Invalid duration");
mMin = duration;
@ -1036,7 +1036,7 @@ nsSMILTimedElement::SetMax(const nsAString& aMaxSpec)
mMax.SetIndefinite();
return NS_ERROR_FAILURE;
}
NS_ABORT_IF_FALSE(duration.GetMillis() > 0L, "Invalid duration");
MOZ_ASSERT(duration.GetMillis() > 0L, "Invalid duration");
}
mMax = duration;
@ -1162,8 +1162,8 @@ nsSMILTimedElement::AddDependent(nsSMILTimeValueSpec& aDependent)
{
// There's probably no harm in attempting to register a dependent
// nsSMILTimeValueSpec twice, but we're not expecting it to happen.
NS_ABORT_IF_FALSE(!mTimeDependents.GetEntry(&aDependent),
"nsSMILTimeValueSpec is already registered as a dependency");
MOZ_ASSERT(!mTimeDependents.GetEntry(&aDependent),
"nsSMILTimeValueSpec is already registered as a dependency");
mTimeDependents.PutEntry(&aDependent);
// Add current interval. We could add historical intervals too but that would
@ -1251,15 +1251,15 @@ nsSMILTimedElement::Traverse(nsCycleCollectionTraversalCallback* aCallback)
uint32_t count = mBeginSpecs.Length();
for (uint32_t i = 0; i < count; ++i) {
nsSMILTimeValueSpec* beginSpec = mBeginSpecs[i];
NS_ABORT_IF_FALSE(beginSpec,
"null nsSMILTimeValueSpec in list of begin specs");
MOZ_ASSERT(beginSpec,
"null nsSMILTimeValueSpec in list of begin specs");
beginSpec->Traverse(aCallback);
}
count = mEndSpecs.Length();
for (uint32_t j = 0; j < count; ++j) {
nsSMILTimeValueSpec* endSpec = mEndSpecs[j];
NS_ABORT_IF_FALSE(endSpec, "null nsSMILTimeValueSpec in list of end specs");
MOZ_ASSERT(endSpec, "null nsSMILTimeValueSpec in list of end specs");
endSpec->Traverse(aCallback);
}
}
@ -1273,15 +1273,15 @@ nsSMILTimedElement::Unlink()
uint32_t count = mBeginSpecs.Length();
for (uint32_t i = 0; i < count; ++i) {
nsSMILTimeValueSpec* beginSpec = mBeginSpecs[i];
NS_ABORT_IF_FALSE(beginSpec,
"null nsSMILTimeValueSpec in list of begin specs");
MOZ_ASSERT(beginSpec,
"null nsSMILTimeValueSpec in list of begin specs");
beginSpec->Unlink();
}
count = mEndSpecs.Length();
for (uint32_t j = 0; j < count; ++j) {
nsSMILTimeValueSpec* endSpec = mEndSpecs[j];
NS_ABORT_IF_FALSE(endSpec, "null nsSMILTimeValueSpec in list of end specs");
MOZ_ASSERT(endSpec, "null nsSMILTimeValueSpec in list of end specs");
endSpec->Unlink();
}
@ -1386,8 +1386,8 @@ bool
nsSMILTimedElement::ApplyEarlyEnd(const nsSMILTimeValue& aSampleTime)
{
// This should only be called within DoSampleAt as a helper function
NS_ABORT_IF_FALSE(mElementState == STATE_ACTIVE,
"Unexpected state to try to apply an early end");
MOZ_ASSERT(mElementState == STATE_ACTIVE,
"Unexpected state to try to apply an early end");
bool updated = false;
@ -1697,8 +1697,8 @@ nsSMILTimedElement::GetNextInterval(const nsSMILInterval* aPrevInterval,
const nsSMILInstanceTime* aFixedBeginTime,
nsSMILInterval& aResult) const
{
NS_ABORT_IF_FALSE(!aFixedBeginTime || aFixedBeginTime->Time().IsDefinite(),
"Unresolved or indefinite begin time specified for interval start");
MOZ_ASSERT(!aFixedBeginTime || aFixedBeginTime->Time().IsDefinite(),
"Unresolved or indefinite begin time given for interval start");
static const nsSMILTimeValue zeroTime(0L);
if (mRestartMode == RESTART_NEVER && aPrevInterval)
@ -1746,9 +1746,9 @@ nsSMILTimedElement::GetNextInterval(const nsSMILInterval* aPrevInterval,
} while (aReplacedInterval &&
tempBegin->GetBaseTime() == aReplacedInterval->Begin());
}
NS_ABORT_IF_FALSE(tempBegin && tempBegin->Time().IsDefinite() &&
tempBegin->Time() >= beginAfter,
"Got a bad begin time while fetching next interval");
MOZ_ASSERT(tempBegin && tempBegin->Time().IsDefinite() &&
tempBegin->Time() >= beginAfter,
"Got a bad begin time while fetching next interval");
// Calculate end time
{
@ -1811,7 +1811,7 @@ nsSMILTimedElement::GetNextInterval(const nsSMILInterval* aPrevInterval,
tempEnd = new nsSMILInstanceTime(activeEnd);
}
}
NS_ABORT_IF_FALSE(tempEnd, "Failed to get end point for next interval");
MOZ_ASSERT(tempEnd, "Failed to get end point for next interval");
// When we choose the interval endpoints, we don't allow coincident
// zero-duration intervals, so if we arrive here and we have a zero-duration
@ -1869,7 +1869,7 @@ nsSMILTimedElement::GetNextGreaterOrEqual(const InstanceTimeList& aList,
for (; aPosition < count && !result; ++aPosition) {
nsSMILInstanceTime* val = aList[aPosition].get();
NS_ABORT_IF_FALSE(val, "NULL instance time in list");
MOZ_ASSERT(val, "NULL instance time in list");
if (val->Time() >= aBase) {
result = val;
}
@ -1887,10 +1887,10 @@ nsSMILTimedElement::CalcActiveEnd(const nsSMILTimeValue& aBegin,
{
nsSMILTimeValue result;
NS_ABORT_IF_FALSE(mSimpleDur.IsResolved(),
"Unresolved simple duration in CalcActiveEnd");
NS_ABORT_IF_FALSE(aBegin.IsDefinite(),
"Indefinite or unresolved begin time in CalcActiveEnd");
MOZ_ASSERT(mSimpleDur.IsResolved(),
"Unresolved simple duration in CalcActiveEnd");
MOZ_ASSERT(aBegin.IsDefinite(),
"Indefinite or unresolved begin time in CalcActiveEnd");
result = GetRepeatDuration();
@ -1968,9 +1968,9 @@ nsSMILTimedElement::ActiveTimeToSimpleTime(nsSMILTime aActiveTime,
{
nsSMILTime result;
NS_ABORT_IF_FALSE(mSimpleDur.IsResolved(),
"Unresolved simple duration in ActiveTimeToSimpleTime");
NS_ABORT_IF_FALSE(aActiveTime >= 0, "Expecting non-negative active time");
MOZ_ASSERT(mSimpleDur.IsResolved(),
"Unresolved simple duration in ActiveTimeToSimpleTime");
MOZ_ASSERT(aActiveTime >= 0, "Expecting non-negative active time");
// Note that a negative aActiveTime will give us a negative value for
// aRepeatIteration, which is bad because aRepeatIteration is unsigned
@ -2001,8 +2001,8 @@ nsSMILInstanceTime*
nsSMILTimedElement::CheckForEarlyEnd(
const nsSMILTimeValue& aContainerTime) const
{
NS_ABORT_IF_FALSE(mCurrentInterval,
"Checking for an early end but the current interval is not set");
MOZ_ASSERT(mCurrentInterval,
"Checking for an early end but the current interval is not set");
if (mRestartMode != RESTART_ALWAYS)
return nullptr;
@ -2052,8 +2052,9 @@ nsSMILTimedElement::UpdateCurrentInterval(bool aForceChangeNotice)
// if we're not post active here then something other than
// UpdateCurrentInterval has updated the element state in between and all
// bets are off.
NS_ABORT_IF_FALSE(mElementState == STATE_POSTACTIVE,
"Expected to be in post-active state after performing double delete");
MOZ_ASSERT(mElementState == STATE_POSTACTIVE,
"Expected to be in post-active state after performing double "
"delete");
return;
}
@ -2064,8 +2065,8 @@ nsSMILTimedElement::UpdateCurrentInterval(bool aForceChangeNotice)
// it. In release builds, just bail out before we overflow the stack.
AutoRestore<uint8_t> depthRestorer(mUpdateIntervalRecursionDepth);
if (++mUpdateIntervalRecursionDepth > sMaxUpdateIntervalRecursionDepth) {
NS_ABORT_IF_FALSE(false,
"Update current interval recursion depth exceeded threshold");
MOZ_ASSERT(false,
"Update current interval recursion depth exceeded threshold");
return;
}
@ -2079,8 +2080,8 @@ nsSMILTimedElement::UpdateCurrentInterval(bool aForceChangeNotice)
if (mElementState == STATE_POSTACTIVE) {
NS_ABORT_IF_FALSE(!mCurrentInterval,
"In postactive state but the interval has been set");
MOZ_ASSERT(!mCurrentInterval,
"In postactive state but the interval has been set");
mCurrentInterval = new nsSMILInterval(updatedInterval);
mElementState = STATE_WAITING;
NotifyNewInterval();
@ -2152,12 +2153,13 @@ nsSMILTimedElement::SampleFillValue()
if (mElementState == STATE_WAITING || mElementState == STATE_POSTACTIVE) {
const nsSMILInterval* prevInterval = GetPreviousInterval();
NS_ABORT_IF_FALSE(prevInterval,
"Attempting to sample fill value but there is no previous interval");
NS_ABORT_IF_FALSE(prevInterval->End()->Time().IsDefinite() &&
prevInterval->End()->IsFixedTime(),
"Attempting to sample fill value but the endpoint of the previous "
"interval is not resolved and fixed");
MOZ_ASSERT(prevInterval,
"Attempting to sample fill value but there is no previous "
"interval");
MOZ_ASSERT(prevInterval->End()->Time().IsDefinite() &&
prevInterval->End()->IsFixedTime(),
"Attempting to sample fill value but the endpoint of the "
"previous interval is not resolved and fixed");
activeTime = prevInterval->End()->Time().GetMillis() -
prevInterval->Begin()->Time().GetMillis();
@ -2219,8 +2221,8 @@ nsSMILTimedElement::RegisterMilestone()
nsSMILTimeContainer* container = GetTimeContainer();
if (!container)
return;
NS_ABORT_IF_FALSE(mAnimationElement,
"Got a time container without an owning animation element");
MOZ_ASSERT(mAnimationElement,
"Got a time container without an owning animation element");
nsSMILMilestone nextMilestone;
if (!GetNextMilestone(nextMilestone))
@ -2265,8 +2267,8 @@ nsSMILTimedElement::GetNextMilestone(nsSMILMilestone& aNextMilestone) const
return true;
case STATE_WAITING:
NS_ABORT_IF_FALSE(mCurrentInterval,
"In waiting state but the current interval has not been set");
MOZ_ASSERT(mCurrentInterval,
"In waiting state but the current interval has not been set");
aNextMilestone.mIsEnd = false;
aNextMilestone.mTime = mCurrentInterval->Begin()->Time().GetMillis();
return true;
@ -2314,9 +2316,9 @@ nsSMILTimedElement::GetNextMilestone(nsSMILMilestone& aNextMilestone) const
void
nsSMILTimedElement::NotifyNewInterval()
{
NS_ABORT_IF_FALSE(mCurrentInterval,
"Attempting to notify dependents of a new interval but the interval "
"is not set");
MOZ_ASSERT(mCurrentInterval,
"Attempting to notify dependents of a new interval but the "
"interval is not set");
nsSMILTimeContainer* container = GetTimeContainer();
if (container) {
@ -2332,7 +2334,7 @@ nsSMILTimedElement::NotifyChangedInterval(nsSMILInterval* aInterval,
bool aBeginObjectChanged,
bool aEndObjectChanged)
{
NS_ABORT_IF_FALSE(aInterval, "Null interval for change notification");
MOZ_ASSERT(aInterval, "Null interval for change notification");
nsSMILTimeContainer* container = GetTimeContainer();
if (container) {
@ -2432,13 +2434,13 @@ nsSMILTimedElement::AreEndTimesDependentOn(
nsSMILTimedElement::NotifyNewIntervalCallback(TimeValueSpecPtrKey* aKey,
void* aData)
{
NS_ABORT_IF_FALSE(aKey, "Null hash key for time container hash table");
NS_ABORT_IF_FALSE(aKey->GetKey(),
"null nsSMILTimeValueSpec in set of time dependents");
MOZ_ASSERT(aKey, "Null hash key for time container hash table");
MOZ_ASSERT(aKey->GetKey(),
"null nsSMILTimeValueSpec in set of time dependents");
NotifyTimeDependentsParams* params =
static_cast<NotifyTimeDependentsParams*>(aData);
NS_ABORT_IF_FALSE(params, "null data ptr while enumerating hashtable");
MOZ_ASSERT(params, "null data ptr while enumerating hashtable");
nsSMILInterval* interval = params->mTimedElement->mCurrentInterval;
// It's possible that in notifying one new time dependent of a new interval
// that a chain reaction is triggered which results in the original interval

View File

@ -124,16 +124,17 @@ void
nsSMILValue::InitAndCheckPostcondition(const nsISMILType* aNewType)
{
aNewType->Init(*this);
NS_ABORT_IF_FALSE(mType == aNewType,
"Post-condition of Init failed. nsSMILValue is invalid");
MOZ_ASSERT(mType == aNewType,
"Post-condition of Init failed. nsSMILValue is invalid");
}
void
nsSMILValue::DestroyAndCheckPostcondition()
{
mType->Destroy(*this);
NS_ABORT_IF_FALSE(IsNull(), "Post-condition of Destroy failed. "
"nsSMILValue not null after destroying");
MOZ_ASSERT(IsNull(),
"Post-condition of Destroy failed. "
"nsSMILValue not null after destroying");
}
void

View File

@ -78,7 +78,7 @@ SpeakerManager::SetForcespeaker(bool aEnable)
void
SpeakerManager::DispatchSimpleEvent(const nsAString& aStr)
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread");
nsresult rv = CheckInnerWindowCorrectness();
if (NS_FAILED(rv)) {
return;

View File

@ -42,7 +42,7 @@ NS_IMETHODIMP_(MozExternalRefCountType) DOMStorageDBChild::Release(void)
void
DOMStorageDBChild::AddIPDLReference()
{
NS_ABORT_IF_FALSE(!mIPCOpen, "Attempting to retain multiple IPDL references");
MOZ_ASSERT(!mIPCOpen, "Attempting to retain multiple IPDL references");
mIPCOpen = true;
AddRef();
}
@ -50,7 +50,7 @@ DOMStorageDBChild::AddIPDLReference()
void
DOMStorageDBChild::ReleaseIPDLReference()
{
NS_ABORT_IF_FALSE(mIPCOpen, "Attempting to release non-existent IPDL reference");
MOZ_ASSERT(mIPCOpen, "Attempting to release non-existent IPDL reference");
mIPCOpen = false;
Release();
}
@ -275,7 +275,7 @@ NS_IMPL_RELEASE(DOMStorageDBParent)
void
DOMStorageDBParent::AddIPDLReference()
{
NS_ABORT_IF_FALSE(!mIPCOpen, "Attempting to retain multiple IPDL references");
MOZ_ASSERT(!mIPCOpen, "Attempting to retain multiple IPDL references");
mIPCOpen = true;
AddRef();
}
@ -283,7 +283,7 @@ DOMStorageDBParent::AddIPDLReference()
void
DOMStorageDBParent::ReleaseIPDLReference()
{
NS_ABORT_IF_FALSE(mIPCOpen, "Attempting to release non-existent IPDL reference");
MOZ_ASSERT(mIPCOpen, "Attempting to release non-existent IPDL reference");
mIPCOpen = false;
Release();
}

View File

@ -107,11 +107,12 @@ DOMSVGLength::DOMSVGLength(DOMSVGLengthList *aList,
, mVal(nullptr)
{
// These shifts are in sync with the members in the header.
NS_ABORT_IF_FALSE(aList &&
aAttrEnum < (1 << 4) &&
aListIndex <= MaxListIndex(), "bad arg");
MOZ_ASSERT(aList &&
aAttrEnum < (1 << 4) &&
aListIndex <= MaxListIndex(),
"bad arg");
NS_ABORT_IF_FALSE(IndexIsValid(), "Bad index for DOMSVGNumber!");
MOZ_ASSERT(IndexIsValid(), "Bad index for DOMSVGNumber!");
}
DOMSVGLength::DOMSVGLength()
@ -535,7 +536,7 @@ DOMSVGLength::InsertingIntoList(DOMSVGLengthList *aList,
mListIndex = aListIndex;
mIsAnimValItem = aIsAnimValItem;
NS_ABORT_IF_FALSE(IndexIsValid(), "Bad index for DOMSVGLength!");
MOZ_ASSERT(IndexIsValid(), "Bad index for DOMSVGLength!");
}
void

View File

@ -367,7 +367,7 @@ DOMSVGLengthList::GetItemAt(uint32_t aIndex)
void
DOMSVGLengthList::MaybeInsertNullInAnimValListAt(uint32_t aIndex)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
DOMSVGLengthList* animVal = mAList->mAnimVal;
@ -376,8 +376,8 @@ DOMSVGLengthList::MaybeInsertNullInAnimValListAt(uint32_t aIndex)
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
animVal->mItems.InsertElementAt(aIndex, static_cast<DOMSVGLength*>(nullptr));
@ -387,7 +387,7 @@ DOMSVGLengthList::MaybeInsertNullInAnimValListAt(uint32_t aIndex)
void
DOMSVGLengthList::MaybeRemoveItemFromAnimValListAt(uint32_t aIndex)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
// This needs to be a strong reference; otherwise, the RemovingFromList call
// below might drop the last reference to animVal before we're done with it.
@ -398,8 +398,8 @@ DOMSVGLengthList::MaybeRemoveItemFromAnimValListAt(uint32_t aIndex)
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
if (animVal->mItems[aIndex]) {
animVal->mItems[aIndex]->RemovingFromList();

View File

@ -81,9 +81,9 @@ public:
* hit OOM in which case our length will be zero.
*/
uint32_t LengthNoFlush() const {
NS_ABORT_IF_FALSE(mItems.Length() == 0 ||
mItems.Length() == InternalList().Length(),
"DOM wrapper's list length is out of sync");
MOZ_ASSERT(mItems.Length() == 0 ||
mItems.Length() == InternalList().Length(),
"DOM wrapper's list length is out of sync");
return mItems.Length();
}
@ -146,8 +146,8 @@ private:
/// Used to determine if this list is the baseVal or animVal list.
bool IsAnimValList() const {
NS_ABORT_IF_FALSE(this == mAList->mBaseVal || this == mAList->mAnimVal,
"Calling IsAnimValList() too early?!");
MOZ_ASSERT(this == mAList->mBaseVal || this == mAList->mAnimVal,
"Calling IsAnimValList() too early?!");
return this == mAList->mAnimVal;
}

View File

@ -93,11 +93,12 @@ DOMSVGNumber::DOMSVGNumber(DOMSVGNumberList *aList,
, mValue(0.0f)
{
// These shifts are in sync with the members in the header.
NS_ABORT_IF_FALSE(aList &&
aAttrEnum < (1 << 4) &&
aListIndex <= MaxListIndex(), "bad arg");
MOZ_ASSERT(aList &&
aAttrEnum < (1 << 4) &&
aListIndex <= MaxListIndex(),
"bad arg");
NS_ABORT_IF_FALSE(IndexIsValid(), "Bad index for DOMSVGNumber!");
MOZ_ASSERT(IndexIsValid(), "Bad index for DOMSVGNumber!");
}
DOMSVGNumber::DOMSVGNumber(nsISupports* aParent)
@ -180,7 +181,7 @@ DOMSVGNumber::InsertingIntoList(DOMSVGNumberList *aList,
mListIndex = aListIndex;
mIsAnimValItem = aIsAnimValItem;
NS_ABORT_IF_FALSE(IndexIsValid(), "Bad index for DOMSVGNumber!");
MOZ_ASSERT(IndexIsValid(), "Bad index for DOMSVGNumber!");
}
void

View File

@ -346,7 +346,7 @@ DOMSVGNumberList::GetItemAt(uint32_t aIndex)
void
DOMSVGNumberList::MaybeInsertNullInAnimValListAt(uint32_t aIndex)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
DOMSVGNumberList* animVal = mAList->mAnimVal;
@ -355,8 +355,8 @@ DOMSVGNumberList::MaybeInsertNullInAnimValListAt(uint32_t aIndex)
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
animVal->mItems.InsertElementAt(aIndex, static_cast<DOMSVGNumber*>(nullptr));
@ -366,7 +366,7 @@ DOMSVGNumberList::MaybeInsertNullInAnimValListAt(uint32_t aIndex)
void
DOMSVGNumberList::MaybeRemoveItemFromAnimValListAt(uint32_t aIndex)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
// This needs to be a strong reference; otherwise, the RemovingFromList call
// below might drop the last reference to animVal before we're done with it.
@ -377,8 +377,8 @@ DOMSVGNumberList::MaybeRemoveItemFromAnimValListAt(uint32_t aIndex)
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
if (animVal->mItems[aIndex]) {
animVal->mItems[aIndex]->RemovingFromList();

View File

@ -81,9 +81,9 @@ public:
* hit OOM in which case our length will be zero.
*/
uint32_t LengthNoFlush() const {
NS_ABORT_IF_FALSE(mItems.Length() == 0 ||
mItems.Length() == InternalList().Length(),
"DOM wrapper's list length is out of sync");
MOZ_ASSERT(mItems.Length() == 0 ||
mItems.Length() == InternalList().Length(),
"DOM wrapper's list length is out of sync");
return mItems.Length();
}
@ -139,8 +139,8 @@ private:
/// Used to determine if this list is the baseVal or animVal list.
bool IsAnimValList() const {
NS_ABORT_IF_FALSE(this == mAList->mBaseVal || this == mAList->mAnimVal,
"Calling IsAnimValList() too early?!");
MOZ_ASSERT(this == mAList->mBaseVal || this == mAList->mAnimVal,
"Calling IsAnimValList() too early?!");
return this == mAList->mAnimVal;
}

View File

@ -80,10 +80,9 @@ DOMSVGPathSeg::DOMSVGPathSeg(DOMSVGPathSegList *aList,
, mIsAnimValItem(aIsAnimValItem)
{
// These shifts are in sync with the members in the header.
NS_ABORT_IF_FALSE(aList &&
aListIndex <= MaxListIndex(), "bad arg");
MOZ_ASSERT(aList && aListIndex <= MaxListIndex(), "bad arg");
NS_ABORT_IF_FALSE(IndexIsValid(), "Bad index for DOMSVGPathSeg!");
MOZ_ASSERT(IndexIsValid(), "Bad index for DOMSVGPathSeg!");
}
DOMSVGPathSeg::DOMSVGPathSeg()
@ -98,13 +97,13 @@ DOMSVGPathSeg::InsertingIntoList(DOMSVGPathSegList *aList,
uint32_t aListIndex,
bool aIsAnimValItem)
{
NS_ABORT_IF_FALSE(!HasOwner(), "Inserting item that is already in a list");
MOZ_ASSERT(!HasOwner(), "Inserting item that is already in a list");
mList = aList;
mListIndex = aListIndex;
mIsAnimValItem = aIsAnimValItem;
NS_ABORT_IF_FALSE(IndexIsValid(), "Bad index for DOMSVGPathSeg!");
MOZ_ASSERT(IndexIsValid(), "Bad index for DOMSVGPathSeg!");
}
void
@ -120,7 +119,7 @@ DOMSVGPathSeg::RemovingFromList()
void
DOMSVGPathSeg::ToSVGPathSegEncodedData(float* aRaw)
{
NS_ABORT_IF_FALSE(aRaw, "null pointer");
MOZ_ASSERT(aRaw, "null pointer");
uint32_t argCount = SVGPathSegUtils::ArgCountForType(Type());
if (IsInList()) {
// 1 + argCount, because we're copying the encoded seg type and args

View File

@ -20,10 +20,10 @@ class nsSVGElement;
namespace mozilla {
#define CHECK_ARG_COUNT_IN_SYNC(segType) \
NS_ABORT_IF_FALSE(ArrayLength(mArgs) == \
SVGPathSegUtils::ArgCountForType(uint32_t(segType)) || \
uint32_t(segType) == PATHSEG_CLOSEPATH, \
"Arg count/array size out of sync")
MOZ_ASSERT(ArrayLength(mArgs) == \
SVGPathSegUtils::ArgCountForType(uint32_t(segType)) || \
uint32_t(segType) == PATHSEG_CLOSEPATH, \
"Arg count/array size out of sync")
#define IMPL_SVGPATHSEG_SUBCLASS_COMMON(segName, segType) \
explicit DOMSVGPathSeg##segName(const float *aArgs) \

View File

@ -190,9 +190,9 @@ DOMSVGPathSegList::InternalListWillChangeTo(const SVGPathData& aNewValue)
dataIndex += 1 + SVGPathSegUtils::ArgCountForType(newSegType);
}
NS_ABORT_IF_FALSE((index == length && dataIndex <= dataLength) ||
(index <= length && dataIndex == dataLength),
"very bad - list corruption?");
MOZ_ASSERT((index == length && dataIndex <= dataLength) ||
(index <= length && dataIndex == dataLength),
"very bad - list corruption?");
if (index < length) {
// aNewValue has fewer items than our previous internal counterpart
@ -232,8 +232,8 @@ DOMSVGPathSegList::InternalListWillChangeTo(const SVGPathData& aNewValue)
}
}
NS_ABORT_IF_FALSE(dataIndex == dataLength, "Serious processing error");
NS_ABORT_IF_FALSE(index == length, "Serious counting error");
MOZ_ASSERT(dataIndex == dataLength, "Serious processing error");
MOZ_ASSERT(index == length, "Serious counting error");
}
bool
@ -252,7 +252,7 @@ DOMSVGPathSegList::InternalList() const
SVGAnimatedPathSegList&
DOMSVGPathSegList::InternalAList() const
{
NS_ABORT_IF_FALSE(mElement->GetAnimPathSegList(), "Internal error");
MOZ_ASSERT(mElement->GetAnimPathSegList(), "Internal error");
return *mElement->GetAnimPathSegList();
}
@ -518,7 +518,7 @@ DOMSVGPathSegList::
uint32_t aInternalIndex,
uint32_t aArgCountForItem)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
if (AttrIsAnimating()) {
// animVal not a clone of baseVal
@ -533,8 +533,8 @@ DOMSVGPathSegList::
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
animVal->mItems.InsertElementAt(aIndex, ItemProxy(nullptr, aInternalIndex));
@ -546,7 +546,7 @@ DOMSVGPathSegList::
MaybeRemoveItemFromAnimValListAt(uint32_t aIndex,
int32_t aArgCountForItem)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
if (AttrIsAnimating()) {
// animVal not a clone of baseVal
@ -562,8 +562,8 @@ DOMSVGPathSegList::
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
if (animVal->ItemAt(aIndex)) {
animVal->ItemAt(aIndex)->RemovingFromList();

View File

@ -98,9 +98,9 @@ public:
* we've hit OOM, in which case our length will be zero.
*/
uint32_t LengthNoFlush() const {
NS_ABORT_IF_FALSE(mItems.Length() == 0 ||
mItems.Length() == InternalList().CountItems(),
"DOM wrapper's list length is out of sync");
MOZ_ASSERT(mItems.Length() == 0 ||
mItems.Length() == InternalList().CountItems(),
"DOM wrapper's list length is out of sync");
return mItems.Length();
}

View File

@ -57,10 +57,9 @@ public:
mIsAnimValItem = aIsAnimValItem;
// These shifts are in sync with the members.
NS_ABORT_IF_FALSE(aList &&
aListIndex <= MaxListIndex(), "bad arg");
MOZ_ASSERT(aList && aListIndex <= MaxListIndex(), "bad arg");
NS_ABORT_IF_FALSE(IndexIsValid(), "Bad index for DOMSVGPoint!");
MOZ_ASSERT(IndexIsValid(), "Bad index for DOMSVGPoint!");
}
explicit DOMSVGPoint(const DOMSVGPoint *aPt = nullptr)

View File

@ -194,7 +194,7 @@ DOMSVGPointList::InternalList() const
SVGAnimatedPointList&
DOMSVGPointList::InternalAList() const
{
NS_ABORT_IF_FALSE(mElement->GetAnimatedPointList(), "Internal error");
MOZ_ASSERT(mElement->GetAnimatedPointList(), "Internal error");
return *mElement->GetAnimatedPointList();
}
@ -414,7 +414,7 @@ DOMSVGPointList::GetItemAt(uint32_t aIndex)
void
DOMSVGPointList::MaybeInsertNullInAnimValListAt(uint32_t aIndex)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
if (AttrIsAnimating()) {
// animVal not a clone of baseVal
@ -429,8 +429,8 @@ DOMSVGPointList::MaybeInsertNullInAnimValListAt(uint32_t aIndex)
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
animVal->mItems.InsertElementAt(aIndex, static_cast<nsISVGPoint*>(nullptr));
@ -440,7 +440,7 @@ DOMSVGPointList::MaybeInsertNullInAnimValListAt(uint32_t aIndex)
void
DOMSVGPointList::MaybeRemoveItemFromAnimValListAt(uint32_t aIndex)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
if (AttrIsAnimating()) {
// animVal not a clone of baseVal
@ -456,8 +456,8 @@ DOMSVGPointList::MaybeRemoveItemFromAnimValListAt(uint32_t aIndex)
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
if (animVal->mItems[aIndex]) {
animVal->mItems[aIndex]->RemovingFromList();

View File

@ -100,9 +100,9 @@ public:
* we've hit OOM, in which case our length will be zero.
*/
uint32_t LengthNoFlush() const {
NS_ABORT_IF_FALSE(mItems.Length() == 0 ||
mItems.Length() == InternalList().Length(),
"DOM wrapper's list length is out of sync");
MOZ_ASSERT(mItems.Length() == 0 ||
mItems.Length() == InternalList().Length(),
"DOM wrapper's list length is out of sync");
return mItems.Length();
}

View File

@ -393,7 +393,7 @@ DOMSVGTransformList::GetItemAt(uint32_t aIndex)
void
DOMSVGTransformList::MaybeInsertNullInAnimValListAt(uint32_t aIndex)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
DOMSVGTransformList* animVal = mAList->mAnimVal;
@ -402,8 +402,8 @@ DOMSVGTransformList::MaybeInsertNullInAnimValListAt(uint32_t aIndex)
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
animVal->mItems.InsertElementAt(aIndex,
static_cast<SVGTransform*>(nullptr));
@ -414,7 +414,7 @@ DOMSVGTransformList::MaybeInsertNullInAnimValListAt(uint32_t aIndex)
void
DOMSVGTransformList::MaybeRemoveItemFromAnimValListAt(uint32_t aIndex)
{
NS_ABORT_IF_FALSE(!IsAnimValList(), "call from baseVal to animVal");
MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
// This needs to be a strong reference; otherwise, the RemovingFromList call
// below might drop the last reference to animVal before we're done with it.
@ -425,8 +425,8 @@ DOMSVGTransformList::MaybeRemoveItemFromAnimValListAt(uint32_t aIndex)
return;
}
NS_ABORT_IF_FALSE(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
"animVal list not in sync!");
if (animVal->mItems[aIndex]) {
animVal->mItems[aIndex]->RemovingFromList();

View File

@ -76,9 +76,8 @@ public:
* hit OOM in which case our length will be zero.
*/
uint32_t LengthNoFlush() const {
NS_ABORT_IF_FALSE(mItems.IsEmpty() ||
mItems.Length() == InternalList().Length(),
"DOM wrapper's list length is out of sync");
MOZ_ASSERT(mItems.IsEmpty() || mItems.Length() == InternalList().Length(),
"DOM wrapper's list length is out of sync");
return mItems.Length();
}
@ -135,8 +134,8 @@ private:
/// Used to determine if this list is the baseVal or animVal list.
bool IsAnimValList() const {
NS_ABORT_IF_FALSE(this == mAList->mBaseVal || this == mAList->mAnimVal,
"Calling IsAnimValList() too early?!");
MOZ_ASSERT(this == mAList->mBaseVal || this == mAList->mAnimVal,
"Calling IsAnimValList() too early?!");
return this == mAList->mAnimVal;
}

View File

@ -82,9 +82,9 @@ SVGAnimationElement::GetTargetElementContent()
if (HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)) {
return mHrefTarget.get();
}
NS_ABORT_IF_FALSE(!mHrefTarget.get(),
"We shouldn't have an xlink:href target "
"if we don't have an xlink:href attribute");
MOZ_ASSERT(!mHrefTarget.get(),
"We shouldn't have an xlink:href target "
"if we don't have an xlink:href attribute");
// No "xlink:href" attribute --> I should target my parent.
nsIContent* parent = GetFlattenedTreeParent();
@ -191,9 +191,8 @@ SVGAnimationElement::BindToTree(nsIDocument* aDocument,
nsIContent* aBindingParent,
bool aCompileEventHandlers)
{
NS_ABORT_IF_FALSE(!mHrefTarget.get(),
"Shouldn't have href-target yet "
"(or it should've been cleared)");
MOZ_ASSERT(!mHrefTarget.get(),
"Shouldn't have href-target yet (or it should've been cleared)");
nsresult rv = SVGAnimationElementBase::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
@ -314,8 +313,8 @@ SVGAnimationElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
mHrefTarget.Unlink();
AnimationTargetChanged();
} else if (IsInDoc()) {
NS_ABORT_IF_FALSE(aValue->Type() == nsAttrValue::eString,
"Expected href attribute to be string type");
MOZ_ASSERT(aValue->Type() == nsAttrValue::eString,
"Expected href attribute to be string type");
UpdateHrefTarget(this, aValue->GetStringValue());
} // else: we're not yet in a document -- we'll update the target on
// next BindToTree call.

View File

@ -56,8 +56,8 @@ SVGContentUtils::GetOuterSVGElement(nsSVGElement *aSVGElement)
void
SVGContentUtils::ActivateByHyperlink(nsIContent *aContent)
{
NS_ABORT_IF_FALSE(aContent->IsNodeOfType(nsINode::eANIMATION),
"Expecting an animation element");
MOZ_ASSERT(aContent->IsNodeOfType(nsINode::eANIMATION),
"Expecting an animation element");
static_cast<SVGAnimationElement*>(aContent)->ActivateByHyperlink();
}
@ -282,17 +282,17 @@ SVGContentUtils::GetFontSize(Element *aElement)
float
SVGContentUtils::GetFontSize(nsIFrame *aFrame)
{
NS_ABORT_IF_FALSE(aFrame, "NULL frame in GetFontSize");
MOZ_ASSERT(aFrame, "NULL frame in GetFontSize");
return GetFontSize(aFrame->StyleContext());
}
float
SVGContentUtils::GetFontSize(nsStyleContext *aStyleContext)
{
NS_ABORT_IF_FALSE(aStyleContext, "NULL style context in GetFontSize");
MOZ_ASSERT(aStyleContext, "NULL style context in GetFontSize");
nsPresContext *presContext = aStyleContext->PresContext();
NS_ABORT_IF_FALSE(presContext, "NULL pres context in GetFontSize");
MOZ_ASSERT(presContext, "NULL pres context in GetFontSize");
nscoord fontSize = aStyleContext->StyleFont()->mSize;
return nsPresContext::AppUnitsToFloatCSSPixels(fontSize) /
@ -320,17 +320,17 @@ SVGContentUtils::GetFontXHeight(Element *aElement)
float
SVGContentUtils::GetFontXHeight(nsIFrame *aFrame)
{
NS_ABORT_IF_FALSE(aFrame, "NULL frame in GetFontXHeight");
MOZ_ASSERT(aFrame, "NULL frame in GetFontXHeight");
return GetFontXHeight(aFrame->StyleContext());
}
float
SVGContentUtils::GetFontXHeight(nsStyleContext *aStyleContext)
{
NS_ABORT_IF_FALSE(aStyleContext, "NULL style context in GetFontXHeight");
MOZ_ASSERT(aStyleContext, "NULL style context in GetFontXHeight");
nsPresContext *presContext = aStyleContext->PresContext();
NS_ABORT_IF_FALSE(presContext, "NULL pres context in GetFontXHeight");
MOZ_ASSERT(presContext, "NULL pres context in GetFontXHeight");
nsRefPtr<nsFontMetrics> fontMetrics;
nsLayoutUtils::GetFontMetricsForStyleContext(aStyleContext,

View File

@ -334,7 +334,7 @@ SVGFEImageElement::Notify(imgIRequest* aRequest, int32_t aType, const nsIntRect*
// Request a decode
nsCOMPtr<imgIContainer> container;
aRequest->GetImage(getter_AddRefs(container));
NS_ABORT_IF_FALSE(container, "who sent the notification then?");
MOZ_ASSERT(container, "who sent the notification then?");
container->StartDecoding();
}

View File

@ -89,7 +89,7 @@ SVGForeignObjectElement::PrependLocalTransformsTo(const gfxMatrix &aMatrix,
if (aWhich == eChildToUserSpace) {
return toUserSpace * aMatrix;
}
NS_ABORT_IF_FALSE(aWhich == eAllTransforms, "Unknown TransformTypes");
MOZ_ASSERT(aWhich == eAllTransforms, "Unknown TransformTypes");
return toUserSpace * fromUserSpace;
}

View File

@ -238,8 +238,8 @@ bool
SVGFragmentIdentifier::ProcessFragmentIdentifier(nsIDocument* aDocument,
const nsAString& aAnchorName)
{
NS_ABORT_IF_FALSE(aDocument->GetRootElement()->IsSVG(nsGkAtoms::svg),
"expecting an SVG root element");
MOZ_ASSERT(aDocument->GetRootElement()->IsSVG(nsGkAtoms::svg),
"expecting an SVG root element");
dom::SVGSVGElement* rootElement =
static_cast<dom::SVGSVGElement*>(aDocument->GetRootElement());

View File

@ -78,7 +78,7 @@ SVGIFrameElement::PrependLocalTransformsTo(const gfxMatrix &aMatrix,
if (aWhich == eChildToUserSpace) {
return toUserSpace;
}
NS_ABORT_IF_FALSE(aWhich == eAllTransforms, "Unknown TransformTypes");
MOZ_ASSERT(aWhich == eAllTransforms, "Unknown TransformTypes");
return toUserSpace * fromUserSpace;
}

View File

@ -13,7 +13,7 @@ namespace mozilla {
void
SVGIntegerPairSMILType::Init(nsSMILValue& aValue) const
{
NS_ABORT_IF_FALSE(aValue.IsNull(), "Unexpected value type");
MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
aValue.mU.mIntPair[0] = 0;
aValue.mU.mIntPair[1] = 0;

View File

@ -77,8 +77,8 @@ IsAbsoluteUnit(uint8_t aUnit)
*/
inline static float GetAbsUnitsPerAbsUnit(uint8_t aUnits, uint8_t aPerUnit)
{
NS_ABORT_IF_FALSE(IsAbsoluteUnit(aUnits), "Not a CSS absolute unit");
NS_ABORT_IF_FALSE(IsAbsoluteUnit(aPerUnit), "Not a CSS absolute unit");
MOZ_ASSERT(IsAbsoluteUnit(aUnits), "Not a CSS absolute unit");
MOZ_ASSERT(IsAbsoluteUnit(aPerUnit), "Not a CSS absolute unit");
float CSSAbsoluteUnitConversionFactors[5][5] = { // columns: cm, mm, in, pt, pc
// cm per...:

View File

@ -110,14 +110,14 @@ private:
}
void ReplaceItem(uint32_t aIndex, const SVGLength &aLength) {
NS_ABORT_IF_FALSE(aIndex < mLengths.Length(),
"DOM wrapper caller should have raised INDEX_SIZE_ERR");
MOZ_ASSERT(aIndex < mLengths.Length(),
"DOM wrapper caller should have raised INDEX_SIZE_ERR");
mLengths[aIndex] = aLength;
}
void RemoveItem(uint32_t aIndex) {
NS_ABORT_IF_FALSE(aIndex < mLengths.Length(),
"DOM wrapper caller should have raised INDEX_SIZE_ERR");
MOZ_ASSERT(aIndex < mLengths.Length(),
"DOM wrapper caller should have raised INDEX_SIZE_ERR");
mLengths.RemoveElementAt(aIndex);
}
@ -203,14 +203,14 @@ public:
*/
bool IsIdentity() const {
if (!mElement) {
NS_ABORT_IF_FALSE(IsEmpty(), "target element propagation failure");
MOZ_ASSERT(IsEmpty(), "target element propagation failure");
return true;
}
return false;
}
uint8_t Axis() const {
NS_ABORT_IF_FALSE(mElement, "Axis() isn't valid");
MOZ_ASSERT(mElement, "Axis() isn't valid");
return mAxis;
}

Some files were not shown because too many files have changed in this diff Show More