| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/debug/leak_tracker.h" | 14 #include "base/debug/leak_tracker.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/optional.h" |
| 17 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
| 18 #include "base/supports_user_data.h" | 19 #include "base/supports_user_data.h" |
| 19 #include "base/threading/non_thread_safe.h" | 20 #include "base/threading/non_thread_safe.h" |
| 20 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 21 #include "net/base/auth.h" | 22 #include "net/base/auth.h" |
| 22 #include "net/base/completion_callback.h" | 23 #include "net/base/completion_callback.h" |
| 23 #include "net/base/load_states.h" | 24 #include "net/base/load_states.h" |
| 24 #include "net/base/load_timing_info.h" | 25 #include "net/base/load_timing_info.h" |
| 25 #include "net/base/net_error_details.h" | 26 #include "net/base/net_error_details.h" |
| 26 #include "net/base/net_export.h" | 27 #include "net/base/net_export.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // each of those requests will be `https://example.com/`. | 297 // each of those requests will be `https://example.com/`. |
| 297 // | 298 // |
| 298 // 2. The request's initiator is the origin of the frame or worker which made | 299 // 2. The request's initiator is the origin of the frame or worker which made |
| 299 // the request, even for top-level navigations. That is, if | 300 // the request, even for top-level navigations. That is, if |
| 300 // `https://example.com/`'s form submission is made in the top-level frame, | 301 // `https://example.com/`'s form submission is made in the top-level frame, |
| 301 // the first party for cookies would be the target URL's origin. The | 302 // the first party for cookies would be the target URL's origin. The |
| 302 // initiator remains `https://example.com/`. | 303 // initiator remains `https://example.com/`. |
| 303 // | 304 // |
| 304 // This value is used to perform the cross-origin check specified in Section | 305 // This value is used to perform the cross-origin check specified in Section |
| 305 // 4.3 of https://tools.ietf.org/html/draft-west-first-party-cookies. | 306 // 4.3 of https://tools.ietf.org/html/draft-west-first-party-cookies. |
| 306 const url::Origin& initiator() const { return initiator_; } | 307 // |
| 308 // Note: the initiator can be null for browser-initiated top level |
| 309 // navigations. This is different from a unique Origin (e.g. in sandboxed |
| 310 // iframes). |
| 311 const base::Optional<url::Origin>& initiator() const { return initiator_; } |
| 307 // This method may only be called before Start(). | 312 // This method may only be called before Start(). |
| 308 void set_initiator(const url::Origin& initiator); | 313 void set_initiator(const base::Optional<url::Origin>& initiator); |
| 309 | 314 |
| 310 // The request method, as an uppercase string. "GET" is the default value. | 315 // The request method, as an uppercase string. "GET" is the default value. |
| 311 // The request method may only be changed before Start() is called and | 316 // The request method may only be changed before Start() is called and |
| 312 // should only be assigned an uppercase value. | 317 // should only be assigned an uppercase value. |
| 313 const std::string& method() const { return method_; } | 318 const std::string& method() const { return method_; } |
| 314 void set_method(const std::string& method); | 319 void set_method(const std::string& method); |
| 315 | 320 |
| 316 // The referrer URL for the request. This header may actually be suppressed | 321 // The referrer URL for the request. This header may actually be suppressed |
| 317 // from the underlying network request for security reasons (e.g., a HTTPS | 322 // from the underlying network request for security reasons (e.g., a HTTPS |
| 318 // URL will not be sent as the referrer for a HTTP request). The referrer | 323 // URL will not be sent as the referrer for a HTTP request). The referrer |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 NetworkDelegate* network_delegate_; | 759 NetworkDelegate* network_delegate_; |
| 755 | 760 |
| 756 // Tracks the time spent in various load states throughout this request. | 761 // Tracks the time spent in various load states throughout this request. |
| 757 NetLogWithSource net_log_; | 762 NetLogWithSource net_log_; |
| 758 | 763 |
| 759 std::unique_ptr<URLRequestJob> job_; | 764 std::unique_ptr<URLRequestJob> job_; |
| 760 std::unique_ptr<UploadDataStream> upload_data_stream_; | 765 std::unique_ptr<UploadDataStream> upload_data_stream_; |
| 761 | 766 |
| 762 std::vector<GURL> url_chain_; | 767 std::vector<GURL> url_chain_; |
| 763 GURL first_party_for_cookies_; | 768 GURL first_party_for_cookies_; |
| 764 url::Origin initiator_; | 769 base::Optional<url::Origin> initiator_; |
| 765 GURL delegate_redirect_url_; | 770 GURL delegate_redirect_url_; |
| 766 std::string method_; // "GET", "POST", etc. Should be all uppercase. | 771 std::string method_; // "GET", "POST", etc. Should be all uppercase. |
| 767 std::string referrer_; | 772 std::string referrer_; |
| 768 ReferrerPolicy referrer_policy_; | 773 ReferrerPolicy referrer_policy_; |
| 769 std::string token_binding_referrer_; | 774 std::string token_binding_referrer_; |
| 770 FirstPartyURLPolicy first_party_url_policy_; | 775 FirstPartyURLPolicy first_party_url_policy_; |
| 771 HttpRequestHeaders extra_request_headers_; | 776 HttpRequestHeaders extra_request_headers_; |
| 772 int load_flags_; // Flags indicating the request type for the load; | 777 int load_flags_; // Flags indicating the request type for the load; |
| 773 // expected values are LOAD_* enums above. | 778 // expected values are LOAD_* enums above. |
| 774 | 779 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 | 861 |
| 857 // The raw header size of the response. | 862 // The raw header size of the response. |
| 858 int raw_header_size_; | 863 int raw_header_size_; |
| 859 | 864 |
| 860 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 865 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
| 861 }; | 866 }; |
| 862 | 867 |
| 863 } // namespace net | 868 } // namespace net |
| 864 | 869 |
| 865 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 870 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |