OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_FETCHER_H_ | 5 #ifndef NET_URL_REQUEST_URL_FETCHER_H_ |
6 #define NET_URL_REQUEST_URL_FETCHER_H_ | 6 #define NET_URL_REQUEST_URL_FETCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // |upload_content| is the data to be sent (the Content-Length header value | 128 // |upload_content| is the data to be sent (the Content-Length header value |
129 // will be set to the length of this data). | 129 // will be set to the length of this data). |
130 virtual void SetUploadData(const std::string& upload_content_type, | 130 virtual void SetUploadData(const std::string& upload_content_type, |
131 const std::string& upload_content) = 0; | 131 const std::string& upload_content) = 0; |
132 | 132 |
133 // Sets data only needed by POSTs. All callers making POST requests should | 133 // Sets data only needed by POSTs. All callers making POST requests should |
134 // call one of the SetUpload* methods before the request is started. | 134 // call one of the SetUpload* methods before the request is started. |
135 // |upload_content_type| is the MIME type of the content, while | 135 // |upload_content_type| is the MIME type of the content, while |
136 // |file_path| is the path to the file containing the data to be sent (the | 136 // |file_path| is the path to the file containing the data to be sent (the |
137 // Content-Length header value will be set to the length of this file). | 137 // Content-Length header value will be set to the length of this file). |
| 138 // |range_offset| and |range_length| specify the range of the part |
| 139 // to be uploaded. To upload the whole file, (0, kuint64max) can be used. |
138 // |file_task_runner| will be used for all file operations. | 140 // |file_task_runner| will be used for all file operations. |
139 virtual void SetUploadFilePath( | 141 virtual void SetUploadFilePath( |
140 const std::string& upload_content_type, | 142 const std::string& upload_content_type, |
141 const base::FilePath& file_path, | 143 const base::FilePath& file_path, |
| 144 uint64 range_offset, |
| 145 uint64 range_length, |
142 scoped_refptr<base::TaskRunner> file_task_runner) = 0; | 146 scoped_refptr<base::TaskRunner> file_task_runner) = 0; |
143 | 147 |
144 // Indicates that the POST data is sent via chunked transfer encoding. | 148 // Indicates that the POST data is sent via chunked transfer encoding. |
145 // This may only be called before calling Start(). | 149 // This may only be called before calling Start(). |
146 // Use AppendChunkToUpload() to give the data chunks after calling Start(). | 150 // Use AppendChunkToUpload() to give the data chunks after calling Start(). |
147 virtual void SetChunkedUpload(const std::string& upload_content_type) = 0; | 151 virtual void SetChunkedUpload(const std::string& upload_content_type) = 0; |
148 | 152 |
149 // Adds the given bytes to a request's POST data transmitted using chunked | 153 // Adds the given bytes to a request's POST data transmitted using chunked |
150 // transfer encoding. | 154 // transfer encoding. |
151 // This method should be called ONLY after calling Start(). | 155 // This method should be called ONLY after calling Start(). |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // be removed once the URLFetcher is destroyed. User should not take | 291 // be removed once the URLFetcher is destroyed. User should not take |
288 // ownership more than once, or call this method after taking ownership. | 292 // ownership more than once, or call this method after taking ownership. |
289 virtual bool GetResponseAsFilePath( | 293 virtual bool GetResponseAsFilePath( |
290 bool take_ownership, | 294 bool take_ownership, |
291 base::FilePath* out_response_path) const = 0; | 295 base::FilePath* out_response_path) const = 0; |
292 }; | 296 }; |
293 | 297 |
294 } // namespace net | 298 } // namespace net |
295 | 299 |
296 #endif // NET_URL_REQUEST_URL_FETCHER_H_ | 300 #endif // NET_URL_REQUEST_URL_FETCHER_H_ |
OLD | NEW |