| 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/browser/loader/mojo_async_resource_handler.h" | 5 #include "content/browser/loader/mojo_async_resource_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 NetLogObserver::PopulateResponseInfo(request(), response); | 188 NetLogObserver::PopulateResponseInfo(request(), response); |
| 189 response->head.encoded_data_length = request()->raw_header_size(); | 189 response->head.encoded_data_length = request()->raw_header_size(); |
| 190 reported_total_received_bytes_ = response->head.encoded_data_length; | 190 reported_total_received_bytes_ = response->head.encoded_data_length; |
| 191 | 191 |
| 192 response->head.request_start = request()->creation_time(); | 192 response->head.request_start = request()->creation_time(); |
| 193 response->head.response_start = base::TimeTicks::Now(); | 193 response->head.response_start = base::TimeTicks::Now(); |
| 194 sent_received_response_message_ = true; | 194 sent_received_response_message_ = true; |
| 195 | 195 |
| 196 mojom::DownloadedTempFileAssociatedPtrInfo downloaded_file_ptr; | 196 mojom::DownloadedTempFileAssociatedPtrInfo downloaded_file_ptr; |
| 197 if (!response->head.download_file_path.empty()) { | 197 if (!response->head.download_file_path.empty()) { |
| 198 downloaded_file_ptr = DownloadedTempFileImpl::Create( | 198 downloaded_file_ptr = DownloadedTempFileImpl::Create(info->GetChildID(), |
| 199 binding_.associated_group(), info->GetChildID(), info->GetRequestID()); | 199 info->GetRequestID()); |
| 200 rdh_->RegisterDownloadedTempFile(info->GetChildID(), info->GetRequestID(), | 200 rdh_->RegisterDownloadedTempFile(info->GetChildID(), info->GetRequestID(), |
| 201 response->head.download_file_path); | 201 response->head.download_file_path); |
| 202 } | 202 } |
| 203 | 203 |
| 204 url_loader_client_->OnReceiveResponse(response->head, | 204 url_loader_client_->OnReceiveResponse(response->head, |
| 205 std::move(downloaded_file_ptr)); | 205 std::move(downloaded_file_ptr)); |
| 206 | 206 |
| 207 net::IOBufferWithSize* metadata = GetResponseMetadata(request()); | 207 net::IOBufferWithSize* metadata = GetResponseMetadata(request()); |
| 208 if (metadata) { | 208 if (metadata) { |
| 209 const uint8_t* data = reinterpret_cast<const uint8_t*>(metadata->data()); | 209 const uint8_t* data = reinterpret_cast<const uint8_t*>(metadata->data()); |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 base::Bind(&MojoAsyncResourceHandler::OnUploadProgressACK, | 576 base::Bind(&MojoAsyncResourceHandler::OnUploadProgressACK, |
| 577 weak_factory_.GetWeakPtr())); | 577 weak_factory_.GetWeakPtr())); |
| 578 } | 578 } |
| 579 | 579 |
| 580 void MojoAsyncResourceHandler::OnUploadProgressACK() { | 580 void MojoAsyncResourceHandler::OnUploadProgressACK() { |
| 581 if (upload_progress_tracker_) | 581 if (upload_progress_tracker_) |
| 582 upload_progress_tracker_->OnAckReceived(); | 582 upload_progress_tracker_->OnAckReceived(); |
| 583 } | 583 } |
| 584 | 584 |
| 585 } // namespace content | 585 } // namespace content |
| OLD | NEW |