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

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

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Fixed compilation error Created 4 years, 1 month 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>
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
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 const base::Optional<url::Origin>& initiator() const { return initiator_; }
307 // This method may only be called before Start(). 308 // This method may only be called before Start().
mmenke 2016/11/03 17:58:58 Is it worth mentioning the difference between a un
clamy 2016/11/04 16:03:50 Done.
308 void set_initiator(const url::Origin& initiator); 309 void set_initiator(const base::Optional<url::Origin>& initiator);
309 310
310 // The request method, as an uppercase string. "GET" is the default value. 311 // 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 312 // The request method may only be changed before Start() is called and
312 // should only be assigned an uppercase value. 313 // should only be assigned an uppercase value.
313 const std::string& method() const { return method_; } 314 const std::string& method() const { return method_; }
314 void set_method(const std::string& method); 315 void set_method(const std::string& method);
315 316
316 // The referrer URL for the request. This header may actually be suppressed 317 // 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 318 // 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 319 // 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
754 NetworkDelegate* network_delegate_; 755 NetworkDelegate* network_delegate_;
755 756
756 // Tracks the time spent in various load states throughout this request. 757 // Tracks the time spent in various load states throughout this request.
757 NetLogWithSource net_log_; 758 NetLogWithSource net_log_;
758 759
759 std::unique_ptr<URLRequestJob> job_; 760 std::unique_ptr<URLRequestJob> job_;
760 std::unique_ptr<UploadDataStream> upload_data_stream_; 761 std::unique_ptr<UploadDataStream> upload_data_stream_;
761 762
762 std::vector<GURL> url_chain_; 763 std::vector<GURL> url_chain_;
763 GURL first_party_for_cookies_; 764 GURL first_party_for_cookies_;
764 url::Origin initiator_; 765 base::Optional<url::Origin> initiator_;
765 GURL delegate_redirect_url_; 766 GURL delegate_redirect_url_;
766 std::string method_; // "GET", "POST", etc. Should be all uppercase. 767 std::string method_; // "GET", "POST", etc. Should be all uppercase.
767 std::string referrer_; 768 std::string referrer_;
768 ReferrerPolicy referrer_policy_; 769 ReferrerPolicy referrer_policy_;
769 std::string token_binding_referrer_; 770 std::string token_binding_referrer_;
770 FirstPartyURLPolicy first_party_url_policy_; 771 FirstPartyURLPolicy first_party_url_policy_;
771 HttpRequestHeaders extra_request_headers_; 772 HttpRequestHeaders extra_request_headers_;
772 int load_flags_; // Flags indicating the request type for the load; 773 int load_flags_; // Flags indicating the request type for the load;
773 // expected values are LOAD_* enums above. 774 // expected values are LOAD_* enums above.
774 775
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 857
857 // The raw header size of the response. 858 // The raw header size of the response.
858 int raw_header_size_; 859 int raw_header_size_;
859 860
860 DISALLOW_COPY_AND_ASSIGN(URLRequest); 861 DISALLOW_COPY_AND_ASSIGN(URLRequest);
861 }; 862 };
862 863
863 } // namespace net 864 } // namespace net
864 865
865 #endif // NET_URL_REQUEST_URL_REQUEST_H_ 866 #endif // NET_URL_REQUEST_URL_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698