Skip to content

Commit f43e695

Browse files
quh4gko8thestinger
authored andcommitted
Update/port patches for 133.0.6943.39.1
1 parent 59cb30c commit f43e695

4 files changed

+191
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: fgei <fgei@gmail.com>
3+
Date: Thu, 30 Jan 2025 14:11:07 +0000
4+
Subject: [PATCH] Extend site setting category visibility check on single
5+
website settings
6+
7+
---
8+
.../browser_ui/site_settings/SingleWebsiteSettings.java | 4 ++++
9+
1 file changed, 4 insertions(+)
10+
11+
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
12+
index 3fbd349284c41..123e8c5f578e4 100644
13+
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
14+
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
15+
@@ -1177,6 +1177,10 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment
16+
SiteSettingsCategory category =
17+
SiteSettingsCategory.createFromContentSettingsType(
18+
getSiteSettingsDelegate().getBrowserContextHandle(), contentType);
19+
+ if (!getSiteSettingsDelegate().isCategoryVisible(category.getType())) {
20+
+ return;
21+
+ }
22+
+
23+
if (category != null
24+
&& value != null
25+
&& value != ContentSettingValues.BLOCK
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: fgei <fgei@gmail.com>
3+
Date: Thu, 30 Jan 2025 14:04:16 +0000
4+
Subject: [PATCH] Remove javascript optimizer settings UI link on Privacy &
5+
Security section
6+
7+
---
8+
.../chrome/browser/privacy/settings/PrivacySettingsExt.java | 2 ++
9+
1 file changed, 2 insertions(+)
10+
11+
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java
12+
index 6f946398fbab4..6c287e0c17852 100644
13+
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java
14+
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java
15+
@@ -77,6 +77,8 @@ final class PrivacySettingsExt {
16+
prefFragment, PrivacySettings.PREF_PRIVACY_SANDBOX);
17+
SettingsExtUtils.safelyRemovePreference(
18+
prefFragment, PrivacySettings.PREF_PRIVACY_GUIDE);
19+
+ SettingsExtUtils.safelyRemovePreference(
20+
+ prefFragment, PrivacySettings.PREF_JAVASCRIPT_OPTIMIZER);
21+
}
22+
23+
static void initializePreferences(@NonNull PreferenceFragmentCompat prefFragment, @NonNull Profile profile) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: fgei <fgei@gmail.com>
3+
Date: Thu, 30 Jan 2025 14:05:11 +0000
4+
Subject: [PATCH] Remove javascript optimizer settings UI
5+
6+
---
7+
.../browser/site_settings/ChromeSiteSettingsDelegate.java | 2 ++
8+
1 file changed, 2 insertions(+)
9+
10+
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java
11+
index d2f1a5bc7fe8d..66f21c2f0d794 100644
12+
--- a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java
13+
+++ b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java
14+
@@ -173,6 +173,8 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate {
15+
case SiteSettingsCategory.Type.ZOOM:
16+
return ContentFeatureMap.isEnabled(
17+
ContentFeatureList.ACCESSIBILITY_PAGE_ZOOM_ENHANCEMENTS);
18+
+ case SiteSettingsCategory.Type.JAVASCRIPT_OPTIMIZER:
19+
+ return false;
20+
default:
21+
return true;
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: fgei <fgei@gmail.com>
3+
Date: Thu, 30 Jan 2025 15:04:31 +0000
4+
Subject: [PATCH] Reset saved javascript optimizer site setting
5+
6+
With the existence of Javascript JIT site setting UI shown in Vanadium
7+
which fully disables JIT instead of only disabling the optimizers, the
8+
added setting upstream for disabling only the optimizers doesn't
9+
provide as much additional protection as stated in its upstream
10+
description.
11+
12+
Earlier commits have removed Javascript (JIT) optimizer site setting and
13+
its link to avoid confusion.
14+
15+
Based on removal of Javascript JIT site settings at:
16+
https://chromium-review.googlesource.com/c/chromium/src/+/5840556
17+
---
18+
.../content_settings_default_provider.cc | 25 +++++++++++++++++++
19+
.../browser/content_settings_pref_provider.cc | 25 +++++++++++++++++++
20+
2 files changed, 50 insertions(+)
21+
22+
diff --git a/components/content_settings/core/browser/content_settings_default_provider.cc b/components/content_settings/core/browser/content_settings_default_provider.cc
23+
index c95ef8807f4a6..f5aef98bfd47a 100644
24+
--- a/components/content_settings/core/browser/content_settings_default_provider.cc
25+
+++ b/components/content_settings/core/browser/content_settings_default_provider.cc
26+
@@ -119,6 +119,20 @@ class DefaultRuleIterator : public RuleIterator {
27+
28+
} // namespace
29+
30+
+namespace {
31+
+
32+
+// Site settings removed downstream, or currently not meant for usage
33+
+#if BUILDFLAG(IS_ANDROID)
34+
+// TODO: Expose this again as an additional option to Javascript JIT
35+
+// site settings UI option in Android
36+
+constexpr char kDownstreamJavascriptOptimizerSettingToClear[] =
37+
+ "profile.default_content_setting_values.javascript_optimizer";
38+
+constexpr char kDownstreamJavascriptOptimizerSettingAlreadyWorkedAroundPref[] =
39+
+ "profile.did_work_around_downstream_javascript_optimizer_default";
40+
+#endif // BUILDFLAG(IS_ANDROID)
41+
+
42+
+} // namespace
43+
+
44+
// static
45+
void DefaultProvider::RegisterProfilePrefs(
46+
user_prefs::PrefRegistrySyncable* registry) {
47+
@@ -155,6 +169,10 @@ void DefaultProvider::RegisterProfilePrefs(
48+
// TODO(https://crbug.com/367181093): clean this up.
49+
registry->RegisterBooleanPref(kBug364820109AlreadyWorkedAroundPref, false);
50+
#endif // !BUILDFLAG(IS_IOS) && !BUILDFLAG(IS_ANDROID)
51+
+
52+
+#if BUILDFLAG(IS_ANDROID)
53+
+ registry->RegisterBooleanPref(kDownstreamJavascriptOptimizerSettingAlreadyWorkedAroundPref, false);
54+
+#endif // BUILDFLAG(IS_ANDROID)
55+
}
56+
57+
DefaultProvider::DefaultProvider(PrefService* prefs,
58+
@@ -399,6 +417,13 @@ void DefaultProvider::DiscardOrMigrateObsoletePreferences() {
59+
prefs_->SetBoolean(kBug364820109AlreadyWorkedAroundPref, true);
60+
}
61+
#endif // !BUILDFLAG(IS_IOS) && !BUILDFLAG(IS_ANDROID)
62+
+
63+
+#if BUILDFLAG(IS_ANDROID)
64+
+ if (!prefs_->GetBoolean(kDownstreamJavascriptOptimizerSettingAlreadyWorkedAroundPref)) {
65+
+ prefs_->ClearPref(kDownstreamJavascriptOptimizerSettingToClear);
66+
+ prefs_->SetBoolean(kDownstreamJavascriptOptimizerSettingAlreadyWorkedAroundPref, true);
67+
+ }
68+
+#endif // BUILDFLAG(IS_ANDROID)
69+
}
70+
71+
void DefaultProvider::RecordHistogramMetrics() {
72+
diff --git a/components/content_settings/core/browser/content_settings_pref_provider.cc b/components/content_settings/core/browser/content_settings_pref_provider.cc
73+
index 98cdc365086bc..48c9d57f3c99c 100644
74+
--- a/components/content_settings/core/browser/content_settings_pref_provider.cc
75+
+++ b/components/content_settings/core/browser/content_settings_pref_provider.cc
76+
@@ -72,6 +72,20 @@ constexpr char kBug364820109AlreadyWorkedAroundPref[] =
77+
78+
} // namespace
79+
80+
+namespace {
81+
+
82+
+// Site settings removed downstream, or currently not meant for usage
83+
+#if BUILDFLAG(IS_ANDROID)
84+
+// TODO: Expose this again as an additional option to Javascript JIT
85+
+// site settings UI option in Android
86+
+constexpr char kDownstreamJavascriptOptimizerSettingToClear[] =
87+
+ "profile.content_settings.exceptions.javascript_optimizer";
88+
+constexpr char kDownstreamJavascriptOptimizerSettingAlreadyWorkedAroundPref[] =
89+
+ "profile.did_work_around_downstream_javascript_optimizer_exceptions";
90+
+#endif // BUILDFLAG(IS_ANDROID)
91+
+
92+
+} // namespace
93+
+
94+
// ////////////////////////////////////////////////////////////////////////////
95+
// PrefProvider:
96+
//
97+
@@ -110,6 +124,10 @@ void PrefProvider::RegisterProfilePrefs(
98+
// TODO(https://crbug.com/367181093): clean this up.
99+
registry->RegisterBooleanPref(kBug364820109AlreadyWorkedAroundPref, false);
100+
#endif // !BUILDFLAG(IS_IOS) && !BUILDFLAG(IS_ANDROID)
101+
+
102+
+#if BUILDFLAG(IS_ANDROID)
103+
+ registry->RegisterBooleanPref(kDownstreamJavascriptOptimizerSettingAlreadyWorkedAroundPref, false);
104+
+#endif // BUILDFLAG(IS_ANDROID)
105+
}
106+
107+
PrefProvider::PrefProvider(PrefService* prefs,
108+
@@ -451,6 +469,13 @@ void PrefProvider::DiscardOrMigrateObsoletePreferences() {
109+
prefs_->SetBoolean(kBug364820109AlreadyWorkedAroundPref, true);
110+
}
111+
#endif // !BUILDFLAG(IS_IOS) && !BUILDFLAG(IS_ANDROID)
112+
+ //
113+
+#if BUILDFLAG(IS_ANDROID)
114+
+ if (!prefs_->GetBoolean(kDownstreamJavascriptOptimizerSettingAlreadyWorkedAroundPref)) {
115+
+ prefs_->ClearPref(kDownstreamJavascriptOptimizerSettingToClear);
116+
+ prefs_->SetBoolean(kDownstreamJavascriptOptimizerSettingAlreadyWorkedAroundPref, true);
117+
+ }
118+
+#endif // BUILDFLAG(IS_ANDROID)
119+
}
120+
121+
void PrefProvider::SetClockForTesting(const base::Clock* clock) {

0 commit comments

Comments
 (0)