| 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 |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 void AppendBytesToUpload(const char* bytes, int bytes_len); | 245 void AppendBytesToUpload(const char* bytes, int bytes_len); |
| 246 void AppendFileRangeToUpload(const std::wstring& file_path, | 246 void AppendFileRangeToUpload(const std::wstring& file_path, |
| 247 uint64 offset, uint64 length); | 247 uint64 offset, uint64 length); |
| 248 void AppendFileToUpload(const std::wstring& file_path) { | 248 void AppendFileToUpload(const std::wstring& file_path) { |
| 249 AppendFileRangeToUpload(file_path, 0, kuint64max); | 249 AppendFileRangeToUpload(file_path, 0, kuint64max); |
| 250 } | 250 } |
| 251 | 251 |
| 252 // Set the upload data directly. | 252 // Set the upload data directly. |
| 253 void set_upload(net::UploadData* upload) { upload_ = upload; } | 253 void set_upload(net::UploadData* upload) { upload_ = upload; } |
| 254 | 254 |
| 255 // Get the upload data directly. |
| 256 net::UploadData* get_upload() { return upload_.get(); } |
| 257 |
| 255 // Returns true if the request has a non-empty message body to upload. | 258 // Returns true if the request has a non-empty message body to upload. |
| 256 bool has_upload() const { return upload_ != NULL; } | 259 bool has_upload() const { return upload_ != NULL; } |
| 257 | 260 |
| 258 // Set an extra request header by ID or name. These methods may only be | 261 // Set an extra request header by ID or name. These methods may only be |
| 259 // called before Start() is called. It is an error to call it later. | 262 // called before Start() is called. It is an error to call it later. |
| 260 void SetExtraRequestHeaderById(int header_id, const std::string& value, | 263 void SetExtraRequestHeaderById(int header_id, const std::string& value, |
| 261 bool overwrite); | 264 bool overwrite); |
| 262 void SetExtraRequestHeaderByName(const std::string& name, | 265 void SetExtraRequestHeaderByName(const std::string& name, |
| 263 const std::string& value, bool overwrite); | 266 const std::string& value, bool overwrite); |
| 264 | 267 |
| 265 // Sets all extra request headers, from a \r\n-delimited string. Any extra | 268 // Sets all extra request headers, from a \r\n-delimited string. Any extra |
| 266 // request headers set by other methods are overwritten by this method. This | 269 // request headers set by other methods are overwritten by this method. This |
| 267 // method may only be called before Start() is called. It is an error to | 270 // method may only be called before Start() is called. It is an error to |
| 268 // call it later. | 271 // call it later. |
| 269 void SetExtraRequestHeaders(const std::string& headers); | 272 void SetExtraRequestHeaders(const std::string& headers); |
| 270 | 273 |
| 274 const std::string& extra_request_headers() { return extra_request_headers_; } |
| 275 |
| 271 // Returns the current load state for the request. | 276 // Returns the current load state for the request. |
| 272 net::LoadState GetLoadState() const; | 277 net::LoadState GetLoadState() const; |
| 273 | 278 |
| 274 // Returns the current upload progress in bytes. | 279 // Returns the current upload progress in bytes. |
| 275 uint64 GetUploadProgress() const; | 280 uint64 GetUploadProgress() const; |
| 276 | 281 |
| 277 // Get response header(s) by ID or name. These methods may only be called | 282 // Get response header(s) by ID or name. These methods may only be called |
| 278 // once the delegate's OnResponseStarted method has been called. Headers | 283 // once the delegate's OnResponseStarted method has been called. Headers |
| 279 // that appear more than once in the response are coalesced, with values | 284 // that appear more than once in the response are coalesced, with values |
| 280 // separated by commas (per RFC 2616). This will not work with cookies since | 285 // separated by commas (per RFC 2616). This will not work with cookies since |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 #else // disable leak checking in release builds... | 524 #else // disable leak checking in release builds... |
| 520 | 525 |
| 521 #define URLREQUEST_COUNT_CTOR() | 526 #define URLREQUEST_COUNT_CTOR() |
| 522 #define URLREQUEST_COUNT_DTOR() | 527 #define URLREQUEST_COUNT_DTOR() |
| 523 | 528 |
| 524 #endif | 529 #endif |
| 525 | 530 |
| 526 | 531 |
| 527 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 532 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| 528 | 533 |
| OLD | NEW |