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

Issue 2105503002: Skip foreign fetch when the skipServiceWorker flag is set on a request. (Closed)

Created:
4 years, 5 months ago by Marijn Kruisselbrink
Modified:
4 years, 5 months ago
Reviewers:
kinuko, palmer, horo
CC:
apavlov+blink_chromium.org, blink-reviews, blink-reviews-api_chromium.org, blink-worker-reviews_chromium.org, caseq+blink_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, devtools-reviews_chromium.org, dglazkov+blink, falken, gavinp+loader_chromium.org, haraken, horo+watch_chromium.org, jam, Nate Chapin, jsbell+serviceworker_chromium.org, kenjibaheux+watch_chromium.org, kinuko+serviceworker, kinuko+watch, kozyatinskiy+blink_chromium.org, loading-reviews_chromium.org, loading-reviews+fetch_chromium.org, lushnikov+blink_chromium.org, michaeln, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, nhiroki, pfeldman+blink_chromium.org, Randy Smith (Not in Mondays), sergeyv+blink_chromium.org, serviceworker-reviews, tyoshino+watch_chromium.org, tzik
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Skip foreign fetch when the skipServiceWorker flag is set on a request. Foreign fetch used to completely ignore the skipServiceWorker flag. Just skipping foreign fetch whenever skipServiceWorker is true would not be correct as the flag is both set in situations where a request needs to bypass service workers, but also when the renderer doesn't believe the client making the request is controlled by a service worker. In that second case foreign fetch would still need to process the request. To fix this, this changes skipServiceWorker to an enum with three states, in order to distinguish between skipping all service workers (for CORS preflight, dev-tools skip service worker, force-refresh, etc) and skipping just the controlling service worker. This also makes sure that (for now) any request that requires a CORS preflight will not get intercepted by foreign fetch. BUG=540509, 604084 Committed: https://crrev.com/2afc5027b2ed43ddd6f26193ad8dc577a2d4b2f0 Cr-Commit-Position: refs/heads/master@{#403312}

Patch Set 1 #

Patch Set 2 : fix resource loading #

Total comments: 8

Patch Set 3 : add comments explaing why skip is set to ::Controlling for fallback requests #

Total comments: 6

Patch Set 4 : rephrase SkipServiceWorker comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+182 lines, -66 lines) Patch
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 2 chunks +8 lines, -8 lines 0 comments Download
M content/browser/service_worker/foreign_fetch_request_handler.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/foreign_fetch_request_handler.cc View 2 chunks +5 lines, -3 lines 0 comments Download
M content/child/request_info.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M content/child/request_info.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/child/web_url_loader_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M content/child/web_url_loader_impl.cc View 1 2 3 chunks +9 lines, -5 lines 0 comments Download
M content/child/web_url_request_util.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/child/web_url_request_util.cc View 1 chunk +12 lines, -0 lines 0 comments Download
M content/common/resource_messages.h View 1 chunk +3 lines, -0 lines 0 comments Download
M content/common/resource_request.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M content/common/service_worker/service_worker_types.h View 1 2 3 1 chunk +13 lines, -0 lines 0 comments Download
M content/public/renderer/resource_fetcher.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/fetchers/resource_fetcher_impl.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/fetchers/resource_fetcher_impl.cc View 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/pepper/pepper_url_loader_host.cc View 1 chunk +3 lines, -1 line 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 2 chunks +7 lines, -3 lines 0 comments Download
M content/renderer/shared_worker/embedded_shared_worker_stub.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-basics.html View 1 3 chunks +37 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-worker.js View 1 2 chunks +9 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceLoader.cpp View 1 2 2 chunks +11 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp View 1 2 3 4 chunks +12 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchManager.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/exported/WebURLRequest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceRequest.h View 1 2 3 3 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceRequest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceRequestTest.cpp View 5 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/public/platform/WebURLRequest.h View 1 2 3 2 chunks +14 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 25 (11 generated)
Marijn Kruisselbrink
4 years, 5 months ago (2016-06-28 00:47:00 UTC) #6
horo
https://codereview.chromium.org/2105503002/diff/20001/content/child/web_url_loader_impl.cc File content/child/web_url_loader_impl.cc (right): https://codereview.chromium.org/2105503002/diff/20001/content/child/web_url_loader_impl.cc#newcode588 content/child/web_url_loader_impl.cc:588: : blink::WebURLRequest::SkipServiceWorker::All, What should happen in this case? 1. ...
4 years, 5 months ago (2016-06-28 12:10:02 UTC) #7
Marijn Kruisselbrink
https://codereview.chromium.org/2105503002/diff/20001/content/child/web_url_loader_impl.cc File content/child/web_url_loader_impl.cc (right): https://codereview.chromium.org/2105503002/diff/20001/content/child/web_url_loader_impl.cc#newcode588 content/child/web_url_loader_impl.cc:588: : blink::WebURLRequest::SkipServiceWorker::All, On 2016/06/28 at 12:10:02, horo wrote: > ...
4 years, 5 months ago (2016-06-28 17:06:13 UTC) #8
horo
https://codereview.chromium.org/2105503002/diff/20001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp File third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp (right): https://codereview.chromium.org/2105503002/diff/20001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp#newcode244 third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp:244: m_fallbackRequestForServiceWorker.setSkipServiceWorker(WebURLRequest::SkipServiceWorker::Controlling); On 2016/06/28 17:06:13, Marijn Kruisselbrink wrote: > On ...
4 years, 5 months ago (2016-06-29 04:06:14 UTC) #9
Marijn Kruisselbrink
https://codereview.chromium.org/2105503002/diff/20001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp File third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp (right): https://codereview.chromium.org/2105503002/diff/20001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp#newcode244 third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp:244: m_fallbackRequestForServiceWorker.setSkipServiceWorker(WebURLRequest::SkipServiceWorker::Controlling); On 2016/06/29 at 04:06:14, horo wrote: > On ...
4 years, 5 months ago (2016-06-29 17:12:15 UTC) #10
horo
lgtm
4 years, 5 months ago (2016-06-29 22:45:55 UTC) #11
kinuko
lgtm with some nits. https://codereview.chromium.org/2105503002/diff/40001/content/common/service_worker/service_worker_types.h File content/common/service_worker/service_worker_types.h (right): https://codereview.chromium.org/2105503002/diff/40001/content/common/service_worker/service_worker_types.h#newcode100 content/common/service_worker/service_worker_types.h:100: // Whether or not a ...
4 years, 5 months ago (2016-06-30 09:38:22 UTC) #12
Marijn Kruisselbrink
https://codereview.chromium.org/2105503002/diff/40001/content/common/service_worker/service_worker_types.h File content/common/service_worker/service_worker_types.h (right): https://codereview.chromium.org/2105503002/diff/40001/content/common/service_worker/service_worker_types.h#newcode100 content/common/service_worker/service_worker_types.h:100: // Whether or not a request should be handled ...
4 years, 5 months ago (2016-06-30 17:41:54 UTC) #13
Marijn Kruisselbrink
+palmer for IPC owners (content/common/resource_messages.h)
4 years, 5 months ago (2016-06-30 17:42:51 UTC) #15
palmer
IPC security LGTM
4 years, 5 months ago (2016-06-30 20:59:42 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2105503002/60001
4 years, 5 months ago (2016-06-30 21:01:50 UTC) #20
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 5 months ago (2016-06-30 22:17:42 UTC) #22
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-06-30 22:18:02 UTC) #23
commit-bot: I haz the power
4 years, 5 months ago (2016-06-30 22:20:20 UTC) #25
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/2afc5027b2ed43ddd6f26193ad8dc577a2d4b2f0
Cr-Commit-Position: refs/heads/master@{#403312}

Powered by Google App Engine
This is Rietveld 408576698