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

Unified Diff: net/base/upload_data_stream.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/upload_data_stream.h ('k') | net/base/upload_file_element_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_data_stream.cc
diff --git a/net/base/upload_data_stream.cc b/net/base/upload_data_stream.cc
index c3a2f0bd1dabaf9364b396a8eab401c5cf5c56e2..0da50753381cda34f6f4c023f78d22f87ff713f2 100644
--- a/net/base/upload_data_stream.cc
+++ b/net/base/upload_data_stream.cc
@@ -12,24 +12,6 @@
namespace net {
-namespace {
-
-// A subclass of UplodBytesElementReader which owns the data given as a vector.
-class UploadOwnedBytesElementReader : public UploadBytesElementReader {
- public:
- UploadOwnedBytesElementReader(std::vector<char>* data)
- : UploadBytesElementReader(&(*data)[0], data->size()) {
- data_.swap(*data);
- }
-
- virtual ~UploadOwnedBytesElementReader() {}
-
- private:
- std::vector<char> data_;
-};
-
-} // namespace
-
bool UploadDataStream::merge_chunks_ = true;
// static
@@ -66,6 +48,14 @@ UploadDataStream::UploadDataStream(Chunked /*chunked*/, int64 identifier)
UploadDataStream::~UploadDataStream() {
}
+UploadDataStream* UploadDataStream::CreateWithReader(
+ scoped_ptr<UploadElementReader> reader,
+ int64 identifier) {
+ ScopedVector<UploadElementReader> readers;
+ readers.push_back(reader.release());
+ return new UploadDataStream(&readers, identifier);
+}
+
int UploadDataStream::Init(const CompletionCallback& callback) {
Reset();
// Use fast path when initialization can be done synchronously.
« no previous file with comments | « net/base/upload_data_stream.h ('k') | net/base/upload_file_element_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698