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

Issue 1117203002: Enforce referrer policies for workers (Closed)

Created:
5 years, 7 months ago by estark
Modified:
5 years, 7 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, gavinp+loader_chromium.org, Nate Chapin, mkwst+watchlist-csp_chromium.org, rwlbuis, sof, tyoshino+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Enforce referrer policies for workers When requesting a resource on behalf of a worker, use the worker's referrer policy instead of the default. This CL does three things: 1. Move the referrer policy from Document to ExecutionContext, so that other contexts (i.e. WorkerGlobalScope) get referrer policies too. 2. When binding a CSP to an ExecutionContext, set the referrer policy for all types of contexts, not just Document. 3. When setting up a MainThreadBridge to load a resource from a worker, use the worker's referrer policy to generate the referrer for the request, instead of always using the default referrer policy. Added layout tests to check that workers can have a referrer policy different from the document's. BUG=483458 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=194885

Patch Set 1 #

Total comments: 4

Patch Set 2 : remove Document::setReferrerPolicy override #

Total comments: 7

Patch Set 3 : fix layout test indentation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -24 lines) Patch
M LayoutTests/http/tests/security/contentSecurityPolicy/resources/worker.php View 1 chunk +11 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/security/referrer-policy-worker-has-referrer.html View 1 2 1 chunk +20 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/security/referrer-policy-worker-no-referrer.html View 1 chunk +19 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/security/resources/echo-referrer-header.php View 1 chunk +8 lines, -0 lines 0 comments Download
M Source/core/dom/Document.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 chunks +0 lines, -11 lines 0 comments Download
M Source/core/dom/ExecutionContext.h View 3 chunks +6 lines, -0 lines 0 comments Download
M Source/core/dom/ExecutionContext.cpp View 1 3 chunks +12 lines, -0 lines 0 comments Download
M Source/core/frame/csp/ContentSecurityPolicy.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M Source/core/loader/WorkerThreadableLoader.h View 3 chunks +3 lines, -2 lines 0 comments Download
M Source/core/loader/WorkerThreadableLoader.cpp View 4 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 13 (3 generated)
estark
Mike, Jochen: please take a look. Thanks!
5 years, 7 months ago (2015-05-01 14:17:47 UTC) #2
Mike West
This is looking great, thanks for taking the time to work this out. LGTM % ...
5 years, 7 months ago (2015-05-01 14:34:29 UTC) #3
estark
https://codereview.chromium.org/1117203002/diff/1/LayoutTests/http/tests/security/contentSecurityPolicy/resources/worker.php File LayoutTests/http/tests/security/contentSecurityPolicy/resources/worker.php (right): https://codereview.chromium.org/1117203002/diff/1/LayoutTests/http/tests/security/contentSecurityPolicy/resources/worker.php#newcode87 LayoutTests/http/tests/security/contentSecurityPolicy/resources/worker.php:87: var xhr = new XMLHttpRequest; On 2015/05/01 14:34:29, Mike ...
5 years, 7 months ago (2015-05-01 18:19:55 UTC) #4
Mike West
Still LGTM. Thanks!
5 years, 7 months ago (2015-05-01 21:45:17 UTC) #5
jochen (gone - plz use gerrit)
overall lgtm thanks for doing this https://codereview.chromium.org/1117203002/diff/20001/LayoutTests/http/tests/security/referrer-policy-worker-has-referrer.html File LayoutTests/http/tests/security/referrer-policy-worker-has-referrer.html (right): https://codereview.chromium.org/1117203002/diff/20001/LayoutTests/http/tests/security/referrer-policy-worker-has-referrer.html#newcode4 LayoutTests/http/tests/security/referrer-policy-worker-has-referrer.html:4: <script src="/resources/testharness.js"></script> nit ...
5 years, 7 months ago (2015-05-04 07:20:31 UTC) #6
Mike West
https://codereview.chromium.org/1117203002/diff/20001/Source/core/dom/ExecutionContext.cpp File Source/core/dom/ExecutionContext.cpp (right): https://codereview.chromium.org/1117203002/diff/20001/Source/core/dom/ExecutionContext.cpp#newcode257 Source/core/dom/ExecutionContext.cpp:257: if (m_referrerPolicy != ReferrerPolicyDefault) On 2015/05/04 07:20:31, jochen wrote: ...
5 years, 7 months ago (2015-05-04 14:17:21 UTC) #7
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1117203002/diff/20001/Source/core/dom/ExecutionContext.cpp File Source/core/dom/ExecutionContext.cpp (right): https://codereview.chromium.org/1117203002/diff/20001/Source/core/dom/ExecutionContext.cpp#newcode257 Source/core/dom/ExecutionContext.cpp:257: if (m_referrerPolicy != ReferrerPolicyDefault) On 2015/05/04 14:17:20, Mike West ...
5 years, 7 months ago (2015-05-04 14:36:12 UTC) #8
estark
https://codereview.chromium.org/1117203002/diff/20001/LayoutTests/http/tests/security/referrer-policy-worker-has-referrer.html File LayoutTests/http/tests/security/referrer-policy-worker-has-referrer.html (right): https://codereview.chromium.org/1117203002/diff/20001/LayoutTests/http/tests/security/referrer-policy-worker-has-referrer.html#newcode4 LayoutTests/http/tests/security/referrer-policy-worker-has-referrer.html:4: <script src="/resources/testharness.js"></script> On 2015/05/04 07:20:31, jochen wrote: > nit ...
5 years, 7 months ago (2015-05-04 18:09:22 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1117203002/40001
5 years, 7 months ago (2015-05-04 18:09:57 UTC) #12
commit-bot: I haz the power
5 years, 7 months ago (2015-05-04 19:49:06 UTC) #13
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=194885

Powered by Google App Engine
This is Rietveld 408576698