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

Unified Diff: content/browser/loader/cross_site_resource_handler.cc

Issue 264613006: Move first-party cookie URL logic to browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/loader/cross_site_resource_handler.cc
diff --git a/content/browser/loader/cross_site_resource_handler.cc b/content/browser/loader/cross_site_resource_handler.cc
index a7e8f122f7ac26c6a338cf6f251dcb1f610a98bf..3e88d3395f36e831dcdafe54d1a85af0edaa9c7f 100644
--- a/content/browser/loader/cross_site_resource_handler.cc
+++ b/content/browser/loader/cross_site_resource_handler.cc
@@ -121,6 +121,11 @@ bool CrossSiteResourceHandler::OnRequestRedirected(
const GURL& new_url,
ResourceResponse* response,
bool* defer) {
+ // Top-level requests change their cookie first-party URL on redirects, while
+ // subframes retain the parent's value.
+ if (GetRequestInfo()->GetResourceType() == ResourceType::MAIN_FRAME)
+ request()->set_first_party_for_cookies(new_url);
+
// We should not have started the transition before being redirected.
DCHECK(!in_cross_site_transition_);
return next_handler_->OnRequestRedirected(
« no previous file with comments | « content/browser/loader/async_resource_handler.cc ('k') | content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698