Page 1 of 1

Update to CEF 3.3359.1768.g8e7c5d6

Posted: Fri Apr 20, 2018 10:57 am
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 :

Re: Update to CEF 3.3359.1768.g8e7c5d6

Posted: Wed Apr 25, 2018 5:07 pm
by thefunkyjoint
Great ! :D

Re: Update to CEF 3.3359.1768.g8e7c5d6

Posted: Thu Apr 26, 2018 7:07 am
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!

Re: Update to CEF 3.3359.1768.g8e7c5d6

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

// GlobalCEFApp.Free;

Re: Update to CEF 3.3359.1768.g8e7c5d6

Posted: Thu Apr 26, 2018 11:54 am
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.

Re: Update to CEF 3.3359.1768.g8e7c5d6

Posted: Thu Apr 26, 2018 4:10 pm
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.

Re: Update to CEF 3.3359.1768.g8e7c5d6

Posted: Fri Apr 27, 2018 8:16 am
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.

Re: Update to CEF 3.3359.1768.g8e7c5d6

Posted: Sat Apr 28, 2018 3:56 pm
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.