| 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://wiki.corp.google.com/twiki/bin/view/Main/ChromeMultiProcessResourc
eLoading | 5 // See http://wiki.corp.google.com/twiki/bin/view/Main/ChromeMultiProcessResourc
eLoading |
| 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/shared_memory.h" | 10 #include "base/shared_memory.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 request_info.peer = new_peer; | 327 request_info.peer = new_peer; |
| 328 peer = new_peer; | 328 peer = new_peer; |
| 329 } | 329 } |
| 330 } | 330 } |
| 331 | 331 |
| 332 RESOURCE_LOG("Dispatching response for " << peer->GetURLForDebugging()); | 332 RESOURCE_LOG("Dispatching response for " << peer->GetURLForDebugging()); |
| 333 peer->OnReceivedResponse(response_head, false); | 333 peer->OnReceivedResponse(response_head, false); |
| 334 } | 334 } |
| 335 | 335 |
| 336 void ResourceDispatcher::OnReceivedData(int request_id, | 336 void ResourceDispatcher::OnReceivedData(int request_id, |
| 337 SharedMemoryHandle shm_handle, | 337 base::SharedMemoryHandle shm_handle, |
| 338 int data_len) { | 338 int data_len) { |
| 339 // Acknowlegde the reception of this data. | 339 // Acknowlegde the reception of this data. |
| 340 IPC::Message::Sender* sender = message_sender(); | 340 IPC::Message::Sender* sender = message_sender(); |
| 341 if (sender) | 341 if (sender) |
| 342 sender->Send( | 342 sender->Send( |
| 343 new ViewHostMsg_DataReceived_ACK(MSG_ROUTING_NONE, request_id)); | 343 new ViewHostMsg_DataReceived_ACK(MSG_ROUTING_NONE, request_id)); |
| 344 | 344 |
| 345 DCHECK((shm_handle && data_len > 0) || (!shm_handle && !data_len)); | 345 DCHECK((shm_handle && data_len > 0) || (!shm_handle && !data_len)); |
| 346 SharedMemory shared_mem(shm_handle, true); // read only | 346 base::SharedMemory shared_mem(shm_handle, true); // read only |
| 347 | 347 |
| 348 PendingRequestList::iterator it = pending_requests_.find(request_id); | 348 PendingRequestList::iterator it = pending_requests_.find(request_id); |
| 349 if (it == pending_requests_.end()) { | 349 if (it == pending_requests_.end()) { |
| 350 // this might happen for kill()ed requests on the webkit end, so perhaps | 350 // this might happen for kill()ed requests on the webkit end, so perhaps |
| 351 // it shouldn't be a warning... | 351 // it shouldn't be a warning... |
| 352 DLOG(WARNING) << "Got data for a nonexistant or finished request"; | 352 DLOG(WARNING) << "Got data for a nonexistant or finished request"; |
| 353 return; | 353 return; |
| 354 } | 354 } |
| 355 | 355 |
| 356 PendingRequestInfo& request_info = it->second; | 356 PendingRequestInfo& request_info = it->second; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 case ViewMsg_Resource_RequestComplete::ID: | 511 case ViewMsg_Resource_RequestComplete::ID: |
| 512 return true; | 512 return true; |
| 513 | 513 |
| 514 default: | 514 default: |
| 515 break; | 515 break; |
| 516 } | 516 } |
| 517 | 517 |
| 518 return false; | 518 return false; |
| 519 } | 519 } |
| 520 | 520 |
| OLD | NEW |