Commit 242708cf authored by Nicholas Nethercote's avatar Nicholas Nethercote
Browse files

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

--HG--
extra : rebase_source : 488e401ff87e31a2074c4108c4df0572d9536667
parent 4482d226
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@ nsChromeRegistryContent::RegisterRemoteChrome(
    const nsACString& aLocale,
    const nsACString& aLocale,
    bool aReset)
    bool aReset)
{
{
  NS_ABORT_IF_FALSE(aReset || mLocale.IsEmpty(),
  MOZ_ASSERT(aReset || mLocale.IsEmpty(),
             "RegisterChrome twice?");
             "RegisterChrome twice?");


  if (aReset) {
  if (aReset) {
+2 −2
Original line number Original line Diff line number Diff line
@@ -27,7 +27,7 @@ ComputedTimingFunction::Init(const nsTimingFunction &aFunction)
static inline double
static inline double
StepEnd(uint32_t aSteps, double aPortion)
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
  uint32_t step = uint32_t(aPortion * aSteps); // floor
  return double(step) / double(aSteps);
  return double(step) / double(aSteps);
}
}
@@ -47,7 +47,7 @@ ComputedTimingFunction::GetValue(double aPortion) const
      // really meant it.
      // really meant it.
      return 1.0 - StepEnd(mSteps, 1.0 - aPortion);
      return 1.0 - StepEnd(mSteps, 1.0 - aPortion);
    default:
    default:
      NS_ABORT_IF_FALSE(false, "bad type");
      MOZ_ASSERT(false, "bad type");
      // fall through
      // fall through
    case nsTimingFunction::StepEnd:
    case nsTimingFunction::StepEnd:
      return StepEnd(mSteps, aPortion);
      return StepEnd(mSteps, aPortion);
+1 −1
Original line number Original line Diff line number Diff line
@@ -42,7 +42,7 @@ private: //data
NS_IMETHODIMP
NS_IMETHODIMP
ArchiveRequestEvent::Run()
ArchiveRequestEvent::Run()
{
{
  NS_ABORT_IF_FALSE(mRequest, "the request is not longer valid");
  MOZ_ASSERT(mRequest, "the request is not longer valid");
  mRequest->Run();
  mRequest->Run();
  return NS_OK;
  return NS_OK;
}
}
+3 −3
Original line number Original line Diff line number Diff line
@@ -48,8 +48,8 @@ Attr::Attr(nsDOMAttributeMap *aAttrMap,
           const nsAString  &aValue, bool aNsAware)
           const nsAString  &aValue, bool aNsAware)
  : nsIAttribute(aAttrMap, aNodeInfo, aNsAware), mValue(aValue)
  : nsIAttribute(aAttrMap, aNodeInfo, aNsAware), mValue(aValue)
{
{
  NS_ABORT_IF_FALSE(mNodeInfo, "We must get a nodeinfo here!");
  MOZ_ASSERT(mNodeInfo, "We must get a nodeinfo here!");
  NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::ATTRIBUTE_NODE,
  MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::ATTRIBUTE_NODE,
             "Wrong nodeType");
             "Wrong nodeType");


  // We don't add a reference to our content. It will tell us
  // We don't add a reference to our content. It will tell us
+2 −2
Original line number Original line Diff line number Diff line
@@ -19,7 +19,7 @@ class Comment MOZ_FINAL : public nsGenericDOMDataNode,
private:
private:
  void Init()
  void Init()
  {
  {
    NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE,
    MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE,
               "Bad NodeType in aNodeInfo");
               "Bad NodeType in aNodeInfo");
  }
  }


Loading