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

Issue 1264453002: Split the constructor of ThreadableLoader into two methods (ctor and start()) (Closed)

Created:
5 years, 4 months ago by tyoshino (SeeGerritForStatus)
Modified:
4 years, 10 months ago
Reviewers:
hiroshige, Mike West
CC:
blink-reviews, blink-reviews-events_chromium.org, blink-worker-reviews_chromium.org, dglazkov+blink, eae+blinkwatch, falken, gavinp+loader_chromium.org, horo+watch_chromium.org, Nate Chapin, kinuko+worker_chromium.org, kinuko+fileapi, nhiroki, tyoshino+watch_chromium.org, tzik
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Split the constructor of ThreadableLoader into two methods (ctor and start()) Reasons: - Basically, it's not good to do much work in a constructor. - DocumentThreadableLoader may fail synchronously, and then m_client->didFail() will be called. The design that m_client is passed to the constructor means that the client should be ready for callbacks (didFail(), etc.) when calling the constructor. It's better if both didFail() call by network thread and the sync one are handled by single logic. However, in the sync callback case, the loader instance is not yet created. This difference gives us some unexpected complexity in the logic to be implemented in didFail(). - Splitting the constructor into a new trivial constructor and start() method allows finishing association between the loader and the client without worry about failure. This CL simplifies EventSource code as m_requestInFlight is unnecessary. start() takes a ResourceRequest as it's good to keep the current design that we don't hold ResourceRequest in a member variable. BUG=518855, 514547, 389326 Committed: https://crrev.com/f2a0d7de0ca23cb14148af488c18f8638a3976a8 Cr-Commit-Position: refs/heads/master@{#375537}

Patch Set 1 #

Total comments: 24

Patch Set 2 : Addressed #2 #

Patch Set 3 : Addressed #7. Rebased #

Total comments: 6

Patch Set 4 : Rebased and fixed issues #

Patch Set 5 : Fix indentation #

Patch Set 6 : More fix #

Patch Set 7 : Fix #

Patch Set 8 : Added comments #

Total comments: 18

Patch Set 9 : Rebased, addressed hiroshige's comments #

Total comments: 2

Patch Set 10 : Fixed EventSource test failure #

Patch Set 11 : Rebased #

Patch Set 12 : Uplaod MockThreadableLoader #

Total comments: 2

Patch Set 13 : Rebase #

Patch Set 14 : Addressed #37 #

Patch Set 15 : Rebase #

Patch Set 16 : Rebase #

Patch Set 17 : Removed pipes around non-variables in a comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+281 lines, -150 lines) Patch
A third_party/WebKit/LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html View 1 2 3 4 5 6 7 8 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/mixedContent/insecure-fetch-blocked.html View 1 2 3 4 5 6 7 8 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/mixedContent/resources/frame-with-insecure-async-xhr-post.html View 1 2 3 4 5 6 7 8 1 chunk +13 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/mixedContent/resources/frame-with-insecure-fetch.html View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp View 1 2 3 1 chunk +5 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +6 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 10 chunks +37 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/core/loader/MockThreadableLoader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/ThreadableLoader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +27 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/loader/ThreadableLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +15 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +54 lines, -33 lines 0 comments Download
M third_party/WebKit/Source/core/page/EventSource.h View 1 2 3 4 5 6 7 8 9 4 chunks +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/page/EventSource.cpp View 1 2 3 4 5 6 7 8 13 chunks +18 lines, -25 lines 0 comments Download
M third_party/WebKit/Source/core/page/EventSourceTest.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp View 1 2 3 3 chunks +12 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandleTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +17 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +17 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchManager.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +4 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/web/AssociatedURLLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 59 (21 generated)
hiroshige
Thanks for taking this! Creating a separate crbug issue would be better, to track changes ...
5 years, 4 months ago (2015-07-28 11:35:37 UTC) #2
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1264453002/diff/1/Source/core/loader/ThreadableLoader.h File Source/core/loader/ThreadableLoader.h (right): https://codereview.chromium.org/1264453002/diff/1/Source/core/loader/ThreadableLoader.h#newcode128 Source/core/loader/ThreadableLoader.h:128: static PassRefPtr<ThreadableLoader> create(ExecutionContext&, ThreadableLoaderClient*, const ThreadableLoaderOptions&, const ResourceLoaderOptions&); On ...
5 years, 4 months ago (2015-07-28 12:21:51 UTC) #3
tyoshino (SeeGerritForStatus)
On 2015/07/28 11:35:37, hiroshige wrote: > Thanks for taking this! > > Creating a separate ...
5 years, 4 months ago (2015-07-28 12:22:35 UTC) #4
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1264453002/diff/1/Source/core/loader/ThreadableLoader.h File Source/core/loader/ThreadableLoader.h (right): https://codereview.chromium.org/1264453002/diff/1/Source/core/loader/ThreadableLoader.h#newcode128 Source/core/loader/ThreadableLoader.h:128: static PassRefPtr<ThreadableLoader> create(ExecutionContext&, ThreadableLoaderClient*, const ThreadableLoaderOptions&, const ResourceLoaderOptions&); On ...
5 years, 4 months ago (2015-07-28 12:36:55 UTC) #5
tyoshino (SeeGerritForStatus)
Regarding the change on EventSource, I plan to merge it into https://codereview.chromium.org/1262593004/.
5 years, 4 months ago (2015-07-28 14:38:24 UTC) #6
hiroshige
Basically looks nice (except for EventSource changes about which I'm not yet so sure). > ...
5 years, 4 months ago (2015-07-30 12:07:21 UTC) #7
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1264453002/diff/1/Source/core/loader/DocumentThreadableLoader.cpp File Source/core/loader/DocumentThreadableLoader.cpp (right): https://codereview.chromium.org/1264453002/diff/1/Source/core/loader/DocumentThreadableLoader.cpp#newcode78 Source/core/loader/DocumentThreadableLoader.cpp:78: return loader.release(); On 2015/07/30 12:07:21, hiroshige wrote: > Now ...
5 years, 4 months ago (2015-07-31 08:00:43 UTC) #8
tyoshino (SeeGerritForStatus)
On 2015/07/30 12:07:21, hiroshige wrote: > Basically looks nice (except for EventSource changes about which ...
5 years, 4 months ago (2015-07-31 08:01:21 UTC) #9
hiroshige
This CL basically looks fine, but please rebase after related CLs (e.g. https://codereview.chromium.org/1262593004/) are landed.
5 years, 4 months ago (2015-08-10 12:54:14 UTC) #10
hiroshige
CL description: - s/DocumentThreadableLoader/ThreadableLoader/g - I created Issue 518855 for this; could you refer it ...
5 years, 4 months ago (2015-08-10 15:00:05 UTC) #11
hiroshige
https://codereview.chromium.org/1264453002/diff/40001/LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html File LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html (right): https://codereview.chromium.org/1264453002/diff/40001/LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html#newcode15 LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html:15: window.open("http://127.0.0.1:8000/security/mixedContent/resources/frame-with-insecure-async-xhr-post.html"); The description says "Opens a HTTPS window" but ...
5 years, 4 months ago (2015-08-11 09:54:42 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1264453002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1264453002/120001
4 years, 11 months ago (2016-01-25 13:46:06 UTC) #16
tyoshino (SeeGerritForStatus)
- Merged - Rebased - Fixed the CL description - Replaced DTL with TL in ...
4 years, 11 months ago (2016-01-25 13:49:09 UTC) #17
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/170698)
4 years, 11 months ago (2016-01-25 13:56:34 UTC) #20
hiroshige
Thanks for updates! Mostly nits. https://codereview.chromium.org/1264453002/diff/140001/third_party/WebKit/LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html File third_party/WebKit/LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html (right): https://codereview.chromium.org/1264453002/diff/140001/third_party/WebKit/LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html#newcode9 third_party/WebKit/LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html:9: var test = async_test("Opens ...
4 years, 11 months ago (2016-01-26 08:44:50 UTC) #21
hiroshige
Er, I found bots are red... (seems just simple compilation errors)
4 years, 11 months ago (2016-01-26 08:46:29 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1264453002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1264453002/160001
4 years, 10 months ago (2016-01-29 12:36:43 UTC) #24
tyoshino (SeeGerritForStatus)
Thanks! https://codereview.chromium.org/1264453002/diff/40001/LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html File LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html (right): https://codereview.chromium.org/1264453002/diff/40001/LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html#newcode15 LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html:15: window.open("http://127.0.0.1:8000/security/mixedContent/resources/frame-with-insecure-async-xhr-post.html"); On 2015/08/11 09:54:42, hiroshige wrote: > The ...
4 years, 10 months ago (2016-01-29 12:36:52 UTC) #25
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1264453002/diff/40001/LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html File LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html (right): https://codereview.chromium.org/1264453002/diff/40001/LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html#newcode15 LayoutTests/http/tests/security/mixedContent/insecure-async-post-xhr-blocked.html:15: window.open("http://127.0.0.1:8000/security/mixedContent/resources/frame-with-insecure-async-xhr-post.html"); On 2016/01/29 12:36:52, tyoshino wrote: > On 2015/08/11 ...
4 years, 10 months ago (2016-01-29 12:37:56 UTC) #26
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/173408)
4 years, 10 months ago (2016-01-29 13:33:40 UTC) #28
tyoshino (SeeGerritForStatus)
OK. CQ dry run failed. It's just because I need some replacement for requestInflight flag. ...
4 years, 10 months ago (2016-01-29 13:40:32 UTC) #29
hiroshige
https://codereview.chromium.org/1264453002/diff/160001/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp File third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp (right): https://codereview.chromium.org/1264453002/diff/160001/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp#newcode105 third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp:105: if (m_failed) I've just found the code related to ...
4 years, 10 months ago (2016-02-01 06:57:47 UTC) #30
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1264453002/diff/160001/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp File third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp (right): https://codereview.chromium.org/1264453002/diff/160001/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp#newcode105 third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp:105: if (m_failed) On 2016/02/01 at 06:57:47, hiroshige wrote: > ...
4 years, 10 months ago (2016-02-01 12:48:16 UTC) #31
tyoshino (SeeGerritForStatus)
Rebased Split MockThreadableLoader change into a separate CL: https://codereview.chromium.org/1656673003
4 years, 10 months ago (2016-02-01 12:48:41 UTC) #32
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1264453002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1264453002/220001
4 years, 10 months ago (2016-02-05 07:09:33 UTC) #34
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ninja/builds/168519)
4 years, 10 months ago (2016-02-05 07:11:31 UTC) #36
hiroshige
lgtm if bots turns green after rebasing after https://codereview.chromium.org/1656673003/. (I'm not sure whether we have ...
4 years, 10 months ago (2016-02-05 08:11:54 UTC) #37
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1264453002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1264453002/240001
4 years, 10 months ago (2016-02-09 12:22:18 UTC) #39
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-09 13:42:04 UTC) #41
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1264453002/diff/220001/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp File third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp (right): https://codereview.chromium.org/1264453002/diff/220001/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp#newcode60 third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp:60: EXPECT_CALL(*loader, start(_)).Times(1).WillOnce(InvokeWithoutArgs(this, &LoaderFactory::handleDidReceiveResponse)); On 2016/02/05 at 08:11:53, hiroshige wrote: ...
4 years, 10 months ago (2016-02-09 14:42:02 UTC) #42
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1264453002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1264453002/280001
4 years, 10 months ago (2016-02-10 12:03:08 UTC) #44
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-10 15:14:09 UTC) #46
tyoshino (SeeGerritForStatus)
+mkwst Hi Mike, sorry for long long delay. Finally this CL got chance to proceed. ...
4 years, 10 months ago (2016-02-12 09:52:50 UTC) #48
Mike West
I think this looks pretty reasonable; LGTM, and thank you for the fix.
4 years, 10 months ago (2016-02-15 13:08:20 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1264453002/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1264453002/300001
4 years, 10 months ago (2016-02-16 07:40:12 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1264453002/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1264453002/320001
4 years, 10 months ago (2016-02-16 07:54:06 UTC) #55
commit-bot: I haz the power
Committed patchset #17 (id:320001)
4 years, 10 months ago (2016-02-16 09:04:47 UTC) #57
commit-bot: I haz the power
4 years, 10 months ago (2016-02-16 22:51:53 UTC) #59
Message was sent while issue was closed.
Patchset 17 (id:??) landed as
https://crrev.com/f2a0d7de0ca23cb14148af488c18f8638a3976a8
Cr-Commit-Position: refs/heads/master@{#375537}

Powered by Google App Engine
This is Rietveld 408576698