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

Issue 2100583002: Apply Referrer-Policy header when following redirects (Closed)

Created:
4 years, 6 months ago by estark
Modified:
4 years, 5 months ago
CC:
cbentzel+watch_chromium.org, chromium-reviews, Mike West
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Apply Referrer-Policy header when following redirects When a Referrer-Policy header is received during a redirect, URLRequestJob parses it and updates the referrer and referrer policy on the request, if necessary. The Referrer-Policy header is being implemented as an experimental web platform feature. The experimental web platform feature flag is plumbed to URLRequestJob via a boolean on URLRequestContext. This flag should be temporary and only live until the Referrer-Policy feature ships. Intent to Implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/Umj9iVRJM70 Implementation plan: https://docs.google.com/document/d/1SyQhP6Y7BHIQXWL8S1saWqMuar4hoWLGigQuHmizg3g/edit BUG=619228 Committed: https://crrev.com/550ba7f9533922cfeac9709d99815cec9b2ad52a Cr-Commit-Position: refs/heads/master@{#403017}

Patch Set 1 #

Patch Set 2 : add comments #

Patch Set 3 : test cleanup #

Patch Set 4 : build fix #

Patch Set 5 : missing #include #

Patch Set 6 : small cleanup #

Total comments: 1

Patch Set 7 : put new policy in RedirectInfo, set from URLRequest::Redirect() #

Patch Set 8 : update ios switch #

Total comments: 13

Patch Set 9 : mmenke test comments #

Patch Set 10 : add new policy states to URLRequest::ReferrerPolicy #

Patch Set 11 : update ios test #

Total comments: 12

Patch Set 12 : mmenke comments #

Total comments: 13

Patch Set 13 : jochen and mmenke comments #

Patch Set 14 : rebase #

Patch Set 15 : fix rebase mistake #

Patch Set 16 : turn on in layout tests and add layout test #

Total comments: 2

Patch Set 17 : jochen suggestion #

Unified diffs Side-by-side diffs Delta from patch set Stats (+395 lines, -24 lines) Patch
M chrome/browser/profiles/profile_io_data.cc View 1 2 3 4 2 chunks +6 lines, -0 lines 0 comments Download
M content/common/resource_messages.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M content/shell/browser/layout_test/layout_test_url_request_context_getter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M content/shell/browser/layout_test/layout_test_url_request_context_getter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download
M content/shell/browser/shell_url_request_context_getter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download
M content/shell/browser/shell_url_request_context_getter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +9 lines, -0 lines 0 comments Download
M ios/web/public/referrer_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -0 lines 0 comments Download
M net/url_request/redirect_info.h View 1 2 3 4 5 6 2 chunks +5 lines, -0 lines 0 comments Download
M net/url_request/redirect_info.cc View 1 2 3 4 5 6 1 chunk +4 lines, -1 line 0 comments Download
M net/url_request/url_request.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +20 lines, -16 lines 0 comments Download
M net/url_request/url_request.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +10 lines, -0 lines 0 comments Download
M net/url_request/url_request_context.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +13 lines, -0 lines 0 comments Download
M net/url_request/url_request_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -1 line 0 comments Download
M net/url_request/url_request_job.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +69 lines, -3 lines 0 comments Download
M net/url_request/url_request_job_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +221 lines, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/referrerPolicyHeader/referrer-policy-redirect.php View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/referrerPolicyHeader/resources/header-test.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/referrerPolicyHeader/resources/no-referrer-on-redirect.php View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/referrerPolicyHeader/resources/postmessage-referrer.php View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 46 (8 generated)
estark
mmenke, jochen, PTAL? (mkwst optional but welcome, as usual) Thanks!
4 years, 6 months ago (2016-06-25 00:59:33 UTC) #2
estark
https://codereview.chromium.org/2100583002/diff/100001/net/url_request/url_request_job.cc File net/url_request/url_request_job.cc (right): https://codereview.chromium.org/2100583002/diff/100001/net/url_request/url_request_job.cc#newcode91 net/url_request/url_request_job.cc:91: request->set_referrer_policy(URLRequest::NEVER_CLEAR_REFERRER); Hrm. These set_referrer_policy() calls run afoul of set_referrer_policy()'s ...
4 years, 6 months ago (2016-06-25 14:42:15 UTC) #3
mmenke
On 2016/06/25 14:42:15, estark wrote: > https://codereview.chromium.org/2100583002/diff/100001/net/url_request/url_request_job.cc > File net/url_request/url_request_job.cc (right): > > https://codereview.chromium.org/2100583002/diff/100001/net/url_request/url_request_job.cc#newcode91 > ...
4 years, 6 months ago (2016-06-25 14:52:09 UTC) #4
estark
On 2016/06/25 14:52:09, mmenke wrote: > On 2016/06/25 14:42:15, estark wrote: > > > https://codereview.chromium.org/2100583002/diff/100001/net/url_request/url_request_job.cc ...
4 years, 6 months ago (2016-06-25 15:11:12 UTC) #5
mmenke
On 2016/06/25 15:11:12, estark wrote: > On 2016/06/25 14:52:09, mmenke wrote: > > On 2016/06/25 ...
4 years, 6 months ago (2016-06-25 18:23:51 UTC) #6
estark
On 2016/06/25 18:23:51, mmenke wrote: > On 2016/06/25 15:11:12, estark wrote: > > On 2016/06/25 ...
4 years, 5 months ago (2016-06-26 16:07:38 UTC) #7
mmenke
On 2016/06/26 16:07:38, estark wrote: > On 2016/06/25 18:23:51, mmenke wrote: > > On 2016/06/25 ...
4 years, 5 months ago (2016-06-26 16:18:51 UTC) #8
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2100583002/diff/140001/chrome/browser/profiles/profile_io_data.cc File chrome/browser/profiles/profile_io_data.cc (right): https://codereview.chromium.org/2100583002/diff/140001/chrome/browser/profiles/profile_io_data.cc#newcode1036 chrome/browser/profiles/profile_io_data.cc:1036: command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)); how will this work in content shell?
4 years, 5 months ago (2016-06-27 08:33:40 UTC) #9
mmenke
https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc File net/url_request/url_request_job.cc (right): https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc#newcode1057 net/url_request/url_request_job.cc:1057: if (request_->context()->enable_referrer_policy_header()) { Question...I may have asked this before, ...
4 years, 5 months ago (2016-06-27 17:18:04 UTC) #10
mmenke
https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc File net/url_request/url_request_job.cc (right): https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc#newcode1057 net/url_request/url_request_job.cc:1057: if (request_->context()->enable_referrer_policy_header()) { On 2016/06/27 17:18:04, mmenke wrote: > ...
4 years, 5 months ago (2016-06-27 17:20:04 UTC) #11
estark
https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc File net/url_request/url_request_job.cc (right): https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc#newcode1057 net/url_request/url_request_job.cc:1057: if (request_->context()->enable_referrer_policy_header()) { On 2016/06/27 17:18:04, mmenke wrote: > ...
4 years, 5 months ago (2016-06-27 17:27:52 UTC) #12
estark
On 2016/06/27 17:27:52, estark wrote: > https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc > File net/url_request/url_request_job.cc (right): > > https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc#newcode1057 > ...
4 years, 5 months ago (2016-06-27 17:29:51 UTC) #13
mmenke
On 2016/06/27 17:29:51, estark wrote: > On 2016/06/27 17:27:52, estark wrote: > > > https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc ...
4 years, 5 months ago (2016-06-27 17:52:26 UTC) #14
mmenke
https://codereview.chromium.org/2100583002/diff/140001/chrome/browser/profiles/profile_io_data.cc File chrome/browser/profiles/profile_io_data.cc (right): https://codereview.chromium.org/2100583002/diff/140001/chrome/browser/profiles/profile_io_data.cc#newcode1036 chrome/browser/profiles/profile_io_data.cc:1036: command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)); On 2016/06/27 08:33:40, jochen wrote: > how will ...
4 years, 5 months ago (2016-06-27 18:38:05 UTC) #15
estark
https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc File net/url_request/url_request_job.cc (right): https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc#newcode84 net/url_request/url_request_job.cc:84: std::string* new_referrer_source) { On 2016/06/27 18:38:05, mmenke wrote: > ...
4 years, 5 months ago (2016-06-27 22:18:34 UTC) #16
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2100583002/diff/140001/chrome/browser/profiles/profile_io_data.cc File chrome/browser/profiles/profile_io_data.cc (right): https://codereview.chromium.org/2100583002/diff/140001/chrome/browser/profiles/profile_io_data.cc#newcode1036 chrome/browser/profiles/profile_io_data.cc:1036: command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)); On 2016/06/27 at 18:38:05, mmenke wrote: > On ...
4 years, 5 months ago (2016-06-28 13:03:46 UTC) #17
mmenke
https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc File net/url_request/url_request_job.cc (right): https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc#newcode84 net/url_request/url_request_job.cc:84: std::string* new_referrer_source) { On 2016/06/27 22:18:34, estark wrote: > ...
4 years, 5 months ago (2016-06-28 14:29:23 UTC) #18
estark
On 2016/06/28 14:29:23, mmenke wrote: > https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc > File net/url_request/url_request_job.cc (right): > > https://codereview.chromium.org/2100583002/diff/140001/net/url_request/url_request_job.cc#newcode84 > ...
4 years, 5 months ago (2016-06-28 20:10:31 UTC) #19
mmenke
A couple suggestions. I haven't quite finished thinking about extra tests or looking at code ...
4 years, 5 months ago (2016-06-28 21:32:09 UTC) #20
estark
https://codereview.chromium.org/2100583002/diff/200001/net/url_request/url_request.h File net/url_request/url_request.h (right): https://codereview.chromium.org/2100583002/diff/200001/net/url_request/url_request.h#newcode95 net/url_request/url_request.h:95: // (NO_REFERRER). On 2016/06/28 21:32:08, mmenke wrote: > optional: ...
4 years, 5 months ago (2016-06-28 22:38:43 UTC) #21
mmenke
A couple nits, but otherwise, LGTM https://codereview.chromium.org/2100583002/diff/220001/net/url_request/url_request_job_unittest.cc File net/url_request/url_request_job_unittest.cc (right): https://codereview.chromium.org/2100583002/diff/220001/net/url_request/url_request_job_unittest.cc#newcode66 net/url_request/url_request_job_unittest.cc:66: void MakeMockReferrerPolicyTransaction(const char* ...
4 years, 5 months ago (2016-06-29 15:05:09 UTC) #22
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2100583002/diff/220001/chrome/browser/profiles/profile_io_data.cc File chrome/browser/profiles/profile_io_data.cc (right): https://codereview.chromium.org/2100583002/diff/220001/chrome/browser/profiles/profile_io_data.cc#newcode1035 chrome/browser/profiles/profile_io_data.cc:1035: main_request_context_->set_enable_referrer_policy_header( can we just turn this unconditionally on in ...
4 years, 5 months ago (2016-06-29 15:26:39 UTC) #23
estark
https://codereview.chromium.org/2100583002/diff/220001/chrome/browser/profiles/profile_io_data.cc File chrome/browser/profiles/profile_io_data.cc (right): https://codereview.chromium.org/2100583002/diff/220001/chrome/browser/profiles/profile_io_data.cc#newcode1035 chrome/browser/profiles/profile_io_data.cc:1035: main_request_context_->set_enable_referrer_policy_header( On 2016/06/29 15:26:39, jochen wrote: > can we ...
4 years, 5 months ago (2016-06-29 17:36:14 UTC) #24
estark
https://codereview.chromium.org/2100583002/diff/220001/net/url_request/url_request_job_unittest.cc File net/url_request/url_request_job_unittest.cc (right): https://codereview.chromium.org/2100583002/diff/220001/net/url_request/url_request_job_unittest.cc#newcode66 net/url_request/url_request_job_unittest.cc:66: void MakeMockReferrerPolicyTransaction(const char* original_location, On 2016/06/29 15:05:09, mmenke wrote: ...
4 years, 5 months ago (2016-06-29 17:44:25 UTC) #25
estark
https://codereview.chromium.org/2100583002/diff/220001/chrome/browser/profiles/profile_io_data.cc File chrome/browser/profiles/profile_io_data.cc (right): https://codereview.chromium.org/2100583002/diff/220001/chrome/browser/profiles/profile_io_data.cc#newcode1035 chrome/browser/profiles/profile_io_data.cc:1035: main_request_context_->set_enable_referrer_policy_header( On 2016/06/29 17:36:14, estark wrote: > On 2016/06/29 ...
4 years, 5 months ago (2016-06-29 17:45:11 UTC) #26
estark
avi: can you please review resource_messages.h? eugenebut: can you please review ios? Thanks!
4 years, 5 months ago (2016-06-29 17:46:28 UTC) #28
Eugene But (OOO till 7-30)
ios lgtm
4 years, 5 months ago (2016-06-29 17:47:38 UTC) #29
Avi (use Gerrit)
On 2016/06/29 17:46:28, estark wrote: > avi: can you please review resource_messages.h? I can't help ...
4 years, 5 months ago (2016-06-29 19:25:27 UTC) #30
estark
palmer can you please review resource_messages.h? Thanks!
4 years, 5 months ago (2016-06-29 19:35:55 UTC) #32
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2100583002/diff/220001/chrome/browser/profiles/profile_io_data.cc File chrome/browser/profiles/profile_io_data.cc (right): https://codereview.chromium.org/2100583002/diff/220001/chrome/browser/profiles/profile_io_data.cc#newcode1035 chrome/browser/profiles/profile_io_data.cc:1035: main_request_context_->set_enable_referrer_policy_header( On 2016/06/29 at 17:45:10, estark wrote: > On ...
4 years, 5 months ago (2016-06-29 19:36:17 UTC) #34
estark
Also I apparently forgot to add palmer... palmer can you please review resource_messages.h? https://codereview.chromium.org/2100583002/diff/220001/chrome/browser/profiles/profile_io_data.cc File ...
4 years, 5 months ago (2016-06-29 20:09:08 UTC) #36
jochen (gone - plz use gerrit)
lgtm, thanks! https://codereview.chromium.org/2100583002/diff/300001/content/shell/browser/shell_url_request_context_getter.cc File content/shell/browser/shell_url_request_context_getter.cc (right): https://codereview.chromium.org/2100583002/diff/300001/content/shell/browser/shell_url_request_context_getter.cc#newcode118 content/shell/browser/shell_url_request_context_getter.cc:118: return false; nit. could be return base::CommandLine::ForCurrentProcess()->HasSwitch(swtiches::kEnableExperimentalWebPlatformFeatures)
4 years, 5 months ago (2016-06-29 20:44:05 UTC) #37
palmer
IPC security LGTM.
4 years, 5 months ago (2016-06-29 20:56:46 UTC) #38
estark
Thanks all! https://codereview.chromium.org/2100583002/diff/300001/content/shell/browser/shell_url_request_context_getter.cc File content/shell/browser/shell_url_request_context_getter.cc (right): https://codereview.chromium.org/2100583002/diff/300001/content/shell/browser/shell_url_request_context_getter.cc#newcode118 content/shell/browser/shell_url_request_context_getter.cc:118: return false; On 2016/06/29 20:44:05, jochen wrote: ...
4 years, 5 months ago (2016-06-29 21:16:48 UTC) #39
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/2100583002/320001
4 years, 5 months ago (2016-06-29 21:18:38 UTC) #42
commit-bot: I haz the power
Committed patchset #17 (id:320001)
4 years, 5 months ago (2016-06-30 00:20:34 UTC) #43
commit-bot: I haz the power
Patchset 17 (id:??) landed as https://crrev.com/550ba7f9533922cfeac9709d99815cec9b2ad52a Cr-Commit-Position: refs/heads/master@{#403017}
4 years, 5 months ago (2016-06-30 00:23:17 UTC) #45
estark
4 years, 5 months ago (2016-06-30 02:57:58 UTC) #46
Message was sent while issue was closed.
A revert of this CL (patchset #17 id:320001) has been created in
https://codereview.chromium.org/2108423002/ by estark@chromium.org.

The reason for reverting is: Broke msan tests
https://build.chromium.org/p/chromium.memory.fyi/builders/Linux%20MSan%20Test....

Powered by Google App Engine
This is Rietveld 408576698