callback OnBrowserCreated never called

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

callback OnBrowserCreated never called

Postby biomerge » Mon Jan 06, 2020 5:52 am

I'm having troubles integrating CEF into an existing project. I have a small demo project that renders google.com correctly, but the integration of the very same code into a big existing project doesn't even create a browser window.
Both project have access to the same DLLs, pak files, etc...

There are two main differences between the demo project and the existing project:
The number of processes spawned after CefInitialize and the fact that OnBrowserCreated is not called after CreateBrowser.
Some more details about these problems below.

1) Behavior after CefInitialize:

Demo project:
3 processes are spawned:
"--type=gpu-process"
"--type=utility --service-sandbox-type=network"
"--type=utility --service-sandbox-type=utility"

Existing project:
only 1 process is spawned:
"--type=gpu-process"

2) Behavior after CefBrowserHost::CreateBrowser

Demo project:
Callback OnBrowserCreated is called and two renderer processes are spawned.

Existing project:
Callback OnBrowserCreated is never called! No renderer process is spawned.

Debug.log:

A run in debug mode results in the following logging in both projects:

Code: Select all
[0106/113656.537:INFO:content_main_runner_impl.cc(960)] Chrome is running in full browser mode.
[0106/113656.762:WARNING:angle_platform_impl.cc(52)] initializeD3DDevice(721): Failed creating Debug D3D11 device - falling back to release runtime.

About CefInitialize

Both projects spawn the same executable "CefSubProcess".

Code: Select all
CefString(&settings.browser_subprocess_path).FromASCII("CefSubProcess.exe");
settings.multi_threaded_message_loop = false;
settings.no_sandbox = true;

Any idea what might trigger the different behavior between both programs sharing the same CEF code? I use Chromium 78.3.9.
Thank you!
biomerge
Techie
 
Posts: 13
Joined: Tue Oct 29, 2019 2:40 am

Re: callback OnBrowserCreated never called

Postby Czarek » Tue Jan 07, 2020 5:21 am

Have you checked that CefBrowser::CreateBrowser is actually called?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: callback OnBrowserCreated never called

Postby biomerge » Tue Jan 07, 2020 11:02 am

Czarek wrote:Have you checked that CefBrowser::CreateBrowser is actually called?

Yes that gets called for sure. I think the problem is situated earlier on after CefInitialize and the fact that the utility subprocesses (CL: "--type=utility") are not spawned.
biomerge
Techie
 
Posts: 13
Joined: Tue Oct 29, 2019 2:40 am

Re: callback OnBrowserCreated never called

Postby biomerge » Wed Jan 08, 2020 3:29 am

Czarek wrote:Have you checked that CefBrowser::CreateBrowser is actually called?

Thanks for the reply but I managed to fix it. CefDoMessageLoopWork calls got blocked in the big application. Sorry for the inconvenience!
biomerge
Techie
 
Posts: 13
Joined: Tue Oct 29, 2019 2:40 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 56 guests