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 is | |
105 // redirected cross-origin, but does not degrade to an insecure connection, | |
106 // the referrer will be delivered with reduced granularity (e.g. an origin | |
107 // rather than a full URL). | |
Mike West
2014/11/19 09:57:37
Bah. TODO2: Add a description of ORIGIN_ONLY_ON_TR
Mike West
2014/11/19 10:23:08
Oh, I did this above. Nevermind, me!
| |
103 enum ReferrerPolicy { | 108 enum ReferrerPolicy { |
104 CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, | 109 CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, |
110 REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN, | |
111 ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN, | |
105 NEVER_CLEAR_REFERRER, | 112 NEVER_CLEAR_REFERRER, |
106 }; | 113 }; |
107 | 114 |
108 // First-party URL redirect policy: During server redirects, the first-party | 115 // 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 | 116 // 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 | 117 // top-level first-party request, the first-party URL should be updated to the |
111 // URL on every redirect. | 118 // URL on every redirect. |
112 enum FirstPartyURLPolicy { | 119 enum FirstPartyURLPolicy { |
113 NEVER_CHANGE_FIRST_PARTY_URL, | 120 NEVER_CHANGE_FIRST_PARTY_URL, |
114 UPDATE_FIRST_PARTY_URL_ON_REDIRECT, | 121 UPDATE_FIRST_PARTY_URL_ON_REDIRECT, |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
834 | 841 |
835 // The proxy server used for this request, if any. | 842 // The proxy server used for this request, if any. |
836 HostPortPair proxy_server_; | 843 HostPortPair proxy_server_; |
837 | 844 |
838 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 845 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
839 }; | 846 }; |
840 | 847 |
841 } // namespace net | 848 } // namespace net |
842 | 849 |
843 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 850 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |