Bug 1406308 - MOZ_RELEASE_ASSERT on nsHtml5StreamParser::mStreamState. r?smaug
MozReview-Commit-ID: 8F7kJ7KKYEI
--- 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;