| OLD | NEW |
| 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 #include "net/base/upload_data_stream.h" | 5 #include "net/base/upload_data_stream.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "net/base/file_stream.h" | 10 #include "net/base/file_stream.h" |
| 11 #include "net/base/io_buffer.h" | 11 #include "net/base/io_buffer.h" |
| 12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 bool UploadDataStream::merge_chunks_ = true; | 16 bool UploadDataStream::merge_chunks_ = true; |
| 17 | 17 |
| 18 // static |
| 19 void UploadDataStream::ResetMergeChunks() { |
| 20 // WARNING: merge_chunks_ must match the above initializer. |
| 21 merge_chunks_ = true; |
| 22 } |
| 23 |
| 18 UploadDataStream::UploadDataStream(UploadData* upload_data) | 24 UploadDataStream::UploadDataStream(UploadData* upload_data) |
| 19 : upload_data_(upload_data), | 25 : upload_data_(upload_data), |
| 20 element_index_(0), | 26 element_index_(0), |
| 21 total_size_(0), | 27 total_size_(0), |
| 22 current_position_(0), | 28 current_position_(0), |
| 23 initialized_successfully_(false) { | 29 initialized_successfully_(false) { |
| 24 } | 30 } |
| 25 | 31 |
| 26 UploadDataStream::~UploadDataStream() { | 32 UploadDataStream::~UploadDataStream() { |
| 27 } | 33 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 return false; | 108 return false; |
| 103 } | 109 } |
| 104 | 110 |
| 105 bool UploadDataStream::IsInMemory() const { | 111 bool UploadDataStream::IsInMemory() const { |
| 106 DCHECK(initialized_successfully_); | 112 DCHECK(initialized_successfully_); |
| 107 | 113 |
| 108 return upload_data_->IsInMemory(); | 114 return upload_data_->IsInMemory(); |
| 109 } | 115 } |
| 110 | 116 |
| 111 } // namespace net | 117 } // namespace net |
| OLD | NEW |