Chromium Code Reviews

Issue 399543002: [ServiceWorker] Make fetch() method better conformance with the spec. (Closed)

Created:
6 years, 5 months ago by horo
Modified:
6 years, 5 months ago
Reviewers:
falken, jochen (gone - plz use gerrit), yhirano
CC:
alecflett+watch_chromium.org, blink-reviews, falken, gavinp+loader_chromium.org, horo+watch_chromium.org, Nate Chapin, jsbell+serviceworker_chromium.org, kenjibaheux+watch_chromium.org, kinuko+serviceworker, michaeln, nhiroki, serviceworker-reviews, tzik
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

[ServiceWorker] Make fetch() method better conformance with the spec. In this patch, I don't implement the redirection procedure because it is a bit complicated and it could cause security issues. When fetch() receives a redirect response, we treat it as an error in DocumentThreadableLoader::redirectReceived(). ResourceResponse's wasFetchedViaServiceWorker flag is used in ResourceFetcher::didReceiveResponse() and DocumentThreadableLoader::handleResponse() for CORS and CSP checking in the renderer side. But this flag will be set correctly in https://codereview.chromium.org/375513002. After this patch is landed, I will add LayoutTests for CORS and CSP checking as I described in https://codereview.chromium.org/375513002#msg18. BUG=373120 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178904

Patch Set 1 : #

Total comments: 21

Patch Set 2 : incorporated yhirano's comment #

Patch Set 3 : remove Source/core/timing/Performance.cpp #

Total comments: 3

Patch Set 4 : update m_forceDoNotAllowStoredCredentials in DocumentThreadableLoader #

Total comments: 24

Patch Set 5 : incorporated yhirano's comment #

Total comments: 10

Patch Set 6 : incorporated yhirano's comment #

Total comments: 6

Patch Set 7 : incorporated yhirano's comment #

Total comments: 12

Patch Set 8 : rebase and incorporated jochen's comment #

Patch Set 9 : rebase #

Total comments: 10

Patch Set 10 : indent and comment fix #

Total comments: 34

Patch Set 11 : incorporated falken's comment #

Unified diffs Side-by-side diffs Stats (+1112 lines, -58 lines)
A LayoutTests/http/tests/serviceworker/fetch-access-control.html View 1 chunk +594 lines, -0 lines 0 comments
A LayoutTests/http/tests/serviceworker/resources/fetch-access-control.php View 1 chunk +42 lines, -0 lines 0 comments
A LayoutTests/http/tests/serviceworker/resources/fetch-access-control-iframe.html View 1 chunk +19 lines, -0 lines 0 comments
A LayoutTests/http/tests/serviceworker/resources/fetch-access-control-login.html View 1 chunk +15 lines, -0 lines 0 comments
A LayoutTests/http/tests/serviceworker/resources/fetch-access-control-worker.js View 1 chunk +99 lines, -0 lines 0 comments
A + LayoutTests/http/tests/serviceworker/resources/redirect.php View 1 chunk +1 line, -1 line 0 comments
M Source/core/fetch/ResourceFetcher.cpp View 1 chunk +8 lines, -1 line 0 comments
M Source/core/loader/DocumentThreadableLoader.cpp View 2 chunks +29 lines, -3 lines 0 comments
M Source/modules/serviceworkers/FetchHeaderList.h View 1 chunk +2 lines, -0 lines 0 comments
M Source/modules/serviceworkers/FetchHeaderList.cpp View 1 chunk +9 lines, -0 lines 0 comments
M Source/modules/serviceworkers/FetchManager.h View 2 chunks +2 lines, -1 line 0 comments
M Source/modules/serviceworkers/FetchManager.cpp View 7 chunks +203 lines, -26 lines 0 comments
M Source/modules/serviceworkers/FetchRequestData.h View 2 chunks +1 line, -1 line 0 comments
M Source/modules/serviceworkers/FetchRequestData.cpp View 1 chunk +18 lines, -0 lines 0 comments
M Source/modules/serviceworkers/Request.h View 1 chunk +0 lines, -2 lines 0 comments
M Source/modules/serviceworkers/Request.cpp View 2 chunks +0 lines, -10 lines 0 comments
M Source/modules/serviceworkers/Response.cpp View 1 chunk +2 lines, -0 lines 0 comments
M Source/modules/serviceworkers/ServiceWorkerGlobalScope.h View 2 chunks +3 lines, -0 lines 0 comments
M Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp View 3 chunks +58 lines, -11 lines 0 comments
M Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl View 1 chunk +2 lines, -2 lines 0 comments
M Source/web/ServiceWorkerGlobalScopeClientImpl.cpp View 1 chunk +5 lines, -0 lines 0 comments

Messages

Total messages: 23 (0 generated)
horo
yhirano@ Could you please review this?
6 years, 5 months ago (2014-07-16 06:52:06 UTC) #1
yhirano
https://codereview.chromium.org/399543002/diff/100001/Source/core/fetch/ResourceFetcher.cpp File Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/399543002/diff/100001/Source/core/fetch/ResourceFetcher.cpp#newcode1317 Source/core/fetch/ResourceFetcher.cpp:1317: if (!canRequest(resource->type(), response.url(), resource->options(), false, FetchRequest::UseDefaultOriginRestrictionForType)) { Is this ...
6 years, 5 months ago (2014-07-16 13:12:27 UTC) #2
horo
https://codereview.chromium.org/399543002/diff/100001/Source/core/fetch/ResourceFetcher.cpp File Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/399543002/diff/100001/Source/core/fetch/ResourceFetcher.cpp#newcode1317 Source/core/fetch/ResourceFetcher.cpp:1317: if (!canRequest(resource->type(), response.url(), resource->options(), false, FetchRequest::UseDefaultOriginRestrictionForType)) { On 2014/07/16 ...
6 years, 5 months ago (2014-07-18 09:12:18 UTC) #3
yhirano
https://codereview.chromium.org/399543002/diff/100001/Source/core/fetch/ResourceFetcher.cpp File Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/399543002/diff/100001/Source/core/fetch/ResourceFetcher.cpp#newcode1317 Source/core/fetch/ResourceFetcher.cpp:1317: if (!canRequest(resource->type(), response.url(), resource->options(), false, FetchRequest::UseDefaultOriginRestrictionForType)) { On 2014/07/18 ...
6 years, 5 months ago (2014-07-23 05:17:14 UTC) #4
horo
https://codereview.chromium.org/399543002/diff/180001/LayoutTests/http/tests/serviceworker/fetch-access-control.html File LayoutTests/http/tests/serviceworker/fetch-access-control.html (right): https://codereview.chromium.org/399543002/diff/180001/LayoutTests/http/tests/serviceworker/fetch-access-control.html#newcode32 LayoutTests/http/tests/serviceworker/fetch-access-control.html:32: if (data.headers[i][0] == name) { On 2014/07/23 05:17:13, yhirano ...
6 years, 5 months ago (2014-07-23 09:05:53 UTC) #5
yhirano
https://codereview.chromium.org/399543002/diff/180001/LayoutTests/http/tests/serviceworker/fetch-access-control.html File LayoutTests/http/tests/serviceworker/fetch-access-control.html (right): https://codereview.chromium.org/399543002/diff/180001/LayoutTests/http/tests/serviceworker/fetch-access-control.html#newcode545 LayoutTests/http/tests/serviceworker/fetch-access-control.html:545: function onWorkerMessage(e) { On 2014/07/23 09:05:52, horo wrote: > ...
6 years, 5 months ago (2014-07-24 04:07:39 UTC) #6
horo
https://codereview.chromium.org/399543002/diff/180001/LayoutTests/http/tests/serviceworker/fetch-access-control.html File LayoutTests/http/tests/serviceworker/fetch-access-control.html (right): https://codereview.chromium.org/399543002/diff/180001/LayoutTests/http/tests/serviceworker/fetch-access-control.html#newcode545 LayoutTests/http/tests/serviceworker/fetch-access-control.html:545: function onWorkerMessage(e) { On 2014/07/24 04:07:38, yhirano wrote: > ...
6 years, 5 months ago (2014-07-24 06:42:50 UTC) #7
yhirano
lgtm https://codereview.chromium.org/399543002/diff/220001/LayoutTests/http/tests/serviceworker/fetch-access-control.html File LayoutTests/http/tests/serviceworker/fetch-access-control.html (right): https://codereview.chromium.org/399543002/diff/220001/LayoutTests/http/tests/serviceworker/fetch-access-control.html#newcode397 LayoutTests/http/tests/serviceworker/fetch-access-control.html:397: [checkJsonpHeader.bind(this, 'Referer', IFRAME_URL)]], On 2014/07/24 06:42:49, horo wrote: ...
6 years, 5 months ago (2014-07-24 07:51:48 UTC) #8
horo
https://codereview.chromium.org/399543002/diff/220001/LayoutTests/http/tests/serviceworker/fetch-access-control.html File LayoutTests/http/tests/serviceworker/fetch-access-control.html (right): https://codereview.chromium.org/399543002/diff/220001/LayoutTests/http/tests/serviceworker/fetch-access-control.html#newcode397 LayoutTests/http/tests/serviceworker/fetch-access-control.html:397: [checkJsonpHeader.bind(this, 'Referer', IFRAME_URL)]], On 2014/07/24 07:51:48, yhirano wrote: > ...
6 years, 5 months ago (2014-07-24 08:26:54 UTC) #9
horo
falken@ Could you please review this? Thank you.
6 years, 5 months ago (2014-07-24 08:27:29 UTC) #10
horo
jochen@ Could you please review these files in this patch? Source/core/fetch/Resource.h Source/core/fetch/Resource.cpp Source/core/fetch/ResourceFetcher.cpp Source/core/loader/DocumentThreadableLoader.cpp Source/web/ServiceWorkerGlobalScopeClientImpl.cpp ...
6 years, 5 months ago (2014-07-24 13:27:17 UTC) #11
jochen (gone - plz use gerrit)
https://codereview.chromium.org/399543002/diff/280001/Source/core/fetch/ResourceFetcher.cpp File Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/399543002/diff/280001/Source/core/fetch/ResourceFetcher.cpp#newcode1306 Source/core/fetch/ResourceFetcher.cpp:1306: context().dispatchDidFail(m_documentLoader, resource->identifier(), ResourceError(errorDomainBlinkInternal, 0, response.url().string(), "Original url check of ...
6 years, 5 months ago (2014-07-24 14:37:26 UTC) #12
horo
https://codereview.chromium.org/399543002/diff/280001/Source/core/fetch/ResourceFetcher.cpp File Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/399543002/diff/280001/Source/core/fetch/ResourceFetcher.cpp#newcode1306 Source/core/fetch/ResourceFetcher.cpp:1306: context().dispatchDidFail(m_documentLoader, resource->identifier(), ResourceError(errorDomainBlinkInternal, 0, response.url().string(), "Original url check of ...
6 years, 5 months ago (2014-07-24 15:50:23 UTC) #13
jochen (gone - plz use gerrit)
lgtm
6 years, 5 months ago (2014-07-24 15:56:56 UTC) #14
falken
Haven't looked at everything yet. https://codereview.chromium.org/399543002/diff/330001/LayoutTests/http/tests/serviceworker/fetch-access-control.html File LayoutTests/http/tests/serviceworker/fetch-access-control.html (right): https://codereview.chromium.org/399543002/diff/330001/LayoutTests/http/tests/serviceworker/fetch-access-control.html#newcode6 LayoutTests/http/tests/serviceworker/fetch-access-control.html:6: <body> don't need <body> ...
6 years, 5 months ago (2014-07-25 01:46:40 UTC) #15
horo
https://codereview.chromium.org/399543002/diff/330001/LayoutTests/http/tests/serviceworker/fetch-access-control.html File LayoutTests/http/tests/serviceworker/fetch-access-control.html (right): https://codereview.chromium.org/399543002/diff/330001/LayoutTests/http/tests/serviceworker/fetch-access-control.html#newcode6 LayoutTests/http/tests/serviceworker/fetch-access-control.html:6: <body> On 2014/07/25 01:46:40, falken wrote: > don't need ...
6 years, 5 months ago (2014-07-25 02:24:49 UTC) #16
falken
basically looks good modulo style nits The CL description says you will add tests, but ...
6 years, 5 months ago (2014-07-25 05:41:29 UTC) #17
horo
i'm planning to add more tests such as CSP and canvas tainting in another CL. ...
6 years, 5 months ago (2014-07-25 06:00:56 UTC) #18
falken
thanks lgtm
6 years, 5 months ago (2014-07-25 06:08:22 UTC) #19
horo
The CQ bit was checked by horo@chromium.org
6 years, 5 months ago (2014-07-25 06:09:24 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/horo@chromium.org/399543002/370001
6 years, 5 months ago (2014-07-25 06:10:12 UTC) #21
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_blink_rel on tryserver.blink ...
6 years, 5 months ago (2014-07-25 07:17:19 UTC) #22
commit-bot: I haz the power
6 years, 5 months ago (2014-07-25 08:00:46 UTC) #23
Message was sent while issue was closed.
Change committed as 178904

Powered by Google App Engine