BREAKING CHANGES

Post Reply
User avatar
salvadordf
Posts: 1950
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

BREAKING CHANGES

Post by salvadordf » Thu Mar 28, 2019 10:04 am

Hi,

This will be a fixed thread with all the breaking changes in case you are upgrading from a very old CEF4Delphi version.


TChromium.OnClose parameters changed!!!
Date : Mar 28, 2019



The latest CEF4Delphi update fixes an issue cancelling the browser destruction sequence and I had to modify the parameters in the TChromium.OnClose and TFMXChromium.OnClose events.

Before the change, TOnClose was declared like this :

Code: Select all

TOnClose = procedure(Sender: TObject; const browser: ICefBrowser; out Result: Boolean) of object;
After this update, TOnClose is declared like this :

Code: Select all

TOnClose = procedure(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction) of object;
Notice that the "out Result : boolean" parameter has been replaced by the new "var aAction : TCefCloseBrowserAction" parameter.

TCefCloseBrowserAction is defined in uCEFTypes.pas like this :

Code: Select all

TCefCloseBrowserAction = (cbaClose, cbaDelay, cbaCancel);
Each TCefCloseBrowserAction value has this meaning :
  • cbaCancel : stop closing the browser.
  • cbaClose : continue closing the browser (THIS IS THE DEFAULT VALUE IN THE ONCLOSE EVENT). This is equivalent to setting "Result" to false with the previous event parameters.
  • cbaDelay : stop closing the browser momentarily. Used when the application needs to execute some custom processes before closing the browser. This is usually needed to destroy a TCEFWindowParent in the main thread before closing the browser. This is equivalent to setting "Result" to true with the previous event parameters.
All the demos have been modified with the new OnClose code. In the case of some OSR demos the default value (cbaClose) is all they needed so the event was removed.

I'm sorry for the inconvenience. :oops:

User avatar
EMartin
Posts: 4
Joined: Wed Mar 27, 2019 2:13 pm
Location: Argentina

Re: ATTENTION : TChromium.OnClose parameters changed!!!

Post by EMartin » Thu Mar 28, 2019 2:57 pm

Hi Salvador, I suggest you change in subject ATTENTION by BREAKING CHANGE, this way it goes less unnoticed.

Best regards.

User avatar
salvadordf
Posts: 1950
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf » Thu Apr 04, 2019 8:39 am

Renamed units

The latest CEF4Delphi update has renamed a few units to fix the issue #119.
  • uBufferPanel.pas is now called uCEFBufferPanel.pas
  • uFMXBufferPanel.pas is now called uCEFFMXBufferPanel.pas
  • uFMXChromium.pas is now called uCEFFMXChromium.pas
  • uFMXWindowParent.pas is now called uCEFFMXWindowParent.pas
  • uFMXWorkScheduler.pas is now called uCEFFMXWorkScheduler.pas
  • uOLEDragAndDrop.pas is now called uCEFOLEDragAndDrop.pas
If you have any problems please uninstall CEF4Delphi from Delphi or Lazarus, delete all BPL and DCU files related to CEF4Delphi and install it again.

User avatar
salvadordf
Posts: 1950
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf » Sun Jun 16, 2019 9:20 am

The update to CEF 75.0.7 introduced many API changes and that means many procedures, functions and events may have different parameters that can break your application.

Please, read this message for all the details details :
https://www.briskbard.com/forum/viewtopic.php?f=8&t=807

User avatar
salvadordf
Posts: 1950
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf » Wed Jul 10, 2019 1:24 pm

I just fixed an issue with the TChromiumWindow.OnBeforeClose event in this commit :
https://github.com/salvadordf/CEF4Delphi/commit/0e08d66a1f2e42fd44b713ed20c9cfab743b0416

TChromiumWindow.OnBeforeClose is now executed in a different thread and the demos send a WM_CLOSE message to close the form.
If you use that event, please don't create or destroy any VCL control inside it.

User avatar
salvadordf
Posts: 1950
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf » Thu Jul 18, 2019 10:22 am

The update to CEF 75.1.4 changed the parameters in the TChromium.OnGetAuthCredentials event.

User avatar
salvadordf
Posts: 1950
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf » Wed Sep 25, 2019 3:49 pm

The update made on September 25th had these breaking changes :
  • The ICEFPostData.GetCount has been renamed to ICEFPostData.GetElementCount
  • ICEFPostData.GetElements has changed. See the PostInspectorBrowser demo to know how to get all the POST elements.
  • ICefPostDataRef.AddElement and ICefPostDataRef.RemoveElement return a boolean.
Read this post for more information :
https://www.briskbard.com/forum/viewtopic.php?f=8&t=959

User avatar
salvadordf
Posts: 1950
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf » Wed Oct 30, 2019 10:38 am

The update to CEF 78.2.9 removed several properties, parameters and functions :
  • Removed GlobalCEFApp.EnableNetSecurityExpiration
  • Removed TChromium.LoadString
  • Removed TFMXChromium.LoadString
  • The "EnableNetSecurityExpiration" parameter was removed from TCefRequestContextRef.New
  • ICefResponse.GetHeader was renamed to ICefResponse.GetHeaderByName
  • Removed CefIsCertStatusMinorError
Read this for more information :
https://www.briskbard.com/forum/viewtopic.php?f=8&t=1013&p=4454#p4454

User avatar
salvadordf
Posts: 1950
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf » Fri Nov 08, 2019 1:58 pm

The update made on November 8th removed the TChromium.OnGetResourceRequestHandler event and replaced it with TChromium.OnGetResourceRequestHandler_ReqHdlr and TChromium.OnGetResourceRequestHandler_ReqCtxHdlr.

Read this for more info :
https://www.briskbard.com/forum/viewtopic.php?f=8&t=1025

Post Reply