| 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 sent_received_response_message_ = true; | 188 sent_received_response_message_ = true; |
| 189 | 189 |
| 190 mojom::DownloadedTempFilePtr downloaded_file_ptr; | 190 mojom::DownloadedTempFilePtr downloaded_file_ptr; |
| 191 if (!response->head.download_file_path.empty()) { | 191 if (!response->head.download_file_path.empty()) { |
| 192 downloaded_file_ptr = DownloadedTempFileImpl::Create(info->GetChildID(), | 192 downloaded_file_ptr = DownloadedTempFileImpl::Create(info->GetChildID(), |
| 193 info->GetRequestID()); | 193 info->GetRequestID()); |
| 194 rdh_->RegisterDownloadedTempFile(info->GetChildID(), info->GetRequestID(), | 194 rdh_->RegisterDownloadedTempFile(info->GetChildID(), info->GetRequestID(), |
| 195 response->head.download_file_path); | 195 response->head.download_file_path); |
| 196 } | 196 } |
| 197 | 197 |
| 198 url_loader_client_->OnReceiveResponse(response->head, | 198 url_loader_client_->OnReceiveResponse(response->head, base::nullopt, |
| 199 std::move(downloaded_file_ptr)); | 199 std::move(downloaded_file_ptr)); |
| 200 | 200 |
| 201 net::IOBufferWithSize* metadata = GetResponseMetadata(request()); | 201 net::IOBufferWithSize* metadata = GetResponseMetadata(request()); |
| 202 if (metadata) { | 202 if (metadata) { |
| 203 const uint8_t* data = reinterpret_cast<const uint8_t*>(metadata->data()); | 203 const uint8_t* data = reinterpret_cast<const uint8_t*>(metadata->data()); |
| 204 | 204 |
| 205 url_loader_client_->OnReceiveCachedMetadata( | 205 url_loader_client_->OnReceiveCachedMetadata( |
| 206 std::vector<uint8_t>(data, data + metadata->size())); | 206 std::vector<uint8_t>(data, data + metadata->size())); |
| 207 } | 207 } |
| 208 | 208 |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 base::Bind(&MojoAsyncResourceHandler::OnUploadProgressACK, | 594 base::Bind(&MojoAsyncResourceHandler::OnUploadProgressACK, |
| 595 weak_factory_.GetWeakPtr())); | 595 weak_factory_.GetWeakPtr())); |
| 596 } | 596 } |
| 597 | 597 |
| 598 void MojoAsyncResourceHandler::OnUploadProgressACK() { | 598 void MojoAsyncResourceHandler::OnUploadProgressACK() { |
| 599 if (upload_progress_tracker_) | 599 if (upload_progress_tracker_) |
| 600 upload_progress_tracker_->OnAckReceived(); | 600 upload_progress_tracker_->OnAckReceived(); |
| 601 } | 601 } |
| 602 | 602 |
| 603 } // namespace content | 603 } // namespace content |
| OLD | NEW |