1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-08-14 21:42:50 +02:00

Update to CEF 96.0.17

Call SetProcessShutdownParameters with the same parameter values as Chromium does.
Fixed some backwards compatibility issues
This commit is contained in:
salvadordf
2021-12-08 17:45:03 +01:00
parent 668e4ab25f
commit 6393b6f480
10 changed files with 61 additions and 37 deletions

View File

@@ -3,16 +3,16 @@ CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chro
CEF4Delphi is based on DCEF3 and fpCEF3. The original license of those projects still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file. CEF4Delphi is based on DCEF3 and fpCEF3. The original license of those projects still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
CEF4Delphi uses CEF 96.0.16 which includes Chromium 96.0.4664.55. CEF4Delphi uses CEF 96.0.17 which includes Chromium 96.0.4664.93.
The CEF binaries used by CEF4Delphi are available for download at Spotify : The CEF binaries used by CEF4Delphi are available for download at Spotify :
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.16%2Bg89c902b%2Bchromium-96.0.4664.55_windows32.tar.bz2) * [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.17%2Bg20e2617%2Bchromium-96.0.4664.93_windows32.tar.bz2)
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.16%2Bg89c902b%2Bchromium-96.0.4664.55_windows64.tar.bz2) * [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.17%2Bg20e2617%2Bchromium-96.0.4664.93_windows64.tar.bz2)
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.16%2Bg89c902b%2Bchromium-96.0.4664.55_linux32.tar.bz2) * [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.17%2Bg20e2617%2Bchromium-96.0.4664.93_linux32.tar.bz2)
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.16%2Bg89c902b%2Bchromium-96.0.4664.55_linux64.tar.bz2) * [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.17%2Bg20e2617%2Bchromium-96.0.4664.93_linux64.tar.bz2)
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.16%2Bg89c902b%2Bchromium-96.0.4664.55_linuxarm.tar.bz2) * [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.17%2Bg20e2617%2Bchromium-96.0.4664.93_linuxarm.tar.bz2)
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.16%2Bg89c902b%2Bchromium-96.0.4664.55_linuxarm64.tar.bz2) * [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.17%2Bg20e2617%2Bchromium-96.0.4664.93_linuxarm64.tar.bz2)
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.16%2Bg89c902b%2Bchromium-96.0.4664.55_macosx64.tar.bz2) * [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_96.0.17%2Bg20e2617%2Bchromium-96.0.4664.93_macosx64.tar.bz2)
CEF4Delphi was developed and tested on Delphi 11.0 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3, Delphi 10.4 and Lazarus 2.2.0RC2/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components. CEF4Delphi was developed and tested on Delphi 11.0 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3, Delphi 10.4 and Lazarus 2.2.0RC2/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
@@ -38,8 +38,7 @@ You can also support this project with Patreon.
Additional: Additional:
Delphinus-Support Delphinus-Support
## Attribution ## Related projects
Other projects :
* [WebView4Delphi](https://github.com/salvadordf/WebView4Delphi) * [WebView4Delphi](https://github.com/salvadordf/WebView4Delphi)
* [DCEF3](https://github.com/hgourvest/dcef3) * [DCEF3](https://github.com/hgourvest/dcef3)
* [fpCEF3](https://github.com/dliw/fpCEF3) * [fpCEF3](https://github.com/dliw/fpCEF3)

View File

@@ -21,7 +21,7 @@
</CompilerOptions> </CompilerOptions>
<Description Value="CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC."/> <Description Value="CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC."/>
<License Value="MPL 1.1"/> <License Value="MPL 1.1"/>
<Version Major="96" Release="16"/> <Version Major="96" Release="17"/>
<Files Count="203"> <Files Count="203">
<Item1> <Item1>
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/> <Filename Value="..\source\uCEFAccessibilityHandler.pas"/>

View File

@@ -66,13 +66,13 @@ uses
const const
CEF_SUPPORTED_VERSION_MAJOR = 96; CEF_SUPPORTED_VERSION_MAJOR = 96;
CEF_SUPPORTED_VERSION_MINOR = 0; CEF_SUPPORTED_VERSION_MINOR = 0;
CEF_SUPPORTED_VERSION_RELEASE = 16; CEF_SUPPORTED_VERSION_RELEASE = 17;
CEF_SUPPORTED_VERSION_BUILD = 0; CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = 96; CEF_CHROMEELF_VERSION_MAJOR = 96;
CEF_CHROMEELF_VERSION_MINOR = 0; CEF_CHROMEELF_VERSION_MINOR = 0;
CEF_CHROMEELF_VERSION_RELEASE = 4664; CEF_CHROMEELF_VERSION_RELEASE = 4664;
CEF_CHROMEELF_VERSION_BUILD = 55; CEF_CHROMEELF_VERSION_BUILD = 93;
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
LIBCEF_DLL = 'libcef.dll'; LIBCEF_DLL = 'libcef.dll';
@@ -493,7 +493,7 @@ type
property HyperlinkAuditing : boolean read FHyperlinkAuditing write FHyperlinkAuditing; // --no-pings property HyperlinkAuditing : boolean read FHyperlinkAuditing write FHyperlinkAuditing; // --no-pings
property DisableNewBrowserInfoTimeout : boolean read FDisableNewBrowserInfoTimeout write FDisableNewBrowserInfoTimeout; // --disable-new-browser-info-timeout property DisableNewBrowserInfoTimeout : boolean read FDisableNewBrowserInfoTimeout write FDisableNewBrowserInfoTimeout; // --disable-new-browser-info-timeout
property DevToolsProtocolLogFile : ustring read FDevToolsProtocolLogFile write FDevToolsProtocolLogFile; // --devtools-protocol-log-file property DevToolsProtocolLogFile : ustring read FDevToolsProtocolLogFile write FDevToolsProtocolLogFile; // --devtools-protocol-log-file
property ForcedDeviceScaleFactor : single read FForcedDeviceScaleFactor write FForcedDeviceScaleFactor; // --device-scale-factor property ForcedDeviceScaleFactor : single read FForcedDeviceScaleFactor write FForcedDeviceScaleFactor; // --force-device-scale-factor
property DisableZygote : boolean read FDisableZygote write FDisableZygote; // --no-zygote property DisableZygote : boolean read FDisableZygote write FDisableZygote; // --no-zygote
property UseMockKeyChain : boolean read FUseMockKeyChain write FUseMockKeyChain; // --use-mock-keychain property UseMockKeyChain : boolean read FUseMockKeyChain write FUseMockKeyChain; // --use-mock-keychain
property DisableRequestHandlingForTesting : boolean read FDisableRequestHandlingForTesting write FDisableRequestHandlingForTesting; // --disable-request-handling-for-testing property DisableRequestHandlingForTesting : boolean read FDisableRequestHandlingForTesting write FDisableRequestHandlingForTesting; // --disable-request-handling-for-testing
@@ -787,7 +787,7 @@ begin
// The main browser process will receive WM_QUERYENDSESSION before the subprocesses // The main browser process will receive WM_QUERYENDSESSION before the subprocesses
// and that allows to close the application in the right order. // and that allows to close the application in the right order.
// See the MiniBrowser demo for all the details. // See the MiniBrowser demo for all the details.
SetProcessShutdownParameters($100, SHUTDOWN_NORETRY); SetProcessShutdownParameters(CHROMIUM_NONBROWSERSHUTDOWNPRIORITY - 1, SHUTDOWN_NORETRY);
{$ENDIF} {$ENDIF}
// Internal filelds // Internal filelds

View File

@@ -769,7 +769,6 @@ type
procedure ClearDataForOrigin(const aOrigin : ustring; aStorageTypes : TCefClearDataStorageTypes = cdstAll); procedure ClearDataForOrigin(const aOrigin : ustring; aStorageTypes : TCefClearDataStorageTypes = cdstAll);
procedure ClearCache; procedure ClearCache;
function DeleteCookies(const url : ustring = ''; const cookieName : ustring = ''; aDeleteImmediately : boolean = False) : boolean; function DeleteCookies(const url : ustring = ''; const cookieName : ustring = ''; aDeleteImmediately : boolean = False) : boolean;
function VisitAllCookies(aID : integer = 0) : boolean; function VisitAllCookies(aID : integer = 0) : boolean;
function VisitURLCookies(const url : ustring; includeHttpOnly : boolean = False; aID : integer = 0) : boolean; function VisitURLCookies(const url : ustring; includeHttpOnly : boolean = False; aID : integer = 0) : boolean;

View File

@@ -681,6 +681,11 @@ const
USER_DEFAULT_SCREEN_DPI = 96; USER_DEFAULT_SCREEN_DPI = 96;
{$IFEND} {$IFEND}
// This constant is defined by Chromium in chrome/app/main_dll_loader_win.cc
// It's used with SetProcessShutdownParameters to set a shutdown priority for the
// subprocesses. $280 is the default value for applications.
CHROMIUM_NONBROWSERSHUTDOWNPRIORITY = $280;
{$IF NOT DECLARED(INFINITE)} {$IF NOT DECLARED(INFINITE)}
INFINITE = Cardinal($FFFFFFFF); INFINITE = Cardinal($FFFFFFFF);
{$IFEND} {$IFEND}

View File

@@ -48,7 +48,7 @@ uses
System.SyncObjs, System.SyncObjs,
{$ENDIF} {$ENDIF}
System.Classes, System.UIConsts, System.Types, System.UITypes, System.Classes, System.UIConsts, System.Types, System.UITypes,
{$IFDEF DELPHI17_UP} {$IFDEF DELPHI19_UP}
FMX.Graphics, FMX.Graphics,
{$ENDIF} {$ENDIF}
FMX.Types, FMX.Controls, FMX.Forms, FMX.Types, FMX.Controls, FMX.Forms,
@@ -123,7 +123,6 @@ type
property HighSpeedDrawing : boolean read FHighSpeedDrawing write FHighSpeedDrawing default True; property HighSpeedDrawing : boolean read FHighSpeedDrawing write FHighSpeedDrawing default True;
{$IFDEF DELPHI17_UP} {$IFDEF DELPHI17_UP}
property TabStop;
property CanFocus; property CanFocus;
property CanParentFocus; property CanParentFocus;
property Height; property Height;
@@ -135,6 +134,9 @@ type
property RotationAngle; property RotationAngle;
property RotationCenter; property RotationCenter;
property Scale; property Scale;
{$ENDIF}
{$IFDEF DELPHI18_UP}
property TabStop;
property Size; property Size;
property OnResized; property OnResized;
{$ENDIF} {$ENDIF}
@@ -162,7 +164,7 @@ implementation
uses uses
System.SysUtils, System.Math, System.SysUtils, System.Math,
{$IFDEF MSWINDOWS}FMX.Helpers.Win,{$ENDIF} {$IFDEF MSWINDOWS}{$IFDEF DELPHI24_UP}FMX.Helpers.Win,{$ENDIF}{$ENDIF}
FMX.Platform, {$IFDEF MACOS}FMX.Platform.Mac,{$ENDIF} FMX.Platform, {$IFDEF MACOS}FMX.Platform.Mac,{$ENDIF}
uCEFMiscFunctions, uCEFApplicationCore; uCEFMiscFunctions, uCEFApplicationCore;
@@ -468,21 +470,27 @@ begin
end; end;
function TFMXBufferPanel.UpdateBufferDimensions(aWidth, aHeight : integer) : boolean; function TFMXBufferPanel.UpdateBufferDimensions(aWidth, aHeight : integer) : boolean;
{$IFDEF DELPHI18_UP}
var var
TempScale : single; TempScale : single;
{$ENDIF}
begin begin
Result := False; Result := False;
{$IFDEF DELPHI18_UP}
TempScale := ScreenScale; TempScale := ScreenScale;
{$ENDIF}
if ((FBuffer = nil) or if ((FBuffer = nil) or
{$IFDEF DELPHI18_UP}
(FBuffer.BitmapScale <> TempScale) or (FBuffer.BitmapScale <> TempScale) or
{$ENDIF}
(FBuffer.Width <> aWidth) or (FBuffer.Width <> aWidth) or
(FBuffer.Height <> aHeight)) then (FBuffer.Height <> aHeight)) then
begin begin
if (FBuffer <> nil) then FreeAndNil(FBuffer); if (FBuffer <> nil) then FreeAndNil(FBuffer);
FBuffer := TBitmap.Create(aWidth, aHeight); FBuffer := TBitmap.Create(aWidth, aHeight);
{$IFDEF DELPHI17_UP} {$IFDEF DELPHI18_UP}
FBuffer.BitmapScale := TempScale; FBuffer.BitmapScale := TempScale;
FScanlineSize := FBuffer.BytesPerLine; FScanlineSize := FBuffer.BytesPerLine;
{$ELSE} {$ELSE}
@@ -506,7 +514,9 @@ begin
TempHeight := round(Height * TempScale); TempHeight := round(Height * TempScale);
Result := (FBuffer <> nil) and Result := (FBuffer <> nil) and
{$IFDEF DELPHI18_UP}
(FBuffer.BitmapScale = TempScale) and (FBuffer.BitmapScale = TempScale) and
{$ENDIF}
(FBuffer.Width = TempWidth) and (FBuffer.Width = TempWidth) and
(FBuffer.Height = TempHeight); (FBuffer.Height = TempHeight);

View File

@@ -49,7 +49,10 @@ uses
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
WinApi.Windows, WinApi.Messages, FMX.Platform.Win, WinApi.Windows, WinApi.Messages, FMX.Platform.Win,
{$ENDIF} {$ENDIF}
FMX.Types, FMX.Platform, FMX.Forms, FMX.Controls, FMX.Graphics, FMX.Types, FMX.Platform, FMX.Forms, FMX.Controls,
{$IFDEF DELPHI19_UP}
FMX.Graphics,
{$ENDIF}
uCEFTypes, uCEFInterfaces, uCEFChromiumCore; uCEFTypes, uCEFInterfaces, uCEFChromiumCore;
type type
@@ -109,7 +112,7 @@ type
implementation implementation
uses uses
{$IFDEF MSWINDOWS}FMX.Helpers.Win,{$ENDIF} {$IFDEF MSWINDOWS}{$IFDEF DELPHI24_UP}FMX.Helpers.Win,{$ENDIF}{$ENDIF}
System.SysUtils, System.Math, System.SysUtils, System.Math,
uCEFApplicationCore; uCEFApplicationCore;
@@ -212,12 +215,12 @@ end;
procedure TFMXChromium.MoveFormTo(const x, y: Integer); procedure TFMXChromium.MoveFormTo(const x, y: Integer);
var var
TempForm : TCustomForm; TempForm : TCustomForm;
{$IFDEF DELPHI17_UP} {$IFDEF DELPHI21_UP}
TempRect : TRect; TempRect : TRect;
{$ENDIF} {$ENDIF}
begin begin
TempForm := GetParentForm; TempForm := GetParentForm;
{$IFDEF DELPHI17_UP} {$IFDEF DELPHI21_UP}
if (TempForm <> nil) then if (TempForm <> nil) then
begin begin
TempRect.Left := min(max(x, max(round(screen.DesktopLeft), 0)), round(screen.DesktopWidth) - TempForm.Width); TempRect.Left := min(max(x, max(round(screen.DesktopLeft), 0)), round(screen.DesktopWidth) - TempForm.Width);
@@ -235,12 +238,12 @@ end;
procedure TFMXChromium.MoveFormBy(const x, y: Integer); procedure TFMXChromium.MoveFormBy(const x, y: Integer);
var var
TempForm : TCustomForm; TempForm : TCustomForm;
{$IFDEF DELPHI17_UP} {$IFDEF DELPHI21_UP}
TempRect : TRect; TempRect : TRect;
{$ENDIF} {$ENDIF}
begin begin
TempForm := GetParentForm; TempForm := GetParentForm;
{$IFDEF DELPHI17_UP} {$IFDEF DELPHI21_UP}
if (TempForm <> nil) then if (TempForm <> nil) then
begin begin
TempRect.Left := min(max(TempForm.Left + x, max(round(screen.DesktopLeft), 0)), round(screen.DesktopWidth) - TempForm.Width); TempRect.Left := min(max(TempForm.Left + x, max(round(screen.DesktopLeft), 0)), round(screen.DesktopWidth) - TempForm.Width);
@@ -292,7 +295,7 @@ begin
TempForm := GetParentForm; TempForm := GetParentForm;
if (TempForm <> nil) then if (TempForm <> nil) then
{$IFDEF DELPHI17_UP} {$IFDEF DELPHI21_UP}
TempForm.Left := min(max(x, max(round(screen.DesktopLeft), 0)), round(screen.DesktopWidth) - TempForm.Width); TempForm.Left := min(max(x, max(round(screen.DesktopLeft), 0)), round(screen.DesktopWidth) - TempForm.Width);
{$ELSE} {$ELSE}
TempForm.Left := x; TempForm.Left := x;
@@ -306,7 +309,7 @@ begin
TempForm := GetParentForm; TempForm := GetParentForm;
if (TempForm <> nil) then if (TempForm <> nil) then
{$IFDEF DELPHI17_UP} {$IFDEF DELPHI21_UP}
TempForm.Top := min(max(y, max(round(screen.DesktopTop), 0)), round(screen.DesktopHeight) - TempForm.Height); TempForm.Top := min(max(y, max(round(screen.DesktopTop), 0)), round(screen.DesktopHeight) - TempForm.Height);
{$ELSE} {$ELSE}
TempForm.Top := y; TempForm.Top := y;

View File

@@ -63,7 +63,7 @@ type
public public
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
procedure Reparent(const aNewParentHandle : TWindowHandle); procedure Reparent(const aNewParentHandle : {$IFDEF DELPHI18_UP}TWindowHandle{$ELSE}TFmxHandle{$ENDIF});
property ChildWindowHandle : HWND read GetChildWindowHandle; property ChildWindowHandle : HWND read GetChildWindowHandle;
{$ENDIF} {$ENDIF}
@@ -130,11 +130,15 @@ begin
end; end;
end; end;
procedure TFMXWindowParent.Reparent(const aNewParentHandle : TWindowHandle); procedure TFMXWindowParent.Reparent(const aNewParentHandle : {$IFDEF DELPHI18_UP}TWindowHandle{$ELSE}TFmxHandle{$ENDIF});
var var
TempChildHandle, TempParentHandle : HWND; TempChildHandle, TempParentHandle : HWND;
begin begin
{$IFDEF DELPHI18_UP}
if (aNewParentHandle <> nil) then if (aNewParentHandle <> nil) then
{$ELSE}
if (aNewParentHandle <> 0) then
{$ENDIF}
begin begin
TempChildHandle := FmxHandleToHWND(Handle); TempChildHandle := FmxHandleToHWND(Handle);
TempParentHandle := FmxHandleToHWND(aNewParentHandle); TempParentHandle := FmxHandleToHWND(aNewParentHandle);

View File

@@ -51,7 +51,6 @@ uses
type type
{$IFNDEF FPC}{$IFDEF DELPHI16_UP}[ComponentPlatformsAttribute(pidWin32 or pidWin64)]{$ENDIF}{$ENDIF} {$IFNDEF FPC}{$IFDEF DELPHI16_UP}[ComponentPlatformsAttribute(pidWin32 or pidWin64)]{$ENDIF}{$ENDIF}
TFMXWorkScheduler = class(TComponent) TFMXWorkScheduler = class(TComponent)
protected protected
FThread : TCEFWorkSchedulerThread; FThread : TCEFWorkSchedulerThread;
@@ -276,10 +275,15 @@ begin
if FUseQueueThread and (FQueueThread <> nil) and FQueueThread.Ready then if FUseQueueThread and (FQueueThread <> nil) and FQueueThread.Ready then
FQueueThread.EnqueueValue(integer(delay_ms)) FQueueThread.EnqueueValue(integer(delay_ms))
else else
TThread.ForceQueue(nil, procedure {$IFDEF DELPHI18_UP}
begin TThread.ForceQueue(nil,
ScheduleWork(delay_ms); {$ELSE}
end); TThread.Queue(nil,
{$ENDIF}
procedure
begin
ScheduleWork(delay_ms);
end);
end; end;
procedure TFMXWorkScheduler.StopScheduler; procedure TFMXWorkScheduler.StopScheduler;

View File

@@ -2,9 +2,9 @@
"UpdateLazPackages" : [ "UpdateLazPackages" : [
{ {
"ForceNotify" : true, "ForceNotify" : true,
"InternalVersion" : 339, "InternalVersion" : 340,
"Name" : "cef4delphi_lazarus.lpk", "Name" : "cef4delphi_lazarus.lpk",
"Version" : "96.0.16.0" "Version" : "96.0.17.0"
} }
], ],
"UpdatePackageData" : { "UpdatePackageData" : {