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

Issue 2393633006: Send net's ReferrerPolicy back to Blink while following redirects (Closed)

Created:
4 years, 2 months ago by estark
Modified:
4 years, 2 months ago
CC:
blink-reviews, cbentzel+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, jam, loading-reviews_chromium.org, Randy Smith (Not in Mondays)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Send net's ReferrerPolicy back to Blink while following redirects //net might modify a request's referrer policy while following server redirects that contain a Referrer-Policy header. Blink learns about the redirects via the ResourceMsg_ReceivedRedirect IPC, and in some cases (notably, CORS-enabled redirects), Blink chooses to tell //net not to follow the redirect but instead kicks off a new request to follow the redirect. (See DocumentThreadableLoader::redirectReceived().) In these cases, Blink needs to know the referrer policy that //net assigned to the request, based on the Referrer-Policy header that was received, so that, for example, Blink can apply that referrer policy while following a CORS-enabled redirect itself. This CL changes WebURLLoaderImpl::PopulateURLRequestForRedirect() to translate the request's net::URLRequest::ReferrerPolicy into a WebReferrerPolicy that gets sent to Blink. So that this translation can always be accurate, this CL also stops using NEVER_CLEAR_REFERRER for multiple referrer policies ('origin', 'unsafe-url', and 'no-referrer') and instead always uses the net::URLRequest::ReferrerPolicy corresponding to the actual referrer policy for the request. That is: ORIGIN and NO_REFERRER are no longer used only internally by URLRequest for processing Referrer-Policy headers, but are now values that callers should use to convey a referrer policy of 'origin' or 'no-referrer', so that the net::URLRequest::ReferrerPolicy of a request can always be relied upon to translate back to a WebReferrerPolicy. BUG=628457 Committed: https://crrev.com/0f5deae9b4797dfc2ce9ec685bc877c68982621b Cr-Commit-Position: refs/heads/master@{#424203}

Patch Set 1 #

Patch Set 2 : Remove unnecessary referrer calculation in DocumentThreadableLoader #

Messages

Total messages: 18 (9 generated)
estark
mmenke, jochen, PTAL?
4 years, 2 months ago (2016-10-06 02:15:09 UTC) #8
jochen (gone - plz use gerrit)
lgtm
4 years, 2 months ago (2016-10-06 12:20:59 UTC) #9
mmenke
On 2016/10/06 12:20:59, jochen wrote: > lgtm LGTM. Do we want to pass it back ...
4 years, 2 months ago (2016-10-06 15:22:54 UTC) #10
estark
On 2016/10/06 15:22:54, mmenke wrote: > On 2016/10/06 12:20:59, jochen wrote: > > lgtm > ...
4 years, 2 months ago (2016-10-06 17:45:45 UTC) #11
mmenke
On 2016/10/06 17:45:45, estark wrote: > On 2016/10/06 15:22:54, mmenke wrote: > > On 2016/10/06 ...
4 years, 2 months ago (2016-10-10 14:52:42 UTC) #12
estark
On 2016/10/10 14:52:42, mmenke wrote: > On 2016/10/06 17:45:45, estark wrote: > > On 2016/10/06 ...
4 years, 2 months ago (2016-10-10 17:38:25 UTC) #13
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/2393633006/20001
4 years, 2 months ago (2016-10-10 17:38:47 UTC) #15
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 2 months ago (2016-10-10 19:05:02 UTC) #16
commit-bot: I haz the power
4 years, 2 months ago (2016-10-10 19:08:51 UTC) #18
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/0f5deae9b4797dfc2ce9ec685bc877c68982621b
Cr-Commit-Position: refs/heads/master@{#424203}

Powered by Google App Engine
This is Rietveld 408576698