Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Subject: [PATCH] enable -fwrapv in Clang for non-UBSan builds
1 file changed, 4 insertions(+)

diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 59fa6f9c57e11..09cc65d305e69 100644
index edd410e3ddf6b..5d9b3e7c35d4b 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -456,6 +456,10 @@ config("compiler") {
@@ -451,6 +451,10 @@ config("compiler") {
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Subject: [PATCH] enable -ftrivial-auto-var-init=zero
1 file changed, 4 insertions(+)

diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 09cc65d305e69..2858240e616e2 100644
index 5d9b3e7c35d4b..0d7f390a574b0 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -460,6 +460,10 @@ config("compiler") {
@@ -455,6 +455,10 @@ config("compiler") {
cflags += [ "-fwrapv" ]
}

Expand Down
128 changes: 110 additions & 18 deletions vanadium_patches/0014-disable-seed-based-field-trials.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,64 +4,156 @@ Date: Tue, 25 Dec 2018 16:19:51 -0500
Subject: [PATCH] disable seed-based field trials

---
.../service/variations_field_trial_creator.cc | 10 ++++++++++
components/variations/synthetic_trial_registry.cc | 2 ++
2 files changed, 12 insertions(+)
components/variations/BUILD.gn | 7 +++++++
components/variations/common_ext/BUILD.gn | 18 ++++++++++++++++++
components/variations/service/BUILD.gn | 7 +++++++
.../service/variations_field_trial_creator.cc | 13 +++++++++++++
.../variations/synthetic_trial_registry.cc | 3 +++
5 files changed, 48 insertions(+)
create mode 100644 components/variations/common_ext/BUILD.gn

diff --git a/components/variations/BUILD.gn b/components/variations/BUILD.gn
index 5ae80aba8b1d6..63f055eb52800 100644
--- a/components/variations/BUILD.gn
+++ b/components/variations/BUILD.gn
@@ -155,6 +155,13 @@ component("variations") {
"//components/variations/android:variations_seed_jni",
]
}
+
+ sources += [
+ ]
+
+ deps += [
+ "//components/variations/common_ext:buildflags",
+ ]
}

if (is_android) {
diff --git a/components/variations/common_ext/BUILD.gn b/components/variations/common_ext/BUILD.gn
new file mode 100644
index 0000000000000..2c448f85a384f
--- /dev/null
+++ b/components/variations/common_ext/BUILD.gn
@@ -0,0 +1,18 @@
+# Copyright 2025 GrapheneOS
+# Use of this source code is governed by a GPLv2.0-style license that can be
+# found in the LICENSE file.
+
+import("//build/buildflag_header.gni")
+
+declare_args() {
+ # Set to true to allow usage of field trial seeds.
+ fieldtrial_seed_enabled = false
+}
+
+buildflag_header("buildflags") {
+ header = "buildflags.h"
+ flags = []
+ flags += [
+ "FIELDTRIAL_SEED_ENABLED=$fieldtrial_seed_enabled"
+ ]
+}
diff --git a/components/variations/service/BUILD.gn b/components/variations/service/BUILD.gn
index fda6153e144d1..61144785825c6 100644
--- a/components/variations/service/BUILD.gn
+++ b/components/variations/service/BUILD.gn
@@ -75,6 +75,13 @@ static_library("service") {
"//services/network/public/cpp",
"//ui/base",
]
+
+ sources += [
+ ]
+
+ deps += [
+ "//components/variations/common_ext:buildflags",
+ ]
}

source_set("unit_tests") {
diff --git a/components/variations/service/variations_field_trial_creator.cc b/components/variations/service/variations_field_trial_creator.cc
index 2787a0fee8398..41fec9f707b7c 100644
index c134930f8e20a..abfc117c623c8 100644
--- a/components/variations/service/variations_field_trial_creator.cc
+++ b/components/variations/service/variations_field_trial_creator.cc
@@ -249,8 +249,14 @@ bool VariationsFieldTrialCreator::SetUpFieldTrials(
}
@@ -39,6 +39,7 @@
#include "components/metrics/metrics_state_manager.h"
#include "components/prefs/pref_service.h"
#include "components/variations/active_field_trials.h"
+#include "components/variations/common_ext/buildflags.h"
#include "components/variations/entropy_provider.h"
#include "components/variations/field_trial_config/field_trial_util.h"
#include "components/variations/platform_field_trials.h"
@@ -253,8 +254,14 @@ bool VariationsFieldTrialCreator::SetUpFieldTrials(

// Force the variation ids selected in chrome://flags and/or specified using
// the command-line flag.
+#if defined(FIELDTRIAL_SEED_ENABLED)
+#if BUILDFLAG(FIELDTRIAL_SEED_ENABLED)
auto result = http_header_provider->ForceVariationIds(
variation_ids, command_line_variation_ids);
+#else
+ // Pretend that it was successful without acutally forcing
+ // variation ids and command line variation ids
+ auto result = VariationsIdsProvider::ForceIdsResult::SUCCESS;
+#endif // defined(FIELDTRIAL_SEED_ENABLED)
+#endif // BUILDFLAG(FIELDTRIAL_SEED_ENABLED)

switch (result) {
case VariationsIdsProvider::ForceIdsResult::INVALID_SWITCH_ENTRY:
@@ -315,13 +321,17 @@ bool VariationsFieldTrialCreator::SetUpFieldTrials(
@@ -319,23 +326,29 @@ bool VariationsFieldTrialCreator::SetUpFieldTrials(

CreateTrialsResult create_trials_result = {.applied_seed = false};
if (!used_testing_config && client_filterable_state) {
+#if defined(FIELDTRIAL_SEED_ENABLED)
+#if BUILDFLAG(FIELDTRIAL_SEED_ENABLED)
// TODO(crbug.com/410008879): Make use of the result's
// seed_has_active_limited_layer field.
create_trials_result = CreateTrialsFromSeed(
entropy_providers, feature_list.get(), safe_seed_manager,
std::move(client_filterable_state));
+#endif
+#endif // BUILDFLAG(FIELDTRIAL_SEED_ENABLED)
}

+#if defined(FIELDTRIAL_SEED_ENABLED)
if (add_entropy_source_to_variations_ids &&
!create_trials_result.AppliedSeedHasActiveLimitedLayer()) {
// TODO(crbug.com/424154785): Consider no longer transmitting LES values
// alongside VariationsIDs.
+#if BUILDFLAG(FIELDTRIAL_SEED_ENABLED)
http_header_provider->SetLowEntropySourceValue(
metrics_state_manager->GetLowEntropySource());
+#endif // BUILDFLAG(FIELDTRIAL_SEED_ENABLED)
}

+#if BUILDFLAG(FIELDTRIAL_SEED_ENABLED)
platform_field_trials->SetUpClientSideFieldTrials(
create_trials_result.applied_seed, entropy_providers, feature_list.get());
+#endif
+#endif // BUILDFLAG(FIELDTRIAL_SEED_ENABLED)

platform_field_trials->RegisterFeatureOverrides(feature_list.get());

diff --git a/components/variations/synthetic_trial_registry.cc b/components/variations/synthetic_trial_registry.cc
index cd3eac8828f2e..574153fb40bee 100644
index e347472482078..b591cedec0e95 100644
--- a/components/variations/synthetic_trial_registry.cc
+++ b/components/variations/synthetic_trial_registry.cc
@@ -122,6 +122,7 @@ SyntheticTrialRegistry::GetCurrentSyntheticFieldTrialsForTest() const {
@@ -10,6 +10,7 @@
#include "base/observer_list.h"
#include "base/strings/string_number_conversions.h"
#include "components/variations/active_field_trials.h"
+#include "components/variations/common_ext/buildflags.h"
#include "components/variations/hashing.h"
#include "components/variations/variations_associated_data.h"

@@ -122,6 +123,7 @@ SyntheticTrialRegistry::GetCurrentSyntheticFieldTrialsForTest() const {

void SyntheticTrialRegistry::RegisterSyntheticFieldTrial(
const SyntheticTrialGroup& trial) {
+#if defined(FIELDTRIAL_SEED_ENABLED)
+#if BUILDFLAG(FIELDTRIAL_SEED_ENABLED)
for (auto& entry : synthetic_trial_groups_) {
if (entry.id().name == trial.id().name) {
if (entry.id().group != trial.id().group ||
@@ -139,6 +140,7 @@ void SyntheticTrialRegistry::RegisterSyntheticFieldTrial(
@@ -139,6 +141,7 @@ void SyntheticTrialRegistry::RegisterSyntheticFieldTrial(
trial_group.SetStartTime(base::TimeTicks::Now());
synthetic_trial_groups_.push_back(trial_group);
NotifySyntheticTrialObservers({trial_group}, {});
+#endif // defined(FIELDTRIAL_SEED_ENABLED)
+#endif // BUILDFLAG(FIELDTRIAL_SEED_ENABLED)
}

std::string_view SyntheticTrialRegistry::GetStudyNameForExpId(
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Subject: [PATCH] disable navigation error correction by default
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chrome/browser/net/profile_network_context_service.cc b/chrome/browser/net/profile_network_context_service.cc
index a4d22cf5f1618..be06c27627396 100644
index d63b035df4e9e..839d655c890ae 100644
--- a/chrome/browser/net/profile_network_context_service.cc
+++ b/chrome/browser/net/profile_network_context_service.cc
@@ -621,7 +621,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParams(
@@ -622,7 +622,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParams(
void ProfileNetworkContextService::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(embedder_support::kAlternateErrorPagesEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Subject: [PATCH] disable hyperlink auditing by default
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index a582e4069416d..5f93e35e9c570 100644
index b8acad00088e2..1d1be81e66a09 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1419,7 +1419,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
@@ -1462,7 +1462,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
void ChromeContentBrowserClient::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Subject: [PATCH] disable showing popular sites by default
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/components/ntp_tiles/features.cc b/components/ntp_tiles/features.cc
index d142c1aa45e45..fd9e3cb948293 100644
index ad99eb2ce208f..b8cb2f180fd82 100644
--- a/components/ntp_tiles/features.cc
+++ b/components/ntp_tiles/features.cc
@@ -15,7 +15,7 @@ const char kPopularSitesFieldTrialName[] = "NTPPopularSites";
Expand All @@ -22,10 +22,10 @@ index d142c1aa45e45..fd9e3cb948293 100644
BASE_FEATURE(kNtpMostLikelyFaviconsFromServerFeature,
"NTPMostLikelyFaviconsFromServer",
diff --git a/components/ntp_tiles/most_visited_sites.cc b/components/ntp_tiles/most_visited_sites.cc
index 218d9a78014ca..91013a45d4739 100644
index 3adb8ecd37d96..73da0a97054b0 100644
--- a/components/ntp_tiles/most_visited_sites.cc
+++ b/components/ntp_tiles/most_visited_sites.cc
@@ -256,9 +256,11 @@ void MostVisitedSites::AddMostVisitedURLsObserver(Observer* observer,
@@ -260,9 +260,11 @@ void MostVisitedSites::AddMostVisitedURLsObserver(Observer* observer,
if (!is_observing_) {
is_observing_ = true;
if (popular_sites_ && NeedPopularSites(prefs_, GetMaxNumSites())) {
Expand All @@ -37,15 +37,15 @@ index 218d9a78014ca..91013a45d4739 100644
}

if (top_sites_) {
@@ -563,6 +565,7 @@ MostVisitedSites::CreatePopularSitesSections(
@@ -631,6 +633,7 @@ MostVisitedSites::CreatePopularSitesSections(
return sections;
}

+#if defined(ENABLE_POPULAR_SITES)
const std::set<std::string> no_hosts;
for (const auto& section_type_and_sites : popular_sites()->sections()) {
SectionType type = section_type_and_sites.first;
@@ -580,6 +583,7 @@ MostVisitedSites::CreatePopularSitesSections(
@@ -648,6 +651,7 @@ MostVisitedSites::CreatePopularSitesSections(
/*num_max_tiles=*/GetMaxNumSites());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Subject: [PATCH] disable sensors access by default
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
index c9b9e27bc415b..a950ef573bd2b 100644
index 4766cd8817d0b..306114b5ab08d 100644
--- a/components/content_settings/core/browser/content_settings_registry.cc
+++ b/components/content_settings/core/browser/content_settings_registry.cc
@@ -391,7 +391,7 @@ void ContentSettingsRegistry::Init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Subject: [PATCH] disable third party cookies by default
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/content_settings/core/browser/cookie_settings.cc b/components/content_settings/core/browser/cookie_settings.cc
index f5567359dd911..f5fc49d72b392 100644
index b977278ac720e..81348f3d2e272 100644
--- a/components/content_settings/core/browser/cookie_settings.cc
+++ b/components/content_settings/core/browser/cookie_settings.cc
@@ -94,7 +94,7 @@ void CookieSettings::RegisterProfilePrefs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Subject: [PATCH] disable background sync by default
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
index 037d1b14dfd1d..67f34ff0793cf 100644
index 4f5c4d95034f7..d8dc7b39d2707 100644
--- a/components/content_settings/core/browser/content_settings_registry.cc
+++ b/components/content_settings/core/browser/content_settings_registry.cc
@@ -245,7 +245,7 @@ void ContentSettingsRegistry::Init() {
Expand Down
4 changes: 2 additions & 2 deletions vanadium_patches/0032-disable-media-router-by-default.patch
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ index daf9060b81282..0308cf507513f 100644

#if !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS)
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 423606c31de58..0b79f5b3c2791 100644
index 00b5b11b5f9f6..5baa4a4b0e55d 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -428,7 +428,7 @@ void ProfileImpl::RegisterProfilePrefs(
@@ -427,7 +427,7 @@ void ProfileImpl::RegisterProfilePrefs(
#endif

registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ index 52a6425d14309..e12a7e812a86b 100644

// static
diff --git a/components/signin/internal/identity_manager/primary_account_manager.cc b/components/signin/internal/identity_manager/primary_account_manager.cc
index c14327e3d8a35..d8a6c3213b5b8 100644
index 1c62d5a6316d4..fb8475f2b3a8b 100644
--- a/components/signin/internal/identity_manager/primary_account_manager.cc
+++ b/components/signin/internal/identity_manager/primary_account_manager.cc
@@ -331,7 +331,7 @@ void PrimaryAccountManager::RegisterProfilePrefs(PrefRegistrySimple* registry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Subject: [PATCH] disable safe browsing reporting opt-in by default
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/safe_browsing/core/common/safe_browsing_prefs.cc b/components/safe_browsing/core/common/safe_browsing_prefs.cc
index cbda8e4a12003..7ff4f4734706c 100644
index 637e113bbf8eb..6580a1d02e69b 100644
--- a/components/safe_browsing/core/common/safe_browsing_prefs.cc
+++ b/components/safe_browsing/core/common/safe_browsing_prefs.cc
@@ -215,7 +215,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ that privacy is preserved.
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/safe_browsing/core/common/safe_browsing_prefs.cc b/components/safe_browsing/core/common/safe_browsing_prefs.cc
index 7ff4f4734706c..6c95bd72d9151 100644
index 6580a1d02e69b..703319b7045d3 100644
--- a/components/safe_browsing/core/common/safe_browsing_prefs.cc
+++ b/components/safe_browsing/core/common/safe_browsing_prefs.cc
@@ -221,7 +221,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ support is enabled.
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
index c0c4996e01bb7..a72e17d613f53 100644
index e6484141d7ca6..658e3ab45f622 100644
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -1157,7 +1157,7 @@ BASE_FEATURE(kMediaDrmPersistentLicense,
@@ -987,7 +987,7 @@ BASE_FEATURE(MediaDrmPersistentLicense, base::FEATURE_ENABLED_BY_DEFAULT);
// Enables MediaDrmOriginIdManager to provide preprovisioned origin IDs for
// MediaDrmBridge. If disabled, MediaDrmBridge will get unprovisioned origin IDs
// which will trigger provisioning process after MediaDrmBridge is created.
BASE_FEATURE(kMediaDrmPreprovisioning,
"MediaDrmPreprovisioning",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ base::FEATURE_DISABLED_BY_DEFAULT);
-BASE_FEATURE(MediaDrmPreprovisioning, base::FEATURE_ENABLED_BY_DEFAULT);
+BASE_FEATURE(MediaDrmPreprovisioning, base::FEATURE_DISABLED_BY_DEFAULT);

// Determines if MediaDrmOriginIdManager should attempt to pre-provision origin
// IDs at startup (whenever a profile is loaded). Also used by tests that
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Subject: [PATCH] disable autofill server communication by default
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/autofill/core/common/autofill_features.cc b/components/autofill/core/common/autofill_features.cc
index 8be068e424633..c852688c88e1f 100644
index c602fd6a4e275..fda38e51887f4 100644
--- a/components/autofill/core/common/autofill_features.cc
+++ b/components/autofill/core/common/autofill_features.cc
@@ -1044,7 +1044,7 @@ const base::FeatureParam<std::string> kAutofillOverridePredictionsJson{
@@ -1037,7 +1037,7 @@ const base::FeatureParam<std::string> kAutofillOverridePredictionsJson{
// i.e., https://other.autofill.server:port/tbproxy/af/
BASE_FEATURE(kAutofillServerCommunication,
"AutofillServerCommunication",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Subject: [PATCH] disable trivial subdomain hiding
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/components/url_formatter/url_formatter.cc b/components/url_formatter/url_formatter.cc
index a11dcb954fcdc..d526a37b16156 100644
index 6e827a0f9bfc2..d20339c6bb5ca 100644
--- a/components/url_formatter/url_formatter.cc
+++ b/components/url_formatter/url_formatter.cc
@@ -676,8 +676,7 @@ std::u16string FormatUrlWithAdjustments(
Expand Down
Loading