Commit 07441f53 authored by Richard Townsend's avatar Richard Townsend Committed by Commit Bot

fix: relax crashing DCHECK in HTMLDocumentParser

Removes an unnecessary state-assertion DCHECK. The consequences of
doing this are relatively small (since PumpTokenizer checks
IsStopped() anyway).

Bug: 901056, 1112544
Change-Id: Ie59b6d3ba34afc0de63aa3780e6ee889f8f93c81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2366893Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Commit-Queue: Richard Townsend <richard.townsend@arm.com>
Cr-Commit-Position: refs/heads/master@{#800688}
parent cd0b413e
...@@ -448,15 +448,14 @@ void HTMLDocumentParser::DeferredPumpTokenizerIfPossible() { ...@@ -448,15 +448,14 @@ void HTMLDocumentParser::DeferredPumpTokenizerIfPossible() {
// and the parser should not be stopped, but sometimes a script completes // and the parser should not be stopped, but sometimes a script completes
// loading (so we schedule a pump) but the Document is stopped in the meantime // loading (so we schedule a pump) but the Document is stopped in the meantime
// (e.g. fast/parser/iframe-onload-document-close-with-external-script.html). // (e.g. fast/parser/iframe-onload-document-close-with-external-script.html).
DCHECK(task_runner_state_->GetState() ==
HTMLDocumentParserState::DeferredParserState::kNotScheduled ||
!IsStopped());
DCHECK(task_runner_state_->GetState() == DCHECK(task_runner_state_->GetState() ==
HTMLDocumentParserState::DeferredParserState::kNotScheduled || HTMLDocumentParserState::DeferredParserState::kNotScheduled ||
!IsDetached()); !IsDetached());
TRACE_EVENT2("blink", "HTMLDocumentParser::DeferredPumpTokenizerIfPossible", TRACE_EVENT2("blink", "HTMLDocumentParser::DeferredPumpTokenizerIfPossible",
"parser", (void*)this, "state", "parser", (void*)this, "state",
task_runner_state_->GetStateAsString()); task_runner_state_->GetStateAsString());
if (IsStopped())
return;
if (task_runner_state_->IsScheduled()) { if (task_runner_state_->IsScheduled()) {
HTMLDocumentParser::PumpTokenizerIfPossible(); HTMLDocumentParser::PumpTokenizerIfPossible();
} else if (task_runner_state_->IsScheduledToDelayEnd()) { } else if (task_runner_state_->IsScheduledToDelayEnd()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment