Chromium Code Reviews| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 class UploadDataStream; | 53 class UploadDataStream; |
| 54 class URLRequestContext; | 54 class URLRequestContext; |
| 55 class URLRequestJob; | 55 class URLRequestJob; |
| 56 class X509Certificate; | 56 class X509Certificate; |
| 57 | 57 |
| 58 // This stores the values of the Set-Cookie headers received during the request. | 58 // This stores the values of the Set-Cookie headers received during the request. |
| 59 // Each item in the vector corresponds to a Set-Cookie: line received, | 59 // Each item in the vector corresponds to a Set-Cookie: line received, |
| 60 // excluding the "Set-Cookie:" part. | 60 // excluding the "Set-Cookie:" part. |
| 61 typedef std::vector<std::string> ResponseCookies; | 61 typedef std::vector<std::string> ResponseCookies; |
| 62 | 62 |
| 63 // The LoFi state which determines whether to add the LoFi header. Must stay | |
| 64 // in sync with the enum in navigation_params.h. | |
| 65 enum LoFiState { | |
| 66 // Request a LoFi version of the resource. | |
| 67 LOFI_ON = 0, | |
| 68 // Request a normal (non-LoFi) version of the resource. | |
| 69 LOFI_OFF, | |
| 70 // Let the browser process decide whether or not to request the LoFi version. | |
| 71 LOFI_DEFAULT, | |
| 72 }; | |
| 73 | |
| 63 //----------------------------------------------------------------------------- | 74 //----------------------------------------------------------------------------- |
| 64 // A class representing the asynchronous load of a data stream from an URL. | 75 // A class representing the asynchronous load of a data stream from an URL. |
| 65 // | 76 // |
| 66 // The lifetime of an instance of this class is completely controlled by the | 77 // The lifetime of an instance of this class is completely controlled by the |
| 67 // consumer, and the instance is not required to live on the heap or be | 78 // consumer, and the instance is not required to live on the heap or be |
| 68 // allocated in any special way. It is also valid to delete an URLRequest | 79 // allocated in any special way. It is also valid to delete an URLRequest |
| 69 // object during the handling of a callback to its delegate. Of course, once | 80 // object during the handling of a callback to its delegate. Of course, once |
| 70 // the URLRequest is deleted, no further callbacks to its delegate will occur. | 81 // the URLRequest is deleted, no further callbacks to its delegate will occur. |
| 71 // | 82 // |
| 72 // NOTE: All usage of all instances of this class should be on the same thread. | 83 // NOTE: All usage of all instances of this class should be on the same thread. |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 | 302 |
| 292 // The referrer policy to apply when updating the referrer during redirects. | 303 // The referrer policy to apply when updating the referrer during redirects. |
| 293 // The referrer policy may only be changed before Start() is called. | 304 // The referrer policy may only be changed before Start() is called. |
| 294 ReferrerPolicy referrer_policy() const { return referrer_policy_; } | 305 ReferrerPolicy referrer_policy() const { return referrer_policy_; } |
| 295 void set_referrer_policy(ReferrerPolicy referrer_policy); | 306 void set_referrer_policy(ReferrerPolicy referrer_policy); |
| 296 | 307 |
| 297 // Sets the delegate of the request. This value may be changed at any time, | 308 // Sets the delegate of the request. This value may be changed at any time, |
| 298 // and it is permissible for it to be null. | 309 // and it is permissible for it to be null. |
| 299 void set_delegate(Delegate* delegate); | 310 void set_delegate(Delegate* delegate); |
| 300 | 311 |
| 312 // Whether or not to request a LoFi version of the resource or let the | |
| 313 // browser decide. | |
| 314 LoFiState lofi_state() const { return lofi_state_; } | |
| 315 void set_lofi_state(LoFiState lofi_state); | |
| 316 | |
| 301 // Indicates that the request body should be sent using chunked transfer | 317 // Indicates that the request body should be sent using chunked transfer |
| 302 // encoding. This method may only be called before Start() is called. | 318 // encoding. This method may only be called before Start() is called. |
| 303 void EnableChunkedUpload(); | 319 void EnableChunkedUpload(); |
| 304 | 320 |
| 305 // Appends the given bytes to the request's upload data to be sent | 321 // Appends the given bytes to the request's upload data to be sent |
| 306 // immediately via chunked transfer encoding. When all data has been added, | 322 // immediately via chunked transfer encoding. When all data has been added, |
| 307 // set |is_last_chunk| to true to indicate the end of upload data. All chunks | 323 // set |is_last_chunk| to true to indicate the end of upload data. All chunks |
| 308 // but the last must have |bytes_len| > 0. | 324 // but the last must have |bytes_len| > 0. |
| 309 // | 325 // |
| 310 // This method may be called only after calling EnableChunkedUpload(). | 326 // This method may be called only after calling EnableChunkedUpload(). |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 822 LoadTimingInfo load_timing_info_; | 838 LoadTimingInfo load_timing_info_; |
| 823 | 839 |
| 824 // Keeps track of whether or not OnBeforeNetworkStart has been called yet. | 840 // Keeps track of whether or not OnBeforeNetworkStart has been called yet. |
| 825 bool notified_before_network_start_; | 841 bool notified_before_network_start_; |
| 826 | 842 |
| 827 // The proxy server used for this request, if any. | 843 // The proxy server used for this request, if any. |
| 828 HostPortPair proxy_server_; | 844 HostPortPair proxy_server_; |
| 829 | 845 |
| 830 scoped_ptr<const base::debug::StackTrace> stack_trace_; | 846 scoped_ptr<const base::debug::StackTrace> stack_trace_; |
| 831 | 847 |
| 848 // Whether or not to request a LoFi version of the resource or let the | |
| 849 // browser decide. | |
| 850 LoFiState lofi_state_; | |
|
davidben
2015/08/27 18:53:50
Why is this on the URLRequest? It's not used by //
megjablon
2015/08/27 23:11:02
We add q=low to the Chrome-Proxy header in DataRed
davidben
2015/08/31 23:43:24
There's other ways to staple consumer-specific sta
bengr
2015/09/02 19:01:36
I like this goal.
megjablon
2015/09/11 20:58:03
Aren't there layering issues with creating and set
davidben
2015/09/14 20:30:29
Portions of //components can depend on //content,
| |
| 851 | |
| 832 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 852 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
| 833 }; | 853 }; |
| 834 | 854 |
| 835 } // namespace net | 855 } // namespace net |
| 836 | 856 |
| 837 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 857 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |