Detect the "crashpad-handler" subprocess

Set the same SetProcessShutdownParameters parameter value as Chromium in the crashpad handler process.
This commit is contained in:
salvadordf 2021-12-11 11:43:58 +01:00
parent 6393b6f480
commit e0e99c26eb
3 changed files with 18 additions and 11 deletions

View File

@ -780,14 +780,18 @@ begin
FMustFreeLibrary := False;
FLastErrorMessage := '';
{$IFDEF MSWINDOWS}
if (FProcessType = ptBrowser) then
GetDLLVersion(ChromeElfPath, FChromeVersionInfo)
else
// Subprocesses will be the last to be notified about the Windows shutdown.
// The main browser process will receive WM_QUERYENDSESSION before the subprocesses
// and that allows to close the application in the right order.
// See the MiniBrowser demo for all the details.
SetProcessShutdownParameters(CHROMIUM_NONBROWSERSHUTDOWNPRIORITY - 1, SHUTDOWN_NORETRY);
case FProcessType of
ptBrowser : GetDLLVersion(ChromeElfPath, FChromeVersionInfo);
ptCrashpad :
// The crashpad handler process must be the last one to be closed
SetProcessShutdownParameters($100, SHUTDOWN_NORETRY);
else
// Subprocesses will be the last to be notified about the Windows shutdown.
// The main browser process will receive WM_QUERYENDSESSION before the subprocesses
// and that allows to close the application in the right order.
// See the MiniBrowser demo for all the details.
SetProcessShutdownParameters(CHROMIUM_NONBROWSERSHUTDOWNPRIORITY - 1, SHUTDOWN_NORETRY);
end;
{$ENDIF}
// Internal filelds
@ -1598,7 +1602,10 @@ begin
if (CompareText(TempValue, 'broker') = 0) then
Result := ptBroker
else
Result := ptOther;
if (CompareText(TempValue, 'crashpad-handler') = 0) then
Result := ptCrashpad
else
Result := ptOther;
end
else
Result := ptBrowser;

View File

@ -448,7 +448,7 @@ type
// in the main thread before closing the browser.
TCefCloseBrowserAction = (cbaClose, cbaDelay, cbaCancel);
TCefProcessType = (ptBrowser, ptRenderer, ptZygote, ptGPU, ptUtility, ptBroker, ptOther);
TCefProcessType = (ptBrowser, ptRenderer, ptZygote, ptGPU, ptUtility, ptBroker, ptCrashpad, ptOther);
// Used in TChromium preferences to allow or block cookies.
TCefCookiePref = (cpDefault, cpAllow, cpBlock);

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 340,
"InternalVersion" : 341,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "96.0.17.0"
}