1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-11-23 21:34:53 +02:00

Update to CEF 78.3.9

- Issue #230 fixed : Shutdown crashes since CEF 77
- Issue #214 fixed : OSR demos crash when resized since CEF 76
This commit is contained in:
Salvador Díaz Fau
2019-11-27 10:42:42 +01:00
parent 1d8773c42c
commit 160d4de7cd
9 changed files with 18 additions and 38 deletions

View File

@@ -50,7 +50,7 @@ uses
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
{$ENDIF}
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants,
uCEFWinControl, uCEFSentinel;
uCEFWinControl, uCEFSentinel, uCEFChromiumCore;
type
TJSWindowBindingWithFunctionFrm = class(TForm)

View File

@@ -398,9 +398,4 @@ object MiniBrowserFrm: TMiniBrowserFrm
Left = 32
Top = 344
end
object CEFSentinel1: TCEFSentinel
OnClose = CEFSentinel1Close
Left = 32
Top = 408
end
end

View File

@@ -129,7 +129,6 @@ type
Downloadimage1: TMenuItem;
Simulatekeyboardpresses1: TMenuItem;
Flushcookies1: TMenuItem;
CEFSentinel1: TCEFSentinel;
procedure FormShow(Sender: TObject);
procedure BackBtnClick(Sender: TObject);
procedure ForwardBtnClick(Sender: TObject);
@@ -230,7 +229,6 @@ type
procedure Simulatekeyboardpresses1Click(Sender: TObject);
procedure Flushcookies1Click(Sender: TObject);
procedure Chromium1CookiesFlushed(Sender: TObject);
procedure CEFSentinel1Close(Sender: TObject);
procedure Chromium1BeforePluginLoad(Sender: TObject; const mimeType,
pluginUrl: ustring; isMainFrame: Boolean;
const topOriginUrl: ustring; const pluginInfo: ICefWebPluginInfo;
@@ -299,8 +297,7 @@ uses
// =================
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
// 3. TChromium.OnBeforeClose calls TCEFSentinel.Start, which will trigger TCEFSentinel.OnClose when the renderer processes are closed.
// 4. TCEFSentinel.OnClose sets FCanClose := True and sends WM_CLOSE to the form.
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
procedure CreateGlobalCEFApp;
begin
@@ -345,12 +342,6 @@ begin
if (length(TempURL) > 0) then Chromium1.ResolveHost(TempURL);
end;
procedure TMiniBrowserFrm.CEFSentinel1Close(Sender: TObject);
begin
FCanClose := True;
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
procedure TMiniBrowserFrm.Chromium1AddressChange(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame; const url: ustring);
begin
@@ -368,7 +359,11 @@ end;
procedure TMiniBrowserFrm.Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
begin
// The main browser is being destroyed
if (Chromium1.BrowserId = 0) then CEFSentinel1.Start;
if (Chromium1.BrowserId = 0) then
begin
FCanClose := True;
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
end;
procedure TMiniBrowserFrm.Chromium1BeforeContextMenu(Sender: TObject;

View File

@@ -193,9 +193,4 @@ object URLRequestFrm: TURLRequestFrm
Left = 304
Top = 104
end
object CEFSentinel1: TCEFSentinel
OnClose = CEFSentinel1Close
Left = 160
Top = 112
end
end

View File

@@ -78,12 +78,10 @@ type
Label6: TLabel;
PostParam2NameEdt: TEdit;
PostParam2ValueEdt: TEdit;
CEFSentinel1: TCEFSentinel;
procedure DownloadBtnClick(Sender: TObject);
procedure SendPostReqBtnClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure CEFSentinel1Close(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
@@ -225,12 +223,6 @@ begin
ShellExecute(0, 'open', 'https://ptsv2.com/t/cef4delphi', nil, nil, SW_SHOWNORMAL);
end;
procedure TURLRequestFrm.CEFSentinel1Close(Sender: TObject);
begin
FCanClose := True;
PostMessage(Handle, WM_CLOSE, 0, 0);
end;
procedure TURLRequestFrm.CEFUrlRequestClientComponent1CreateURLRequest(Sender: TObject);
begin
if FSendingGET then
@@ -354,7 +346,10 @@ begin
// Use request.response here to get a ICefResponse interface with all the response headers, status, error code, etc.
if FClosing then
CEFSentinel1.Start
begin
FCanClose := True;
PostMessage(Handle, WM_CLOSE, 0, 0);
end
else
if (request <> nil) and (request.RequestStatus = UR_SUCCESS) then
PostMessage(Handle, URLREQUEST_SUCCESS, 0, 0)