| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 if (has_completion_message) { | 102 if (has_completion_message) { |
| 103 DCHECK_GT(messages.size(), 0u); | 103 DCHECK_GT(messages.size(), 0u); |
| 104 DCHECK_EQ(messages.back().type(), | 104 DCHECK_EQ(messages.back().type(), |
| 105 static_cast<uint32_t>(ResourceMsg_RequestComplete::ID)); | 105 static_cast<uint32_t>(ResourceMsg_RequestComplete::ID)); |
| 106 Dispatch(messages.back()); | 106 Dispatch(messages.back()); |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| 110 void URLLoaderClientImpl::OnReceiveResponse( | 110 void URLLoaderClientImpl::OnReceiveResponse( |
| 111 const ResourceResponseHead& response_head, | 111 const ResourceResponseHead& response_head, |
| 112 const base::Optional<net::SSLInfo>& ssl_info, |
| 112 mojom::DownloadedTempFilePtr downloaded_file) { | 113 mojom::DownloadedTempFilePtr downloaded_file) { |
| 113 has_received_response_ = true; | 114 has_received_response_ = true; |
| 114 downloaded_file_ = std::move(downloaded_file); | 115 downloaded_file_ = std::move(downloaded_file); |
| 115 Dispatch(ResourceMsg_ReceivedResponse(request_id_, response_head)); | 116 Dispatch(ResourceMsg_ReceivedResponse(request_id_, response_head)); |
| 116 } | 117 } |
| 117 | 118 |
| 118 void URLLoaderClientImpl::OnReceiveRedirect( | 119 void URLLoaderClientImpl::OnReceiveRedirect( |
| 119 const net::RedirectInfo& redirect_info, | 120 const net::RedirectInfo& redirect_info, |
| 120 const ResourceResponseHead& response_head) { | 121 const ResourceResponseHead& response_head) { |
| 121 DCHECK(!has_received_response_); | 122 DCHECK(!has_received_response_); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 178 |
| 178 void URLLoaderClientImpl::OnUploadProgress(int64_t current_position, | 179 void URLLoaderClientImpl::OnUploadProgress(int64_t current_position, |
| 179 int64_t total_size, | 180 int64_t total_size, |
| 180 const base::Closure& ack_callback) { | 181 const base::Closure& ack_callback) { |
| 181 Dispatch( | 182 Dispatch( |
| 182 ResourceMsg_UploadProgress(request_id_, current_position, total_size)); | 183 ResourceMsg_UploadProgress(request_id_, current_position, total_size)); |
| 183 ack_callback.Run(); | 184 ack_callback.Run(); |
| 184 } | 185 } |
| 185 | 186 |
| 186 } // namespace content | 187 } // namespace content |
| OLD | NEW |