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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 // |file_task_runner| will be used for all file operations. | 138 // |file_task_runner| will be used for all file operations. |
139 virtual void SetUploadFilePath( | 139 virtual void SetUploadFilePath( |
140 const std::string& upload_content_type, | 140 const std::string& upload_content_type, |
141 const base::FilePath& file_path, | 141 const base::FilePath& file_path, |
142 scoped_refptr<base::TaskRunner> file_task_runner) = 0; | 142 scoped_refptr<base::TaskRunner> file_task_runner) = 0; |
143 | 143 |
144 // Sets data only needed by POSTs as same as SetUploadFilePath(). | |
145 // The only difference is that this method takes the |range_offset| and | |
146 // |range_length| to upload a part of the file at |file_path|. | |
147 virtual void SetUploadFilePathWithRange( | |
148 const std::string& upload_content_type, | |
149 const base::FilePath& file_path, | |
150 uint64 range_offset, | |
151 uint64 range_length, | |
hashimoto
2013/04/30 10:27:36
Instead of adding a new method, can we add these r
hidehiko
2013/04/30 11:30:14
We can, but should we do that?
I'm thinking that s
hashimoto
2013/05/01 06:39:21
I don't think we should maintain two unpopular met
hidehiko
2013/05/01 13:51:49
Ok. Done.
| |
152 scoped_refptr<base::TaskRunner> file_task_runner) = 0; | |
153 | |
144 // Indicates that the POST data is sent via chunked transfer encoding. | 154 // Indicates that the POST data is sent via chunked transfer encoding. |
145 // This may only be called before calling Start(). | 155 // This may only be called before calling Start(). |
146 // Use AppendChunkToUpload() to give the data chunks after calling Start(). | 156 // Use AppendChunkToUpload() to give the data chunks after calling Start(). |
147 virtual void SetChunkedUpload(const std::string& upload_content_type) = 0; | 157 virtual void SetChunkedUpload(const std::string& upload_content_type) = 0; |
148 | 158 |
149 // Adds the given bytes to a request's POST data transmitted using chunked | 159 // Adds the given bytes to a request's POST data transmitted using chunked |
150 // transfer encoding. | 160 // transfer encoding. |
151 // This method should be called ONLY after calling Start(). | 161 // This method should be called ONLY after calling Start(). |
152 virtual void AppendChunkToUpload(const std::string& data, | 162 virtual void AppendChunkToUpload(const std::string& data, |
153 bool is_last_chunk) = 0; | 163 bool is_last_chunk) = 0; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
287 // be removed once the URLFetcher is destroyed. User should not take | 297 // be removed once the URLFetcher is destroyed. User should not take |
288 // ownership more than once, or call this method after taking ownership. | 298 // ownership more than once, or call this method after taking ownership. |
289 virtual bool GetResponseAsFilePath( | 299 virtual bool GetResponseAsFilePath( |
290 bool take_ownership, | 300 bool take_ownership, |
291 base::FilePath* out_response_path) const = 0; | 301 base::FilePath* out_response_path) const = 0; |
292 }; | 302 }; |
293 | 303 |
294 } // namespace net | 304 } // namespace net |
295 | 305 |
296 #endif // NET_URL_REQUEST_URL_FETCHER_H_ | 306 #endif // NET_URL_REQUEST_URL_FETCHER_H_ |
OLD | NEW |