diff options
Diffstat (limited to 'chrome/browser')
3 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index 7c192ec..3432eb1 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -658,8 +658,10 @@ void ResourceDispatcherHost::OnCancelRequest(int request_id) { void ResourceDispatcherHost::OnFollowRedirect( int request_id, + bool has_new_first_party_for_cookies, const GURL& new_first_party_for_cookies) { FollowDeferredRedirect(receiver_->id(), request_id, + has_new_first_party_for_cookies, new_first_party_for_cookies); } @@ -834,6 +836,7 @@ void ResourceDispatcherHost::CancelRequest(int child_id, void ResourceDispatcherHost::FollowDeferredRedirect( int child_id, int request_id, + bool has_new_first_party_for_cookies, const GURL& new_first_party_for_cookies) { PendingRequestList::iterator i = pending_requests_.find( GlobalRequestID(child_id, request_id)); @@ -842,7 +845,7 @@ void ResourceDispatcherHost::FollowDeferredRedirect( return; } - if (!new_first_party_for_cookies.is_empty()) + if (has_new_first_party_for_cookies) i->second->set_first_party_for_cookies(new_first_party_for_cookies); i->second->FollowDeferredRedirect(); } diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.h b/chrome/browser/renderer_host/resource_dispatcher_host.h index 9796e80..ee62a82 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.h +++ b/chrome/browser/renderer_host/resource_dispatcher_host.h @@ -143,11 +143,14 @@ class ResourceDispatcherHost : public URLRequest::Delegate { // Follows a deferred redirect for the given request. // new_first_party_for_cookies, if non-empty, is the new cookie policy URL - // for the redirected URL. Pass an empty, invalid URL as - // new_first_party_for_cookies to indicate that the cookie policy URL - // doesn't need changing. + // for the redirected URL. If the cookie policy URL needs changing, pass + // true as has_new_first_party_for_cookies and the new cookie policy URL as + // new_first_party_for_cookies. Otherwise, pass false as + // has_new_first_party_for_cookies, and new_first_party_for_cookies will not + // be used. void FollowDeferredRedirect(int process_unique_id, int request_id, + bool has_new_first_party_for_cookies, const GURL& new_first_party_for_cookies); // Returns true if it's ok to send the data. If there are already too many @@ -406,6 +409,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate { void OnUploadProgressACK(int request_id); void OnCancelRequest(int request_id); void OnFollowRedirect(int request_id, + bool has_new_first_party_for_cookies, const GURL& new_first_party_for_cookies); // Returns true if the message passed in is a resource related message. diff --git a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc index ad3105d..64119a7 100644 --- a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc +++ b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc @@ -242,8 +242,9 @@ void SafeBrowsingResourceHandler::ResumeRedirect() { next_handler_->OnRequestRedirected(redirect_id_, redirect_url_, redirect_response_, &defer); if (!defer) { + // TODO(wtc): should we pass a new first party for cookies URL? rdh_->FollowDeferredRedirect(render_process_host_id_, redirect_id_, - GURL()); + false, GURL()); } redirect_response_ = NULL; |
