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 <string> | 10 #include <string> |
(...skipping 28 matching lines...) Expand all Loading... |
39 namespace base { | 39 namespace base { |
40 class Value; | 40 class Value; |
41 | 41 |
42 namespace debug { | 42 namespace debug { |
43 class StackTrace; | 43 class StackTrace; |
44 } // namespace debug | 44 } // namespace debug |
45 } // namespace base | 45 } // namespace base |
46 | 46 |
47 namespace net { | 47 namespace net { |
48 | 48 |
49 class ChunkedUploadDataStream; | |
50 class CookieOptions; | 49 class CookieOptions; |
51 class HostPortPair; | 50 class HostPortPair; |
52 class IOBuffer; | 51 class IOBuffer; |
53 struct LoadTimingInfo; | 52 struct LoadTimingInfo; |
54 struct RedirectInfo; | 53 struct RedirectInfo; |
55 class SSLCertRequestInfo; | 54 class SSLCertRequestInfo; |
56 class SSLInfo; | 55 class SSLInfo; |
57 class SSLPrivateKey; | 56 class SSLPrivateKey; |
58 class UploadDataStream; | 57 class UploadDataStream; |
59 class URLRequestContext; | 58 class URLRequestContext; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 // The referrer policy to apply when updating the referrer during redirects. | 323 // The referrer policy to apply when updating the referrer during redirects. |
325 // The referrer policy may only be changed before Start() is called. | 324 // The referrer policy may only be changed before Start() is called. |
326 ReferrerPolicy referrer_policy() const { return referrer_policy_; } | 325 ReferrerPolicy referrer_policy() const { return referrer_policy_; } |
327 void set_referrer_policy(ReferrerPolicy referrer_policy); | 326 void set_referrer_policy(ReferrerPolicy referrer_policy); |
328 | 327 |
329 // Sets the delegate of the request. This is only to allow creating a request | 328 // Sets the delegate of the request. This is only to allow creating a request |
330 // before creating its delegate. |delegate| must be non-NULL and the request | 329 // before creating its delegate. |delegate| must be non-NULL and the request |
331 // must not yet have a Delegate set. | 330 // must not yet have a Delegate set. |
332 void set_delegate(Delegate* delegate); | 331 void set_delegate(Delegate* delegate); |
333 | 332 |
334 // Indicates that the request body should be sent using chunked transfer | |
335 // encoding. This method may only be called before Start() is called. | |
336 void EnableChunkedUpload(); | |
337 | |
338 // Appends the given bytes to the request's upload data to be sent | |
339 // immediately via chunked transfer encoding. When all data has been added, | |
340 // set |is_last_chunk| to true to indicate the end of upload data. All chunks | |
341 // but the last must have |bytes_len| > 0. | |
342 // | |
343 // This method may be called only after calling EnableChunkedUpload(). | |
344 // | |
345 // Despite the name of this method, over-the-wire chunk boundaries will most | |
346 // likely not match the "chunks" appended with this function. | |
347 void AppendChunkToUpload(const char* bytes, | |
348 int bytes_len, | |
349 bool is_last_chunk); | |
350 | |
351 // Sets the upload data. | 333 // Sets the upload data. |
352 void set_upload(scoped_ptr<UploadDataStream> upload); | 334 void set_upload(scoped_ptr<UploadDataStream> upload); |
353 | 335 |
354 // Gets the upload data. | 336 // Gets the upload data. |
355 const UploadDataStream* get_upload() const; | 337 const UploadDataStream* get_upload() const; |
356 | 338 |
357 // Returns true if the request has a non-empty message body to upload. | 339 // Returns true if the request has a non-empty message body to upload. |
358 bool has_upload() const; | 340 bool has_upload() const; |
359 | 341 |
360 // Set or remove a extra request header. These methods may only be called | 342 // Set or remove a extra request header. These methods may only be called |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 // cookie store, socket pool, etc.) | 757 // cookie store, socket pool, etc.) |
776 const URLRequestContext* context_; | 758 const URLRequestContext* context_; |
777 | 759 |
778 NetworkDelegate* network_delegate_; | 760 NetworkDelegate* network_delegate_; |
779 | 761 |
780 // Tracks the time spent in various load states throughout this request. | 762 // Tracks the time spent in various load states throughout this request. |
781 BoundNetLog net_log_; | 763 BoundNetLog net_log_; |
782 | 764 |
783 scoped_ptr<URLRequestJob> job_; | 765 scoped_ptr<URLRequestJob> job_; |
784 scoped_ptr<UploadDataStream> upload_data_stream_; | 766 scoped_ptr<UploadDataStream> upload_data_stream_; |
785 // TODO(mmenke): Make whether or not an upload is chunked transparent to the | |
786 // URLRequest. | |
787 ChunkedUploadDataStream* upload_chunked_data_stream_; | |
788 | 767 |
789 std::vector<GURL> url_chain_; | 768 std::vector<GURL> url_chain_; |
790 GURL first_party_for_cookies_; | 769 GURL first_party_for_cookies_; |
791 url::Origin initiator_; | 770 url::Origin initiator_; |
792 GURL delegate_redirect_url_; | 771 GURL delegate_redirect_url_; |
793 std::string method_; // "GET", "POST", etc. Should be all uppercase. | 772 std::string method_; // "GET", "POST", etc. Should be all uppercase. |
794 std::string referrer_; | 773 std::string referrer_; |
795 ReferrerPolicy referrer_policy_; | 774 ReferrerPolicy referrer_policy_; |
796 FirstPartyURLPolicy first_party_url_policy_; | 775 FirstPartyURLPolicy first_party_url_policy_; |
797 HttpRequestHeaders extra_request_headers_; | 776 HttpRequestHeaders extra_request_headers_; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 HostPortPair proxy_server_; | 863 HostPortPair proxy_server_; |
885 | 864 |
886 scoped_ptr<const base::debug::StackTrace> stack_trace_; | 865 scoped_ptr<const base::debug::StackTrace> stack_trace_; |
887 | 866 |
888 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 867 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
889 }; | 868 }; |
890 | 869 |
891 } // namespace net | 870 } // namespace net |
892 | 871 |
893 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 872 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |