| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/child/url_loader_client_impl.h" | 5 #include "content/child/url_loader_client_impl.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "content/child/resource_dispatcher.h" | 9 #include "content/child/resource_dispatcher.h" |
| 10 #include "content/child/url_response_body_consumer.h" | 10 #include "content/child/url_response_body_consumer.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 if (is_deferred_) { | 195 if (is_deferred_) { |
| 196 deferred_messages_.push_back(message); | 196 deferred_messages_.push_back(message); |
| 197 } else if (deferred_messages_.size() > 0) { | 197 } else if (deferred_messages_.size() > 0) { |
| 198 deferred_messages_.push_back(message); | 198 deferred_messages_.push_back(message); |
| 199 FlushDeferredMessages(); | 199 FlushDeferredMessages(); |
| 200 } else { | 200 } else { |
| 201 NOTREACHED(); | 201 NOTREACHED(); |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 | 204 |
| 205 void URLLoaderClientImpl::OnUploadProgress(int64_t current_position, | 205 void URLLoaderClientImpl::OnUploadProgress( |
| 206 int64_t total_size, | 206 int64_t current_position, |
| 207 const base::Closure& ack_callback) { | 207 int64_t total_size, |
| 208 OnUploadProgressCallback ack_callback) { |
| 208 if (NeedsStoringMessage()) { | 209 if (NeedsStoringMessage()) { |
| 209 StoreAndDispatch( | 210 StoreAndDispatch( |
| 210 ResourceMsg_UploadProgress(request_id_, current_position, total_size)); | 211 ResourceMsg_UploadProgress(request_id_, current_position, total_size)); |
| 211 } else { | 212 } else { |
| 212 resource_dispatcher_->OnUploadProgress(request_id_, current_position, | 213 resource_dispatcher_->OnUploadProgress(request_id_, current_position, |
| 213 total_size); | 214 total_size); |
| 214 } | 215 } |
| 215 ack_callback.Run(); | 216 std::move(ack_callback).Run(); |
| 216 } | 217 } |
| 217 | 218 |
| 218 } // namespace content | 219 } // namespace content |
| OLD | NEW |