| 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 // it shouldn't be a warning... | 414 // it shouldn't be a warning... |
| 415 DLOG(WARNING) << "Got data for a nonexistant or finished request"; | 415 DLOG(WARNING) << "Got data for a nonexistant or finished request"; |
| 416 return; | 416 return; |
| 417 } | 417 } |
| 418 | 418 |
| 419 PendingRequestInfo& request_info = it->second; | 419 PendingRequestInfo& request_info = it->second; |
| 420 | 420 |
| 421 RESOURCE_LOG("Dispatching redirect for " << | 421 RESOURCE_LOG("Dispatching redirect for " << |
| 422 request_info.peer->GetURLForDebugging().possibly_invalid_spec()); | 422 request_info.peer->GetURLForDebugging().possibly_invalid_spec()); |
| 423 | 423 |
| 424 if (request_info.peer->OnReceivedRedirect(new_url, info)) { | 424 GURL new_first_party_for_cookies; |
| 425 if (request_info.peer->OnReceivedRedirect(new_url, info, |
| 426 &new_first_party_for_cookies)) { |
| 425 message_sender()->Send( | 427 message_sender()->Send( |
| 426 new ViewHostMsg_FollowRedirect(message.routing_id(), request_id)); | 428 new ViewHostMsg_FollowRedirect(message.routing_id(), request_id, |
| 429 new_first_party_for_cookies)); |
| 427 } else { | 430 } else { |
| 428 CancelPendingRequest(message.routing_id(), request_id); | 431 CancelPendingRequest(message.routing_id(), request_id); |
| 429 } | 432 } |
| 430 } | 433 } |
| 431 | 434 |
| 432 void ResourceDispatcher::OnRequestComplete(int request_id, | 435 void ResourceDispatcher::OnRequestComplete(int request_id, |
| 433 const URLRequestStatus& status, | 436 const URLRequestStatus& status, |
| 434 const std::string& security_info) { | 437 const std::string& security_info) { |
| 435 PendingRequestList::iterator it = pending_requests_.find(request_id); | 438 PendingRequestList::iterator it = pending_requests_.find(request_id); |
| 436 if (it == pending_requests_.end()) { | 439 if (it == pending_requests_.end()) { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 // handle or there will be a memory leak. | 632 // handle or there will be a memory leak. |
| 630 if (message.type() == ViewMsg_Resource_DataReceived::ID) { | 633 if (message.type() == ViewMsg_Resource_DataReceived::ID) { |
| 631 base::SharedMemoryHandle shm_handle; | 634 base::SharedMemoryHandle shm_handle; |
| 632 if (IPC::ParamTraits<base::SharedMemoryHandle>::Read(&message, | 635 if (IPC::ParamTraits<base::SharedMemoryHandle>::Read(&message, |
| 633 &iter, | 636 &iter, |
| 634 &shm_handle)) { | 637 &shm_handle)) { |
| 635 base::SharedMemory::CloseHandle(shm_handle); | 638 base::SharedMemory::CloseHandle(shm_handle); |
| 636 } | 639 } |
| 637 } | 640 } |
| 638 } | 641 } |
| OLD | NEW |