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

Issue 74513003: Moved text decoding to the parser thread (Closed)

Created:
7 years, 1 month ago by oystein (OOO til 10th of July)
Modified:
7 years ago
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch, adamk+blink_chromium.org, jamesr
Base URL:
https://chromium.googlesource.com/chromium/blink.git@parserthread_step25
Visibility:
Public.

Description

Moved text decoding to the parser thread. When the HTTPDocumentParser defers the document parsing to the background parser thread, it'll now also pass ownership of its TextResourceDecoder so the parser thread can do the decoding as well. R=abarth@chromium.org,eseidel@chromium.org BUG=277886 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=163977

Patch Set 1 #

Total comments: 25

Patch Set 2 : Review fixes #

Total comments: 3

Patch Set 3 : DocumentEncodingData is now constructed from a decoder #

Total comments: 12

Patch Set 4 : Review fixes #

Patch Set 5 : Visual Hebrew fixes #

Patch Set 6 : Fixed plain text parsing #

Patch Set 7 : Crash fix when parsing plaintext documents #

Patch Set 8 : XSSAuditor fix #

Total comments: 10

Patch Set 9 : Moved TextResourceDecoder to core/html/parser #

Patch Set 10 : Removed AtomicString from HTMLMetaCharsetParser #

Total comments: 8

Patch Set 11 : Review fixes #

Patch Set 12 : Rebase #

Patch Set 13 : Rebase #

Patch Set 14 : #

Patch Set 15 : Rebase #

Total comments: 7

Patch Set 16 : Review fixes #

Patch Set 17 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+423 lines, -797 lines) Patch
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +3 lines, -2 lines 0 comments Download
M Source/core/dom/DecodedDataDocumentParser.h View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M Source/core/dom/DecodedDataDocumentParser.cpp View 1 2 3 4 5 6 7 8 4 chunks +8 lines, -19 lines 0 comments Download
M Source/core/dom/Document.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -4 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +14 lines, -13 lines 0 comments Download
M Source/core/dom/DocumentEncodingData.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +21 lines, -9 lines 0 comments Download
A Source/core/dom/DocumentEncodingData.cpp View 1 2 3 4 5 6 7 8 1 chunk +56 lines, -0 lines 0 comments Download
M Source/core/dom/DocumentParser.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M Source/core/fetch/CSSStyleSheetResource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M Source/core/fetch/DocumentResource.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M Source/core/fetch/FontResource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/core/fetch/ScriptResource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/core/fetch/ShaderResource.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
D Source/core/fetch/TextResourceDecoder.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -105 lines 0 comments Download
D Source/core/fetch/TextResourceDecoder.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -437 lines 0 comments Download
M Source/core/fetch/XSLStyleSheetResource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M Source/core/fileapi/FileReaderLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M Source/core/frame/FrameView.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +1 line, -1 line 0 comments Download
M Source/core/html/HTMLBaseElement.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/parser/BackgroundHTMLParser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 chunks +11 lines, -8 lines 0 comments Download
M Source/core/html/parser/BackgroundHTMLParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +44 lines, -0 lines 0 comments Download
M Source/core/html/parser/CSSPreloadScanner.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/parser/HTMLDocumentParser.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -0 lines 0 comments Download
M Source/core/html/parser/HTMLDocumentParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +51 lines, -14 lines 0 comments Download
M Source/core/html/parser/HTMLMetaCharsetParser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -12 lines 0 comments Download
M Source/core/html/parser/HTMLMetaCharsetParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +9 lines, -89 lines 0 comments Download
M Source/core/html/parser/HTMLParserIdioms.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +8 lines, -0 lines 0 comments Download
M Source/core/html/parser/HTMLParserIdioms.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +90 lines, -0 lines 0 comments Download
M Source/core/html/parser/HTMLPreloadScanner.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/parser/HTMLTokenizer.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/parser/HTMLTokenizer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +11 lines, -10 lines 0 comments Download
M Source/core/html/parser/HTMLViewSourceParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/html/parser/TextDocumentParser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/parser/TextDocumentParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -2 lines 0 comments Download
A + Source/core/html/parser/TextResourceDecoder.h View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -1 line 0 comments Download
A + Source/core/html/parser/TextResourceDecoder.cpp View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +12 lines, -12 lines 0 comments Download
M Source/core/html/parser/XSSAuditor.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M Source/core/html/parser/XSSAuditor.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +31 lines, -22 lines 0 comments Download
M Source/core/html/track/vtt/VTTParser.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/InspectorFileSystemAgent.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/InspectorFrontendHost.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/InspectorPageAgent.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/NetworkResourcesData.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/core/loader/DocumentLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M Source/core/loader/DocumentWriter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +1 line, -2 lines 0 comments Download
M Source/core/loader/TextResourceDecoderBuilder.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/EventSource.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/PageSerializer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -5 lines 0 comments Download
M Source/core/rendering/RenderText.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M Source/core/workers/WorkerScriptLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/core/xml/XMLHttpRequest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M Source/core/xml/XSLTProcessor.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/xml/parser/XMLDocumentParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 44 (0 generated)
oystein (OOO til 10th of July)
Please take a look and let me know if you agree with the approach or ...
7 years, 1 month ago (2013-11-16 01:24:58 UTC) #1
abarth-chromium
I probably should look at this CL again when I'm less tired. Here are some ...
7 years, 1 month ago (2013-11-18 06:57:10 UTC) #2
abarth-chromium
https://codereview.chromium.org/74513003/diff/1/Source/core/dom/DecodedDataDocumentParser.h File Source/core/dom/DecodedDataDocumentParser.h (right): https://codereview.chromium.org/74513003/diff/1/Source/core/dom/DecodedDataDocumentParser.h#newcode36 Source/core/dom/DecodedDataDocumentParser.h:36: class DecodedDataDocumentParser : public DocumentParser { I wonder if ...
7 years, 1 month ago (2013-11-18 17:32:23 UTC) #3
eseidel
https://codereview.chromium.org/74513003/diff/1/Source/core/dom/DecodedDataDocumentParser.cpp File Source/core/dom/DecodedDataDocumentParser.cpp (right): https://codereview.chromium.org/74513003/diff/1/Source/core/dom/DecodedDataDocumentParser.cpp#newcode57 Source/core/dom/DecodedDataDocumentParser.cpp:57: PassOwnPtr<TextResourceDecoder> DecodedDataDocumentParser::adoptDecoder() Maybe takeDecoder()? Not quite sure what this ...
7 years, 1 month ago (2013-11-18 20:07:39 UTC) #4
oystein (OOO til 10th of July)
Thanks guys :) https://codereview.chromium.org/74513003/diff/1/Source/core/dom/DecodedDataDocumentParser.cpp File Source/core/dom/DecodedDataDocumentParser.cpp (right): https://codereview.chromium.org/74513003/diff/1/Source/core/dom/DecodedDataDocumentParser.cpp#newcode57 Source/core/dom/DecodedDataDocumentParser.cpp:57: PassOwnPtr<TextResourceDecoder> DecodedDataDocumentParser::adoptDecoder() On 2013/11/18 20:07:40, eseidel ...
7 years, 1 month ago (2013-11-18 22:18:42 UTC) #5
oystein (OOO til 10th of July)
https://codereview.chromium.org/74513003/diff/1/Source/core/html/parser/HTMLDocumentParser.h File Source/core/html/parser/HTMLDocumentParser.h (right): https://codereview.chromium.org/74513003/diff/1/Source/core/html/parser/HTMLDocumentParser.h#newcode99 Source/core/html/parser/HTMLDocumentParser.h:99: void didReceiveEncodingDataFromBackgroundParser(const DocumentEncodingData&); On 2013/11/18 22:18:42, Oystein wrote: > ...
7 years, 1 month ago (2013-11-18 22:31:02 UTC) #6
eseidel
https://codereview.chromium.org/74513003/diff/130001/Source/core/dom/DecodedDataDocumentParser.cpp File Source/core/dom/DecodedDataDocumentParser.cpp (right): https://codereview.chromium.org/74513003/diff/130001/Source/core/dom/DecodedDataDocumentParser.cpp#newcode102 Source/core/dom/DecodedDataDocumentParser.cpp:102: m_decoder->getEncodingData(encodingData); document()->setEncodingData(m_decoder->encodingData())? https://codereview.chromium.org/74513003/diff/130001/Source/core/fetch/TextResourceDecoder.h File Source/core/fetch/TextResourceDecoder.h (right): https://codereview.chromium.org/74513003/diff/130001/Source/core/fetch/TextResourceDecoder.h#newcode67 Source/core/fetch/TextResourceDecoder.h:67: void ...
7 years, 1 month ago (2013-11-18 22:32:07 UTC) #7
oystein (OOO til 10th of July)
https://codereview.chromium.org/74513003/diff/130001/Source/core/fetch/TextResourceDecoder.h File Source/core/fetch/TextResourceDecoder.h (right): https://codereview.chromium.org/74513003/diff/130001/Source/core/fetch/TextResourceDecoder.h#newcode67 Source/core/fetch/TextResourceDecoder.h:67: void getEncodingData(DocumentEncodingData&) const; On 2013/11/18 22:32:07, eseidel wrote: > ...
7 years, 1 month ago (2013-11-18 22:36:46 UTC) #8
eseidel
We could also go the other way, and be able to fill one of these ...
7 years, 1 month ago (2013-11-18 22:40:26 UTC) #9
oystein (OOO til 10th of July)
On 2013/11/18 22:40:26, eseidel wrote: > We could also go the other way, and be ...
7 years, 1 month ago (2013-11-19 22:07:30 UTC) #10
eseidel
looks great. Just a few nits. Update the description and I think we're ready to ...
7 years, 1 month ago (2013-11-19 22:27:45 UTC) #11
oystein (OOO til 10th of July)
Awesome, thanks :). Note that this'll break support for the Visual Hebrew encoding; I didn't ...
7 years, 1 month ago (2013-11-19 22:52:19 UTC) #12
eseidel
I don't think we can break Visual Hebrew yet. I believe I've lost that battle ...
7 years, 1 month ago (2013-11-19 23:09:12 UTC) #13
oystein (OOO til 10th of July)
On 2013/11/19 23:09:12, eseidel wrote: > I don't think we can break Visual Hebrew yet. ...
7 years, 1 month ago (2013-11-21 21:11:13 UTC) #14
eseidel
I remembered this morning that I think TextDecoder buffers appends until it has hit a ...
7 years, 1 month ago (2013-11-21 22:14:47 UTC) #15
oystein (OOO til 10th of July)
On 2013/11/21 22:14:47, eseidel wrote: > I remembered this morning that I think TextDecoder buffers ...
7 years, 1 month ago (2013-11-21 22:24:33 UTC) #16
oystein (OOO til 10th of July)
ping :)
7 years ago (2013-11-25 19:52:11 UTC) #17
eseidel
lgtm. I think abarth should probably look as well. Since he and I have somewhat ...
7 years ago (2013-11-25 19:57:13 UTC) #18
abarth-chromium
not lgtm This CL is very close to correct, but I'm not sure we've fully ...
7 years ago (2013-11-25 21:45:39 UTC) #19
oystein (OOO til 10th of July)
On 2013/11/25 21:45:39, abarth wrote: > For example, TextResourceDecoder depends on HTMLMetaCharsetParser and > HTMLMetaCharsetParser ...
7 years ago (2013-11-25 22:07:38 UTC) #20
abarth-chromium
On 2013/11/25 22:07:38, Oystein wrote: > I thought AtomicStrings used TLS for its string table, ...
7 years ago (2013-11-25 22:12:35 UTC) #21
abarth-chromium
On 2013/11/25 22:12:35, abarth wrote: > For example, we could move them to Source/platform/textdecoder. Actually, ...
7 years ago (2013-11-25 22:13:13 UTC) #22
oystein (OOO til 10th of July)
On 2013/11/25 22:13:13, abarth wrote: > On 2013/11/25 22:12:35, abarth wrote: > > For example, ...
7 years ago (2013-11-25 22:24:21 UTC) #23
eseidel
I should have caught the thread-safey issue. Thankfully we have abarth around to keep us ...
7 years ago (2013-11-26 00:02:14 UTC) #24
oystein (OOO til 10th of July)
On 2013/11/25 22:12:35, abarth wrote: > On 2013/11/25 22:07:38, Oystein wrote: > > I thought ...
7 years ago (2013-11-26 00:45:42 UTC) #25
oystein (OOO til 10th of July)
On 2013/11/26 00:45:42, Oystein wrote: > On 2013/11/25 22:12:35, abarth wrote: > > On 2013/11/25 ...
7 years ago (2013-11-26 01:00:43 UTC) #26
oystein (OOO til 10th of July)
On 2013/11/26 01:00:43, Oystein wrote: > On 2013/11/26 00:45:42, Oystein wrote: > > On 2013/11/25 ...
7 years ago (2013-11-26 01:03:39 UTC) #27
oystein (OOO til 10th of July)
>In the first case, we should break the dependency from HTMLMetaCharsetParser on >AtomicString and use ...
7 years ago (2013-11-27 00:47:29 UTC) #28
abarth-chromium
https://codereview.chromium.org/74513003/diff/610001/Source/core/html/parser/HTMLIdentifier.h File Source/core/html/parser/HTMLIdentifier.h (right): https://codereview.chromium.org/74513003/diff/610001/Source/core/html/parser/HTMLIdentifier.h#newcode59 Source/core/html/parser/HTMLIdentifier.h:59: HTMLIdentifier(const AtomicString& str, CharacterWidth width) str -> string Please ...
7 years ago (2013-11-27 18:18:08 UTC) #29
oystein (OOO til 10th of July)
https://codereview.chromium.org/74513003/diff/610001/Source/core/html/parser/HTMLIdentifier.h File Source/core/html/parser/HTMLIdentifier.h (right): https://codereview.chromium.org/74513003/diff/610001/Source/core/html/parser/HTMLIdentifier.h#newcode59 Source/core/html/parser/HTMLIdentifier.h:59: HTMLIdentifier(const AtomicString& str, CharacterWidth width) On 2013/11/27 18:18:08, abarth ...
7 years ago (2013-11-27 18:46:32 UTC) #30
abarth-chromium
On 2013/11/27 18:46:32, Oystein wrote: > > It seems very strange that we would want ...
7 years ago (2013-11-27 18:57:19 UTC) #31
oystein (OOO til 10th of July)
On 2013/11/27 18:57:19, abarth wrote: > On 2013/11/27 18:46:32, Oystein wrote: > > > It ...
7 years ago (2013-11-27 19:17:04 UTC) #32
abarth-chromium
On 2013/11/27 19:17:04, Oystein wrote: > All of that relies on the assumption that none ...
7 years ago (2013-12-02 19:23:35 UTC) #33
oystein (OOO til 10th of July)
On 2013/12/02 19:23:35, abarth wrote: > Hum... PageSerializer only needs to call > HTMLMetaCharsetParser::encodingFromMetaAttributes, which ...
7 years ago (2013-12-04 18:48:18 UTC) #34
abarth-chromium
On 2013/12/04 18:48:18, Oystein wrote: > On 2013/12/02 19:23:35, abarth wrote: > > Hum... PageSerializer ...
7 years ago (2013-12-05 04:22:30 UTC) #35
eseidel
StringImpl's marked with isStatic() don't have a thread-safe refcount, they just ignore any attempt to ...
7 years ago (2013-12-05 04:31:17 UTC) #36
oystein (OOO til 10th of July)
On 2013/12/05 04:22:30, abarth wrote: > > What should HTMLIdentifier be replaced with? > > ...
7 years ago (2013-12-10 00:12:44 UTC) #37
abarth-chromium
On 2013/12/10 00:12:44, Oystein wrote: > Gotcha, looking at this now. Should the HTMLIdentifier live ...
7 years ago (2013-12-10 01:14:12 UTC) #38
oystein (OOO til 10th of July)
To pick this up again: After the HTMLIdentifier removal landed, I replaced its usage in ...
7 years ago (2013-12-13 18:38:41 UTC) #39
abarth-chromium
LGTM This version looks much better. Thanks for cleaning up the HTMLIdentifier mess. I'm not ...
7 years ago (2013-12-15 05:49:59 UTC) #40
oystein (OOO til 10th of July)
Great, thanks for the review :). I already have something WIP ready for the next ...
7 years ago (2013-12-16 19:33:28 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/oysteine@chromium.org/74513003/750001
7 years ago (2013-12-16 19:34:22 UTC) #42
commit-bot: I haz the power
Change committed as 163977
7 years ago (2013-12-16 21:44:07 UTC) #43
oystein (OOO til 10th of July)
7 years ago (2013-12-18 20:02:59 UTC) #44
Message was sent while issue was closed.
A revert of this CL has been created in
https://codereview.chromium.org/118573002/ by oysteine@chromium.org.

The reason for reverting is:
https://code.google.com/p/chromium/issues/detail?id=329603.

Powered by Google App Engine
This is Rietveld 408576698