OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 292 |
293 // The data comprising the request message body is specified as a sequence of | 293 // The data comprising the request message body is specified as a sequence of |
294 // data segments and/or files containing data to upload. These methods may | 294 // data segments and/or files containing data to upload. These methods may |
295 // be called to construct the data sequence to upload, and they may only be | 295 // be called to construct the data sequence to upload, and they may only be |
296 // called before Start() is called. For POST requests, the user must call | 296 // called before Start() is called. For POST requests, the user must call |
297 // SetRequestHeaderBy{Id,Name} to set the Content-Type of the request to the | 297 // SetRequestHeaderBy{Id,Name} to set the Content-Type of the request to the |
298 // appropriate value before calling Start(). | 298 // appropriate value before calling Start(). |
299 // | 299 // |
300 // When uploading data, bytes_len must be non-zero. | 300 // When uploading data, bytes_len must be non-zero. |
301 // When uploading a file range, length must be non-zero. If length | 301 // When uploading a file range, length must be non-zero. If length |
302 // exceeds the end-of-file, the upload is clipped at end-of-file. | 302 // exceeds the end-of-file, the upload is clipped at end-of-file. If the |
| 303 // expected modification time is provided (non-zero), it will be used to |
| 304 // check if the underlying file has been changed or not. The granularity of |
| 305 // the time comparison is 1 second since time_t precision is used in WebKit. |
303 void AppendBytesToUpload(const char* bytes, int bytes_len); | 306 void AppendBytesToUpload(const char* bytes, int bytes_len); |
304 void AppendFileRangeToUpload(const FilePath& file_path, | 307 void AppendFileRangeToUpload(const FilePath& file_path, |
305 uint64 offset, uint64 length); | 308 uint64 offset, uint64 length, |
| 309 const base::Time& expected_modification_time); |
306 void AppendFileToUpload(const FilePath& file_path) { | 310 void AppendFileToUpload(const FilePath& file_path) { |
307 AppendFileRangeToUpload(file_path, 0, kuint64max); | 311 AppendFileRangeToUpload(file_path, 0, kuint64max, base::Time()); |
308 } | 312 } |
309 | 313 |
310 // Set the upload data directly. | 314 // Set the upload data directly. |
311 void set_upload(net::UploadData* upload); | 315 void set_upload(net::UploadData* upload); |
312 | 316 |
313 // Get the upload data directly. | 317 // Get the upload data directly. |
314 net::UploadData* get_upload(); | 318 net::UploadData* get_upload(); |
315 | 319 |
316 // Returns true if the request has a non-empty message body to upload. | 320 // Returns true if the request has a non-empty message body to upload. |
317 bool has_upload() const; | 321 bool has_upload() const; |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 // The priority level for this request. Objects like ClientSocketPool use | 627 // The priority level for this request. Objects like ClientSocketPool use |
624 // this to determine which URLRequest to allocate sockets to first. | 628 // this to determine which URLRequest to allocate sockets to first. |
625 net::RequestPriority priority_; | 629 net::RequestPriority priority_; |
626 | 630 |
627 base::LeakTracker<URLRequest> leak_tracker_; | 631 base::LeakTracker<URLRequest> leak_tracker_; |
628 | 632 |
629 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 633 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
630 }; | 634 }; |
631 | 635 |
632 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 636 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |