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

Unified Diff: net/base/chunked_upload_data_stream.cc

Issue 1465803002: Remove ScopedVector from chunked_upload_data_stream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/chunked_upload_data_stream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/chunked_upload_data_stream.cc
diff --git a/net/base/chunked_upload_data_stream.cc b/net/base/chunked_upload_data_stream.cc
index 6ba40c585bffa56475299088d9864f830e4ed17b..52cf48561c9b2b3f775d85ada1a4c372c3ddc8ea 100644
--- a/net/base/chunked_upload_data_stream.cc
+++ b/net/base/chunked_upload_data_stream.cc
@@ -28,7 +28,8 @@ void ChunkedUploadDataStream::AppendData(
DCHECK(data_len > 0 || is_done);
if (data_len > 0) {
DCHECK(data);
- upload_data_.push_back(new std::vector<char>(data, data + data_len));
+ upload_data_.push_back(
+ make_scoped_ptr(new std::vector<char>(data, data + data_len)));
}
all_data_appended_ = is_done;
@@ -74,7 +75,7 @@ int ChunkedUploadDataStream::ReadChunk(IOBuffer* buf, int buf_len) {
// Copy as much data as possible from |upload_data_| to |buf|.
int bytes_read = 0;
while (read_index_ < upload_data_.size() && bytes_read < buf_len) {
- std::vector<char>* data = upload_data_[read_index_];
+ std::vector<char>* data = upload_data_[read_index_].get();
size_t bytes_to_read =
std::min(static_cast<size_t>(buf_len - bytes_read),
data->size() - read_offset_);
« no previous file with comments | « net/base/chunked_upload_data_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698