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 // Add the LoFi header to the request. | |
| 67 LOFI_ON = 0, | |
| 68 // Do not add the LoFi header to the request. | |
| 69 LOFI_OFF, | |
| 70 // Check with the network-quality-based triggering logic and add the header if | |
|
bengr
2015/08/25 00:00:02
See my previous comment about not specifying the i
megjablon
2015/08/25 20:29:47
Done.
| |
| 71 // the network is slow. | |
| 72 LOFI_DEFAULT, | |
| 73 }; | |
| 74 | |
| 63 //----------------------------------------------------------------------------- | 75 //----------------------------------------------------------------------------- |
| 64 // A class representing the asynchronous load of a data stream from an URL. | 76 // A class representing the asynchronous load of a data stream from an URL. |
| 65 // | 77 // |
| 66 // The lifetime of an instance of this class is completely controlled by the | 78 // 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 | 79 // 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 | 80 // 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 | 81 // 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. | 82 // the URLRequest is deleted, no further callbacks to its delegate will occur. |
| 71 // | 83 // |
| 72 // NOTE: All usage of all instances of this class should be on the same thread. | 84 // 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 | 303 |
| 292 // The referrer policy to apply when updating the referrer during redirects. | 304 // The referrer policy to apply when updating the referrer during redirects. |
| 293 // The referrer policy may only be changed before Start() is called. | 305 // The referrer policy may only be changed before Start() is called. |
| 294 ReferrerPolicy referrer_policy() const { return referrer_policy_; } | 306 ReferrerPolicy referrer_policy() const { return referrer_policy_; } |
| 295 void set_referrer_policy(ReferrerPolicy referrer_policy); | 307 void set_referrer_policy(ReferrerPolicy referrer_policy); |
| 296 | 308 |
| 297 // Sets the delegate of the request. This value may be changed at any time, | 309 // Sets the delegate of the request. This value may be changed at any time, |
| 298 // and it is permissible for it to be null. | 310 // and it is permissible for it to be null. |
| 299 void set_delegate(Delegate* delegate); | 311 void set_delegate(Delegate* delegate); |
| 300 | 312 |
| 313 // TODO(megjablon): Add comment. | |
|
bengr
2015/08/25 00:00:02
Add it.
megjablon
2015/08/25 20:29:47
Done.
| |
| 314 void set_lofi_state(LoFiState lofi_state); | |
| 315 | |
| 316 LoFiState lofi_state() const { return lofi_state_; } | |
| 317 | |
| 301 // Indicates that the request body should be sent using chunked transfer | 318 // Indicates that the request body should be sent using chunked transfer |
| 302 // encoding. This method may only be called before Start() is called. | 319 // encoding. This method may only be called before Start() is called. |
| 303 void EnableChunkedUpload(); | 320 void EnableChunkedUpload(); |
| 304 | 321 |
| 305 // Appends the given bytes to the request's upload data to be sent | 322 // 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, | 323 // 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 | 324 // set |is_last_chunk| to true to indicate the end of upload data. All chunks |
| 308 // but the last must have |bytes_len| > 0. | 325 // but the last must have |bytes_len| > 0. |
| 309 // | 326 // |
| 310 // This method may be called only after calling EnableChunkedUpload(). | 327 // 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_; | 839 LoadTimingInfo load_timing_info_; |
| 823 | 840 |
| 824 // Keeps track of whether or not OnBeforeNetworkStart has been called yet. | 841 // Keeps track of whether or not OnBeforeNetworkStart has been called yet. |
| 825 bool notified_before_network_start_; | 842 bool notified_before_network_start_; |
| 826 | 843 |
| 827 // The proxy server used for this request, if any. | 844 // The proxy server used for this request, if any. |
| 828 HostPortPair proxy_server_; | 845 HostPortPair proxy_server_; |
| 829 | 846 |
| 830 scoped_ptr<const base::debug::StackTrace> stack_trace_; | 847 scoped_ptr<const base::debug::StackTrace> stack_trace_; |
| 831 | 848 |
| 849 // TODO(megjablon): Add comment | |
|
bengr
2015/08/25 00:00:02
Add it.
megjablon
2015/08/25 20:29:47
Done.
| |
| 850 LoFiState lofi_state_; | |
| 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 |