Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Side by Side Diff: chrome/browser/renderer_host/resource_dispatcher_host.cc

Issue 405011: Use an explicit boolean has_new_first_party_for_cookies instead... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Upload before checkin Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/browser/renderer_host/resource_dispatcher_host.h" 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 ResourceDispatcherHostRequestInfo* info = InfoForRequest(i->second); 651 ResourceDispatcherHostRequestInfo* info = InfoForRequest(i->second);
652 info->set_waiting_for_upload_progress_ack(false); 652 info->set_waiting_for_upload_progress_ack(false);
653 } 653 }
654 654
655 void ResourceDispatcherHost::OnCancelRequest(int request_id) { 655 void ResourceDispatcherHost::OnCancelRequest(int request_id) {
656 CancelRequest(receiver_->id(), request_id, true, true); 656 CancelRequest(receiver_->id(), request_id, true, true);
657 } 657 }
658 658
659 void ResourceDispatcherHost::OnFollowRedirect( 659 void ResourceDispatcherHost::OnFollowRedirect(
660 int request_id, 660 int request_id,
661 bool has_new_first_party_for_cookies,
661 const GURL& new_first_party_for_cookies) { 662 const GURL& new_first_party_for_cookies) {
662 FollowDeferredRedirect(receiver_->id(), request_id, 663 FollowDeferredRedirect(receiver_->id(), request_id,
664 has_new_first_party_for_cookies,
663 new_first_party_for_cookies); 665 new_first_party_for_cookies);
664 } 666 }
665 667
666 void ResourceDispatcherHost::OnClosePageACK( 668 void ResourceDispatcherHost::OnClosePageACK(
667 const ViewMsg_ClosePage_Params& params) { 669 const ViewMsg_ClosePage_Params& params) {
668 if (params.for_cross_site_transition) { 670 if (params.for_cross_site_transition) {
669 // Closes for cross-site transitions are handled such that the cross-site 671 // Closes for cross-site transitions are handled such that the cross-site
670 // transition continues. 672 // transition continues.
671 GlobalRequestID global_id(params.new_render_process_host_id, 673 GlobalRequestID global_id(params.new_render_process_host_id,
672 params.new_request_id); 674 params.new_request_id);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 829
828 void ResourceDispatcherHost::CancelRequest(int child_id, 830 void ResourceDispatcherHost::CancelRequest(int child_id,
829 int request_id, 831 int request_id,
830 bool from_renderer) { 832 bool from_renderer) {
831 CancelRequest(child_id, request_id, from_renderer, true); 833 CancelRequest(child_id, request_id, from_renderer, true);
832 } 834 }
833 835
834 void ResourceDispatcherHost::FollowDeferredRedirect( 836 void ResourceDispatcherHost::FollowDeferredRedirect(
835 int child_id, 837 int child_id,
836 int request_id, 838 int request_id,
839 bool has_new_first_party_for_cookies,
837 const GURL& new_first_party_for_cookies) { 840 const GURL& new_first_party_for_cookies) {
838 PendingRequestList::iterator i = pending_requests_.find( 841 PendingRequestList::iterator i = pending_requests_.find(
839 GlobalRequestID(child_id, request_id)); 842 GlobalRequestID(child_id, request_id));
840 if (i == pending_requests_.end()) { 843 if (i == pending_requests_.end()) {
841 DLOG(WARNING) << "FollowDeferredRedirect for invalid request"; 844 DLOG(WARNING) << "FollowDeferredRedirect for invalid request";
842 return; 845 return;
843 } 846 }
844 847
845 if (!new_first_party_for_cookies.is_empty()) 848 if (has_new_first_party_for_cookies)
846 i->second->set_first_party_for_cookies(new_first_party_for_cookies); 849 i->second->set_first_party_for_cookies(new_first_party_for_cookies);
847 i->second->FollowDeferredRedirect(); 850 i->second->FollowDeferredRedirect();
848 } 851 }
849 852
850 bool ResourceDispatcherHost::WillSendData(int child_id, 853 bool ResourceDispatcherHost::WillSendData(int child_id,
851 int request_id) { 854 int request_id) {
852 PendingRequestList::iterator i = pending_requests_.find( 855 PendingRequestList::iterator i = pending_requests_.find(
853 GlobalRequestID(child_id, request_id)); 856 GlobalRequestID(child_id, request_id));
854 if (i == pending_requests_.end()) { 857 if (i == pending_requests_.end()) {
855 NOTREACHED() << "WillSendData for invalid request"; 858 NOTREACHED() << "WillSendData for invalid request";
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
1815 case ViewHostMsg_UploadProgress_ACK::ID: 1818 case ViewHostMsg_UploadProgress_ACK::ID:
1816 case ViewHostMsg_SyncLoad::ID: 1819 case ViewHostMsg_SyncLoad::ID:
1817 return true; 1820 return true;
1818 1821
1819 default: 1822 default:
1820 break; 1823 break;
1821 } 1824 }
1822 1825
1823 return false; 1826 return false;
1824 } 1827 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698