| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 |
| 11 #include "base/file_path.h" |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "base/ref_counted.h" | 13 #include "base/ref_counted.h" |
| 13 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 14 #include "net/base/load_states.h" | 15 #include "net/base/load_states.h" |
| 15 #include "net/http/http_response_info.h" | 16 #include "net/http/http_response_info.h" |
| 16 #include "net/url_request/url_request_status.h" | 17 #include "net/url_request/url_request_status.h" |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 class Time; | 20 class Time; |
| 20 } // namespace base | 21 } // namespace base |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // data segments and/or files containing data to upload. These methods may | 230 // data segments and/or files containing data to upload. These methods may |
| 230 // be called to construct the data sequence to upload, and they may only be | 231 // be called to construct the data sequence to upload, and they may only be |
| 231 // called before Start() is called. For POST requests, the user must call | 232 // called before Start() is called. For POST requests, the user must call |
| 232 // SetRequestHeaderBy{Id,Name} to set the Content-Type of the request to the | 233 // SetRequestHeaderBy{Id,Name} to set the Content-Type of the request to the |
| 233 // appropriate value before calling Start(). | 234 // appropriate value before calling Start(). |
| 234 // | 235 // |
| 235 // When uploading data, bytes_len must be non-zero. | 236 // When uploading data, bytes_len must be non-zero. |
| 236 // When uploading a file range, length must be non-zero. If length | 237 // When uploading a file range, length must be non-zero. If length |
| 237 // exceeds the end-of-file, the upload is clipped at end-of-file. | 238 // exceeds the end-of-file, the upload is clipped at end-of-file. |
| 238 void AppendBytesToUpload(const char* bytes, int bytes_len); | 239 void AppendBytesToUpload(const char* bytes, int bytes_len); |
| 239 void AppendFileRangeToUpload(const std::wstring& file_path, | 240 void AppendFileRangeToUpload(const FilePath& file_path, |
| 240 uint64 offset, uint64 length); | 241 uint64 offset, uint64 length); |
| 241 void AppendFileToUpload(const std::wstring& file_path) { | 242 void AppendFileToUpload(const FilePath& file_path) { |
| 242 AppendFileRangeToUpload(file_path, 0, kuint64max); | 243 AppendFileRangeToUpload(file_path, 0, kuint64max); |
| 243 } | 244 } |
| 244 | 245 |
| 245 // Set the upload data directly. | 246 // Set the upload data directly. |
| 246 void set_upload(net::UploadData* upload); | 247 void set_upload(net::UploadData* upload); |
| 247 | 248 |
| 248 // Get the upload data directly. | 249 // Get the upload data directly. |
| 249 net::UploadData* get_upload(); | 250 net::UploadData* get_upload(); |
| 250 | 251 |
| 251 // Returns true if the request has a non-empty message body to upload. | 252 // Returns true if the request has a non-empty message body to upload. |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 #define URLREQUEST_COUNT_DTOR() url_request_metrics.object_count-- | 539 #define URLREQUEST_COUNT_DTOR() url_request_metrics.object_count-- |
| 539 | 540 |
| 540 #else // disable leak checking in release builds... | 541 #else // disable leak checking in release builds... |
| 541 | 542 |
| 542 #define URLREQUEST_COUNT_CTOR() | 543 #define URLREQUEST_COUNT_CTOR() |
| 543 #define URLREQUEST_COUNT_DTOR() | 544 #define URLREQUEST_COUNT_DTOR() |
| 544 | 545 |
| 545 #endif // #ifndef NDEBUG | 546 #endif // #ifndef NDEBUG |
| 546 | 547 |
| 547 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 548 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |