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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 class BlobURLRequestJobTest; | 84 class BlobURLRequestJobTest; |
85 } | 85 } |
86 | 86 |
87 namespace net { | 87 namespace net { |
88 | 88 |
89 class CookieOptions; | 89 class CookieOptions; |
90 class HostPortPair; | 90 class HostPortPair; |
91 class IOBuffer; | 91 class IOBuffer; |
92 class SSLCertRequestInfo; | 92 class SSLCertRequestInfo; |
93 class SSLInfo; | 93 class SSLInfo; |
94 class UploadData; | |
95 class UploadDataStream; | 94 class UploadDataStream; |
96 class URLRequestContext; | 95 class URLRequestContext; |
97 class URLRequestJob; | 96 class URLRequestJob; |
98 class X509Certificate; | 97 class X509Certificate; |
99 | 98 |
100 // This stores the values of the Set-Cookie headers received during the request. | 99 // This stores the values of the Set-Cookie headers received during the request. |
101 // Each item in the vector corresponds to a Set-Cookie: line received, | 100 // Each item in the vector corresponds to a Set-Cookie: line received, |
102 // excluding the "Set-Cookie:" part. | 101 // excluding the "Set-Cookie:" part. |
103 typedef std::vector<std::string> ResponseCookies; | 102 typedef std::vector<std::string> ResponseCookies; |
104 | 103 |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 404 |
406 // Appends the given bytes to the request's upload data to be sent | 405 // Appends the given bytes to the request's upload data to be sent |
407 // immediately via chunked transfer encoding. When all data has been sent, | 406 // immediately via chunked transfer encoding. When all data has been sent, |
408 // call MarkEndOfChunks() to indicate the end of upload data. | 407 // call MarkEndOfChunks() to indicate the end of upload data. |
409 // | 408 // |
410 // This method may be called only after calling EnableChunkedUpload(). | 409 // This method may be called only after calling EnableChunkedUpload(). |
411 void AppendChunkToUpload(const char* bytes, | 410 void AppendChunkToUpload(const char* bytes, |
412 int bytes_len, | 411 int bytes_len, |
413 bool is_last_chunk); | 412 bool is_last_chunk); |
414 | 413 |
415 // Set the upload data directly. | 414 // Sets the upload data. |
416 void set_upload(UploadData* upload); | 415 void set_upload(scoped_ptr<UploadDataStream> upload); |
417 | 416 |
418 // Get the upload data directly. | 417 // Gets the upload data. |
419 const UploadDataStream* get_upload() const; | 418 const UploadDataStream* get_upload() const; |
420 | 419 |
421 // Returns true if the request has a non-empty message body to upload. | 420 // Returns true if the request has a non-empty message body to upload. |
422 bool has_upload() const; | 421 bool has_upload() const; |
423 | 422 |
424 // Set an extra request header by ID or name, or remove one by name. These | 423 // Set an extra request header by ID or name, or remove one by name. These |
425 // methods may only be called before Start() is called, or before a new | 424 // methods may only be called before Start() is called, or before a new |
426 // redirect in the request chain. | 425 // redirect in the request chain. |
427 void SetExtraRequestHeaderById(int header_id, const std::string& value, | 426 void SetExtraRequestHeaderById(int header_id, const std::string& value, |
428 bool overwrite); | 427 bool overwrite); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 // most of the dependencies which are shared between requests (disk cache, | 748 // most of the dependencies which are shared between requests (disk cache, |
750 // cookie store, socket pool, etc.) | 749 // cookie store, socket pool, etc.) |
751 const URLRequestContext* context_; | 750 const URLRequestContext* context_; |
752 | 751 |
753 NetworkDelegate* network_delegate_; | 752 NetworkDelegate* network_delegate_; |
754 | 753 |
755 // Tracks the time spent in various load states throughout this request. | 754 // Tracks the time spent in various load states throughout this request. |
756 BoundNetLog net_log_; | 755 BoundNetLog net_log_; |
757 | 756 |
758 scoped_refptr<URLRequestJob> job_; | 757 scoped_refptr<URLRequestJob> job_; |
759 scoped_refptr<UploadData> upload_; | |
760 scoped_ptr<UploadDataStream> upload_data_stream_; | 758 scoped_ptr<UploadDataStream> upload_data_stream_; |
761 std::vector<GURL> url_chain_; | 759 std::vector<GURL> url_chain_; |
762 GURL first_party_for_cookies_; | 760 GURL first_party_for_cookies_; |
763 GURL delegate_redirect_url_; | 761 GURL delegate_redirect_url_; |
764 std::string method_; // "GET", "POST", etc. Should be all uppercase. | 762 std::string method_; // "GET", "POST", etc. Should be all uppercase. |
765 std::string referrer_; | 763 std::string referrer_; |
766 ReferrerPolicy referrer_policy_; | 764 ReferrerPolicy referrer_policy_; |
767 HttpRequestHeaders extra_request_headers_; | 765 HttpRequestHeaders extra_request_headers_; |
768 int load_flags_; // Flags indicating the request type for the load; | 766 int load_flags_; // Flags indicating the request type for the load; |
769 // expected values are LOAD_* enums above. | 767 // expected values are LOAD_* enums above. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 base::TimeTicks creation_time_; | 840 base::TimeTicks creation_time_; |
843 | 841 |
844 scoped_ptr<const base::debug::StackTrace> stack_trace_; | 842 scoped_ptr<const base::debug::StackTrace> stack_trace_; |
845 | 843 |
846 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 844 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
847 }; | 845 }; |
848 | 846 |
849 } // namespace net | 847 } // namespace net |
850 | 848 |
851 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 849 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |