removes the preset limit for partitioned cookies (10240 bytes max). since they are all and always partitioned, the limits applied must be the general ones.
472 lines
22 KiB
Diff
472 lines
22 KiB
Diff
From: uazo <uazo@users.noreply.github.com>
|
|
Date: Mon, 9 Jan 2023 12:02:05 +0000
|
|
Subject: Partitioning all cookies by top frame domain
|
|
|
|
Enables cookie partitioning by top frame etld, respecting the
|
|
user's possible wish to disable all third-party cookies.
|
|
Disabling the flag via the ui restores the normal mode, where
|
|
samesite=none first-party cookies are sent in third-party contexts.
|
|
|
|
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
|
---
|
|
.../browser/chrome_content_browser_client.cc | 2 +-
|
|
.../net/profile_network_context_service.cc | 12 ++--
|
|
.../privacy_sandbox_settings_delegate.cc | 1 +
|
|
...storage_access_grant_permission_context.cc | 12 ++++
|
|
.../experiment/experiment_manager_impl.cc | 1 +
|
|
.../core/browser/cookie_settings.cc | 2 +
|
|
.../core/common/cookie_settings_base.cc | 59 -------------------
|
|
...ioning-all-cookies-by-top-frame-domain.inc | 3 +
|
|
...ioning-all-cookies-by-top-frame-domain.inc | 1 +
|
|
...ioning-all-cookies-by-top-frame-domain.inc | 1 +
|
|
...ioning-all-cookies-by-top-frame-domain.inc | 9 +++
|
|
net/cookies/canonical_cookie.cc | 13 +---
|
|
net/cookies/cookie_deletion_info.cc | 3 +-
|
|
net/cookies/cookie_monster.cc | 1 +
|
|
net/cookies/parsed_cookie.h | 6 +-
|
|
.../sqlite/sqlite_persistent_cookie_store.cc | 8 +++
|
|
net/url_request/url_request_http_job.cc | 10 +---
|
|
services/network/cookie_settings.cc | 5 +-
|
|
services/network/restricted_cookie_manager.cc | 6 ++
|
|
.../modules/cookie_store/cookie_init.idl | 2 +-
|
|
.../modules/cookie_store/cookie_store.cc | 3 +
|
|
.../cookie_store_delete_options.idl | 2 +-
|
|
ui/webui/webui_allowlist.cc | 1 +
|
|
23 files changed, 71 insertions(+), 92 deletions(-)
|
|
create mode 100644 cromite_flags/components/content_settings/core/common/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc
|
|
create mode 100644 cromite_flags/components/permissions/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc
|
|
create mode 100644 cromite_flags/content/public/common/content_features_cc/Partitioning-all-cookies-by-top-frame-domain.inc
|
|
create mode 100644 cromite_flags/net/base/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc
|
|
|
|
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
|
|
--- a/chrome/browser/chrome_content_browser_client.cc
|
|
+++ b/chrome/browser/chrome_content_browser_client.cc
|
|
@@ -3474,7 +3474,7 @@ bool ChromeContentBrowserClient::IsFullCookieAccessAllowed(
|
|
scoped_refptr<content_settings::CookieSettings> cookie_settings =
|
|
CookieSettingsFactory::GetForProfile(profile);
|
|
if (!cookie_settings) {
|
|
- return true;
|
|
+ return false;
|
|
}
|
|
return cookie_settings->IsFullCookieAccessAllowed(
|
|
url, storage_key.ToNetSiteForCookies(),
|
|
diff --git a/chrome/browser/net/profile_network_context_service.cc b/chrome/browser/net/profile_network_context_service.cc
|
|
--- a/chrome/browser/net/profile_network_context_service.cc
|
|
+++ b/chrome/browser/net/profile_network_context_service.cc
|
|
@@ -806,16 +806,16 @@ ProfileNetworkContextService::CreateCookieManagerParams(
|
|
// UI to interact with SameSite cookies on accounts.google.com, which is used
|
|
// for displaying a list of available accounts on the NTP
|
|
// (chrome://new-tab-page), etc.
|
|
- out->secure_origin_cookies_allowed_schemes.push_back(
|
|
- content::kChromeUIScheme);
|
|
+ // out->secure_origin_cookies_allowed_schemes.push_back(
|
|
+ // content::kChromeUIScheme);
|
|
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
|
// TODO(chlily): To be consistent with the content_settings version of
|
|
// CookieSettings, we should probably also add kExtensionScheme to the list of
|
|
// matching_scheme_cookies_allowed_schemes.
|
|
- out->third_party_cookies_allowed_schemes.push_back(
|
|
- extensions::kExtensionScheme);
|
|
- out->third_party_cookies_allowed_schemes.push_back(
|
|
- content::kChromeDevToolsScheme);
|
|
+ // out->third_party_cookies_allowed_schemes.push_back(
|
|
+ // extensions::kExtensionScheme);
|
|
+ // out->third_party_cookies_allowed_schemes.push_back(
|
|
+ // content::kChromeDevToolsScheme);
|
|
#endif
|
|
|
|
HostContentSettingsMap* host_content_settings_map =
|
|
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_settings_delegate.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_settings_delegate.cc
|
|
--- a/chrome/browser/privacy_sandbox/privacy_sandbox_settings_delegate.cc
|
|
+++ b/chrome/browser/privacy_sandbox/privacy_sandbox_settings_delegate.cc
|
|
@@ -359,6 +359,7 @@ bool PrivacySandboxSettingsDelegate::IsCookieDeprecationLabelAllowed() const {
|
|
|
|
bool PrivacySandboxSettingsDelegate::
|
|
AreThirdPartyCookiesBlockedByCookieDeprecationExperiment() const {
|
|
+ if ((true)) return false;
|
|
if (net::cookie_util::IsForceThirdPartyCookieBlockingEnabled()) {
|
|
return false;
|
|
}
|
|
diff --git a/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc b/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc
|
|
--- a/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc
|
|
+++ b/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc
|
|
@@ -351,6 +351,18 @@ void StorageAccessGrantPermissionContext::CheckForAutoGrantOrAutoDenial(
|
|
permissions::PermissionRequestData request_data,
|
|
permissions::BrowserPermissionCallback callback,
|
|
net::FirstPartySetMetadata metadata) {
|
|
+ if ((true)) {
|
|
+ // don't use implicit grants or heuristic, ask to user
|
|
+ PermissionContextBase::DecidePermission(std::move(request_data),
|
|
+ std::move(callback));
|
|
+ // to deny:
|
|
+ // NotifyPermissionSetInternal(request_data.id, request_data.requesting_origin,
|
|
+ // request_data.embedding_origin,
|
|
+ // std::move(callback),
|
|
+ // /*persist=*/true, CONTENT_SETTING_BLOCK,
|
|
+ // RequestOutcome::kDeniedByFirstPartySet);
|
|
+ return;
|
|
+ }
|
|
if (metadata.AreSitesInSameFirstPartySet()) {
|
|
switch (metadata.top_frame_entry()->site_type()) {
|
|
case net::SiteType::kPrimary:
|
|
diff --git a/chrome/browser/tpcd/experiment/experiment_manager_impl.cc b/chrome/browser/tpcd/experiment/experiment_manager_impl.cc
|
|
--- a/chrome/browser/tpcd/experiment/experiment_manager_impl.cc
|
|
+++ b/chrome/browser/tpcd/experiment/experiment_manager_impl.cc
|
|
@@ -177,6 +177,7 @@ void ExperimentManagerImpl::MaybeUpdateSyntheticTrialRegistration() {
|
|
}
|
|
|
|
std::optional<bool> ExperimentManagerImpl::IsClientEligible() const {
|
|
+ if ((true)) return std::nullopt;
|
|
if (kForceEligibleForTesting.Get()) {
|
|
return true;
|
|
}
|
|
diff --git a/components/content_settings/core/browser/cookie_settings.cc b/components/content_settings/core/browser/cookie_settings.cc
|
|
--- a/components/content_settings/core/browser/cookie_settings.cc
|
|
+++ b/components/content_settings/core/browser/cookie_settings.cc
|
|
@@ -132,6 +132,7 @@ void CookieSettings::SetTemporaryCookieGrantForHeuristic(
|
|
const GURL& first_party_url,
|
|
base::TimeDelta ttl,
|
|
bool use_schemeless_patterns) {
|
|
+ if ((true)) return;
|
|
if (url.is_empty() || first_party_url.is_empty()) {
|
|
return;
|
|
}
|
|
@@ -397,6 +398,7 @@ bool CookieSettings::MitigationsEnabledFor3pcdInternal() {
|
|
return !tracking_protection_settings_->AreAllThirdPartyCookiesBlocked();
|
|
}
|
|
|
|
+ if ((true)) return false;
|
|
if (net::cookie_util::IsForceThirdPartyCookieBlockingEnabled()) {
|
|
return true;
|
|
}
|
|
diff --git a/components/content_settings/core/common/cookie_settings_base.cc b/components/content_settings/core/common/cookie_settings_base.cc
|
|
--- a/components/content_settings/core/common/cookie_settings_base.cc
|
|
+++ b/components/content_settings/core/common/cookie_settings_base.cc
|
|
@@ -39,16 +39,6 @@ using net::cookie_util::StorageAccessResult;
|
|
using ThirdPartyCookieAllowMechanism =
|
|
CookieSettingsBase::ThirdPartyCookieAllowMechanism;
|
|
|
|
-bool IsAllowedByCORS(const net::CookieSettingOverrides& overrides,
|
|
- const GURL& request_url,
|
|
- const GURL& first_party_url) {
|
|
- return overrides.Has(
|
|
- net::CookieSettingOverride::kCrossSiteCredentialedWithCORS) &&
|
|
- base::FeatureList::IsEnabled(
|
|
- net::features::kThirdPartyCookieTopLevelSiteCorsException) &&
|
|
- net::SchemefulSite(request_url) == net::SchemefulSite(first_party_url);
|
|
-}
|
|
-
|
|
constexpr StorageAccessResult GetStorageAccessResult(
|
|
ThirdPartyCookieAllowMechanism mechanism) {
|
|
switch (mechanism) {
|
|
@@ -534,63 +524,14 @@ CookieSettingsBase::DecideAccess(const GURL& url,
|
|
return BlockAllCookies{};
|
|
}
|
|
|
|
- if (!ShouldBlockThirdPartyCookies() &&
|
|
- !Are3pcsForceDisabledByOverride(overrides)) {
|
|
- return AllowAllCookies{
|
|
- ThirdPartyCookieAllowMechanism::kAllowByGlobalSetting};
|
|
- }
|
|
-
|
|
if (!is_third_party_request) {
|
|
return AllowAllCookies{ThirdPartyCookieAllowMechanism::kNone};
|
|
}
|
|
- if (IsThirdPartyCookiesAllowedScheme(first_party_url.scheme())) {
|
|
- return AllowAllCookies{ThirdPartyCookieAllowMechanism::kNone};
|
|
- }
|
|
-
|
|
- // Site controlled mechanisms (ex: web APIs, deprecation trial):
|
|
- if (IsAllowedByCORS(overrides, url, first_party_url)) {
|
|
- return AllowAllCookies{
|
|
- ThirdPartyCookieAllowMechanism::kAllowByCORSException};
|
|
- }
|
|
- if (IsAllowedByTopLevelStorageAccessGrant(url, first_party_url, overrides)) {
|
|
- return AllowAllCookies{
|
|
- ThirdPartyCookieAllowMechanism::kAllowByTopLevelStorageAccess};
|
|
- }
|
|
if (IsAllowedByStorageAccessGrant(url, first_party_url, overrides)) {
|
|
return AllowAllCookies{
|
|
ThirdPartyCookieAllowMechanism::kAllowByStorageAccess};
|
|
}
|
|
|
|
- if (IsAllowedBy3pcdHeuristicsGrantsSettings(url, first_party_url,
|
|
- overrides)) {
|
|
- return AllowAllCookies{
|
|
- ThirdPartyCookieAllowMechanism::kAllowBy3PCDHeuristics};
|
|
- }
|
|
-
|
|
- if (IsAllowedByTopLevel3pcdTrialSettings(first_party_url, overrides)) {
|
|
- return AllowAllCookies{
|
|
- ThirdPartyCookieAllowMechanism::kAllowByTopLevel3PCD};
|
|
- }
|
|
- if (IsAllowedBy3pcdTrialSettings(url, first_party_url, overrides)) {
|
|
- return AllowAllCookies{ThirdPartyCookieAllowMechanism::kAllowBy3PCD};
|
|
- }
|
|
-
|
|
- // Enterprise Policies:
|
|
- if (is_explicit_setting &&
|
|
- setting_source == SettingSource::SETTING_SOURCE_POLICY) {
|
|
- return AllowAllCookies{ThirdPartyCookieAllowMechanism::
|
|
- kAllowByEnterprisePolicyCookieAllowedForUrls};
|
|
- }
|
|
-
|
|
- // Chrome controlled mechanisms (ex. 3PCD Metadata Grants):
|
|
- SettingInfo tpcd_metadata_info;
|
|
- if (IsAllowedBy3pcdMetadataGrantsSettings(url, first_party_url, overrides,
|
|
- &tpcd_metadata_info) &&
|
|
- !IgnoreTpcdDtGracePeriodMetadataEntry(tpcd_metadata_info)) {
|
|
- return AllowAllCookies{TpcdMetadataSourceToAllowMechanism(
|
|
- tpcd_metadata_info.metadata.tpcd_metadata_rule_source())};
|
|
- }
|
|
-
|
|
if (is_explicit_setting) {
|
|
return AllowAllCookies{
|
|
ThirdPartyCookieAllowMechanism::kAllowByExplicitSetting};
|
|
diff --git a/cromite_flags/components/content_settings/core/common/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc b/cromite_flags/components/content_settings/core/common/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/cromite_flags/components/content_settings/core/common/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc
|
|
@@ -0,0 +1,3 @@
|
|
+SET_CROMITE_FEATURE_DISABLED(kTrackingProtection3pcd);
|
|
+SET_CROMITE_FEATURE_DISABLED(kUserBypassUI);
|
|
+SET_CROMITE_FEATURE_DISABLED(kTpcdHeuristicsGrants);
|
|
diff --git a/cromite_flags/components/permissions/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc b/cromite_flags/components/permissions/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/cromite_flags/components/permissions/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc
|
|
@@ -0,0 +1 @@
|
|
+SET_CROMITE_FEATURE_ENABLED(kShowRelatedWebsiteSetsPermissionGrants);
|
|
diff --git a/cromite_flags/content/public/common/content_features_cc/Partitioning-all-cookies-by-top-frame-domain.inc b/cromite_flags/content/public/common/content_features_cc/Partitioning-all-cookies-by-top-frame-domain.inc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/cromite_flags/content/public/common/content_features_cc/Partitioning-all-cookies-by-top-frame-domain.inc
|
|
@@ -0,0 +1 @@
|
|
+SET_CROMITE_FEATURE_DISABLED(kCookieDeprecationFacilitatedTesting);
|
|
diff --git a/cromite_flags/net/base/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc b/cromite_flags/net/base/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/cromite_flags/net/base/features_cc/Partitioning-all-cookies-by-top-frame-domain.inc
|
|
@@ -0,0 +1,9 @@
|
|
+SET_CROMITE_FEATURE_ENABLED(kCookieDomainRejectNonASCII);
|
|
+
|
|
+SET_CROMITE_FEATURE_DISABLED(kForceThirdPartyCookieBlocking);
|
|
+SET_CROMITE_FEATURE_DISABLED(kThirdPartyPartitionedStorageAllowedByDefault);
|
|
+
|
|
+SET_CROMITE_FEATURE_ENABLED(kCookieSameSiteConsidersRedirectChain);
|
|
+SET_CROMITE_FEATURE_ENABLED(kSchemefulSameSite);
|
|
+SET_CROMITE_FEATURE_ENABLED(kSameSiteDefaultChecksMethodRigorously);
|
|
+SET_CROMITE_FEATURE_ENABLED(kTimeLimitedInsecureCookies);
|
|
diff --git a/net/cookies/canonical_cookie.cc b/net/cookies/canonical_cookie.cc
|
|
--- a/net/cookies/canonical_cookie.cc
|
|
+++ b/net/cookies/canonical_cookie.cc
|
|
@@ -1025,9 +1025,6 @@ bool CanonicalCookie::IsCanonicalForFromStorage() const {
|
|
if (CookiePartitionKey::HasNonce(PartitionKey())) {
|
|
return true;
|
|
}
|
|
- if (!SecureAttribute()) {
|
|
- return false;
|
|
- }
|
|
}
|
|
|
|
return true;
|
|
@@ -1250,15 +1247,7 @@ bool CanonicalCookie::IsCookiePartitionedValid(const GURL& url,
|
|
bool secure,
|
|
bool is_partitioned,
|
|
bool partition_has_nonce) {
|
|
- if (!is_partitioned)
|
|
- return true;
|
|
- if (partition_has_nonce)
|
|
- return true;
|
|
- CookieAccessScheme scheme = cookie_util::ProvisionalAccessScheme(url);
|
|
- bool result = (scheme != CookieAccessScheme::kNonCryptographic) && secure;
|
|
- DLOG_IF(WARNING, !result)
|
|
- << "CanonicalCookie has invalid Partitioned attribute";
|
|
- return result;
|
|
+ return true;
|
|
}
|
|
|
|
CookieAndLineWithAccessResult::CookieAndLineWithAccessResult() = default;
|
|
diff --git a/net/cookies/cookie_deletion_info.cc b/net/cookies/cookie_deletion_info.cc
|
|
--- a/net/cookies/cookie_deletion_info.cc
|
|
+++ b/net/cookies/cookie_deletion_info.cc
|
|
@@ -131,7 +131,8 @@ bool CookieDeletionInfo::Matches(const CanonicalCookie& cookie,
|
|
return false;
|
|
}
|
|
|
|
- if (cookie.IsPartitioned() &&
|
|
+ // opened bug https://bugs.chromium.org/p/chromium/issues/detail?id=1405772
|
|
+ if (cookie.IsPartitioned() && !cookie_partition_key_collection.IsEmpty() &&
|
|
!cookie_partition_key_collection.Contains(*cookie.PartitionKey())) {
|
|
return false;
|
|
}
|
|
diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc
|
|
--- a/net/cookies/cookie_monster.cc
|
|
+++ b/net/cookies/cookie_monster.cc
|
|
@@ -2215,6 +2215,7 @@ size_t CookieMonster::GarbageCollectPartitionedCookies(
|
|
if (cookie_partition_it == partitioned_cookies_.end())
|
|
return num_deleted;
|
|
|
|
+ if ((false))
|
|
if (NumBytesInCookieMapForKey(*cookie_partition_it->second.get(), key) >
|
|
kPerPartitionDomainMaxCookieBytes ||
|
|
cookie_partition_it->second->count(key) > kPerPartitionDomainMaxCookies) {
|
|
diff --git a/net/cookies/parsed_cookie.h b/net/cookies/parsed_cookie.h
|
|
--- a/net/cookies/parsed_cookie.h
|
|
+++ b/net/cookies/parsed_cookie.h
|
|
@@ -11,6 +11,7 @@
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
+#include "net/base/features.h"
|
|
#include "net/base/net_export.h"
|
|
#include "net/cookies/cookie_constants.h"
|
|
|
|
@@ -85,7 +86,10 @@ class NET_EXPORT ParsedCookie {
|
|
CookieSameSite SameSite(
|
|
CookieSameSiteString* samesite_string = nullptr) const;
|
|
CookiePriority Priority() const;
|
|
- bool IsPartitioned() const { return partitioned_index_ != 0; }
|
|
+ bool IsPartitioned() const {
|
|
+ if ((true)) return true;
|
|
+ return partitioned_index_ != 0;
|
|
+ }
|
|
bool HasInternalHtab() const { return internal_htab_; }
|
|
TruncatingCharacterInCookieStringType
|
|
GetTruncatingCharacterInCookieStringType() const {
|
|
diff --git a/net/extras/sqlite/sqlite_persistent_cookie_store.cc b/net/extras/sqlite/sqlite_persistent_cookie_store.cc
|
|
--- a/net/extras/sqlite/sqlite_persistent_cookie_store.cc
|
|
+++ b/net/extras/sqlite/sqlite_persistent_cookie_store.cc
|
|
@@ -871,6 +871,14 @@ bool SQLitePersistentCookieStore::Backend::DoInitializeDatabase() {
|
|
if (!restore_old_session_cookies_)
|
|
DeleteSessionCookiesOnStartup();
|
|
|
|
+ // Since there is no automatic transition to partitioned cookies
|
|
+ // (the information would be missing), we clean the current ones
|
|
+ // present because they would otherwise be sent in third-party contexts
|
|
+ // even if the flag is active.
|
|
+ if (!db()->Execute("DELETE FROM cookies WHERE top_frame_site_key = ''")) {
|
|
+ LOG(WARNING) << "Unable to delete unpartitioned cookies.";
|
|
+ }
|
|
+
|
|
return true;
|
|
}
|
|
|
|
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
|
|
--- a/net/url_request/url_request_http_job.cc
|
|
+++ b/net/url_request/url_request_http_job.cc
|
|
@@ -785,13 +785,9 @@ void URLRequestHttpJob::SetCookieHeaderAndStart(
|
|
AnnotateAndMoveUserBlockedCookies(maybe_included_cookies, excluded_cookies);
|
|
}
|
|
|
|
- const bool cookie_deprecation_testing_enabled =
|
|
- request_->context()->cookie_deprecation_label().has_value();
|
|
- const bool cookie_deprecation_testing_has_label =
|
|
- cookie_deprecation_testing_enabled &&
|
|
- !request_->context()->cookie_deprecation_label().value().empty();
|
|
- bool may_set_sec_cookie_deprecation_header =
|
|
- cookie_deprecation_testing_has_label;
|
|
+ const bool cookie_deprecation_testing_enabled = false;
|
|
+ const bool cookie_deprecation_testing_has_label = false;
|
|
+ bool may_set_sec_cookie_deprecation_header = false;
|
|
|
|
if (!maybe_included_cookies.empty()) {
|
|
std::string cookie_line =
|
|
diff --git a/services/network/cookie_settings.cc b/services/network/cookie_settings.cc
|
|
--- a/services/network/cookie_settings.cc
|
|
+++ b/services/network/cookie_settings.cc
|
|
@@ -44,7 +44,7 @@ bool AffectedByThirdPartyCookiePhaseout(
|
|
const bool is_third_party_request,
|
|
const bool is_cookie_partitioned) {
|
|
return cookie_same_site == net::CookieSameSite::NO_RESTRICTION &&
|
|
- is_third_party_request && !is_cookie_partitioned;
|
|
+ is_third_party_request;
|
|
}
|
|
|
|
bool IsValidType(ContentSettingsType type) {
|
|
@@ -119,8 +119,7 @@ bool IsOriginOpaqueHttpOrHttps(const url::Origin* top_frame_origin) {
|
|
// static
|
|
bool CookieSettings::IsCookieAllowed(const net::CanonicalCookie& cookie,
|
|
const CookieSettingWithMetadata& setting) {
|
|
- return IsAllowed(setting.cookie_setting()) ||
|
|
- (cookie.IsPartitioned() && setting.allow_partitioned_cookies());
|
|
+ return IsAllowed(setting.cookie_setting());
|
|
}
|
|
|
|
// static
|
|
diff --git a/services/network/restricted_cookie_manager.cc b/services/network/restricted_cookie_manager.cc
|
|
--- a/services/network/restricted_cookie_manager.cc
|
|
+++ b/services/network/restricted_cookie_manager.cc
|
|
@@ -947,6 +947,12 @@ void RestrictedCookieManager::SetCookieFromString(
|
|
|
|
std::move(callback).Run();
|
|
|
|
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=911299
|
|
+ bool site_for_cookies_ok =
|
|
+ BoundSiteForCookies().IsEquivalent(site_for_cookies);
|
|
+ bool top_frame_origin_ok = top_frame_origin == BoundTopFrameOrigin();
|
|
+ if (!site_for_cookies_ok || !top_frame_origin_ok) return;
|
|
+
|
|
net::CookieInclusionStatus status;
|
|
std::unique_ptr<net::CanonicalCookie> parsed_cookie =
|
|
net::CanonicalCookie::Create(
|
|
diff --git a/third_party/blink/renderer/modules/cookie_store/cookie_init.idl b/third_party/blink/renderer/modules/cookie_store/cookie_init.idl
|
|
--- a/third_party/blink/renderer/modules/cookie_store/cookie_init.idl
|
|
+++ b/third_party/blink/renderer/modules/cookie_store/cookie_init.idl
|
|
@@ -17,5 +17,5 @@ dictionary CookieInit {
|
|
USVString path = "/";
|
|
DOMHighResTimeStamp? expires = null;
|
|
CookieSameSite sameSite = "strict";
|
|
- boolean partitioned = false;
|
|
+ boolean partitioned = true;
|
|
};
|
|
diff --git a/third_party/blink/renderer/modules/cookie_store/cookie_store.cc b/third_party/blink/renderer/modules/cookie_store/cookie_store.cc
|
|
--- a/third_party/blink/renderer/modules/cookie_store/cookie_store.cc
|
|
+++ b/third_party/blink/renderer/modules/cookie_store/cookie_store.cc
|
|
@@ -340,6 +340,7 @@ ScriptPromise<IDLUndefined> CookieStore::set(ScriptState* script_state,
|
|
CookieInit* set_options = CookieInit::Create();
|
|
set_options->setName(name);
|
|
set_options->setValue(value);
|
|
+ set_options->setPartitioned(true);
|
|
return set(script_state, set_options, exception_state);
|
|
}
|
|
|
|
@@ -363,6 +364,7 @@ ScriptPromise<IDLUndefined> CookieStore::Delete(
|
|
set_options->setName(name);
|
|
set_options->setValue("deleted");
|
|
set_options->setExpires(0);
|
|
+ set_options->setPartitioned(true);
|
|
return DoWrite(script_state, set_options, exception_state);
|
|
}
|
|
|
|
@@ -378,6 +380,7 @@ ScriptPromise<IDLUndefined> CookieStore::Delete(
|
|
set_options->setPath(options->path());
|
|
set_options->setSameSite("strict");
|
|
set_options->setPartitioned(options->partitioned());
|
|
+ set_options->setPartitioned(true);
|
|
return DoWrite(script_state, set_options, exception_state);
|
|
}
|
|
|
|
diff --git a/third_party/blink/renderer/modules/cookie_store/cookie_store_delete_options.idl b/third_party/blink/renderer/modules/cookie_store/cookie_store_delete_options.idl
|
|
--- a/third_party/blink/renderer/modules/cookie_store/cookie_store_delete_options.idl
|
|
+++ b/third_party/blink/renderer/modules/cookie_store/cookie_store_delete_options.idl
|
|
@@ -8,5 +8,5 @@ dictionary CookieStoreDeleteOptions {
|
|
required USVString name;
|
|
USVString? domain = null;
|
|
USVString path = "/";
|
|
- boolean partitioned = false;
|
|
+ boolean partitioned = true;
|
|
};
|
|
diff --git a/ui/webui/webui_allowlist.cc b/ui/webui/webui_allowlist.cc
|
|
--- a/ui/webui/webui_allowlist.cc
|
|
+++ b/ui/webui/webui_allowlist.cc
|
|
@@ -75,6 +75,7 @@ void WebUIAllowlist::RegisterAutoGrantedPermissions(
|
|
void WebUIAllowlist::RegisterAutoGrantedThirdPartyCookies(
|
|
const url::Origin& top_level_origin,
|
|
const std::vector<ContentSettingsPattern>& origin_patterns) {
|
|
+ if ((true)) return;
|
|
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
|
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
|
|
|
--
|