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

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

Issue 921453003: Allow URLRequest::AppendChunkToUpload to take 0-byte final chunks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reduce tests, refactor out some of the boilerplate, merge some lines Created 5 years, 10 months 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/http/http_stream_parser_unittest.cc ('k') | net/url_request/url_request.cc » ('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_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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 // Sets the delegate of the request. This value may be changed at any time, 297 // Sets the delegate of the request. This value may be changed at any time,
298 // and it is permissible for it to be null. 298 // and it is permissible for it to be null.
299 void set_delegate(Delegate* delegate); 299 void set_delegate(Delegate* delegate);
300 300
301 // Indicates that the request body should be sent using chunked transfer 301 // Indicates that the request body should be sent using chunked transfer
302 // encoding. This method may only be called before Start() is called. 302 // encoding. This method may only be called before Start() is called.
303 void EnableChunkedUpload(); 303 void EnableChunkedUpload();
304 304
305 // Appends the given bytes to the request's upload data to be sent 305 // Appends the given bytes to the request's upload data to be sent
306 // immediately via chunked transfer encoding. When all data has been sent, 306 // immediately via chunked transfer encoding. When all data has been added,
307 // call MarkEndOfChunks() to indicate the end of upload data. 307 // set |is_last_chunk| to true to indicate the end of upload data. All chunks
308 // but the last must have |bytes_len| > 0.
308 // 309 //
309 // This method may be called only after calling EnableChunkedUpload(). 310 // This method may be called only after calling EnableChunkedUpload().
311 //
312 // Despite the name of this method, over-the-wire chunk boundaries will most
313 // likely not match the "chunks" appended with this function.
310 void AppendChunkToUpload(const char* bytes, 314 void AppendChunkToUpload(const char* bytes,
311 int bytes_len, 315 int bytes_len,
312 bool is_last_chunk); 316 bool is_last_chunk);
313 317
314 // Sets the upload data. 318 // Sets the upload data.
315 void set_upload(scoped_ptr<UploadDataStream> upload); 319 void set_upload(scoped_ptr<UploadDataStream> upload);
316 320
317 // Gets the upload data. 321 // Gets the upload data.
318 const UploadDataStream* get_upload() const; 322 const UploadDataStream* get_upload() const;
319 323
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 824
821 // The proxy server used for this request, if any. 825 // The proxy server used for this request, if any.
822 HostPortPair proxy_server_; 826 HostPortPair proxy_server_;
823 827
824 DISALLOW_COPY_AND_ASSIGN(URLRequest); 828 DISALLOW_COPY_AND_ASSIGN(URLRequest);
825 }; 829 };
826 830
827 } // namespace net 831 } // namespace net
828 832
829 #endif // NET_URL_REQUEST_URL_REQUEST_H_ 833 #endif // NET_URL_REQUEST_URL_REQUEST_H_
OLDNEW
« no previous file with comments | « net/http/http_stream_parser_unittest.cc ('k') | net/url_request/url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698