Files
cromite/build/patches/Disable-privacy-sandbox.patch
2026-05-19 10:48:25 +02:00

502 lines
25 KiB
Diff

From: uazo <uazo@users.noreply.github.com>
Date: Sat, 13 Nov 2021 09:17:06 +0000
Subject: Disable privacy sandbox
Remove UI from the settings and set the flags to inactive
Permanently removes FLoC support, disabling the download of LSH clusters,
the marking the history navigation and the javascript API and permission policies.
Also disable FirstPartySets and StorageAccessAPI.
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
chrome/android/BUILD.gn | 1 -
.../browser/chrome_content_browser_client.cc | 5 ++++-
.../first_party_sets_navigation_throttle.cc | 2 +-
.../first_party_sets_policy_service.cc | 3 ++-
chrome/browser/privacy_sandbox/BUILD.gn | 1 -
.../privacy_sandbox_service_impl.cc | 3 ++-
.../privacy_sandbox_settings_delegate.cc | 1 +
.../settings/privacy_page/cookies_page.ts | 2 +-
chrome/test/BUILD.gn | 2 --
.../site_settings/CookieSettings.java | 4 ++--
.../history/core/browser/history_backend.cc | 13 +------------
.../privacy_sandbox_attestations/BUILD.gn | 6 ------
.../preload/BUILD.gn | 2 +-
.../privacy_sandbox_attestations.cc | 8 +++-----
.../privacy_sandbox_features.cc | 4 ++++
.../privacy_sandbox/privacy_sandbox_prefs.cc | 8 ++++----
.../privacy_sandbox_settings_impl.cc | 19 ++++++++++++++-----
.../signin/base/AccountCapabilities.java | 3 +--
.../identity_manager/account_capabilities.cc | 2 +-
.../shared_storage_document_service_impl.cc | 9 +++++++++
.../public/browser/content_browser_client.cc | 2 +-
.../features_cc/Disable-privacy-sandbox.inc | 1 +
.../Disable-privacy-sandbox.inc | 1 +
.../features_cc/Disable-privacy-sandbox.inc | 1 +
.../features_cc/Disable-privacy-sandbox.inc | 1 +
third_party/blink/common/features.cc | 1 +
26 files changed, 57 insertions(+), 48 deletions(-)
create mode 100644 cromite_flags/content/common/features_cc/Disable-privacy-sandbox.inc
create mode 100644 cromite_flags/content/public/common/content_features_cc/Disable-privacy-sandbox.inc
create mode 100644 cromite_flags/services/network/public/cpp/features_cc/Disable-privacy-sandbox.inc
create mode 100644 cromite_flags/third_party/blink/common/features_cc/Disable-privacy-sandbox.inc
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -1769,7 +1769,6 @@ if (_is_default_toolchain) {
java_group("chrome_public_non_pak_assets") {
deps = [
"//chrome/android/webapk/libs/runtime_library:runtime_library_assets",
- "//components/privacy_sandbox/privacy_sandbox_attestations/preload:privacy_sandbox_attestations_assets",
]
}
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
@@ -3567,6 +3567,9 @@ bool ChromeContentBrowserClient::IsAttributionReportingOperationAllowed(
const url::Origin* destination_origin,
const url::Origin* reporting_origin,
bool* can_bypass) {
+ // make sure that this is always disabled in Bromite even if privacy sandbox is already disabled in the prefs
+ if ((true))
+ return false;
Profile* profile = Profile::FromBrowserContext(browser_context);
auto* privacy_sandbox_settings =
@@ -8296,7 +8299,7 @@ bool ChromeContentBrowserClient::ShouldDisableOriginAgentClusterDefault(
}
bool ChromeContentBrowserClient::WillProvidePublicFirstPartySets() {
- return !is_minimal_mode_ &&
+ return ((false)) && !is_minimal_mode_ &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableComponentUpdate);
}
diff --git a/chrome/browser/first_party_sets/first_party_sets_navigation_throttle.cc b/chrome/browser/first_party_sets/first_party_sets_navigation_throttle.cc
--- a/chrome/browser/first_party_sets/first_party_sets_navigation_throttle.cc
+++ b/chrome/browser/first_party_sets/first_party_sets_navigation_throttle.cc
@@ -60,7 +60,7 @@ void FirstPartySetsNavigationThrottle::MaybeCreateAndAdd(
navigation_handle.GetWebContents()->GetBrowserContext());
// The `service` might be null for some irregular profiles.
- if (!profile->IsRegularProfile()) {
+ if (((true)) || !profile->IsRegularProfile()) {
return;
}
diff --git a/chrome/browser/first_party_sets/first_party_sets_policy_service.cc b/chrome/browser/first_party_sets/first_party_sets_policy_service.cc
--- a/chrome/browser/first_party_sets/first_party_sets_policy_service.cc
+++ b/chrome/browser/first_party_sets/first_party_sets_policy_service.cc
@@ -57,6 +57,7 @@ const base::DictValue* GetOverridesPolicyForProfile(const PrefService* prefs) {
}
ServiceState GetServiceState(Profile* profile, bool pref_enabled) {
+ if ((true)) return ServiceState::kPermanentlyDisabled;
if (profile->IsSystemProfile() || profile->IsGuestSession() ||
profile->IsOffTheRecord()) {
return ServiceState::kPermanentlyDisabled;
@@ -100,7 +101,7 @@ void FirstPartySetsPolicyService::Init() {
service_state_ = GetServiceState(
profile, privacy_sandbox_settings_->AreRelatedWebsiteSetsEnabled());
-
+ service_state_ = ServiceState::kPermanentlyDisabled;
if (service_state_ == ServiceState::kPermanentlyDisabled) {
OnReadyToNotifyDelegates(net::FirstPartySetsContextConfig(),
net::FirstPartySetsCacheFilter());
diff --git a/chrome/browser/privacy_sandbox/BUILD.gn b/chrome/browser/privacy_sandbox/BUILD.gn
--- a/chrome/browser/privacy_sandbox/BUILD.gn
+++ b/chrome/browser/privacy_sandbox/BUILD.gn
@@ -165,7 +165,6 @@ if (!is_android) {
"//components/privacy_sandbox:test_support",
"//components/privacy_sandbox/privacy_sandbox_attestations",
"//components/privacy_sandbox/privacy_sandbox_attestations:metrics",
- "//components/privacy_sandbox/privacy_sandbox_attestations/preload",
"//components/privacy_sandbox/privacy_sandbox_attestations/proto",
"//content/test:test_support",
]
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc
--- a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc
+++ b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc
@@ -365,7 +365,7 @@ bool PrivacySandboxServiceImpl::IsRestrictedNoticeEnabled() {
void PrivacySandboxServiceImpl::SetRelatedWebsiteSetsDataAccessEnabled(
bool enabled) {
pref_service_->SetBoolean(prefs::kPrivacySandboxRelatedWebsiteSetsEnabled,
- enabled);
+ false);
}
bool PrivacySandboxServiceImpl::IsRelatedWebsiteSetsDataAccessEnabled() const {
@@ -668,6 +668,7 @@ void PrivacySandboxServiceImpl::RecordPrivacySandbox4StartupMetrics() {
}
void PrivacySandboxServiceImpl::LogPrivacySandboxState() {
+ if ((true)) return;
// Do not record metrics for non-regular profiles.
if (!IsRegularProfile(profile_type_)) {
return;
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
@@ -144,6 +144,7 @@ bool PrivacySandboxSettingsDelegate::HasAppropriateTopicsConsent() const {
bool PrivacySandboxSettingsDelegate::PrivacySandboxRestrictedNoticeRequired()
const {
+ if ((true)) return true;
auto* identity_manager = IdentityManagerFactory::GetForProfile(profile_);
if (!identity_manager ||
diff --git a/chrome/browser/resources/settings/privacy_page/cookies_page.ts b/chrome/browser/resources/settings/privacy_page/cookies_page.ts
--- a/chrome/browser/resources/settings/privacy_page/cookies_page.ts
+++ b/chrome/browser/resources/settings/privacy_page/cookies_page.ts
@@ -175,7 +175,7 @@ export class SettingsCookiesPageElement extends SettingsCookiesPageElementBase {
}
private relatedWebsiteSetsToggleDisabled_() {
- return this.getPref('generated.third_party_cookie_blocking_setting')
+ return ((true)) || this.getPref('generated.third_party_cookie_blocking_setting')
.value !== ThirdPartyCookieBlockingSetting.BLOCK_THIRD_PARTY;
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -2129,8 +2129,6 @@ if (is_android) {
"//components/privacy_sandbox/privacy_sandbox_attestations",
"//components/privacy_sandbox/privacy_sandbox_attestations:metrics",
"//components/privacy_sandbox/privacy_sandbox_attestations:test_support",
- "//components/privacy_sandbox/privacy_sandbox_attestations/preload",
- "//components/privacy_sandbox/privacy_sandbox_attestations/preload:privacy_sandbox_attestations_assets",
"//components/privacy_sandbox/privacy_sandbox_attestations/proto",
"//components/qr_code_generator:bitmap_generator",
"//components/safe_browsing/content/common:interfaces",
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/CookieSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/CookieSettings.java
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/CookieSettings.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/CookieSettings.java
@@ -134,7 +134,7 @@ public class CookieSettings extends BaseSiteSettingsFragment
mAllowRwsPreference.setChecked(
getSiteSettingsDelegate().isRelatedWebsiteSetsDataAccessEnabled());
- if (!isBlockThirdPartyCookieSelected()) {
+ if (((true)) || !isBlockThirdPartyCookieSelected()) {
mAllowRwsPreference.setEnabled(false);
}
mAllowRwsPreference.setOnPreferenceChangeListener(this);
@@ -150,7 +150,7 @@ public class CookieSettings extends BaseSiteSettingsFragment
public boolean onPreferenceChange(Preference preference, Object newValue) {
String key = preference.getKey();
if (ALLOW_RWS_COOKIE_PREFERENCE.equals(key)) {
- getSiteSettingsDelegate().setRelatedWebsiteSetsDataAccessEnabled((boolean) newValue);
+ getSiteSettingsDelegate().setRelatedWebsiteSetsDataAccessEnabled((boolean) false);
} else {
assert false : "Should not be reached";
}
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc
--- a/components/history/core/browser/history_backend.cc
+++ b/components/history/core/browser/history_backend.cc
@@ -661,18 +661,7 @@ void HistoryBackend::SetBrowsingTopicsAllowed(ContextID context_id,
if (!visit_id)
return;
- // Only add to the annotations table if the visit_id exists in the visits
- // table.
- VisitContentAnnotations annotations;
- if (db_->GetContentAnnotationsForVisit(visit_id, &annotations)) {
- annotations.annotation_flags |=
- VisitContentAnnotationFlag::kBrowsingTopicsEligible;
- db_->UpdateContentAnnotationsForVisit(visit_id, annotations);
- } else {
- annotations.annotation_flags |=
- VisitContentAnnotationFlag::kBrowsingTopicsEligible;
- db_->AddContentAnnotationsForVisit(visit_id, annotations);
- }
+ // in Bromite disallow marking anything in history related to topics
ScheduleCommit();
}
diff --git a/components/privacy_sandbox/privacy_sandbox_attestations/BUILD.gn b/components/privacy_sandbox/privacy_sandbox_attestations/BUILD.gn
--- a/components/privacy_sandbox/privacy_sandbox_attestations/BUILD.gn
+++ b/components/privacy_sandbox/privacy_sandbox_attestations/BUILD.gn
@@ -25,12 +25,6 @@ if (use_blink) {
"//content/public/browser",
]
- if (is_android) {
- deps += [
- "//components/privacy_sandbox/privacy_sandbox_attestations/preload",
- ]
- }
-
public_deps = [
"//base",
"//build:buildflag_header_h",
diff --git a/components/privacy_sandbox/privacy_sandbox_attestations/preload/BUILD.gn b/components/privacy_sandbox/privacy_sandbox_attestations/preload/BUILD.gn
--- a/components/privacy_sandbox/privacy_sandbox_attestations/preload/BUILD.gn
+++ b/components/privacy_sandbox/privacy_sandbox_attestations/preload/BUILD.gn
@@ -23,7 +23,7 @@ if (is_mac) {
}
}
-if (is_android) {
+if (((false)) && is_android) {
import("//build/config/android/rules.gni")
# Bundle the preload attestations list to Android APK assets.
diff --git a/components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations.cc b/components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations.cc
--- a/components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations.cc
+++ b/components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations.cc
@@ -42,7 +42,7 @@
#include "net/base/schemeful_site.h"
#include "url/gurl.h"
-#if BUILDFLAG(IS_ANDROID)
+#if ((false)) && BUILDFLAG(IS_ANDROID)
#include "base/android/apk_assets.h"
#include "base/containers/span.h"
#include "base/files/memory_mapped_file.h"
@@ -142,7 +142,7 @@ LoadAttestationsInternal(base::FilePath installed_file_path) {
return ParseAttestationsMap(proto_str);
}
-#if BUILDFLAG(IS_ANDROID)
+#if ((false)) && BUILDFLAG(IS_ANDROID)
void RecordLoadAPKAssetStatusHistogram(LoadAPKAssetStatus status) {
base::UmaHistogramEnumeration(kAttestationsLoadAPKAssetStatusUMA, status);
@@ -469,8 +469,6 @@ void PrivacySandboxAttestations::OnAttestationsParsed(
if (attestations_map.has_value() &&
(!file_version_.IsValid() || file_version_.CompareTo(version) < 0)) {
// Parsing succeeded and the attestations file has newer version.
- file_version_ = std::move(version);
- attestations_map_ = std::move(attestations_map.value());
}
SetIsPreInstalled(is_pre_installed);
@@ -496,7 +494,7 @@ void PrivacySandboxAttestations::OnAttestationsFileCheckComplete() {
// the in-memory attestations map.
// TODO(crbug.com/406020732): Consider also loading the attestations component
// from APK assets if the parsing has finished with error.
-#if BUILDFLAG(IS_ANDROID)
+#if ((false)) && BUILDFLAG(IS_ANDROID)
if (attestations_parse_progress_ == Progress::kNotStarted &&
base::FeatureList::IsEnabled(
privacy_sandbox::kPrivacySandboxAttestationsLoadFromAPKAsset)) {
diff --git a/components/privacy_sandbox/privacy_sandbox_features.cc b/components/privacy_sandbox/privacy_sandbox_features.cc
--- a/components/privacy_sandbox/privacy_sandbox_features.cc
+++ b/components/privacy_sandbox/privacy_sandbox_features.cc
@@ -97,4 +97,8 @@ BASE_FEATURE(kPrivacySandboxNoticeFramework, base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kPrivacySandboxAdPrivacyUxDeprecation,
base::FEATURE_DISABLED_BY_DEFAULT);
+
+SET_CROMITE_FEATURE_DISABLED(kPrivacySandboxSettings4);
+SET_CROMITE_FEATURE_ENABLED(kDisablePrivacySandboxPrompts);
+SET_CROMITE_FEATURE_DISABLED(kEnforcePrivacySandboxAttestations);
} // namespace privacy_sandbox
diff --git a/components/privacy_sandbox/privacy_sandbox_prefs.cc b/components/privacy_sandbox/privacy_sandbox_prefs.cc
--- a/components/privacy_sandbox/privacy_sandbox_prefs.cc
+++ b/components/privacy_sandbox/privacy_sandbox_prefs.cc
@@ -26,7 +26,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(prefs::kPrivacySandboxM1FledgeEnabled, false);
registry->RegisterBooleanPref(prefs::kPrivacySandboxM1AdMeasurementEnabled,
false);
- registry->RegisterBooleanPref(prefs::kPrivacySandboxM1Restricted, false);
+ registry->RegisterBooleanPref(prefs::kPrivacySandboxM1Restricted, true);
registry->RegisterTimePref(prefs::kPrivacySandboxTopicsDataAccessibleSince,
base::Time());
@@ -51,7 +51,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
prefs::kPrivacySandboxRelatedWebsiteSetsDataAccessAllowedInitialized,
false);
registry->RegisterBooleanPref(
- prefs::kPrivacySandboxRelatedWebsiteSetsEnabled, true,
+ prefs::kPrivacySandboxRelatedWebsiteSetsEnabled, false, // must be disabled
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kPrivacySandboxTopicsConsentGiven,
@@ -69,9 +69,9 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
// TODO: b/462419925 - Deprecate these prefs post-Mode B rollback.
registry->RegisterBooleanPref(prefs::kShowRollbackUiModeB, false);
registry->RegisterBooleanPref(
- prefs::kBlockAll3pcToggleEnabled, false,
+ prefs::kBlockAll3pcToggleEnabled, false, // with true enables FPS
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kTrackingProtection3pcdEnabled, false);
+ registry->RegisterBooleanPref(prefs::kTrackingProtection3pcdEnabled, false); // with true enables FPS
}
void ClearAdPrivacyPrefs(PrefService* prefs) {
diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/components/privacy_sandbox/privacy_sandbox_settings_impl.cc
--- a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc
+++ b/components/privacy_sandbox/privacy_sandbox_settings_impl.cc
@@ -129,7 +129,7 @@ std::set<browsing_topics::Topic> GetTopicsSetFromString(
// static
bool PrivacySandboxSettingsImpl::IsAllowed(Status status) {
- return status == Status::kAllowed;
+ return false;
}
// static
@@ -244,7 +244,8 @@ PrivacySandboxSettingsImpl::GetFinchPrioritizedTopics() {
return finch_prioritized_topics_;
}
-bool PrivacySandboxSettingsImpl::IsTopicsAllowed() const {
+bool PrivacySandboxSettingsImpl::IsTopicsAllowed() const { // disabled in Bromite
+ if ((true)) return false;
Status status = GetM1TopicAllowedStatus();
JoinHistogram(kIsTopicsAllowedHistogram, status);
return IsAllowed(status);
@@ -276,7 +277,8 @@ bool PrivacySandboxSettingsImpl::IsTopicsAllowedForContext(
return IsAllowed(status);
}
-bool PrivacySandboxSettingsImpl::IsTopicAllowed(const CanonicalTopic& topic) {
+bool PrivacySandboxSettingsImpl::IsTopicAllowed(const CanonicalTopic& topic) { // disabled in Bromite
+ if ((true)) return false;
const auto& blocked_topics =
pref_service_->GetList(prefs::kPrivacySandboxBlockedTopics);
@@ -491,6 +493,7 @@ bool PrivacySandboxSettingsImpl::
void PrivacySandboxSettingsImpl::SetFledgeJoiningAllowed(
const std::string& top_frame_etld_plus1,
bool allowed) {
+ if ((true)) return;
ScopedDictPrefUpdate scoped_pref_update(
pref_service_, prefs::kPrivacySandboxFledgeJoinBlocked);
@@ -560,7 +563,8 @@ void PrivacySandboxSettingsImpl::ClearFledgeJoiningAllowedSettings(
}
bool PrivacySandboxSettingsImpl::IsFledgeJoiningAllowed(
- const url::Origin& top_frame_origin) const {
+ const url::Origin& top_frame_origin) const { // disabled in Bromite
+ if ((true)) return false;
ScopedDictPrefUpdate scoped_pref_update(
pref_service_, prefs::kPrivacySandboxFledgeJoinBlocked);
auto& pref_data = scoped_pref_update.Get();
@@ -846,7 +850,10 @@ void PrivacySandboxSettingsImpl::SetDelegateForTesting(
delegate_ = std::move(delegate);
}
-void PrivacySandboxSettingsImpl::SetTopicsDataAccessibleFromNow() const {
+void PrivacySandboxSettingsImpl::SetTopicsDataAccessibleFromNow() const { // disabled in Bromite
+ pref_service_->ClearPref(prefs::kPrivacySandboxTopicsDataAccessibleSince);
+ if ((true)) return;
+
pref_service_->SetTime(prefs::kPrivacySandboxTopicsDataAccessibleSince,
base::Time::Now());
@@ -859,6 +866,7 @@ PrivacySandboxSettingsImpl::Status
PrivacySandboxSettingsImpl::GetSiteAccessAllowedStatus(
const url::Origin& top_frame_origin,
const GURL& url) const {
+ if ((true)) return Status::kSiteDataAccessBlocked;
// Relying on |host_content_settings_map_| instead of |cookie_settings_|
// allows to query whether the site associated with the |url| is allowed to
// access Site data (aka ContentSettingsType::COOKIES) without considering any
@@ -873,6 +881,7 @@ PrivacySandboxSettingsImpl::GetSiteAccessAllowedStatus(
PrivacySandboxSettingsImpl::Status
PrivacySandboxSettingsImpl::GetPrivacySandboxAllowedStatus(
bool should_ignore_restriction /*=false*/) const {
+ if ((true)) return Status::kRestricted;
if (delegate_->IsIncognitoProfile()) {
return Status::kIncognitoProfile;
}
diff --git a/components/signin/public/android/java/src/org/chromium/components/signin/base/AccountCapabilities.java b/components/signin/public/android/java/src/org/chromium/components/signin/base/AccountCapabilities.java
--- a/components/signin/public/android/java/src/org/chromium/components/signin/base/AccountCapabilities.java
+++ b/components/signin/public/android/java/src/org/chromium/components/signin/base/AccountCapabilities.java
@@ -88,8 +88,7 @@ public class AccountCapabilities {
* @return canRunChromePrivacySandboxTrials capability value.
*/
public @Tribool int canRunChromePrivacySandboxTrials() {
- return getCapabilityByName(
- AccountCapabilitiesConstants.CAN_RUN_CHROME_PRIVACY_SANDBOX_TRIALS_CAPABILITY_NAME);
+ return Tribool.FALSE;
}
/**
diff --git a/components/signin/public/identity_manager/account_capabilities.cc b/components/signin/public/identity_manager/account_capabilities.cc
--- a/components/signin/public/identity_manager/account_capabilities.cc
+++ b/components/signin/public/identity_manager/account_capabilities.cc
@@ -113,7 +113,7 @@ AccountCapabilities::can_make_chrome_search_engine_choice_screen_choice()
#if !BUILDFLAG(IS_IOS)
signin::Tribool AccountCapabilities::can_run_chrome_privacy_sandbox_trials()
const {
- return GetCapabilityByName(kCanRunChromePrivacySandboxTrialsCapabilityName);
+ return signin::Tribool::kFalse;
}
#endif
diff --git a/content/browser/shared_storage/shared_storage_document_service_impl.cc b/content/browser/shared_storage/shared_storage_document_service_impl.cc
--- a/content/browser/shared_storage/shared_storage_document_service_impl.cc
+++ b/content/browser/shared_storage/shared_storage_document_service_impl.cc
@@ -123,6 +123,15 @@ void SharedStorageDocumentServiceImpl::CreateWorklet(
render_frame_host().GetLastCommittedOrigin().IsSameOriginWith(
data_origin);
+ // A document can only create cross-origin worklets with
+ // `kSharedStorageAPIM125` enabled.
+ if (!is_same_origin) {
+ // This could indicate a compromised renderer, so let's terminate it.
+ receiver_.ReportBadMessage(
+ "Attempted to load a cross-origin module script.");
+ return;
+ }
+
// `CreateWorklet()` cannot differentiate between calls from addModule() and
// createWorklet(). Hence, we skip the mojom validation for opaque origin
// context for addModule().
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -1711,7 +1711,7 @@ bool ContentBrowserClient::ShouldPreconnectNavigation(
}
bool ContentBrowserClient::IsFirstPartySetsEnabled() {
- return true;
+ return false;
}
bool ContentBrowserClient::WillProvidePublicFirstPartySets() {
diff --git a/cromite_flags/content/common/features_cc/Disable-privacy-sandbox.inc b/cromite_flags/content/common/features_cc/Disable-privacy-sandbox.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/content/common/features_cc/Disable-privacy-sandbox.inc
@@ -0,0 +1 @@
+SET_CROMITE_FEATURE_DISABLED(kPrivacySandboxAdsAPIsM1Override);
diff --git a/cromite_flags/content/public/common/content_features_cc/Disable-privacy-sandbox.inc b/cromite_flags/content/public/common/content_features_cc/Disable-privacy-sandbox.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/content/public/common/content_features_cc/Disable-privacy-sandbox.inc
@@ -0,0 +1 @@
+SET_CROMITE_FEATURE_DISABLED(kPrivacySandboxAdsAPIsOverride);
diff --git a/cromite_flags/services/network/public/cpp/features_cc/Disable-privacy-sandbox.inc b/cromite_flags/services/network/public/cpp/features_cc/Disable-privacy-sandbox.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/services/network/public/cpp/features_cc/Disable-privacy-sandbox.inc
@@ -0,0 +1 @@
+SET_CROMITE_FEATURE_DISABLED(kSharedStorageAPI);
diff --git a/cromite_flags/third_party/blink/common/features_cc/Disable-privacy-sandbox.inc b/cromite_flags/third_party/blink/common/features_cc/Disable-privacy-sandbox.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/third_party/blink/common/features_cc/Disable-privacy-sandbox.inc
@@ -0,0 +1 @@
+SET_CROMITE_FEATURE_DISABLED(kFencedFrames);
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -2718,6 +2718,7 @@ BASE_FEATURE(kUnframedIwa, base::FEATURE_DISABLED_BY_DEFAULT);
// constants for features in the section above.
bool IsAllowURNsInIframeEnabled() {
+ if ((true)) return false; // see https://chromium-review.googlesource.com/c/chromium/src/+/3690741
return base::FeatureList::IsEnabled(blink::features::kAllowURNsInIframes);
}
--