| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "net/base/chunked_upload_data_stream.h" | 5 #include "net/base/chunked_upload_data_stream.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 ChunkedUploadDataStream::ChunkedUploadDataStream(int64 identifier) | 14 ChunkedUploadDataStream::ChunkedUploadDataStream(int64_t identifier) |
| 15 : UploadDataStream(true, identifier), | 15 : UploadDataStream(true, identifier), |
| 16 read_index_(0), | 16 read_index_(0), |
| 17 read_offset_(0), | 17 read_offset_(0), |
| 18 all_data_appended_(false), | 18 all_data_appended_(false), |
| 19 read_buffer_len_(0) { | 19 read_buffer_len_(0) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 ChunkedUploadDataStream::~ChunkedUploadDataStream() { | 22 ChunkedUploadDataStream::~ChunkedUploadDataStream() { |
| 23 } | 23 } |
| 24 | 24 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // ERR_IO_PENDING. The read will be completed in the next call to AppendData. | 94 // ERR_IO_PENDING. The read will be completed in the next call to AppendData. |
| 95 if (bytes_read == 0 && !all_data_appended_) | 95 if (bytes_read == 0 && !all_data_appended_) |
| 96 return ERR_IO_PENDING; | 96 return ERR_IO_PENDING; |
| 97 | 97 |
| 98 if (read_index_ == upload_data_.size() && all_data_appended_) | 98 if (read_index_ == upload_data_.size() && all_data_appended_) |
| 99 SetIsFinalChunk(); | 99 SetIsFinalChunk(); |
| 100 return bytes_read; | 100 return bytes_read; |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace net | 103 } // namespace net |
| OLD | NEW |