OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/common/resource_dispatcher.h" | 7 #include "chrome/common/resource_dispatcher.h" |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 "finished request"; | 308 "finished request"; |
309 return; | 309 return; |
310 } | 310 } |
311 | 311 |
312 PendingRequestInfo& request_info = it->second; | 312 PendingRequestInfo& request_info = it->second; |
313 | 313 |
314 RESOURCE_LOG("Dispatching upload progress for " << | 314 RESOURCE_LOG("Dispatching upload progress for " << |
315 request_info.peer->GetURLForDebugging().possibly_invalid_spec()); | 315 request_info.peer->GetURLForDebugging().possibly_invalid_spec()); |
316 request_info.peer->OnUploadProgress(position, size); | 316 request_info.peer->OnUploadProgress(position, size); |
317 | 317 |
318 // Acknowlegde reciept | 318 // Acknowledge receipt |
319 message_sender()->Send( | 319 message_sender()->Send( |
320 new ViewHostMsg_UploadProgress_ACK(message.routing_id(), request_id)); | 320 new ViewHostMsg_UploadProgress_ACK(message.routing_id(), request_id)); |
321 } | 321 } |
322 | 322 |
323 void ResourceDispatcher::OnReceivedResponse( | 323 void ResourceDispatcher::OnReceivedResponse( |
324 int request_id, const ResourceResponseHead& response_head) { | 324 int request_id, const ResourceResponseHead& response_head) { |
325 PendingRequestList::iterator it = pending_requests_.find(request_id); | 325 PendingRequestList::iterator it = pending_requests_.find(request_id); |
326 if (it == pending_requests_.end()) { | 326 if (it == pending_requests_.end()) { |
327 // This might happen for kill()ed requests on the webkit end, so perhaps it | 327 // This might happen for kill()ed requests on the webkit end, so perhaps it |
328 // shouldn't be a warning... | 328 // shouldn't be a warning... |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 // handle or there will be a memory leak. | 606 // handle or there will be a memory leak. |
607 if (message.type() == ViewMsg_Resource_DataReceived::ID) { | 607 if (message.type() == ViewMsg_Resource_DataReceived::ID) { |
608 base::SharedMemoryHandle shm_handle; | 608 base::SharedMemoryHandle shm_handle; |
609 if (IPC::ParamTraits<base::SharedMemoryHandle>::Read(&message, | 609 if (IPC::ParamTraits<base::SharedMemoryHandle>::Read(&message, |
610 &iter, | 610 &iter, |
611 &shm_handle)) { | 611 &shm_handle)) { |
612 base::SharedMemory::CloseHandle(shm_handle); | 612 base::SharedMemory::CloseHandle(shm_handle); |
613 } | 613 } |
614 } | 614 } |
615 } | 615 } |
OLD | NEW |