Bug 990764 - Replace MOZ_ASSUME_UNREACHABLE in content. r=smaug
authorChris Peterson <cpeterson@mozilla.com>
Sun, 20 Apr 2014 22:00:33 -0700
changeset 182300 335bd3cd08025f412bf4f26ab43a5bb74e8f0755
parent 182299 5153021485badc4e0cadb12b3835439cf0352b8a
child 182301 db13bb9473cc40c42900c1d0afd841fe6ea378e2
push id43256
push usercpeterson@mozilla.com
push dateFri, 09 May 2014 05:49:28 +0000
treeherdermozilla-inbound@c648f9211172 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs990764
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 990764 - Replace MOZ_ASSUME_UNREACHABLE in content. r=smaug
content/canvas/src/CanvasRenderingContext2D.cpp
content/html/content/src/HTMLFormControlsCollection.cpp
content/html/document/src/nsHTMLContentSink.cpp
--- a/content/canvas/src/CanvasRenderingContext2D.cpp
+++ b/content/canvas/src/CanvasRenderingContext2D.cpp
@@ -1385,17 +1385,17 @@ CanvasRenderingContext2D::SetStyleFromUn
     return;
   }
 
   if (value.IsCanvasPattern()) {
     SetStyleFromPattern(value.GetAsCanvasPattern(), whichStyle);
     return;
   }
 
-  MOZ_ASSUME_UNREACHABLE("Invalid union value");
+  MOZ_ASSERT_UNREACHABLE("Invalid union value");
 }
 
 void
 CanvasRenderingContext2D::SetFillRule(const nsAString& aString)
 {
   FillRule rule;
 
   if (aString.EqualsLiteral("evenodd"))
--- a/content/html/content/src/HTMLFormControlsCollection.cpp
+++ b/content/html/content/src/HTMLFormControlsCollection.cpp
@@ -356,17 +356,18 @@ HTMLFormControlsCollection::GetFirstName
   const OwningNodeListOrElement& result = maybeResult.Value();
   if (result.IsElement()) {
     return result.GetAsElement().get();
   }
   if (result.IsNodeList()) {
     nsINodeList& nodelist = result.GetAsNodeList();
     return nodelist.Item(0)->AsElement();
   }
-  MOZ_ASSUME_UNREACHABLE("Should only have Elements and NodeLists here.");
+  MOZ_ASSERT_UNREACHABLE("Should only have Elements and NodeLists here.");
+  return nullptr;
 }
 
 void
 HTMLFormControlsCollection::NamedGetter(const nsAString& aName,
                                         bool& aFound,
                                         Nullable<OwningNodeListOrElement>& aResult)
 {
   nsISupports* item = NamedItemInternal(aName, true);
@@ -378,17 +379,17 @@ HTMLFormControlsCollection::NamedGetter(
   if (nsCOMPtr<Element> element = do_QueryInterface(item)) {
     aResult.SetValue().SetAsElement() = element;
     return;
   }
   if (nsCOMPtr<nsINodeList> nodelist = do_QueryInterface(item)) {
     aResult.SetValue().SetAsNodeList() = nodelist;
     return;
   }
-  MOZ_ASSERT(false, "Should only have Elements and NodeLists here.");
+  MOZ_ASSERT_UNREACHABLE("Should only have Elements and NodeLists here.");
 }
 
 static PLDHashOperator
 CollectNames(const nsAString& aName,
              nsISupports* /* unused */,
              void* aClosure)
 {
   static_cast<nsTArray<nsString>*>(aClosure)->AppendElement(aName);
--- a/content/html/document/src/nsHTMLContentSink.cpp
+++ b/content/html/document/src/nsHTMLContentSink.cpp
@@ -1141,17 +1141,17 @@ HTMLContentSink::FlushTags()
   }
   
   return mCurrentContext ? mCurrentContext->FlushTags() : NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLContentSink::SetDocumentCharset(nsACString& aCharset)
 {
-  MOZ_ASSUME_UNREACHABLE("<meta charset> case doesn't occur with about:blank");
+  MOZ_ASSERT_UNREACHABLE("<meta charset> case doesn't occur with about:blank");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsISupports *
 HTMLContentSink::GetTarget()
 {
   return mDocument;
 }