Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Update to CEF 3.3359.1768.g8e7c5d6

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

Update to CEF 3.3359.1768.g8e7c5d6

Post by salvadordf »

Hi,

I updated CEF4Delhi to CEF 3.3359.1768.g8e7c5d6 which includes Chromium 66.0.3359.117. :D

I did some minor modifications to the SimpleFMXBrowser demo to destroy the form safely.

These are the CEF binaries used in this update :
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 3.3359.1768.g8e7c5d6

Post by thefunkyjoint »

Great ! :D
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3359.1768.g8e7c5d6

Post by salvadordf »

Hi,

Please provide a code sample to reproduce the error.
Do you have that problem with the SimpleBrowser demo?
What Delphi version are you using?

Thanks!
blueflagbj
Posts: 8
Joined: Mon Jul 10, 2017 8:08 am

Re: Update to CEF 3.3359.1768.g8e7c5d6

Post by blueflagbj »

Please comment out this line:

// GlobalCEFApp.Free;
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 3.3359.1768.g8e7c5d6

Post by thefunkyjoint »

blueflagbj wrote: Thu Apr 26, 2018 9:13 am Please comment out this line:

// GlobalCEFApp.Free;
Why this line should be commented ? In my apps this line is always active.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3359.1768.g8e7c5d6

Post by salvadordf »

I had to edit your post. Please, don't send EXE files.

That file was detected by 3 antivirus engines as infected.

I'll try to modify the SimpleBrowser demo to set the dimensions of TChromiumWindow manually but it would be best if you could post pascal code, not executables.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3359.1768.g8e7c5d6

Post by salvadordf »

I tested your code and I couldn't replicate that error.

However, there are several things missing in that code :
  • You must follow the "Destruction steps" described in the code comments from the SimpleBrowser demo. This is necessary to avoid shutdown problems.
  • CreateBrowser must be called after GlobalCEFApp.GlobalContextInitialized is set to TRUE or it will fail. That's why the demos have a TTimer.
  • You should add the procedures to handle WM_MOVE, WM_MOVING, WM_ENTERMENULOOP and WM_EXITMENULOOP.
  • TChromiumWindow is an extremely simplistic component made to be used as an extremely simple browser. If you need to add anything else it's recommended to use TChromium and TWindowParent. Use the SimpleBrowser2 demo as a template for your app.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3359.1768.g8e7c5d6

Post by salvadordf »

TChromium.RetrieveHTML is an asynchronous procedure and a TTimer uses a low-priority message : WM_TIMER.

TChromium.RetrieveHTML uses a TCustomCefStringVisitor that calls an internal TChromium procedure to return the HTML in the TChromium.OnTextResultAvailable event.

If you stress your CPU and you try to close the app then the remaining WM_TIMER messages in the queue could cause problems.

The safest way to call TChromium.RetrieveHTML repeatedly would be to wait for the previous TChromium.OnTextResultAvailable event before enabling TTimer again.

Follow these steps if you try to close your app :
  • Use a boolean global variable to keep your TTimer disabled. You should not enable your timer again if that variable is set.
  • Disable the TTimer.
  • Wait for any remaining TChromium.OnTextResultAvailable event to be received.
  • Start the "destruction sequence" for TChromium.
  • Close your app when TChromium.OnBeforeClose is received.
Post Reply