Bug 1406308 - MOZ_RELEASE_ASSERT on nsHtml5StreamParser::mStreamState. r?smaug draft
authorHenri Sivonen <hsivonen@hsivonen.fi>
Fri, 06 Oct 2017 10:42:21 +0300
changeset 675914 4c6b21057f1f1d00d2a4f3c98287614e8f9d4ca0
parent 675867 8aeb7ae27188ede07f58d08a98355ac80f5be0b2
child 734763 ba7afbd19f0abb5aafee620d0b111a8eb849c7f7
push id83300
push userbmo:hsivonen@hsivonen.fi
push dateFri, 06 Oct 2017 07:43:07 +0000
reviewerssmaug
bugs1406308
milestone58.0a1
Bug 1406308 - MOZ_RELEASE_ASSERT on nsHtml5StreamParser::mStreamState. r?smaug MozReview-Commit-ID: 8F7kJ7KKYEI
parser/html/nsHtml5StreamParser.cpp
--- a/parser/html/nsHtml5StreamParser.cpp
+++ b/parser/html/nsHtml5StreamParser.cpp
@@ -884,18 +884,18 @@ public:
   }
 
   nsCOMPtr<nsIDocShell> mDocShell;
 };
 
 nsresult
 nsHtml5StreamParser::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
 {
-  NS_PRECONDITION(STREAM_NOT_STARTED == mStreamState,
-                  "Got OnStartRequest when the stream had already started.");
+  MOZ_RELEASE_ASSERT(STREAM_NOT_STARTED == mStreamState,
+                     "Got OnStartRequest when the stream had already started.");
   NS_PRECONDITION(
     !mExecutor->HasStarted(),
     "Got OnStartRequest at the wrong stage in the executor life cycle.");
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
   if (mObserver) {
     mObserver->OnStartRequest(aRequest, aContext);
   }
   mRequest = aRequest;
@@ -1049,18 +1049,18 @@ nsHtml5StreamParser::CheckListenerChain(
   }
   return rv;
 }
 
 void
 nsHtml5StreamParser::DoStopRequest()
 {
   NS_ASSERTION(IsParserThread(), "Wrong thread!");
-  NS_PRECONDITION(STREAM_BEING_READ == mStreamState,
-                  "Stream ended without being open.");
+  MOZ_RELEASE_ASSERT(STREAM_BEING_READ == mStreamState,
+                     "Stream ended without being open.");
   mTokenizerMutex.AssertCurrentThreadOwns();
 
   if (IsTerminated()) {
     return;
   }
 
   mStreamState = STREAM_ENDED;
 
@@ -1153,18 +1153,18 @@ nsHtml5StreamParser::OnStopRequest(nsIRe
   }
   return NS_OK;
 }
 
 void
 nsHtml5StreamParser::DoDataAvailable(const uint8_t* aBuffer, uint32_t aLength)
 {
   NS_ASSERTION(IsParserThread(), "Wrong thread!");
-  NS_PRECONDITION(STREAM_BEING_READ == mStreamState,
-                  "DoDataAvailable called when stream not open.");
+  MOZ_RELEASE_ASSERT(STREAM_BEING_READ == mStreamState,
+                     "DoDataAvailable called when stream not open.");
   mTokenizerMutex.AssertCurrentThreadOwns();
 
   if (IsTerminated()) {
     return;
   }
 
   uint32_t writeCount;
   nsresult rv;