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

Issue 1390943003: Bypass ServiceWorker when the request originates from isolated world. (Closed)

Created:
5 years, 2 months ago by horo
Modified:
5 years, 1 month ago
CC:
blink-reviews, chromium-reviews, gavinp+loader_chromium.org, Nate Chapin, kinuko+watch, tyoshino+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Bypass ServiceWorker when the request originates from isolated world. After https://codereview.chromium.org/1192013003, when Chrome extension sends XHR request to "chrome-extension://*" to get the contents in the extension, the request goes to the page's ServiceWorker. This is breaking some extensions. (crbug.com/517181) And also it is causing ASSERT failure. (crbug.com/528818) The requests initiated from extensions should not go to the ServiceWorker. So this CL checks DOMWrapperWorld.isIsolatedWorld and sets the skipServiceWorker flag to bypass the SW. BUG=528818, 517181 Committed: https://crrev.com/1eedddee100558e29c08a599d4274609c581dc2a Cr-Commit-Position: refs/heads/master@{#360533}

Patch Set 1 #

Patch Set 2 : add browser test #

Total comments: 2

Patch Set 3 : use m_document and add comments #

Total comments: 2

Patch Set 4 : move to .js file. #

Total comments: 3

Patch Set 5 : Check isIsolatedWorld and set skipServiceWorker. #

Total comments: 2

Patch Set 6 : rebase #

Patch Set 7 : add License comments #

Patch Set 8 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -10 lines) Patch
M chrome/browser/extensions/service_worker_apitest.cc View 1 2 3 4 5 6 7 3 chunks +22 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/service_worker/content_script_fetch/background.js View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/service_worker/content_script_fetch/content_script.js View 1 2 3 4 1 chunk +26 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/service_worker/content_script_fetch/controlled_page/index.html View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/service_worker/content_script_fetch/controlled_page/register_sw.js View 1 2 3 4 5 6 1 chunk +27 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/service_worker/content_script_fetch/controlled_page/sw.js View 1 2 1 chunk +21 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/api_test/service_worker/content_script_fetch/controlled_page/sw.js.mock-http-headers View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/test/data/extensions/api_test/service_worker/content_script_fetch/data_for_content_script View 1 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/service_worker/content_script_fetch/manifest.json View 1 1 chunk +19 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp View 1 2 3 4 5 6 5 chunks +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchManager.cpp View 1 2 3 4 5 6 6 chunks +8 lines, -5 lines 0 comments Download

Messages

Total messages: 58 (25 generated)
horo
hiroshige@ Could you please review this?
5 years, 2 months ago (2015-10-07 05:19:59 UTC) #2
hiroshige
Looks good. Can we add tests?
5 years, 2 months ago (2015-10-08 14:28:09 UTC) #3
horo
On 2015/10/08 14:28:09, hiroshige wrote: > Looks good. Can we add tests? Added.
5 years, 2 months ago (2015-10-09 09:50:56 UTC) #4
horo
On 2015/10/09 09:50:56, horo wrote: > On 2015/10/08 14:28:09, hiroshige wrote: > > Looks good. ...
5 years, 2 months ago (2015-10-15 02:25:41 UTC) #5
hiroshige
lgtm with a nit. https://codereview.chromium.org/1390943003/diff/20001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp File third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp (right): https://codereview.chromium.org/1390943003/diff/20001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp#newcode185 third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp:185: if (!document.securityOrigin()->isSameSchemeHostPort(securityOrigin())) { nit: Using ...
5 years, 2 months ago (2015-10-15 08:30:02 UTC) #6
hiroshige
FYI. blink_presubmit fails: Found a bad license header in these files: chrome/test/data/extensions/api_test/service_worker/content_script_fetch/background.js \ chrome/test/data/extensions/api_test/service_worker/content_script_fetch/content_script.js \ ...
5 years, 2 months ago (2015-10-15 08:31:32 UTC) #7
horo
asargent@ Could you please review chrome/browser/extensions/*?
5 years, 2 months ago (2015-10-16 06:02:12 UTC) #9
asargent_no_longer_on_chrome
lgtm https://codereview.chromium.org/1390943003/diff/40001/chrome/test/data/extensions/api_test/service_worker/content_script_fetch/controlled_page/index.html File chrome/test/data/extensions/api_test/service_worker/content_script_fetch/controlled_page/index.html (right): https://codereview.chromium.org/1390943003/diff/40001/chrome/test/data/extensions/api_test/service_worker/content_script_fetch/controlled_page/index.html#newcode1 chrome/test/data/extensions/api_test/service_worker/content_script_fetch/controlled_page/index.html:1: <script> optional suggestion: you might consider moving all ...
5 years, 2 months ago (2015-10-16 17:58:48 UTC) #10
horo
https://codereview.chromium.org/1390943003/diff/40001/chrome/test/data/extensions/api_test/service_worker/content_script_fetch/controlled_page/index.html File chrome/test/data/extensions/api_test/service_worker/content_script_fetch/controlled_page/index.html (right): https://codereview.chromium.org/1390943003/diff/40001/chrome/test/data/extensions/api_test/service_worker/content_script_fetch/controlled_page/index.html#newcode1 chrome/test/data/extensions/api_test/service_worker/content_script_fetch/controlled_page/index.html:1: <script> On 2015/10/16 17:58:48, Antony Sargent wrote: > optional ...
5 years, 2 months ago (2015-10-19 03:54:39 UTC) #11
horo
mkwst@ Could you please review third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp?
5 years, 2 months ago (2015-10-19 03:55:17 UTC) #13
Mike West
https://codereview.chromium.org/1390943003/diff/60001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp File third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp (right): https://codereview.chromium.org/1390943003/diff/60001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp#newcode188 third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp:188: if (!m_document.securityOrigin()->isSameSchemeHostPort(securityOrigin())) { 1. This doesn't have anything to ...
5 years, 2 months ago (2015-10-19 11:55:18 UTC) #14
horo
https://codereview.chromium.org/1390943003/diff/60001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp File third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp (right): https://codereview.chromium.org/1390943003/diff/60001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp#newcode188 third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp:188: if (!m_document.securityOrigin()->isSameSchemeHostPort(securityOrigin())) { On 2015/10/19 11:55:18, Mike West (slow) ...
5 years, 2 months ago (2015-10-19 12:49:32 UTC) #15
kinuko (google)
https://codereview.chromium.org/1390943003/diff/60001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp File third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp (right): https://codereview.chromium.org/1390943003/diff/60001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp#newcode188 third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp:188: if (!m_document.securityOrigin()->isSameSchemeHostPort(securityOrigin())) { On 2015/10/19 12:49:32, horo wrote: > ...
5 years, 2 months ago (2015-10-19 14:57:30 UTC) #17
horo
On 2015/10/19 14:57:30, kinuko (google) wrote: > https://codereview.chromium.org/1390943003/diff/60001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp > File third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp (right): > > https://codereview.chromium.org/1390943003/diff/60001/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp#newcode188 ...
5 years, 1 month ago (2015-11-05 03:39:14 UTC) #19
Mike West
https://codereview.chromium.org/1390943003/diff/80001/third_party/WebKit/Source/modules/fetch/FetchManager.cpp File third_party/WebKit/Source/modules/fetch/FetchManager.cpp (right): https://codereview.chromium.org/1390943003/diff/80001/third_party/WebKit/Source/modules/fetch/FetchManager.cpp#newcode560 third_party/WebKit/Source/modules/fetch/FetchManager.cpp:560: request.setSkipServiceWorker(m_isIsolatedWorld); Doesn't this override the setting in cases where ...
5 years, 1 month ago (2015-11-05 08:27:27 UTC) #20
horo
https://codereview.chromium.org/1390943003/diff/80001/third_party/WebKit/Source/modules/fetch/FetchManager.cpp File third_party/WebKit/Source/modules/fetch/FetchManager.cpp (right): https://codereview.chromium.org/1390943003/diff/80001/third_party/WebKit/Source/modules/fetch/FetchManager.cpp#newcode560 third_party/WebKit/Source/modules/fetch/FetchManager.cpp:560: request.setSkipServiceWorker(m_isIsolatedWorld); On 2015/11/05 08:27:27, Mike West wrote: > Doesn't ...
5 years, 1 month ago (2015-11-05 08:47:10 UTC) #21
horo
ping?
5 years, 1 month ago (2015-11-17 04:01:16 UTC) #22
Mike West
On 2015/11/17 at 04:01:16, horo wrote: > ping? Sorry for the delay, this fell off ...
5 years, 1 month ago (2015-11-17 18:51:17 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390943003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390943003/100001
5 years, 1 month ago (2015-11-18 01:46:23 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, no build URL)
5 years, 1 month ago (2015-11-18 02:02:33 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390943003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390943003/100001
5 years, 1 month ago (2015-11-18 06:29:57 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/119687)
5 years, 1 month ago (2015-11-18 06:39:03 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390943003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390943003/120001
5 years, 1 month ago (2015-11-18 08:07:00 UTC) #38
commit-bot: I haz the power
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/142348)
5 years, 1 month ago (2015-11-18 09:50:34 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390943003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390943003/120001
5 years, 1 month ago (2015-11-18 22:42:46 UTC) #42
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, no build URL) linux_chromium_rel_ng on ...
5 years, 1 month ago (2015-11-18 23:38:52 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390943003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390943003/120001
5 years, 1 month ago (2015-11-18 23:54:16 UTC) #46
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, no build URL)
5 years, 1 month ago (2015-11-19 01:02:48 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390943003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390943003/120001
5 years, 1 month ago (2015-11-19 01:40:51 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, no build URL) linux_chromium_rel_ng on ...
5 years, 1 month ago (2015-11-19 02:00:09 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1390943003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1390943003/160001
5 years, 1 month ago (2015-11-19 03:13:36 UTC) #56
commit-bot: I haz the power
Committed patchset #8 (id:160001)
5 years, 1 month ago (2015-11-19 05:59:34 UTC) #57
commit-bot: I haz the power
5 years, 1 month ago (2015-11-19 06:00:40 UTC) #58
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/1eedddee100558e29c08a599d4274609c581dc2a
Cr-Commit-Position: refs/heads/master@{#360533}

Powered by Google App Engine
This is Rietveld 408576698