1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-12 22:07:39 +02:00

Update to CEF 98.1.19

This commit is contained in:
salvadordf
2022-02-14 21:57:27 +01:00
parent ef8d9e02c1
commit 6176fd8585
9 changed files with 218 additions and 23 deletions

View File

@ -60,19 +60,21 @@ uses
{$ELSE}
{$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, {$IFDEF FPC}dynlibs,{$ENDIF}
{$ENDIF}
{$IFDEF LINUX}{$IFDEF FPC}xlib,{$ENDIF}{$ENDIF}
{$IFDEF LINUX}
{$IFDEF FPC}xlib,{$ENDIF} uCEFArgCopy,
{$ENDIF}
uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar;
const
CEF_SUPPORTED_VERSION_MAJOR = 98;
CEF_SUPPORTED_VERSION_MINOR = 1;
CEF_SUPPORTED_VERSION_RELEASE = 16;
CEF_SUPPORTED_VERSION_RELEASE = 19;
CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = 98;
CEF_CHROMEELF_VERSION_MINOR = 0;
CEF_CHROMEELF_VERSION_RELEASE = 4758;
CEF_CHROMEELF_VERSION_BUILD = 55;
CEF_CHROMEELF_VERSION_BUILD = 80;
{$IFDEF MSWINDOWS}
LIBCEF_DLL = 'libcef.dll';
@ -194,6 +196,9 @@ type
// Fields used during the CEF initialization
FWindowsSandboxInfo : pointer;
FEnableHighDPISupport : boolean;
{$IFDEF LINUX}
FArgCopy : TCEFArgCopy;
{$ENDIF}
// Fields used by custom properties
FDeleteCache : boolean;
@ -287,6 +292,8 @@ type
function GetApiHashCommit : ustring;
{$IFDEF LINUX}
function GetXDisplay : PXDisplay;
function GetArgc : longint;
function GetArgv : PPChar;
{$ENDIF}
function LoadCEFlibrary : boolean; virtual;
@ -506,6 +513,10 @@ type
// Properties used during the CEF initialization
property WindowsSandboxInfo : Pointer read FWindowsSandboxInfo write FWindowsSandboxInfo;
property EnableHighDPISupport : boolean read FEnableHighDPISupport write FEnableHighDPISupport;
{$IFDEF LINUX}
property argc : longint read GetArgc;
property argv : PPChar read GetArgv;
{$ENDIF}
// Custom properties
property DeleteCache : boolean read FDeleteCache write FDeleteCache;
@ -752,6 +763,9 @@ begin
// Fields used during the CEF initialization
FWindowsSandboxInfo := nil;
FEnableHighDPISupport := False;
{$IFDEF LINUX}
FArgCopy := TCEFArgCopy.Create;
{$ENDIF}
// Fields used by custom properties
FDeleteCache := False;
@ -850,6 +864,9 @@ begin
FreeLibcefLibrary;
{$IFDEF LINUX}
if (FArgCopy <> nil) then FreeAndNil(FArgCopy);
{$ENDIF}
if (FCustomCommandLines <> nil) then FreeAndNil(FCustomCommandLines);
if (FCustomCommandLineValues <> nil) then FreeAndNil(FCustomCommandLineValues);
finally
@ -1341,8 +1358,11 @@ begin
TempArgs.instance := HINSTANCE{$IFDEF FPC}(){$ENDIF};
{$ELSE}
{$IFDEF FPC}
TempArgs.argc := argc;
TempArgs.argv := argv;
{$IFDEF LINUX}
FArgCopy.CopyFromArgs(argc, argv);
{$ENDIF}
TempArgs.argc := argc;
TempArgs.argv := argv;
{$ELSE}
TempArgs.argc := ArgCount;
TempArgs.argv := PPWideChar(ArgValues);
@ -2081,12 +2101,14 @@ begin
// The list of features you can enable is here :
// https://chromium.googlesource.com/chromium/src/+/master/chrome/common/chrome_features.cc
// https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/content_features.cc
// https://source.chromium.org/search?q=base::Feature
if (length(FEnableFeatures) > 0) then
AppendSwitch(aKeys, aValues, '--enable-features', FEnableFeatures);
// The list of features you can disable is here :
// https://chromium.googlesource.com/chromium/src/+/master/chrome/common/chrome_features.cc
// https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/content_features.cc
// https://source.chromium.org/search?q=base::Feature
if (length(FDisableFeatures) > 0) then
AppendSwitch(aKeys, aValues, '--disable-features', FDisableFeatures);
@ -2307,13 +2329,13 @@ begin
TempProcHWND := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, False, TempProcess.th32ProcessID);
if (TempProcHWND <> 0) then
begin
try
ZeroMemory(@TempMemCtrs, SizeOf(TProcessMemoryCounters));
TempMemCtrs.cb := SizeOf(TProcessMemoryCounters);
if GetProcessMemoryInfo(TempProcHWND, {$IFNDEF FPC}@{$ENDIF}TempMemCtrs, TempMemCtrs.cb) then
inc(Result, TempMemCtrs.WorkingSetSize);
finally
CloseHandle(TempProcHWND);
end;
end;
@ -2418,6 +2440,22 @@ begin
else
Result := nil;
end;
function TCefApplicationCore.GetArgc : longint;
begin
if (FArgCopy <> nil) then
Result := FArgCopy.argc
else
Result := 0;
end;
function TCefApplicationCore.GetArgv : PPChar;
begin
if (FArgCopy <> nil) then
Result := FArgCopy.argv
else
Result := nil;
end;
{$ENDIF}
function TCefApplicationCore.LoadCEFlibrary : boolean;