OLD | NEW |
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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 enum { | 87 enum { |
88 #define HTTP_ATOM(x) HTTP_ ## x, | 88 #define HTTP_ATOM(x) HTTP_ ## x, |
89 #include "net/http/http_atom_list.h" | 89 #include "net/http/http_atom_list.h" |
90 #undef HTTP_ATOM | 90 #undef HTTP_ATOM |
91 }; | 91 }; |
92 | 92 |
93 // Referrer policies (see set_referrer_policy): During server redirects, the | 93 // Referrer policies (see set_referrer_policy): During server redirects, the |
94 // referrer header might be cleared, if the protocol changes from HTTPS to | 94 // referrer header might be cleared, if the protocol changes from HTTPS to |
95 // HTTP. This is the default behavior of URLRequest, corresponding to | 95 // HTTP. This is the default behavior of URLRequest, corresponding to |
96 // CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE. Alternatively, the | 96 // CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE. Alternatively, the |
97 // referrer policy can be set to never change the referrer header. This | 97 // referrer policy can be set to strip the referrer down to an origin upon |
98 // behavior corresponds to NEVER_CLEAR_REFERRER. Embedders will want to use | 98 // cross-origin navigation (ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN), or |
99 // NEVER_CLEAR_REFERRER when implementing the meta-referrer support | 99 // never change the referrer header (NEVER_CLEAR_REFERRER). Embedders will |
100 // (http://wiki.whatwg.org/wiki/Meta_referrer) and sending requests with a | 100 // want to use these options when implementing referrer policy support |
101 // non-default referrer policy. Only the default referrer policy requires | 101 // (https://w3c.github.io/webappsec/specs/referrer-policy/). |
102 // the referrer to be cleared on transitions from HTTPS to HTTP. | 102 // |
| 103 // REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN is a slight variant |
| 104 // on CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE: If the request |
| 105 // downgrades from HTTPS to HTTP, the referrer will be cleared. If the request |
| 106 // transitions cross-origin (but does not downgrade), the referrer's |
| 107 // granularity will be reduced (currently stripped down to an origin rather |
| 108 // than a full URL). Same-origin requests will send the full referrer. |
103 enum ReferrerPolicy { | 109 enum ReferrerPolicy { |
104 CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, | 110 CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, |
| 111 REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN, |
| 112 ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN, |
105 NEVER_CLEAR_REFERRER, | 113 NEVER_CLEAR_REFERRER, |
106 }; | 114 }; |
107 | 115 |
108 // First-party URL redirect policy: During server redirects, the first-party | 116 // First-party URL redirect policy: During server redirects, the first-party |
109 // URL for cookies normally doesn't change. However, if the request is a | 117 // URL for cookies normally doesn't change. However, if the request is a |
110 // top-level first-party request, the first-party URL should be updated to the | 118 // top-level first-party request, the first-party URL should be updated to the |
111 // URL on every redirect. | 119 // URL on every redirect. |
112 enum FirstPartyURLPolicy { | 120 enum FirstPartyURLPolicy { |
113 NEVER_CHANGE_FIRST_PARTY_URL, | 121 NEVER_CHANGE_FIRST_PARTY_URL, |
114 UPDATE_FIRST_PARTY_URL_ON_REDIRECT, | 122 UPDATE_FIRST_PARTY_URL_ON_REDIRECT, |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 | 842 |
835 // The proxy server used for this request, if any. | 843 // The proxy server used for this request, if any. |
836 HostPortPair proxy_server_; | 844 HostPortPair proxy_server_; |
837 | 845 |
838 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 846 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
839 }; | 847 }; |
840 | 848 |
841 } // namespace net | 849 } // namespace net |
842 | 850 |
843 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 851 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |