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

Side by Side Diff: net/base/upload_data_stream.h

Issue 11439008: net: Change argument of URLRequest::set_upload from UploadData to UploadDataStream (Closed) Base URL: http://git.chromium.org/chromium/src.git@chunk
Patch Set: Fix android Created 8 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/base/upload_bytes_element_reader.cc ('k') | net/base/upload_data_stream.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_BASE_UPLOAD_DATA_STREAM_H_ 5 #ifndef NET_BASE_UPLOAD_DATA_STREAM_H_
6 #define NET_BASE_UPLOAD_DATA_STREAM_H_ 6 #define NET_BASE_UPLOAD_DATA_STREAM_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 16 matching lines...) Expand all
27 // Constructs a non-chunked data stream. 27 // Constructs a non-chunked data stream.
28 // |element_readers| is cleared by this ctor. 28 // |element_readers| is cleared by this ctor.
29 UploadDataStream(ScopedVector<UploadElementReader>* element_readers, 29 UploadDataStream(ScopedVector<UploadElementReader>* element_readers,
30 int64 identifier); 30 int64 identifier);
31 31
32 // Constructs a chunked data stream. 32 // Constructs a chunked data stream.
33 UploadDataStream(Chunked chunked, int64 identifier); 33 UploadDataStream(Chunked chunked, int64 identifier);
34 34
35 ~UploadDataStream(); 35 ~UploadDataStream();
36 36
37 // Creates UploadDataStream with a reader.
38 static UploadDataStream* CreateWithReader(
39 scoped_ptr<UploadElementReader> reader,
40 int64 identifier);
41
37 // Initializes the stream. This function must be called before calling any 42 // Initializes the stream. This function must be called before calling any
38 // other method. It is not valid to call any method (other than the 43 // other method. It is not valid to call any method (other than the
39 // destructor) if Init() returns a failure. This method can be called multiple 44 // destructor) if Init() returns a failure. This method can be called multiple
40 // times. Calling this method after a Init() success results in resetting the 45 // times. Calling this method after a Init() success results in resetting the
41 // state. 46 // state.
42 // 47 //
43 // Does the initialization synchronously and returns the result if possible, 48 // Does the initialization synchronously and returns the result if possible,
44 // otherwise returns ERR_IO_PENDING and runs the callback with the result. 49 // otherwise returns ERR_IO_PENDING and runs the callback with the result.
45 // 50 //
46 // Returns OK on success. Returns ERR_UPLOAD_FILE_CHANGED if the expected 51 // Returns OK on success. Returns ERR_UPLOAD_FILE_CHANGED if the expected
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // TODO(satish): Remove this once we have a better way to unit test POST 167 // TODO(satish): Remove this once we have a better way to unit test POST
163 // requests with chunked uploads. 168 // requests with chunked uploads.
164 static bool merge_chunks_; 169 static bool merge_chunks_;
165 170
166 DISALLOW_COPY_AND_ASSIGN(UploadDataStream); 171 DISALLOW_COPY_AND_ASSIGN(UploadDataStream);
167 }; 172 };
168 173
169 } // namespace net 174 } // namespace net
170 175
171 #endif // NET_BASE_UPLOAD_DATA_STREAM_H_ 176 #endif // NET_BASE_UPLOAD_DATA_STREAM_H_
OLDNEW
« no previous file with comments | « net/base/upload_bytes_element_reader.cc ('k') | net/base/upload_data_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698