Files
cromite/build/patches/Enable-StrictOriginIsolation-and-SitePerProcess.patch
T
2023-07-14 11:15:04 +02:00

87 lines
4.5 KiB
Diff

From: uazo <uazo@users.noreply.github.com>
Date: Sat, 29 Jan 2022 15:25:19 +0000
Subject: Enable StrictOriginIsolation and SitePerProcess
Enable the StrictOriginIsolation feature and the SitePerProcess preference.
SitePerProcess: bypass any device memory size check.
SitePerProcess: always consider enterprise policies applicable.
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/browser/about_flags.cc | 3 ---
chrome/browser/chrome_content_browser_client.cc | 4 ++--
components/site_isolation/site_isolation_policy.cc | 2 ++
content/public/common/content_features.cc | 4 ++--
4 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4773,9 +4773,6 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kSiteIsolationForPasswordSitesDescription, kOsAndroid,
FEATURE_VALUE_TYPE(
site_isolation::features::kSiteIsolationForPasswordSites)},
- {"enable-site-per-process", flag_descriptions::kStrictSiteIsolationName,
- flag_descriptions::kStrictSiteIsolationDescription, kOsAndroid,
- SINGLE_VALUE_TYPE(switches::kSitePerProcess)},
#endif
{"enable-isolated-web-apps", flag_descriptions::kEnableIsolatedWebAppsName,
flag_descriptions::kEnableIsolatedWebAppsDescription, kOsAll,
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
@@ -1575,7 +1575,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
registry->RegisterFilePathPref(prefs::kDiskCacheDir, base::FilePath());
registry->RegisterIntegerPref(prefs::kDiskCacheSize, 0);
registry->RegisterStringPref(prefs::kIsolateOrigins, std::string());
- registry->RegisterBooleanPref(prefs::kSitePerProcess, false);
+ registry->RegisterBooleanPref(prefs::kSitePerProcess, true);
registry->RegisterBooleanPref(prefs::kTabFreezingEnabled, true);
registry->RegisterIntegerPref(prefs::kSCTAuditingHashdanceReportCount, 0);
registry->RegisterBooleanPref(
@@ -1597,7 +1597,7 @@ void ChromeContentBrowserClient::RegisterProfilePrefs(
// user policy in addition to the same named ones in Local State (which are
// used for mapping the command-line flags).
registry->RegisterStringPref(prefs::kIsolateOrigins, std::string());
- registry->RegisterBooleanPref(prefs::kSitePerProcess, false);
+ registry->RegisterBooleanPref(prefs::kSitePerProcess, true);
registry->RegisterListPref(
site_isolation::prefs::kUserTriggeredIsolatedOrigins);
registry->RegisterDictionaryPref(
diff --git a/components/site_isolation/site_isolation_policy.cc b/components/site_isolation/site_isolation_policy.cc
--- a/components/site_isolation/site_isolation_policy.cc
+++ b/components/site_isolation/site_isolation_policy.cc
@@ -164,6 +164,7 @@ bool SiteIsolationPolicy::IsIsolationForOAuthSitesEnabled() {
// static
bool SiteIsolationPolicy::IsEnterprisePolicyApplicable() {
+ if ((true)) return true;
#if BUILDFLAG(IS_ANDROID)
// https://crbug.com/844118: Limiting policy to devices with > 1GB RAM.
// Using 1077 rather than 1024 because it helps ensure that devices with
@@ -179,6 +180,7 @@ bool SiteIsolationPolicy::IsEnterprisePolicyApplicable() {
// static
bool SiteIsolationPolicy::ShouldDisableSiteIsolationDueToMemoryThreshold(
content::SiteIsolationMode site_isolation_mode) {
+ if ((true)) return false;
if (!g_disallow_memory_threshold_caching_for_testing) {
return CachedDisableSiteIsolation(site_isolation_mode);
}
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -1269,8 +1269,8 @@ BASE_FEATURE(kStopVideoCaptureOnScreenLock,
// Controls whether site isolation should use origins instead of scheme and
// eTLD+1.
BASE_FEATURE(kStrictOriginIsolation,
- "StrictOriginIsolation",
- base::FEATURE_DISABLED_BY_DEFAULT);
+ "StrictOriginIsolation", // must be enabled
+ base::FEATURE_ENABLED_BY_DEFAULT); // in Bromite
// Disallows window.{alert, prompt, confirm} if triggered inside a subframe that
// is not same origin with the main frame.
--
2.25.1