From b10fafa0a31e9881bcbfce3b53912a436eb65b0a Mon Sep 17 00:00:00 2001 From: zouzhiwei Date: Mon, 4 Mar 2024 15:17:00 +0800 Subject: [PATCH] site_isolation Signed-off-by: zouzhiwei --- libcef/browser/alloy/alloy_content_browser_client.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index 7506570a1..fee0d8e5b 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -3052,14 +3052,19 @@ static bool GetLockdownModeStatus() { return system_properties_adapter.GetLockdownModeStatus(); } +bool IsMultipleRenderProcess() { + return (*base::CommandLite::ForCurrentProcess()) + .HasSwitch(switches::kForBrowser); +} + bool AlloyContentBrowserClient::ShouldDisableSiteIsolation( content::SiteIsolationMode site_isolation_mode) { - if (base::ohos::IsPcDevice()) { + if (base::ohos::IsPcDevice() || base::ohos::IsTabletDevice()) { return site_isolation::SiteIsolationPolicy:: ShouldDisableSiteIsolationDueToMemoryThreshold(site_isolation_mode); } else { bool isLockdownModeEnabled = GetLockdownModeStatus(); - if(isLockdownModeEnabled) { + if(isLockdownModeEnabled && IsMultipleRenderProcess()) { return site_isolation::SiteIsolationPolicy:: ShouldDisableSiteIsolationDueToMemoryThreshold(site_isolation_mode); } else { -- Gitee