Commit 882f4f9f authored by olli.raula's avatar olli.raula Committed by Commit bot

Remove ScopedVector from chunked_upload_data_stream

BUG=554289

Review URL: https://codereview.chromium.org/1465803002

Cr-Commit-Position: refs/heads/master@{#361079}
parent 9d66b7d2
...@@ -28,7 +28,8 @@ void ChunkedUploadDataStream::AppendData( ...@@ -28,7 +28,8 @@ void ChunkedUploadDataStream::AppendData(
DCHECK(data_len > 0 || is_done); DCHECK(data_len > 0 || is_done);
if (data_len > 0) { if (data_len > 0) {
DCHECK(data); 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; all_data_appended_ = is_done;
...@@ -74,7 +75,7 @@ int ChunkedUploadDataStream::ReadChunk(IOBuffer* buf, int buf_len) { ...@@ -74,7 +75,7 @@ int ChunkedUploadDataStream::ReadChunk(IOBuffer* buf, int buf_len) {
// Copy as much data as possible from |upload_data_| to |buf|. // Copy as much data as possible from |upload_data_| to |buf|.
int bytes_read = 0; int bytes_read = 0;
while (read_index_ < upload_data_.size() && bytes_read < buf_len) { 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 = size_t bytes_to_read =
std::min(static_cast<size_t>(buf_len - bytes_read), std::min(static_cast<size_t>(buf_len - bytes_read),
data->size() - read_offset_); data->size() - read_offset_);
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h"
#include "net/base/completion_callback.h" #include "net/base/completion_callback.h"
#include "net/base/net_export.h" #include "net/base/net_export.h"
#include "net/base/upload_data_stream.h" #include "net/base/upload_data_stream.h"
...@@ -48,7 +47,7 @@ class NET_EXPORT ChunkedUploadDataStream : public UploadDataStream { ...@@ -48,7 +47,7 @@ class NET_EXPORT ChunkedUploadDataStream : public UploadDataStream {
// True once all data has been appended to the stream. // True once all data has been appended to the stream.
bool all_data_appended_; bool all_data_appended_;
ScopedVector<std::vector<char>> upload_data_; std::vector<scoped_ptr<std::vector<char>>> upload_data_;
// Buffer to write the next read's data to. Only set when a call to // Buffer to write the next read's data to. Only set when a call to
// ReadInternal reads no data. // ReadInternal reads no data.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment