Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Issue 644573002: Disable async main thread HTML parsing (Closed)

Created:
6 years, 2 months ago by kouhei (in TOK)
Modified:
6 years, 2 months ago
Reviewers:
haraken, eseidel
CC:
blink-reviews, dglazkov+blink, blink-reviews-html_chromium.org, adamk
Project:
blink
Visibility:
Public.

Description

Disable 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -29 lines) Patch
M Source/core/html/parser/HTMLDocumentParser.cpp View 1 2 6 chunks +10 lines, -18 lines 0 comments Download
M Source/core/html/parser/HTMLParserOptions.cpp View 1 chunk +1 line, -9 lines 0 comments Download
M Source/web/tests/FrameTestHelpers.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/web/tests/FrameTestHelpers.cpp View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
M Source/web/tests/WebFrameTest.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
kouhei (in TOK)
Would you take a look? I will create follow-up CLs for removing the codes disabled ...
6 years, 2 months ago (2014-10-09 02:18:11 UTC) #3
eseidel
lgtm Do you plan to remove useThreading in a follow-up?
6 years, 2 months ago (2014-10-09 16:29:37 UTC) #4
eseidel
Actually, can you test your document.write change? document.write is extremely tricky and it's best to ...
6 years, 2 months ago (2014-10-09 16:30:23 UTC) #5
kouhei (in TOK)
> Do you plan to remove useThreading in a follow-up? Yes. :) After this lands, ...
6 years, 2 months ago (2014-10-10 07:46:08 UTC) #6
kouhei (in TOK)
This patch exposed a loader bug. The layout test failures are fixed in separate CL: ...
6 years, 2 months ago (2014-10-10 07:47:45 UTC) #7
kouhei (in TOK)
On 2014/10/10 07:47:45, kouhei wrote: > This patch exposed a loader bug. The layout test ...
6 years, 2 months ago (2014-10-11 07:34:38 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/644573002/40001
6 years, 2 months ago (2014-10-11 07:35:09 UTC) #10
commit-bot: I haz the power
6 years, 2 months ago (2014-10-11 07:38:47 UTC) #11
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as 183572

Powered by Google App Engine
This is Rietveld 408576698