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

Issue 1969403004: Expose and check origin of request in response for foreign fetch. (Closed)

Created:
4 years, 7 months ago by Marijn Kruisselbrink
Modified:
4 years, 7 months ago
Reviewers:
Nate Chapin, horo
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, dglazkov+blink, falken, haraken, horo+watch_chromium.org, jsbell+serviceworker_chromium.org, kenjibaheux+watch_chromium.org, kinuko+serviceworker, michaeln, nhiroki, serviceworker-reviews, tzik
Base URL:
https://chromium.googlesource.com/chromium/src.git@set-request-and-credentials-mode
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Expose and check origin of request in response for foreign fetch. Adds the |origin| attribute in ForeignFetchEvent that was specced in https://github.com/slightlyoff/ServiceWorker/commit/10df242c45757ccf83e2b3ab5813bd1852b2fe7e And implements the checks for the |origin| in the ForeignFetchResponse that is passed to ForeignFetchEvent.respondWith, as specced in steps 16.8 through 16.11 of https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#on-foreign-fetch-request-algorithm as got added in https://github.com/slightlyoff/ServiceWorker/commit/d2fdb147c9c769ac6338117c1acd9f4010365f19 BUG=540509 Committed: https://crrev.com/1e4e767bf4fa7722bc5e9943d7f1446d1b1bdf61 Cr-Commit-Position: refs/heads/master@{#394163}

Patch Set 1 #

Patch Set 2 : fix test expectations #

Total comments: 6

Patch Set 3 : rebase #

Patch Set 4 : update layouttests #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+398 lines, -39 lines) Patch
M third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-basics.html View 1 2 3 3 chunks +27 lines, -16 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-cors.html View 1 2 3 1 chunk +222 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-cors-worker.js View 1 chunk +30 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-helpers.js View 1 2 3 1 chunk +20 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-worker.js View 1 2 3 2 chunks +13 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchResponseData.h View 1 chunk +7 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp View 1 2 5 chunks +12 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchResponseDataTest.cpp View 6 chunks +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ForeignFetchEvent.h View 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ForeignFetchEvent.cpp View 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ForeignFetchEvent.idl View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ForeignFetchEventInit.idl View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.h View 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp View 1 2 3 2 chunks +27 lines, -4 lines 2 comments Download
M third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.cpp View 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerResponseError.h View 1 chunk +3 lines, -1 line 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 19 (8 generated)
Marijn Kruisselbrink
(the layouttests in this CL are maybe a bit more complicated than needed to test ...
4 years, 7 months ago (2016-05-12 23:12:08 UTC) #6
horo
This cl lgtm. But please add LayoutTest to check that ForeignFetchEvent.origin is "null" when "no-referrer" ...
4 years, 7 months ago (2016-05-16 05:28:39 UTC) #7
Marijn Kruisselbrink
On 2016/05/16 at 05:28:39, horo wrote: > But please add LayoutTest to check that ForeignFetchEvent.origin ...
4 years, 7 months ago (2016-05-16 23:35:44 UTC) #8
horo
On 2016/05/16 23:35:44, Marijn Kruisselbrink wrote: > On 2016/05/16 at 05:28:39, horo wrote: > > ...
4 years, 7 months ago (2016-05-17 00:16:42 UTC) #9
Marijn Kruisselbrink
+japhet for WebKit/Source/web OWNERS
4 years, 7 months ago (2016-05-17 00:19:44 UTC) #11
Nate Chapin
Source/web/ LGTM, but a concern in modules... https://codereview.chromium.org/1969403004/diff/80001/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp File third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp (right): https://codereview.chromium.org/1969403004/diff/80001/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp#newcode43 third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp:43: } else ...
4 years, 7 months ago (2016-05-17 17:39:22 UTC) #12
Marijn Kruisselbrink
https://codereview.chromium.org/1969403004/diff/80001/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp File third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp (right): https://codereview.chromium.org/1969403004/diff/80001/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp#newcode43 third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp:43: } else if (m_requestOrigin->toString() != foreignFetchResponse.origin()) { On 2016/05/17 ...
4 years, 7 months ago (2016-05-17 17:43:16 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1969403004/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1969403004/80001
4 years, 7 months ago (2016-05-17 17:43:59 UTC) #15
Nate Chapin
On 2016/05/17 17:43:16, Marijn Kruisselbrink wrote: > https://codereview.chromium.org/1969403004/diff/80001/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp > File > third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp > (right): > ...
4 years, 7 months ago (2016-05-17 17:51:31 UTC) #16
commit-bot: I haz the power
Committed patchset #4 (id:80001)
4 years, 7 months ago (2016-05-17 18:04:31 UTC) #17
commit-bot: I haz the power
4 years, 7 months ago (2016-05-17 18:06:14 UTC) #19
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/1e4e767bf4fa7722bc5e9943d7f1446d1b1bdf61
Cr-Commit-Position: refs/heads/master@{#394163}

Powered by Google App Engine
This is Rietveld 408576698