From 43321f74e6af8301bcd6e054cb1b66bddcd3e731 Mon Sep 17 00:00:00 2001 From: Alex Maitland Date: Sun, 16 Jun 2024 08:37:16 +1000 Subject: [PATCH] WinForms/WPF/OffScreen - Change to using Chrome bootstrap by default Issue #4835 --- CefSharp.Example/CefExample.cs | 4 ---- CefSharp.OffScreen.Example/Program.cs | 1 - CefSharp.OffScreen/CefSettings.cs | 1 + CefSharp.Test/CefSharpFixture.cs | 1 - CefSharp.WinForms.Example/Program.cs | 2 -- CefSharp.WinForms/CefSettings.cs | 7 +++++++ CefSharp.Wpf.Example/App.xaml.cs | 1 - CefSharp.Wpf/CefSettings.cs | 1 + 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CefSharp.Example/CefExample.cs b/CefSharp.Example/CefExample.cs index 04645f15fe..f5ba6344a8 100644 --- a/CefSharp.Example/CefExample.cs +++ b/CefSharp.Example/CefExample.cs @@ -161,10 +161,6 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser //settings.LogSeverity = LogSeverity.Verbose; - //Experimental setting see https://github.com/chromiumembedded/cef/issues/2969 - //for details - //settings.ChromeRuntime = true; - if (DebuggingSubProcess) { var architecture = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); diff --git a/CefSharp.OffScreen.Example/Program.cs b/CefSharp.OffScreen.Example/Program.cs index 1e0c8a5256..4efbbd9f2f 100644 --- a/CefSharp.OffScreen.Example/Program.cs +++ b/CefSharp.OffScreen.Example/Program.cs @@ -35,7 +35,6 @@ public static int Main(string[] args) Cef.EnableWaitForBrowsersToClose(); var settings = new CefSettings(); - settings.ChromeRuntime = true; //The location where cache data will be stored on disk. If empty an in-memory cache will be used for some features and a temporary disk cache for others. //HTML5 databases such as localStorage will only persist across sessions if a cache path is specified. settings.CachePath = Path.GetFullPath("cache"); diff --git a/CefSharp.OffScreen/CefSettings.cs b/CefSharp.OffScreen/CefSettings.cs index 1a95225bca..d78d303532 100644 --- a/CefSharp.OffScreen/CefSettings.cs +++ b/CefSharp.OffScreen/CefSettings.cs @@ -16,6 +16,7 @@ public class CefSettings : CefSettingsBase public CefSettings() : base() { WindowlessRenderingEnabled = true; + ChromeRuntime = true; //For OffScreen it doesn't make much sense to enable audio by default, so we disable it. //this can be removed in user code if required diff --git a/CefSharp.Test/CefSharpFixture.cs b/CefSharp.Test/CefSharpFixture.cs index b8f8f29c6b..275b20bde2 100644 --- a/CefSharp.Test/CefSharpFixture.cs +++ b/CefSharp.Test/CefSharpFixture.cs @@ -56,7 +56,6 @@ private void CefInitialize() //HTML5 databases such as localStorage will only persist across sessions if a cache path is specified. settings.CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Tests\\Cache"); settings.RootCachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Tests"); - settings.ChromeRuntime = true; //settings.CefCommandLineArgs.Add("renderer-startup-dialog"); //settings.CefCommandLineArgs.Add("disable-site-isolation-trials"); diff --git a/CefSharp.WinForms.Example/Program.cs b/CefSharp.WinForms.Example/Program.cs index 098f4ad006..67366a48f0 100644 --- a/CefSharp.WinForms.Example/Program.cs +++ b/CefSharp.WinForms.Example/Program.cs @@ -41,7 +41,6 @@ public static int Main(string[] args) var settings = new CefSettings(); settings.BrowserSubprocessPath = System.IO.Path.GetFullPath("CefSharp.WinForms.Example.exe"); - settings.ChromeRuntime = true; Cef.Initialize(settings); @@ -96,7 +95,6 @@ public static int Main(string[] args) var settings = new CefSettings(); settings.MultiThreadedMessageLoop = multiThreadedMessageLoop; settings.ExternalMessagePump = externalMessagePump; - settings.ChromeRuntime = true; CefExample.Init(settings, browserProcessHandler: browserProcessHandler); diff --git a/CefSharp.WinForms/CefSettings.cs b/CefSharp.WinForms/CefSettings.cs index 050f91b2d4..e0731eb79c 100644 --- a/CefSharp.WinForms/CefSettings.cs +++ b/CefSharp.WinForms/CefSettings.cs @@ -10,5 +10,12 @@ namespace CefSharp.WinForms /// public class CefSettings : CefSettingsBase { + /// + /// Intialize with default values + /// + public CefSettings() : base() + { + ChromeRuntime = true; + } } } diff --git a/CefSharp.Wpf.Example/App.xaml.cs b/CefSharp.Wpf.Example/App.xaml.cs index 817b53d620..23eba51f98 100644 --- a/CefSharp.Wpf.Example/App.xaml.cs +++ b/CefSharp.Wpf.Example/App.xaml.cs @@ -41,7 +41,6 @@ protected override void OnStartup(StartupEventArgs e) var settings = new CefSettings(); settings.MultiThreadedMessageLoop = multiThreadedMessageLoop; settings.ExternalMessagePump = !multiThreadedMessageLoop; - settings.ChromeRuntime = true; CefExample.Init(settings, browserProcessHandler: browserProcessHandler); diff --git a/CefSharp.Wpf/CefSettings.cs b/CefSharp.Wpf/CefSettings.cs index f9d3af16e5..db895d2dec 100644 --- a/CefSharp.Wpf/CefSettings.cs +++ b/CefSharp.Wpf/CefSettings.cs @@ -16,6 +16,7 @@ public class CefSettings : CefSettingsBase public CefSettings() : base() { WindowlessRenderingEnabled = true; + ChromeRuntime = true; //Disable multithreaded, compositor scrolling of web content //With OSR rendering it's fairly common for this to improve scrolling performace