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

Issue 1235563004: Apply meta tag referrer policy for preloaded requests (Closed)

Created:
5 years, 5 months ago by estark
Modified:
5 years, 5 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, dglazkov+blink, Yoav Weiss
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Apply meta tag referrer policy for preloaded requests When a referrer policy is discovered in a meta tag during a preload scan, apply that policy to the document so that it will be used for subsequent preloaded resource loads. BUG=508310 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=198992

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : fix conflicting policies test #

Total comments: 1

Patch Set 4 : rebase #

Patch Set 5 : rebase #

Patch Set 6 : set referrer policy on CachedDocParams, and set per preload request instead of for whole document #

Patch Set 7 : cleanup #

Patch Set 8 : more cleanup #

Total comments: 3

Patch Set 9 : put meta referrer logic in helper function #

Patch Set 10 : minor cleanup #

Total comments: 2

Patch Set 11 : style fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -30 lines) Patch
A LayoutTests/http/tests/security/referrer-policy-subresource.html View 1 chunk +18 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/security/resources/referrer-policy-script.php View 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 1 chunk +6 lines, -13 lines 0 comments Download
M Source/core/html/parser/CSSPreloadScanner.h View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -0 lines 0 comments Download
M Source/core/html/parser/CSSPreloadScanner.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +7 lines, -1 line 0 comments Download
M Source/core/html/parser/HTMLPreloadScanner.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/html/parser/HTMLPreloadScanner.cpp View 1 2 3 4 5 6 7 8 6 chunks +38 lines, -11 lines 0 comments Download
M Source/core/html/parser/PreloadRequest.h View 1 2 3 4 5 6 7 8 9 10 5 chunks +7 lines, -3 lines 0 comments Download
M Source/core/html/parser/PreloadRequest.cpp View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download
M Source/platform/weborigin/SecurityPolicy.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M Source/platform/weborigin/SecurityPolicy.cpp View 1 2 3 4 5 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (5 generated)
estark
jochen, could you please take a look? Thanks! https://codereview.chromium.org/1235563004/diff/40001/LayoutTests/http/tests/security/resources/referrer-policy-conflicting-policies.html File LayoutTests/http/tests/security/resources/referrer-policy-conflicting-policies.html (right): https://codereview.chromium.org/1235563004/diff/40001/LayoutTests/http/tests/security/resources/referrer-policy-conflicting-policies.html#newcode18 LayoutTests/http/tests/security/resources/referrer-policy-conflicting-policies.html:18: <script> ...
5 years, 5 months ago (2015-07-14 04:45:35 UTC) #2
jochen (gone - plz use gerrit)
what about adding an String m_referrerPolicy to CachedDocumentParameters, then you don't need to pass the ...
5 years, 5 months ago (2015-07-14 14:29:36 UTC) #3
estark
On 2015/07/14 14:29:36, jochen wrote: > what about adding an String m_referrerPolicy to CachedDocumentParameters, then ...
5 years, 5 months ago (2015-07-14 22:24:30 UTC) #4
Yoav Weiss
All in all, the preloadScanner parts look good. https://codereview.chromium.org/1235563004/diff/140001/Source/core/html/parser/HTMLPreloadScanner.cpp File Source/core/html/parser/HTMLPreloadScanner.cpp (right): https://codereview.chromium.org/1235563004/diff/140001/Source/core/html/parser/HTMLPreloadScanner.cpp#newcode564 Source/core/html/parser/HTMLPreloadScanner.cpp:564: m_cssScanner.setReferrerPolicy(m_documentParameters->referrerPolicy); ...
5 years, 5 months ago (2015-07-15 08:14:47 UTC) #6
jochen (gone - plz use gerrit)
lgtm from my side, thx! https://codereview.chromium.org/1235563004/diff/140001/Source/core/html/parser/PreloadRequest.h File Source/core/html/parser/PreloadRequest.h (right): https://codereview.chromium.org/1235563004/diff/140001/Source/core/html/parser/PreloadRequest.h#newcode59 Source/core/html/parser/PreloadRequest.h:59: RequestType requestType, const ReferrerPolicy& ...
5 years, 5 months ago (2015-07-15 13:43:54 UTC) #7
estark
https://codereview.chromium.org/1235563004/diff/140001/Source/core/html/parser/HTMLPreloadScanner.cpp File Source/core/html/parser/HTMLPreloadScanner.cpp (right): https://codereview.chromium.org/1235563004/diff/140001/Source/core/html/parser/HTMLPreloadScanner.cpp#newcode564 Source/core/html/parser/HTMLPreloadScanner.cpp:564: m_cssScanner.setReferrerPolicy(m_documentParameters->referrerPolicy); On 2015/07/15 08:14:47, Yoav Weiss wrote: > Could ...
5 years, 5 months ago (2015-07-15 21:58:56 UTC) #8
Yoav Weiss
Thanks! :) LGTM from my end as well % a minor style nit. https://codereview.chromium.org/1235563004/diff/180001/Source/core/html/parser/PreloadRequest.h File ...
5 years, 5 months ago (2015-07-15 22:19:45 UTC) #9
estark
Thanks Jochen and Yoav. https://codereview.chromium.org/1235563004/diff/180001/Source/core/html/parser/PreloadRequest.h File Source/core/html/parser/PreloadRequest.h (right): https://codereview.chromium.org/1235563004/diff/180001/Source/core/html/parser/PreloadRequest.h#newcode59 Source/core/html/parser/PreloadRequest.h:59: RequestType requestType, const ReferrerPolicy referrerPolicy) ...
5 years, 5 months ago (2015-07-15 22:31:40 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1235563004/200001
5 years, 5 months ago (2015-07-15 22:32:35 UTC) #13
commit-bot: I haz the power
Committed patchset #11 (id:200001) as https://src.chromium.org/viewvc/blink?view=rev&revision=198992
5 years, 5 months ago (2015-07-16 00:19:18 UTC) #14
patrick.toomey
This test seems to verify that a subresource after the meta tag does not include ...
5 years, 5 months ago (2015-07-16 00:40:31 UTC) #16
jochen (gone - plz use gerrit)
5 years, 5 months ago (2015-07-16 05:20:03 UTC) #17
Message was sent while issue was closed.
the spec doesn't really talk about pre-fetching.

safari doesn't do referrer handling during pre-fetching, since it gets the
header right, I guess it just doesn't prefetch at all.

firefox discards prefetched resources that were fetched with the wrong header
afaik. I don't think that's a reasonable approach, because if you were worried
about not leaking the referrer, it leaked already anyways, so why not just use
the cached entry. Also, just use CSP to set the referrer.

anyways, adding more tests seems reasonable.

Powered by Google App Engine
This is Rietveld 408576698