summaryrefslogtreecommitdiff
path: root/chromium/content/browser/cookie_store/cookie_change_subscription.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/browser/cookie_store/cookie_change_subscription.cc')
-rw-r--r--chromium/content/browser/cookie_store/cookie_change_subscription.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/chromium/content/browser/cookie_store/cookie_change_subscription.cc b/chromium/content/browser/cookie_store/cookie_change_subscription.cc
index 6dff0ba3213..07b9b55f5fd 100644
--- a/chromium/content/browser/cookie_store/cookie_change_subscription.cc
+++ b/chromium/content/browser/cookie_store/cookie_change_subscription.cc
@@ -7,6 +7,9 @@
#include <utility>
#include "content/browser/cookie_store/cookie_change_subscriptions.pb.h"
+#include "net/cookies/cookie_constants.h"
+#include "net/cookies/cookie_util.h"
+#include "services/network/public/cpp/is_potentially_trustworthy.h"
namespace content {
@@ -164,11 +167,24 @@ bool CookieChangeSubscription::ShouldObserveChangeTo(
break;
}
+ // We assume that this is a same-site, same-party context.
net::CookieOptions net_options;
net_options.set_same_site_cookie_context(
net::CookieOptions::SameSiteCookieContext::MakeInclusive());
-
- return cookie.IncludeForRequestURL(url_, net_options, access_semantics)
+ net_options.set_same_party_cookie_context_type(
+ net::CookieOptions::SamePartyCookieContextType::kSameParty);
+ // It doesn't matter which we choose here, since both SameParty and SameSite
+ // semantics should allow this access. But we make a choice to be explicit.
+ net_options.set_is_in_nontrivial_first_party_set(true);
+
+ return cookie
+ .IncludeForRequestURL(
+ url_, net_options,
+ net::CookieAccessParams{
+ access_semantics,
+ network::IsUrlPotentiallyTrustworthy(url_),
+ net::cookie_util::GetSamePartyStatus(cookie, net_options),
+ })
.status.IsInclude();
}