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

Issue 1263363005: Better handle reentrancy into DocumentLoader::dataReceived(). (Closed)

Created:
5 years, 4 months ago by dcheng
Modified:
5 years, 4 months ago
CC:
blink-reviews, gavinp+loader_chromium.org, kinuko+watch, tyoshino+watch_chromium.org, sigbjorn
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Better handle reentrancy into DocumentLoader::dataReceived(). dataReceived() can be called reentrantly if it triggers a nested message loop when detaching a Document or parsing script for the new Document. Since dataReceived() isn't safe for reentrancy, any nested invocations queue the received data to be processed by the top-level invocation of dataReceived(). BUG=515876 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200436 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200603

Patch Set 1 #

Patch Set 2 : better comments #

Patch Set 3 : . #

Total comments: 2

Patch Set 4 : SharedBuffer #

Patch Set 5 : clear the buffer #

Patch Set 6 : Tests #

Patch Set 7 : rebas #

Patch Set 8 : Add comments #

Patch Set 9 : Simplify logic #

Total comments: 6

Patch Set 10 : . #

Patch Set 11 : Rebased? #

Patch Set 12 : Fix UaF #

Unified diffs Side-by-side diffs Delta from patch set Stats (+211 lines, -0 lines) Patch
M Source/core/loader/DocumentLoader.h View 1 2 3 4 5 6 3 chunks +6 lines, -0 lines 0 comments Download
M Source/core/loader/DocumentLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +33 lines, -0 lines 0 comments Download
A Source/web/tests/DocumentLoaderTest.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +171 lines, -0 lines 0 comments Download
M Source/web/web.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 29 (5 generated)
dcheng
+japhet for primary review. +kouhei, +morrita: Even with the threaded HTML parser, I assume that ...
5 years, 4 months ago (2015-08-05 00:18:13 UTC) #3
kouhei (in TOK)
> +kouhei, +morrita: Even with the threaded HTML parser, I assume that if we hit ...
5 years, 4 months ago (2015-08-05 05:22:11 UTC) #4
Nate Chapin
https://codereview.chromium.org/1263363005/diff/40001/Source/core/loader/DocumentLoader.h File Source/core/loader/DocumentLoader.h (right): https://codereview.chromium.org/1263363005/diff/40001/Source/core/loader/DocumentLoader.h#newcode242 Source/core/loader/DocumentLoader.h:242: Deque<OwnPtr<Vector<char>>> m_dataQueue; I assume the OwnPtr here is actually ...
5 years, 4 months ago (2015-08-05 18:27:07 UTC) #5
dcheng
https://codereview.chromium.org/1263363005/diff/40001/Source/core/loader/DocumentLoader.h File Source/core/loader/DocumentLoader.h (right): https://codereview.chromium.org/1263363005/diff/40001/Source/core/loader/DocumentLoader.h#newcode242 Source/core/loader/DocumentLoader.h:242: Deque<OwnPtr<Vector<char>>> m_dataQueue; On 2015/08/05 at 18:27:06, Nate Chapin wrote: ...
5 years, 4 months ago (2015-08-05 21:57:12 UTC) #6
Nate Chapin
On 2015/08/05 21:57:12, dcheng wrote: > https://codereview.chromium.org/1263363005/diff/40001/Source/core/loader/DocumentLoader.h > File Source/core/loader/DocumentLoader.h (right): > > https://codereview.chromium.org/1263363005/diff/40001/Source/core/loader/DocumentLoader.h#newcode242 > ...
5 years, 4 months ago (2015-08-05 21:59:37 UTC) #7
Nate Chapin
On 2015/08/05 21:59:37, Nate Chapin wrote: > On 2015/08/05 21:57:12, dcheng wrote: > > > ...
5 years, 4 months ago (2015-08-05 21:59:56 UTC) #8
dcheng
On 2015/08/05 at 21:59:56, japhet wrote: > On 2015/08/05 21:59:37, Nate Chapin wrote: > > ...
5 years, 4 months ago (2015-08-05 22:19:20 UTC) #9
Nate Chapin
On 2015/08/05 22:19:20, dcheng wrote: > On 2015/08/05 at 21:59:56, japhet wrote: > > On ...
5 years, 4 months ago (2015-08-05 22:23:08 UTC) #10
dcheng
On 2015/08/05 at 22:23:08, japhet wrote: > On 2015/08/05 22:19:20, dcheng wrote: > > On ...
5 years, 4 months ago (2015-08-05 22:40:20 UTC) #11
Nate Chapin
On 2015/08/05 22:40:20, dcheng wrote: > On 2015/08/05 at 22:23:08, japhet wrote: > > On ...
5 years, 4 months ago (2015-08-05 22:42:15 UTC) #12
dcheng
On 2015/08/05 at 22:42:15, japhet wrote: > On 2015/08/05 22:40:20, dcheng wrote: > > On ...
5 years, 4 months ago (2015-08-05 22:46:54 UTC) #13
Nate Chapin
On 2015/08/05 22:46:54, dcheng wrote: > On 2015/08/05 at 22:42:15, japhet wrote: > > On ...
5 years, 4 months ago (2015-08-05 22:52:05 UTC) #14
dcheng
PTAL, I added some tests using the WebURLLoaderTestDelegate glue I added.
5 years, 4 months ago (2015-08-10 23:57:58 UTC) #15
Nate Chapin
https://codereview.chromium.org/1263363005/diff/160001/Source/web/tests/DocumentLoaderTest.cpp File Source/web/tests/DocumentLoaderTest.cpp (right): https://codereview.chromium.org/1263363005/diff/160001/Source/web/tests/DocumentLoaderTest.cpp#newcode20 Source/web/tests/DocumentLoaderTest.cpp:20: class DocumentLoaderTest : public ::testing::Test { It feels wrong ...
5 years, 4 months ago (2015-08-11 17:36:36 UTC) #16
dcheng
https://codereview.chromium.org/1263363005/diff/160001/Source/web/tests/DocumentLoaderTest.cpp File Source/web/tests/DocumentLoaderTest.cpp (right): https://codereview.chromium.org/1263363005/diff/160001/Source/web/tests/DocumentLoaderTest.cpp#newcode20 Source/web/tests/DocumentLoaderTest.cpp:20: class DocumentLoaderTest : public ::testing::Test { On 2015/08/11 at ...
5 years, 4 months ago (2015-08-11 17:41:37 UTC) #17
Nate Chapin
LGTM https://codereview.chromium.org/1263363005/diff/160001/Source/web/tests/DocumentLoaderTest.cpp File Source/web/tests/DocumentLoaderTest.cpp (right): https://codereview.chromium.org/1263363005/diff/160001/Source/web/tests/DocumentLoaderTest.cpp#newcode20 Source/web/tests/DocumentLoaderTest.cpp:20: class DocumentLoaderTest : public ::testing::Test { On 2015/08/11 ...
5 years, 4 months ago (2015-08-12 21:10:53 UTC) #18
dcheng
https://codereview.chromium.org/1263363005/diff/160001/Source/web/tests/DocumentLoaderTest.cpp File Source/web/tests/DocumentLoaderTest.cpp (right): https://codereview.chromium.org/1263363005/diff/160001/Source/web/tests/DocumentLoaderTest.cpp#newcode20 Source/web/tests/DocumentLoaderTest.cpp:20: class DocumentLoaderTest : public ::testing::Test { On 2015/08/12 at ...
5 years, 4 months ago (2015-08-12 22:06:41 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1263363005/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1263363005/180001
5 years, 4 months ago (2015-08-12 22:07:40 UTC) #22
commit-bot: I haz the power
Committed patchset #10 (id:180001) as https://src.chromium.org/viewvc/blink?view=rev&revision=200436
5 years, 4 months ago (2015-08-12 23:29:16 UTC) #23
sof
A revert of this CL (patchset #10 id:180001) has been created in https://codereview.chromium.org/1295553002/ by sigbjornf@opera.com. ...
5 years, 4 months ago (2015-08-13 20:03:53 UTC) #24
dcheng
PTAL. There was a UaF bug in the original patch, since TemporaryChange was destroyed after ...
5 years, 4 months ago (2015-08-14 17:12:44 UTC) #25
Nate Chapin
On 2015/08/14 17:12:44, dcheng wrote: > PTAL. There was a UaF bug in the original ...
5 years, 4 months ago (2015-08-14 20:34:35 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1263363005/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1263363005/220001
5 years, 4 months ago (2015-08-15 05:05:56 UTC) #28
commit-bot: I haz the power
5 years, 4 months ago (2015-08-15 06:51:52 UTC) #29
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=200603

Powered by Google App Engine
This is Rietveld 408576698