| 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 bool has_new_first_party_for_cookies = false; |
| 424 GURL new_first_party_for_cookies; | 425 GURL new_first_party_for_cookies; |
| 425 if (request_info.peer->OnReceivedRedirect(new_url, info, | 426 if (request_info.peer->OnReceivedRedirect(new_url, info, |
| 427 &has_new_first_party_for_cookies, |
| 426 &new_first_party_for_cookies)) { | 428 &new_first_party_for_cookies)) { |
| 427 message_sender()->Send( | 429 message_sender()->Send( |
| 428 new ViewHostMsg_FollowRedirect(message.routing_id(), request_id, | 430 new ViewHostMsg_FollowRedirect(message.routing_id(), request_id, |
| 431 has_new_first_party_for_cookies, |
| 429 new_first_party_for_cookies)); | 432 new_first_party_for_cookies)); |
| 430 } else { | 433 } else { |
| 431 CancelPendingRequest(message.routing_id(), request_id); | 434 CancelPendingRequest(message.routing_id(), request_id); |
| 432 } | 435 } |
| 433 } | 436 } |
| 434 | 437 |
| 435 void ResourceDispatcher::OnRequestComplete(int request_id, | 438 void ResourceDispatcher::OnRequestComplete(int request_id, |
| 436 const URLRequestStatus& status, | 439 const URLRequestStatus& status, |
| 437 const std::string& security_info) { | 440 const std::string& security_info) { |
| 438 PendingRequestList::iterator it = pending_requests_.find(request_id); | 441 PendingRequestList::iterator it = pending_requests_.find(request_id); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 // handle or there will be a memory leak. | 635 // handle or there will be a memory leak. |
| 633 if (message.type() == ViewMsg_Resource_DataReceived::ID) { | 636 if (message.type() == ViewMsg_Resource_DataReceived::ID) { |
| 634 base::SharedMemoryHandle shm_handle; | 637 base::SharedMemoryHandle shm_handle; |
| 635 if (IPC::ParamTraits<base::SharedMemoryHandle>::Read(&message, | 638 if (IPC::ParamTraits<base::SharedMemoryHandle>::Read(&message, |
| 636 &iter, | 639 &iter, |
| 637 &shm_handle)) { | 640 &shm_handle)) { |
| 638 base::SharedMemory::CloseHandle(shm_handle); | 641 base::SharedMemory::CloseHandle(shm_handle); |
| 639 } | 642 } |
| 640 } | 643 } |
| 641 } | 644 } |
| OLD | NEW |