CEF cookie fixes (#2934)

* Trying to get res:// and usr:// cookies to wrok

* Update CefGlue

* Bump CEF

* Seal types in WebView

Fixes warnings

* Move most of client cleanup to game thread.

This used to run in the windowing thread which broke CEF shutdown, most notably cookie saving.

* "flushcookies" command for CEF.

* Remove unecessary res:// code.

* Fix tests

* More request handler fixes.

* Good thing I don't have to care about commit quality in PRs like this.
This commit is contained in:
Pieter-Jan Briers
2022-06-10 14:30:57 +02:00
committed by GitHub
parent 776669b789
commit 05bb361eb2
12 changed files with 75 additions and 71 deletions

View File

@@ -5,7 +5,7 @@ using Xilium.CefGlue;
namespace Robust.Client.WebView.Cef
{
internal class RobustCefApp : CefApp
internal sealed class RobustCefApp : CefApp
{
private readonly BrowserProcessHandler _browserProcessHandler = new();
private readonly RenderProcessHandler _renderProcessHandler = new();
@@ -24,12 +24,12 @@ namespace Robust.Client.WebView.Cef
{
// Disable zygote on Linux.
commandLine.AppendSwitch("--no-zygote");
// Work around https://bitbucket.org/chromiumembedded/cef/issues/3213/ozone-egl-initialization-does-not-have
// Desktop GL force makes Chromium not try to load its own ANGLE/Swiftshader so load paths aren't problematic.
if (OperatingSystem.IsLinux())
commandLine.AppendSwitch("--use-gl", "desktop");
// commandLine.AppendSwitch("--single-process");
//commandLine.AppendSwitch("--disable-gpu");
@@ -43,12 +43,18 @@ namespace Robust.Client.WebView.Cef
Logger.Debug($"{commandLine}");
}
private class BrowserProcessHandler : CefBrowserProcessHandler
protected override void OnRegisterCustomSchemes(CefSchemeRegistrar registrar)
{
registrar.AddCustomScheme("res", CefSchemeOptions.Secure | CefSchemeOptions.Standard);
registrar.AddCustomScheme("usr", CefSchemeOptions.Secure | CefSchemeOptions.Standard);
}
private sealed class BrowserProcessHandler : CefBrowserProcessHandler
{
}
// TODO CEF: Research - Is this even needed?
private class RenderProcessHandler : CefRenderProcessHandler
private sealed class RenderProcessHandler : CefRenderProcessHandler
{
}
}