OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 // check if the underlying file has been changed or not. The granularity of | 313 // check if the underlying file has been changed or not. The granularity of |
314 // the time comparison is 1 second since time_t precision is used in WebKit. | 314 // the time comparison is 1 second since time_t precision is used in WebKit. |
315 void AppendBytesToUpload(const char* bytes, int bytes_len); // takes a copy | 315 void AppendBytesToUpload(const char* bytes, int bytes_len); // takes a copy |
316 void AppendFileRangeToUpload(const FilePath& file_path, | 316 void AppendFileRangeToUpload(const FilePath& file_path, |
317 uint64 offset, uint64 length, | 317 uint64 offset, uint64 length, |
318 const base::Time& expected_modification_time); | 318 const base::Time& expected_modification_time); |
319 void AppendFileToUpload(const FilePath& file_path) { | 319 void AppendFileToUpload(const FilePath& file_path) { |
320 AppendFileRangeToUpload(file_path, 0, kuint64max, base::Time()); | 320 AppendFileRangeToUpload(file_path, 0, kuint64max, base::Time()); |
321 } | 321 } |
322 | 322 |
| 323 // Indicates that the request body should be sent using chunked transfer |
| 324 // encoding. This method may only be called before Start() is called. |
| 325 void EnableChunkedUpload(); |
| 326 |
| 327 // Appends the given bytes to the request's upload data to be sent |
| 328 // immediately via chunked transfer encoding. When all data has been sent, |
| 329 // call MarkEndOfChunks() to indicate the end of upload data. |
| 330 // |
| 331 // This method may be called only after calling EnableChunkedUpload(). |
| 332 void AppendChunkToUpload(const char* bytes, int bytes_len); |
| 333 |
| 334 // Indicates the end of a chunked transfer encoded request body. |
| 335 void MarkEndOfChunks(); |
| 336 |
323 // Set the upload data directly. | 337 // Set the upload data directly. |
324 void set_upload(net::UploadData* upload); | 338 void set_upload(net::UploadData* upload); |
325 | 339 |
326 // Get the upload data directly. | 340 // Get the upload data directly. |
327 net::UploadData* get_upload(); | 341 net::UploadData* get_upload(); |
328 | 342 |
329 // Returns true if the request has a non-empty message body to upload. | 343 // Returns true if the request has a non-empty message body to upload. |
330 bool has_upload() const; | 344 bool has_upload() const; |
331 | 345 |
332 // Set an extra request header by ID or name. These methods may only be | 346 // Set an extra request header by ID or name. These methods may only be |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 net::RequestPriority priority_; | 653 net::RequestPriority priority_; |
640 | 654 |
641 base::debug::LeakTracker<URLRequest> leak_tracker_; | 655 base::debug::LeakTracker<URLRequest> leak_tracker_; |
642 | 656 |
643 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 657 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
644 }; | 658 }; |
645 | 659 |
646 } // namespace net | 660 } // namespace net |
647 | 661 |
648 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 662 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |