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

Side by Side Diff: net/url_request/url_request.h

Issue 2918313002: Implement new referrer policies (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_URL_REQUEST_URL_REQUEST_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_H_
6 #define NET_URL_REQUEST_URL_REQUEST_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 enum ReferrerPolicy { 89 enum ReferrerPolicy {
90 // Clear the referrer header if the protocol changes from HTTPS to 90 // Clear the referrer header if the protocol changes from HTTPS to
91 // HTTP. This is the default behavior of URLRequest. 91 // HTTP. This is the default behavior of URLRequest.
92 CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, 92 CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
93 // A slight variant on 93 // A slight variant on
94 // CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE: If the 94 // CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE: If the
95 // request downgrades from HTTPS to HTTP, the referrer will be 95 // request downgrades from HTTPS to HTTP, the referrer will be
96 // cleared. If the request transitions cross-origin (but does not 96 // cleared. If the request transitions cross-origin (but does not
97 // downgrade), the referrer's granularity will be reduced (currently 97 // downgrade), the referrer's granularity will be reduced (currently
98 // stripped down to an origin rather than a full URL). Same-origin 98 // stripped down to an origin rather than a full URL). Same-origin
99 // requests will send the full referrer. 99 // requests will send the full referrer.
mmenke 2017/06/07 21:03:57 Remove "(currently stripped down to an origin rath
estark 2017/06/08 18:42:57 Done.
100 REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN, 100 REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN,
101 // Strip the referrer down to an origin upon cross-origin navigation. 101 // Strip the referrer down to an origin upon cross-origin navigation.
102 ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN, 102 ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN,
103 // Never change the referrer. 103 // Never change the referrer.
104 NEVER_CLEAR_REFERRER, 104 NEVER_CLEAR_REFERRER,
105 // Strip the referrer down to the origin regardless of the redirect 105 // Strip the referrer down to the origin regardless of the redirect
106 // location. 106 // location.
107 ORIGIN, 107 ORIGIN,
108 // Clear the referrer on cross-origin redirect locations.
109 CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN,
110 // Strip the referrer down to the origin, but clear it entirely if the
111 // protocol changes from HTTPS to HTTP.
112 ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
mmenke 2017/06/07 21:03:57 These names aren't accurate - not sure if there's
estark 2017/06/08 18:42:57 Updated the comments. I think it would also help t
108 // Always clear the referrer regardless of the redirect location. 113 // Always clear the referrer regardless of the redirect location.
109 NO_REFERRER, 114 NO_REFERRER,
110 MAX_REFERRER_POLICY 115 MAX_REFERRER_POLICY
111 }; 116 };
112 117
113 // First-party URL redirect policy: During server redirects, the first-party 118 // First-party URL redirect policy: During server redirects, the first-party
114 // URL for cookies normally doesn't change. However, if the request is a 119 // URL for cookies normally doesn't change. However, if the request is a
115 // top-level first-party request, the first-party URL should be updated to the 120 // top-level first-party request, the first-party URL should be updated to the
116 // URL on every redirect. 121 // URL on every redirect.
117 enum FirstPartyURLPolicy { 122 enum FirstPartyURLPolicy {
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 const NetworkTrafficAnnotationTag traffic_annotation_; 866 const NetworkTrafficAnnotationTag traffic_annotation_;
862 867
863 THREAD_CHECKER(thread_checker_); 868 THREAD_CHECKER(thread_checker_);
864 869
865 DISALLOW_COPY_AND_ASSIGN(URLRequest); 870 DISALLOW_COPY_AND_ASSIGN(URLRequest);
866 }; 871 };
867 872
868 } // namespace net 873 } // namespace net
869 874
870 #endif // NET_URL_REQUEST_URL_REQUEST_H_ 875 #endif // NET_URL_REQUEST_URL_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698