From: uazo 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. --- 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 | 2 +- 4 files changed, 5 insertions(+), 6 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 @@ -4016,9 +4016,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 {"isolate-origins", flag_descriptions::kIsolateOriginsName, flag_descriptions::kIsolateOriginsDescription, 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 @@ -1301,7 +1301,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); } @@ -1315,7 +1315,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 @@ -86,6 +86,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 1) it helps ensure that devices with @@ -101,6 +102,7 @@ bool SiteIsolationPolicy::IsEnterprisePolicyApplicable() { // static bool SiteIsolationPolicy::ShouldDisableSiteIsolationDueToMemoryThreshold( content::SiteIsolationMode site_isolation_mode) { + if ((true)) return false; // The memory threshold behavior differs for desktop and Android: // - Android uses a 1900MB default threshold for partial site isolation modes // and a 3200MB default threshold for strict site isolation. See docs in 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 @@ -953,7 +953,7 @@ const base::Feature kStopVideoCaptureOnScreenLock{ // Controls whether site isolation should use origins instead of scheme and // eTLD+1. const base::Feature kStrictOriginIsolation{"StrictOriginIsolation", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; // Enables subresource loading with Web Bundles. const base::Feature kSubresourceWebBundles{"SubresourceWebBundles", -- 2.25.1