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

Issue 521363002: Make XHR use the background HTML parser (Closed)

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

Description

Make XHR use background HTML parser This patch enables background html parser for documents with no frames, which are XMLHttpRequest response documents. HTML imports and inspector/DOMPatchSupport will still to use the synchronous mode as the current code expect the change to happen synchronously. Before this change, XMLHttpRequest immediately set its state to DONE after receiving the last data. After this change, XMLHttpRequest will wait for |Document::finishedParsing| before changing its state to DONE if it has responseType == "document". This is needed because |DocumentParser::finish()| do not synchronously give the complete document, but we have to wait until all tokens from the background parser is processed. BUG=409461 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181684

Patch Set 1 #

Patch Set 2 : document parse finishes asyncronously after DocumentParser::finish #

Patch Set 3 : rebased against 521403002 #

Patch Set 4 : remove 521403002 changes from diff #

Total comments: 4

Patch Set 5 : address tyoshino-san review / more comments #

Total comments: 6

Patch Set 6 : register before finish #

Total comments: 4

Patch Set 7 : Use DocumentParserClient #

Patch Set 8 : fix clean up code #

Patch Set 9 : fix LayoutTests? #

Patch Set 10 : give up on html imports for now #

Patch Set 11 : fix compile #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -18 lines) Patch
M Source/core/html/parser/HTMLDocumentParser.cpp View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -2 lines 0 comments Download
M Source/core/html/parser/HTMLParserOptions.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -6 lines 0 comments Download
M Source/core/inspector/DOMPatchSupport.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 1 comment Download
M Source/core/xml/XMLHttpRequest.h View 1 2 3 4 5 6 4 chunks +8 lines, -0 lines 0 comments Download
M Source/core/xml/XMLHttpRequest.cpp View 1 2 3 4 5 6 7 8 5 chunks +43 lines, -10 lines 6 comments Download

Messages

Total messages: 19 (2 generated)
kouhei (in TOK)
Would you take a look? This CL depends on https://codereview.chromium.org/521403002/ so please take a look ...
6 years, 3 months ago (2014-09-01 03:56:09 UTC) #2
tyoshino (SeeGerritForStatus)
wrap the description to 80 col? https://codereview.chromium.org/521363002/diff/60001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/521363002/diff/60001/Source/core/xml/XMLHttpRequest.cpp#newcode260 Source/core/xml/XMLHttpRequest.cpp:260: if (!m_responseDocument->wellFormed()) { ...
6 years, 3 months ago (2014-09-01 05:28:03 UTC) #3
kouhei (in TOK)
PTAL. https://codereview.chromium.org/521363002/diff/60001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/521363002/diff/60001/Source/core/xml/XMLHttpRequest.cpp#newcode260 Source/core/xml/XMLHttpRequest.cpp:260: if (!m_responseDocument->wellFormed()) { On 2014/09/01 05:28:02, tyoshino wrote: ...
6 years, 3 months ago (2014-09-01 20:44:28 UTC) #4
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/521363002/diff/80001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/521363002/diff/80001/Source/core/xml/XMLHttpRequest.cpp#newcode952 Source/core/xml/XMLHttpRequest.cpp:952: } I recommend that we place this close to ...
6 years, 3 months ago (2014-09-02 04:12:16 UTC) #5
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/521363002/diff/80001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/521363002/diff/80001/Source/core/xml/XMLHttpRequest.cpp#newcode1308 Source/core/xml/XMLHttpRequest.cpp:1308: m_responseDocumentParser->finish(); We are never notified of completion synchronously? If ...
6 years, 3 months ago (2014-09-02 04:19:19 UTC) #6
kouhei (in TOK)
https://codereview.chromium.org/521363002/diff/80001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/521363002/diff/80001/Source/core/xml/XMLHttpRequest.cpp#newcode952 Source/core/xml/XMLHttpRequest.cpp:952: } On 2014/09/02 04:12:16, tyoshino wrote: > I recommend ...
6 years, 3 months ago (2014-09-02 16:17:27 UTC) #7
abarth-chromium
https://codereview.chromium.org/521363002/diff/100001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/521363002/diff/100001/Source/core/dom/Document.cpp#newcode4699 Source/core/dom/Document.cpp:4699: xhr->didFinishParsingDocument(); Can we make this into a generic client ...
6 years, 3 months ago (2014-09-02 20:13:19 UTC) #8
kouhei (in TOK)
https://codereview.chromium.org/521363002/diff/100001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/521363002/diff/100001/Source/core/dom/Document.cpp#newcode4699 Source/core/dom/Document.cpp:4699: xhr->didFinishParsingDocument(); On 2014/09/02 20:13:19, abarth wrote: > Can we ...
6 years, 3 months ago (2014-09-03 03:23:51 UTC) #9
kouhei (in TOK)
Would you take another look? https://codereview.chromium.org/521363002/diff/100001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/521363002/diff/100001/Source/core/dom/Document.cpp#newcode4699 Source/core/dom/Document.cpp:4699: xhr->didFinishParsingDocument(); On 2014/09/03 03:23:50, ...
6 years, 3 months ago (2014-09-09 22:14:41 UTC) #10
eseidel
lgtm https://codereview.chromium.org/521363002/diff/200001/Source/core/inspector/DOMPatchSupport.cpp File Source/core/inspector/DOMPatchSupport.cpp (right): https://codereview.chromium.org/521363002/diff/200001/Source/core/inspector/DOMPatchSupport.cpp#newcode100 Source/core/inspector/DOMPatchSupport.cpp:100: parser->pinToMainThread(); This shouldn't be necessary with insert(), but ...
6 years, 3 months ago (2014-09-09 22:18:20 UTC) #11
kouhei (in TOK)
On 2014/09/09 22:18:20, eseidel wrote: > lgtm > > https://codereview.chromium.org/521363002/diff/200001/Source/core/inspector/DOMPatchSupport.cpp > File Source/core/inspector/DOMPatchSupport.cpp (right): > ...
6 years, 3 months ago (2014-09-09 22:25:31 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kouhei@chromium.org/521363002/200001
6 years, 3 months ago (2014-09-09 22:30:00 UTC) #14
commit-bot: I haz the power
Committed patchset #11 (id:200001) as 181684
6 years, 3 months ago (2014-09-09 22:46:12 UTC) #15
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/521363002/diff/200001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/521363002/diff/200001/Source/core/xml/XMLHttpRequest.cpp#newcode930 Source/core/xml/XMLHttpRequest.cpp:930: if (m_responseDocumentParser && !m_responseDocumentParser->isStopped()) how about calling m_responseDocumentParser->removeClient(this); here? ...
6 years, 3 months ago (2014-09-10 06:46:37 UTC) #16
kouhei (in TOK)
https://codereview.chromium.org/521363002/diff/200001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/521363002/diff/200001/Source/core/xml/XMLHttpRequest.cpp#newcode930 Source/core/xml/XMLHttpRequest.cpp:930: if (m_responseDocumentParser && !m_responseDocumentParser->isStopped()) On 2014/09/10 06:46:36, tyoshino wrote: ...
6 years, 3 months ago (2014-09-10 20:50:42 UTC) #17
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/521363002/diff/200001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/521363002/diff/200001/Source/core/xml/XMLHttpRequest.cpp#newcode930 Source/core/xml/XMLHttpRequest.cpp:930: if (m_responseDocumentParser && !m_responseDocumentParser->isStopped()) On 2014/09/10 20:50:42, kouhei wrote: ...
6 years, 3 months ago (2014-09-11 02:58:00 UTC) #18
tyoshino (SeeGerritForStatus)
6 years, 3 months ago (2014-09-11 03:41:32 UTC) #19
Message was sent while issue was closed.
https://codereview.chromium.org/521363002/diff/200001/Source/core/xml/XMLHttp...
File Source/core/xml/XMLHttpRequest.cpp (right):

https://codereview.chromium.org/521363002/diff/200001/Source/core/xml/XMLHttp...
Source/core/xml/XMLHttpRequest.cpp:1048: 
On 2014/09/10 20:50:42, kouhei wrote:
> On 2014/09/10 06:46:36, tyoshino wrote:
> > if the loader is cancelled by someone else than the client, we reach here.
> we're
> > currently not calling internalAbort(). So, we clears m_responseDocument but
> not
> > m_responseDocumentParser until open() calls internalAbort().
> > 
> > I'm going to add internalAbort() call in
> > https://codereview.chromium.org/490083002/.
> Hmm. I guess you mean that handleDidFailGeneric doesn't call
> clearVariablesForLoading. This is indeed weird. your patch sgtm

Right!

Powered by Google App Engine
This is Rietveld 408576698