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

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

Issue 1411813003: Teach URLRequest about initiator checks for First-Party-Only cookies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback. Created 5 years, 2 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 <string> 10 #include <string>
(...skipping 24 matching lines...) Expand all
35 #include "url/gurl.h" 35 #include "url/gurl.h"
36 36
37 namespace base { 37 namespace base {
38 class Value; 38 class Value;
39 39
40 namespace debug { 40 namespace debug {
41 class StackTrace; 41 class StackTrace;
42 } // namespace debug 42 } // namespace debug
43 } // namespace base 43 } // namespace base
44 44
45 namespace url {
46 class Origin;
47 }
48
45 namespace net { 49 namespace net {
46 50
47 class ChunkedUploadDataStream; 51 class ChunkedUploadDataStream;
48 class CookieOptions; 52 class CookieOptions;
49 class HostPortPair; 53 class HostPortPair;
50 class IOBuffer; 54 class IOBuffer;
51 struct LoadTimingInfo; 55 struct LoadTimingInfo;
52 struct RedirectInfo; 56 struct RedirectInfo;
53 class SSLCertRequestInfo; 57 class SSLCertRequestInfo;
54 class SSLInfo; 58 class SSLInfo;
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 void set_first_party_for_cookies(const GURL& first_party_for_cookies); 279 void set_first_party_for_cookies(const GURL& first_party_for_cookies);
276 280
277 // The first-party URL policy to apply when updating the first party URL 281 // The first-party URL policy to apply when updating the first party URL
278 // during redirects. The first-party URL policy may only be changed before 282 // during redirects. The first-party URL policy may only be changed before
279 // Start() is called. 283 // Start() is called.
280 FirstPartyURLPolicy first_party_url_policy() const { 284 FirstPartyURLPolicy first_party_url_policy() const {
281 return first_party_url_policy_; 285 return first_party_url_policy_;
282 } 286 }
283 void set_first_party_url_policy(FirstPartyURLPolicy first_party_url_policy); 287 void set_first_party_url_policy(FirstPartyURLPolicy first_party_url_policy);
284 288
289 // The origin of the context which initiated the request.
290 const url::Origin initiator() const { return initiator_; }
mmenke 2015/10/21 15:36:38 const url::Origin&
mmenke 2015/10/21 15:36:38 I'm concerned that I have no idea what the differe
Mike West 2015/10/22 13:17:02 Done and done.
291 // This method may only be called before Start().
292 void set_initiator(const url::Origin& initiator);
293
285 // The request method, as an uppercase string. "GET" is the default value. 294 // The request method, as an uppercase string. "GET" is the default value.
286 // The request method may only be changed before Start() is called and 295 // The request method may only be changed before Start() is called and
287 // should only be assigned an uppercase value. 296 // should only be assigned an uppercase value.
288 const std::string& method() const { return method_; } 297 const std::string& method() const { return method_; }
289 void set_method(const std::string& method); 298 void set_method(const std::string& method);
290 299
300 // True if the request method is "safe" (per section 4.2.1 of RFC 7231).
301 bool is_safe_method() const;
302
291 // The referrer URL for the request. This header may actually be suppressed 303 // The referrer URL for the request. This header may actually be suppressed
292 // from the underlying network request for security reasons (e.g., a HTTPS 304 // from the underlying network request for security reasons (e.g., a HTTPS
293 // URL will not be sent as the referrer for a HTTP request). The referrer 305 // URL will not be sent as the referrer for a HTTP request). The referrer
294 // may only be changed before Start() is called. 306 // may only be changed before Start() is called.
295 const std::string& referrer() const { return referrer_; } 307 const std::string& referrer() const { return referrer_; }
296 // Referrer is sanitized to remove URL fragment, user name and password. 308 // Referrer is sanitized to remove URL fragment, user name and password.
297 void SetReferrer(const std::string& referrer); 309 void SetReferrer(const std::string& referrer);
298 310
299 // The referrer policy to apply when updating the referrer during redirects. 311 // The referrer policy to apply when updating the referrer during redirects.
300 // The referrer policy may only be changed before Start() is called. 312 // The referrer policy may only be changed before Start() is called.
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 BoundNetLog net_log_; 764 BoundNetLog net_log_;
753 765
754 scoped_refptr<URLRequestJob> job_; 766 scoped_refptr<URLRequestJob> job_;
755 scoped_ptr<UploadDataStream> upload_data_stream_; 767 scoped_ptr<UploadDataStream> upload_data_stream_;
756 // TODO(mmenke): Make whether or not an upload is chunked transparent to the 768 // TODO(mmenke): Make whether or not an upload is chunked transparent to the
757 // URLRequest. 769 // URLRequest.
758 ChunkedUploadDataStream* upload_chunked_data_stream_; 770 ChunkedUploadDataStream* upload_chunked_data_stream_;
759 771
760 std::vector<GURL> url_chain_; 772 std::vector<GURL> url_chain_;
761 GURL first_party_for_cookies_; 773 GURL first_party_for_cookies_;
774 url::Origin initiator_;
762 GURL delegate_redirect_url_; 775 GURL delegate_redirect_url_;
763 std::string method_; // "GET", "POST", etc. Should be all uppercase. 776 std::string method_; // "GET", "POST", etc. Should be all uppercase.
764 std::string referrer_; 777 std::string referrer_;
765 ReferrerPolicy referrer_policy_; 778 ReferrerPolicy referrer_policy_;
766 FirstPartyURLPolicy first_party_url_policy_; 779 FirstPartyURLPolicy first_party_url_policy_;
767 HttpRequestHeaders extra_request_headers_; 780 HttpRequestHeaders extra_request_headers_;
768 int load_flags_; // Flags indicating the request type for the load; 781 int load_flags_; // Flags indicating the request type for the load;
769 // expected values are LOAD_* enums above. 782 // expected values are LOAD_* enums above.
770 783
771 // Never access methods of the |delegate_| directly. Always use the 784 // Never access methods of the |delegate_| directly. Always use the
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 HostPortPair proxy_server_; 867 HostPortPair proxy_server_;
855 868
856 scoped_ptr<const base::debug::StackTrace> stack_trace_; 869 scoped_ptr<const base::debug::StackTrace> stack_trace_;
857 870
858 DISALLOW_COPY_AND_ASSIGN(URLRequest); 871 DISALLOW_COPY_AND_ASSIGN(URLRequest);
859 }; 872 };
860 873
861 } // namespace net 874 } // namespace net
862 875
863 #endif // NET_URL_REQUEST_URL_REQUEST_H_ 876 #endif // NET_URL_REQUEST_URL_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698