Chromium Code Reviews| 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/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | 183 |
| 184 net_log_.EndEventWithNetErrorCode(NetLogEventType::UPLOAD_DATA_STREAM_READ, | 184 net_log_.EndEventWithNetErrorCode(NetLogEventType::UPLOAD_DATA_STREAM_READ, |
| 185 result); | 185 result); |
| 186 | 186 |
| 187 if (!callback_.is_null()) | 187 if (!callback_.is_null()) |
| 188 base::ResetAndReturn(&callback_).Run(result); | 188 base::ResetAndReturn(&callback_).Run(result); |
| 189 } | 189 } |
| 190 | 190 |
| 191 UploadProgress UploadDataStream::GetUploadProgress() const { | |
| 192 // While initialization / rewinding is in progress, return nothing. | |
| 193 if (!initialized_successfully_) { | |
| 194 return UploadProgress(); | |
| 195 } | |
|
mmenke
2016/09/12 19:35:31
nit: Remove braces.
shivanisha
2016/09/14 20:40:25
done.
| |
| 196 | |
| 197 return UploadProgress(current_position_, total_size_); | |
| 198 } | |
| 199 | |
| 191 } // namespace net | 200 } // namespace net |
| OLD | NEW |