LeOSium_old/patches/0001-Vanadium/0110-Block-partitioned-thir...

37 lines
1.6 KiB
Diff
Raw Normal View History

2023-11-18 11:23:04 +01:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: fgei <fgei@gmail.com>
Date: Sat, 15 Apr 2023 04:04:47 +0000
Subject: [PATCH] Block partitioned third party cookies as well when blocking
third party cookies
---
services/network/cookie_settings.cc | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/services/network/cookie_settings.cc b/services/network/cookie_settings.cc
index d5299ee0a680d..3145460067cf1 100644
--- a/services/network/cookie_settings.cc
+++ b/services/network/cookie_settings.cc
@@ -35,6 +35,11 @@ bool IsExplicitSetting(const ContentSettingPatternSource& setting) {
!setting.secondary_pattern.MatchesAllHosts();
}
+bool IsThirdPartyAllowed(const ContentSettingPatternSource& setting) {
+ return setting.primary_pattern.MatchesAllHosts() &&
+ !setting.secondary_pattern.MatchesAllHosts();
+}
+
const ContentSettingPatternSource* FindMatchingSetting(
const GURL& primary_url,
const GURL& secondary_url,
@@ -197,7 +202,8 @@ CookieSettings::GetThirdPartyBlockingScope(const GURL& first_party_url) const {
// partitioned cross-site cookies.
if (const ContentSettingPatternSource* match = FindMatchingSetting(
first_party_url, first_party_url, content_settings_);
- !match || match->GetContentSetting() == CONTENT_SETTING_ALLOW) {
+ match && IsThirdPartyAllowed(*match) &&
+ match->GetContentSetting() == CONTENT_SETTING_ALLOW) {
return ThirdPartyBlockingScope::kUnpartitionedOnly;
}
return ThirdPartyBlockingScope::kUnpartitionedAndPartitioned;