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

Issue 2918313002: Implement new referrer policies (Closed)

Created:
3 years, 6 months ago by estark
Modified:
3 years, 6 months ago
CC:
Aaron Boodman, abarth-chromium, apavlov+blink_chromium.org, blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, caseq+blink_chromium.org, cbentzel+watch_chromium.org, chromium-reviews, darin (slow to review), darin-cc_chromium.org, devtools-reviews_chromium.org, dglazkov+blink, eae+blinkwatch, gavinp+prerender_chromium.org, haraken, jam, kinuko+watch, kozyatinskiy+blink_chromium.org, loading-reviews+parser_chromium.org, lushnikov+blink_chromium.org, net-reviews_chromium.org, pfeldman, pfeldman+blink_chromium.org, platform-architecture-syd+reviews-web_chromium.org, qsr+mojo_chromium.org, rwlbuis, sof, viettrungluu+watch_chromium.org, Yoav Weiss, yzshen+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement new referrer policies This CL implements the policies 'same-origin' and 'strict-origin', and repurposes existing logic that was previously only available behind a flag for 'strict-origin-when-cross-origin'. (I've left it as a TODO for a follow-up to rename this policy to match the spec.) Existing web platform tests cover the new policies and should now pass. Intent to Implement and Ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/TgtPUowSWuU/Y-Sn2oRsCAAJ BUG=627968 Review-Url: https://codereview.chromium.org/2918313002 Cr-Commit-Position: refs/heads/master@{#479182} Committed: https://chromium.googlesource.com/chromium/src/+/c8ccba8b415fa20f5ded85c58a100cfb3cdda4c4

Patch Set 1 #

Patch Set 2 : fix test expectations #

Patch Set 3 : update ios #

Patch Set 4 : remove redundant logic and use util function #

Patch Set 5 : ios fix #

Total comments: 2

Patch Set 6 : switch enum ordering #

Patch Set 7 : rebase #

Total comments: 20

Patch Set 8 : mmenke, kkhorimoto comments #

Patch Set 9 : update a comment #

Total comments: 5

Patch Set 10 : rebase #

Patch Set 11 : update public/platform/OWNERS per presubmit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+660 lines, -242 lines) Patch
M chrome/browser/referrer_policy_browsertest.cc View 2 chunks +40 lines, -0 lines 0 comments Download
M components/sessions/ios/ios_serialized_navigation_driver.cc View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -23 lines 0 comments Download
M content/browser/devtools/protocol/network_handler.cc View 3 chunks +8 lines, -7 lines 0 comments Download
M content/child/web_url_loader_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M content/public/common/referrer.cc View 2 chunks +16 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -2 lines 0 comments Download
M ios/web/public/referrer.h View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M ios/web/public/referrer_util.cc View 1 2 3 chunks +32 lines, -3 lines 0 comments Download
M ios/web/public/referrer_util_unittest.cc View 1 2 4 chunks +82 lines, -19 lines 0 comments Download
M net/url_request/url_request.h View 1 2 3 4 5 6 7 2 chunks +28 lines, -17 lines 0 comments Download
M net/url_request/url_request.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_job.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -4 lines 0 comments Download
M net/url_request/url_request_job.cc View 1 2 3 4 5 6 7 5 chunks +36 lines, -10 lines 0 comments Download
M net/url_request/url_request_job_unittest.cc View 1 2 3 4 5 6 7 1 chunk +91 lines, -0 lines 0 comments Download
M net/url_request/url_request_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +158 lines, -55 lines 0 comments Download
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -5 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/beacon/headers/header-referrer-same-origin-expected.txt View 1 1 chunk +0 lines, -5 lines 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/beacon/headers/header-referrer-strict-origin-when-cross-origin.https-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/beacon/headers/header-referrer-strict-origin.https-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/fetch/api/redirect/redirect-referrer-expected.txt View 1 1 chunk +0 lines, -35 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/fetch/api/redirect/redirect-referrer-worker-expected.txt View 1 1 chunk +0 lines, -35 lines 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-init-001.sub-expected.txt View 1 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-invalid-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/DocumentTest.cpp View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ExecutionContext.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp View 1 chunk +16 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp View 1 2 3 4 5 6 2 chunks +6 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/browser_protocol.json View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp View 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/Request.cpp View 1 2 3 4 5 6 1 chunk +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/RequestInit.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/weborigin/ReferrerPolicy.h View 1 2 3 4 5 1 chunk +9 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp View 1 2 3 4 5 6 2 chunks +28 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/weborigin/SecurityPolicyTest.cpp View 6 chunks +27 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/AssertMatchingEnums.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/OWNERS View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/ReferrerPolicyEnumTraits.h View 2 chunks +10 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebReferrerPolicy.h View 1 2 3 4 5 2 chunks +7 lines, -2 lines 0 comments Download
M third_party/WebKit/public/platform/referrer.mojom View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 62 (45 generated)
estark
Jochen, PTAL? (Sorry for the large CL... a lot of it is mechanical.) Caveats: - ...
3 years, 6 months ago (2017-06-05 23:24:32 UTC) #13
jochen (gone - plz use gerrit)
lgtm with nit https://codereview.chromium.org/2918313002/diff/80001/third_party/WebKit/public/platform/WebReferrerPolicy.h File third_party/WebKit/public/platform/WebReferrerPolicy.h (right): https://codereview.chromium.org/2918313002/diff/80001/third_party/WebKit/public/platform/WebReferrerPolicy.h#newcode43 third_party/WebKit/public/platform/WebReferrerPolicy.h:43: kWebReferrerPolicySameOrigin, these should go at the ...
3 years, 6 months ago (2017-06-06 14:51:27 UTC) #24
estark
Thanks, Jochen. Adding in other owners: - mmenke for net/ - kkhorimoto for ios/ - ...
3 years, 6 months ago (2017-06-06 22:41:00 UTC) #28
mmenke
https://codereview.chromium.org/2918313002/diff/120001/net/url_request/url_request.h File net/url_request/url_request.h (right): https://codereview.chromium.org/2918313002/diff/120001/net/url_request/url_request.h#newcode99 net/url_request/url_request.h:99: // requests will send the full referrer. Remove "(currently ...
3 years, 6 months ago (2017-06-07 21:04:03 UTC) #35
kkhorimoto
https://codereview.chromium.org/2918313002/diff/120001/ios/web/public/referrer_util.cc File ios/web/public/referrer_util.cc (left): https://codereview.chromium.org/2918313002/diff/120001/ios/web/public/referrer_util.cc#oldcode73 ios/web/public/referrer_util.cc:73: return web::ReferrerPolicyNever; It looks like we were intentionally using ...
3 years, 6 months ago (2017-06-08 00:56:46 UTC) #36
estark
https://codereview.chromium.org/2918313002/diff/120001/ios/web/public/referrer_util.cc File ios/web/public/referrer_util.cc (left): https://codereview.chromium.org/2918313002/diff/120001/ios/web/public/referrer_util.cc#oldcode73 ios/web/public/referrer_util.cc:73: return web::ReferrerPolicyNever; On 2017/06/08 00:56:46, kkhorimoto_ wrote: > It ...
3 years, 6 months ago (2017-06-08 18:42:58 UTC) #39
mmenke
net/ LGTM https://codereview.chromium.org/2918313002/diff/120001/net/url_request/url_request_job.cc File net/url_request/url_request_job.cc (right): https://codereview.chromium.org/2918313002/diff/120001/net/url_request/url_request_job.cc#newcode90 net/url_request/url_request_job.cc:90: for (const auto& token : policy_tokens) { ...
3 years, 6 months ago (2017-06-08 19:11:28 UTC) #44
estark
Friendly ping to pfeldman ( third_party/WebKit/Source/core/inspector/browser_protocol.json) and kkhorimoto (ios/)
3 years, 6 months ago (2017-06-09 17:06:57 UTC) #45
kkhorimoto
ios/ lgtm
3 years, 6 months ago (2017-06-09 18:10:46 UTC) #46
estark
Another ping to pfeldman for third_party/WebKit/Source/core/inspector/browser_protocol.json also +mkwst for IPC security review (third_party/WebKit/public/platform/referrer.mojom)
3 years, 6 months ago (2017-06-13 00:04:11 UTC) #48
Mike West
mojo LGTM. Tiny questions about tests. https://codereview.chromium.org/2918313002/diff/160001/third_party/WebKit/LayoutTests/external/wpt/beacon/headers/header-referrer-strict-origin-when-cross-origin.https-expected.txt File third_party/WebKit/LayoutTests/external/wpt/beacon/headers/header-referrer-strict-origin-when-cross-origin.https-expected.txt (right): https://codereview.chromium.org/2918313002/diff/160001/third_party/WebKit/LayoutTests/external/wpt/beacon/headers/header-referrer-strict-origin-when-cross-origin.https-expected.txt#newcode3 third_party/WebKit/LayoutTests/external/wpt/beacon/headers/header-referrer-strict-origin-when-cross-origin.https-expected.txt:3: FAIL Test referer ...
3 years, 6 months ago (2017-06-13 08:49:58 UTC) #49
pfeldman
browser_protocol.json lgtm
3 years, 6 months ago (2017-06-13 19:24:01 UTC) #50
estark
Thanks, everyone. https://codereview.chromium.org/2918313002/diff/160001/third_party/WebKit/LayoutTests/external/wpt/beacon/headers/header-referrer-strict-origin-when-cross-origin.https-expected.txt File third_party/WebKit/LayoutTests/external/wpt/beacon/headers/header-referrer-strict-origin-when-cross-origin.https-expected.txt (right): https://codereview.chromium.org/2918313002/diff/160001/third_party/WebKit/LayoutTests/external/wpt/beacon/headers/header-referrer-strict-origin-when-cross-origin.https-expected.txt#newcode3 third_party/WebKit/LayoutTests/external/wpt/beacon/headers/header-referrer-strict-origin-when-cross-origin.https-expected.txt:3: FAIL Test referer header http://web-platform.test:8001/beacon/resources/ assert_true: SendBeacon ...
3 years, 6 months ago (2017-06-13 19:46:31 UTC) #51
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/2918313002/180001
3 years, 6 months ago (2017-06-13 19:52:15 UTC) #54
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/462848)
3 years, 6 months ago (2017-06-13 20:06:47 UTC) #56
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/2918313002/200001
3 years, 6 months ago (2017-06-13 20:08:14 UTC) #59
commit-bot: I haz the power
3 years, 6 months ago (2017-06-13 22:38:04 UTC) #62
Message was sent while issue was closed.
Committed patchset #11 (id:200001) as
https://chromium.googlesource.com/chromium/src/+/c8ccba8b415fa20f5ded85c58a10...

Powered by Google App Engine
This is Rietveld 408576698