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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
6 | 6 |
7 #include "content/child/resource_dispatcher.h" | 7 #include "content/child/resource_dispatcher.h" |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 void ResourceDispatcher::OnUploadProgress(int request_id, | 151 void ResourceDispatcher::OnUploadProgress(int request_id, |
152 int64_t position, | 152 int64_t position, |
153 int64_t size) { | 153 int64_t size) { |
154 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); | 154 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); |
155 if (!request_info) | 155 if (!request_info) |
156 return; | 156 return; |
157 | 157 |
158 request_info->peer->OnUploadProgress(position, size); | 158 request_info->peer->OnUploadProgress(position, size); |
159 | 159 |
160 // Acknowledge receipt | 160 // URLLoaderClientImpl has its own acknowledgement, and doesn't need the IPC |
161 message_sender_->Send(new ResourceHostMsg_UploadProgress_ACK(request_id)); | 161 // message here. |
| 162 if (!request_info->url_loader) { |
| 163 // Acknowledge receipt |
| 164 message_sender_->Send(new ResourceHostMsg_UploadProgress_ACK(request_id)); |
| 165 } |
162 } | 166 } |
163 | 167 |
164 void ResourceDispatcher::OnReceivedResponse( | 168 void ResourceDispatcher::OnReceivedResponse( |
165 int request_id, const ResourceResponseHead& response_head) { | 169 int request_id, const ResourceResponseHead& response_head) { |
166 TRACE_EVENT0("loader", "ResourceDispatcher::OnReceivedResponse"); | 170 TRACE_EVENT0("loader", "ResourceDispatcher::OnReceivedResponse"); |
167 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); | 171 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); |
168 if (!request_info) | 172 if (!request_info) |
169 return; | 173 return; |
170 request_info->response_start = ConsumeIOTimestamp(); | 174 request_info->response_start = ConsumeIOTimestamp(); |
171 | 175 |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 delete message; | 817 delete message; |
814 } | 818 } |
815 } | 819 } |
816 | 820 |
817 void ResourceDispatcher::SetResourceSchedulingFilter( | 821 void ResourceDispatcher::SetResourceSchedulingFilter( |
818 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { | 822 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { |
819 resource_scheduling_filter_ = resource_scheduling_filter; | 823 resource_scheduling_filter_ = resource_scheduling_filter; |
820 } | 824 } |
821 | 825 |
822 } // namespace content | 826 } // namespace content |
OLD | NEW |