Bug 782602 - Use NS_FAILED instead of boolean test (parser/html/); r=hsivonen

This commit is contained in:
Aryeh Gregor
2012-08-14 12:10:41 +03:00
parent 5b01f29a20
commit 72c6ba883e
3 changed files with 5 additions and 5 deletions

View File

@@ -587,7 +587,7 @@ nsHtml5Parser::IsScriptCreated()
void void
nsHtml5Parser::ParseUntilBlocked() nsHtml5Parser::ParseUntilBlocked()
{ {
if (mBlocked || mExecutor->IsComplete() || mExecutor->IsBroken()) { if (mBlocked || mExecutor->IsComplete() || NS_FAILED(mExecutor->IsBroken())) {
return; return;
} }
NS_ASSERTION(mExecutor->HasStarted(), "Bad life cycle."); NS_ASSERTION(mExecutor->HasStarted(), "Bad life cycle.");

View File

@@ -1412,7 +1412,7 @@ nsHtml5StreamParser::ContinueAfterScripts(nsHtml5Tokenizer* aTokenizer,
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
NS_ASSERTION(!(mMode == VIEW_SOURCE_HTML || mMode == VIEW_SOURCE_XML), NS_ASSERTION(!(mMode == VIEW_SOURCE_HTML || mMode == VIEW_SOURCE_XML),
"ContinueAfterScripts called in view source mode!"); "ContinueAfterScripts called in view source mode!");
if (mExecutor->IsBroken()) { if (NS_FAILED(mExecutor->IsBroken())) {
return; return;
} }
#ifdef DEBUG #ifdef DEBUG

View File

@@ -146,7 +146,7 @@ nsHtml5TreeOpExecutor::DidBuildModel(bool aTerminated)
// This comes from nsXMLContentSink and nsHTMLContentSink // This comes from nsXMLContentSink and nsHTMLContentSink
// If this parser has been marked as broken, treat the end of parse as // If this parser has been marked as broken, treat the end of parse as
// forced termination. // forced termination.
DidBuildModelImpl(aTerminated || IsBroken()); DidBuildModelImpl(aTerminated || NS_FAILED(IsBroken()));
if (!mLayoutStarted) { if (!mLayoutStarted) {
// We never saw the body, and layout never got started. Force // We never saw the body, and layout never got started. Force
@@ -480,7 +480,7 @@ nsHtml5TreeOpExecutor::RunFlushLoop()
return; return;
} }
if (IsBroken()) { if (NS_FAILED(IsBroken())) {
return; return;
} }
@@ -936,7 +936,7 @@ nsHtml5TreeOpExecutor::Reset()
mFlushState = eNotFlushing; mFlushState = eNotFlushing;
mRunFlushLoopOnStack = false; mRunFlushLoopOnStack = false;
MOZ_ASSERT(!mReadingFromStage); MOZ_ASSERT(!mReadingFromStage);
MOZ_ASSERT(!mBroken); MOZ_ASSERT(NS_SUCCEEDED(mBroken));
} }
void void