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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 2099243002: PlzNavigate: properly set the initiator of the navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years 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: net/url_request/url_request_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index e35938088eaf77926a08624e14578e8666249ec8..806ef869fee419d475978c05b0b63e789d0f32e1 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -687,7 +687,9 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() {
//
// * Include both "strict" and "lax" same-site cookies if the request's
// |url|, |initiator|, and |first_party_for_cookies| all have the same
- // registrable domain.
+ // registrable domain. Note: this also covers the case of a request
+ // without an initiatore (only happens for browser-initiated main frame
nasko 2016/12/16 20:32:42 nit: initiator, no e needed at the end.
clamy 2016/12/21 14:54:19 Done.
+ // navigations).
//
// * Include only "lax" same-site cookies if the request's |URL| and
// |first_party_for_cookies| have the same registrable domain, _and_ the
@@ -700,7 +702,7 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() {
if (registry_controlled_domains::SameDomainOrHost(
request_->url(), request_->first_party_for_cookies(),
registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)) {
- if (request_->initiator() &&
+ if (!request_->initiator() ||
registry_controlled_domains::SameDomainOrHost(
request_->url(), request_->initiator().value().GetURL(),
registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)) {

Powered by Google App Engine
This is Rietveld 408576698