Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: net/url_request/url_fetcher.h

Issue 809663003: net: Add SetUploadStream method to URLFetcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/url_request/test_url_fetcher_factory.cc ('k') | net/url_request/url_fetcher_core.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // |range_offset| and |range_length| specify the range of the part 142 // |range_offset| and |range_length| specify the range of the part
143 // to be uploaded. To upload the whole file, (0, kuint64max) can be used. 143 // to be uploaded. To upload the whole file, (0, kuint64max) can be used.
144 // |file_task_runner| will be used for all file operations. 144 // |file_task_runner| will be used for all file operations.
145 virtual void SetUploadFilePath( 145 virtual void SetUploadFilePath(
146 const std::string& upload_content_type, 146 const std::string& upload_content_type,
147 const base::FilePath& file_path, 147 const base::FilePath& file_path,
148 uint64 range_offset, 148 uint64 range_offset,
149 uint64 range_length, 149 uint64 range_length,
150 scoped_refptr<base::TaskRunner> file_task_runner) = 0; 150 scoped_refptr<base::TaskRunner> file_task_runner) = 0;
151 151
152 // Sets data only needed by POSTs. All callers making POST requests should
153 // call one of the SetUpload* methods before the request is started.
154 // |upload_content_type| is the MIME type of the content, while
155 // |upload_stream| is the data to be sent (the Content-Length header value
156 // will be set to the length of this data).
157 virtual void SetUploadStream(
158 const std::string& upload_content_type,
159 scoped_ptr<net::UploadDataStream> upload_stream) = 0;
mmenke 2014/12/18 15:38:46 Why is this needed? This is incompatible with all
160
152 // Indicates that the POST data is sent via chunked transfer encoding. 161 // Indicates that the POST data is sent via chunked transfer encoding.
153 // This may only be called before calling Start(). 162 // This may only be called before calling Start().
154 // Use AppendChunkToUpload() to give the data chunks after calling Start(). 163 // Use AppendChunkToUpload() to give the data chunks after calling Start().
155 virtual void SetChunkedUpload(const std::string& upload_content_type) = 0; 164 virtual void SetChunkedUpload(const std::string& upload_content_type) = 0;
156 165
157 // Adds the given bytes to a request's POST data transmitted using chunked 166 // Adds the given bytes to a request's POST data transmitted using chunked
158 // transfer encoding. 167 // transfer encoding.
159 // This method should be called ONLY after calling Start(). 168 // This method should be called ONLY after calling Start().
160 virtual void AppendChunkToUpload(const std::string& data, 169 virtual void AppendChunkToUpload(const std::string& data,
161 bool is_last_chunk) = 0; 170 bool is_last_chunk) = 0;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 // be removed once the URLFetcher is destroyed. User should not take 310 // be removed once the URLFetcher is destroyed. User should not take
302 // ownership more than once, or call this method after taking ownership. 311 // ownership more than once, or call this method after taking ownership.
303 virtual bool GetResponseAsFilePath( 312 virtual bool GetResponseAsFilePath(
304 bool take_ownership, 313 bool take_ownership,
305 base::FilePath* out_response_path) const = 0; 314 base::FilePath* out_response_path) const = 0;
306 }; 315 };
307 316
308 } // namespace net 317 } // namespace net
309 318
310 #endif // NET_URL_REQUEST_URL_FETCHER_H_ 319 #endif // NET_URL_REQUEST_URL_FETCHER_H_
OLDNEW
« no previous file with comments | « net/url_request/test_url_fetcher_factory.cc ('k') | net/url_request/url_fetcher_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698