Bug 1018486 - Part 6: Changes in parser/, r=peterv, r=hsivonen

MozReview-Commit-ID: EN2yZUn8xj
This commit is contained in:
Michael Layzell
2016-07-18 12:42:35 -04:00
parent 829f88a6df
commit 26360a95c9
3 changed files with 31 additions and 28 deletions

View File

@@ -350,7 +350,7 @@ nsHtml5TreeOpExecutor::RunFlushLoop()
nsHtml5FlushLoopGuard guard(this); // this is also the self-kungfu!
nsCOMPtr<nsISupports> parserKungFuDeathGrip(mParser);
RefPtr<nsParserBase> parserKungFuDeathGrip(mParser);
// Remember the entry time
(void) nsContentSink::WillParseImpl();
@@ -366,7 +366,7 @@ nsHtml5TreeOpExecutor::RunFlushLoop()
return;
}
if (!mParser->IsParserEnabled()) {
if (!parserKungFuDeathGrip->IsParserEnabled()) {
// The parser is blocked.
return;
}
@@ -413,6 +413,7 @@ nsHtml5TreeOpExecutor::RunFlushLoop()
// gripped before calling ParseUntilBlocked();
RefPtr<nsHtml5StreamParser> streamKungFuDeathGrip =
GetParser()->GetStreamParser();
mozilla::Unused << streamKungFuDeathGrip; // Not used within function
// Now parse content left in the document.write() buffer queue if any.
// This may generate tree ops on its own or dequeue a speculation.
nsresult rv = GetParser()->ParseUntilBlocked();
@@ -527,6 +528,7 @@ nsHtml5TreeOpExecutor::FlushDocumentWrite()
// avoid crashing near EOF
RefPtr<nsHtml5TreeOpExecutor> kungFuDeathGrip(this);
RefPtr<nsParserBase> parserKungFuDeathGrip(mParser);
mozilla::Unused << parserKungFuDeathGrip; // Intentionally not used within function
NS_ASSERTION(!mReadingFromStage,
"Got doc write flush when reading from stage");