DescriptionDisable async main thread HTML parsing
This CL depends on CL: https://codereview.chromium.org/646913002/
This CL disables async main thread HTML parsing code path by:
- forcing HTMLParserOptions::useThreading to be true
- making all pumpTokenizer calls ForceSynchronous
HTMLDocumentParser has three parsing modes:
- Synchronous main thread parsing
- Asynchronous main thread parsing
- Asynchronous background thread parsing
Asynchronous main thread parsing is a historic feature before
asynchronous background parsing. Now all use cases that required
asynchronous main thread parsing are gone, we can disable
the code path so that we only have two parsing modes.
The HTMLParserOptions::useThreading had comment about where the
flag was used to force synchronous parsing behavior, but it is
obsolete as of now:
- The about:blank url itself does not use HTMLDocumentParser.
- javascript: urls use about:blank url, but synchronous behavior
is not controlled by this useThreading flag, but call to
pinToMainThread from DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL.
- core/inspector/DOMPatchSupport also explicitly call
pinToMainThread to force synchronous parsing.
This CL also removes the last asynchronous main thread parsing
case where:
- document.write caused recursive document.write via script, and
- the suspended document.write was resumed asynchronously.
However I think this behavior was a bug, as the suspended
document.write should have resumed synchronously.
To fix this, HTMLDocumentParser::resumeParsingAfterScriptExecution
is changed to resume parsing synchronously when background thread
doesn't exist.
This codepath is tested on fast/loader/external-script-URL-location.html
TEST=fast/loader/external-script-URL-location.html
BUG=421289
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=183572
Patch Set 1 #Patch Set 2 : stricter assers #Patch Set 3 : WebFrameTest should wait for background thread tasks #
Messages
Total messages: 11 (3 generated)
|