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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 2542843009: Avoid gurl -> origin -> gurl conversion in AddCookieHeaderAndStart (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5f2fd91d6cc266ec923c49e6dad4e3191c255d51..28f8a1ee1a5d16e9c3170cb97b13e036046bbdcf 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -689,14 +689,12 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() {
// which target a top-level browsing context.
//
// * Otherwise, do not include same-site cookies.
- url::Origin requested_origin(request_->url());
- url::Origin site_for_cookies(request_->first_party_for_cookies());
-
if (registry_controlled_domains::SameDomainOrHost(
- requested_origin, site_for_cookies,
+ request_->url(), request_->first_party_for_cookies(),
registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)) {
- if (registry_controlled_domains::SameDomainOrHost(
- requested_origin, request_->initiator(),
+ if (request_->initiator() &&
+ registry_controlled_domains::SameDomainOrHost(
+ request_->url(), request_->initiator().value().GetURL(),
registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)) {
options.set_same_site_cookie_mode(
CookieOptions::SameSiteCookieMode::INCLUDE_STRICT_AND_LAX);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698