| 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() and |
| 332 // Start(). |
| 333 void AppendChunkToUpload(const char* bytes, int bytes_len); |
| 334 |
| 335 // Indicates the end of a chunked transfer encoded request body. |
| 336 void MarkEndOfChunks(); |
| 337 |
| 323 // Set the upload data directly. | 338 // Set the upload data directly. |
| 324 void set_upload(net::UploadData* upload); | 339 void set_upload(net::UploadData* upload); |
| 325 | 340 |
| 326 // Get the upload data directly. | 341 // Get the upload data directly. |
| 327 net::UploadData* get_upload(); | 342 net::UploadData* get_upload(); |
| 328 | 343 |
| 329 // Returns true if the request has a non-empty message body to upload. | 344 // Returns true if the request has a non-empty message body to upload. |
| 330 bool has_upload() const; | 345 bool has_upload() const; |
| 331 | 346 |
| 332 // Set an extra request header by ID or name. These methods may only be | 347 // 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_; | 654 net::RequestPriority priority_; |
| 640 | 655 |
| 641 base::debug::LeakTracker<URLRequest> leak_tracker_; | 656 base::debug::LeakTracker<URLRequest> leak_tracker_; |
| 642 | 657 |
| 643 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 658 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
| 644 }; | 659 }; |
| 645 | 660 |
| 646 } // namespace net | 661 } // namespace net |
| 647 | 662 |
| 648 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 663 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |