API for multiple renderer processes

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.

API for multiple renderer processes

Postby gshaibi » Tue Nov 24, 2020 7:24 am

Hi,
I've upgraded CEF from 3683 to 4044, and noticed that now there may be several render processes per window with iframes(different process for each domain).
Until now, I've used your API to get information regarding the renderers state (such as OnRenderViewReady and OnRenderProcessTerminated) which were called every time a renderer was spawned, but it seems that now its now the case, and these methods are called only for the main renderer.
How can I get it to work with all the renderers?

Thanks!
gshaibi
Techie
 
Posts: 17
Joined: Wed Mar 25, 2020 8:24 am

Re: API for multiple renderer processes

Postby magreenblatt » Tue Nov 24, 2020 1:51 pm

See here which explains about the multiple renderer processes.
gshaibi wrote:Until now, I've used your API to get information regarding the renderers state (such as OnRenderViewReady and OnRenderProcessTerminated) which were called every time a renderer was spawned

What purpose are you using these callbacks for?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: API for multiple renderer processes

Postby gshaibi » Wed Nov 25, 2020 5:39 am

I need these functions for various reasons, such as sending initial configurations for each renderer that spawns, creating a watchdog for it etc.
gshaibi
Techie
 
Posts: 17
Joined: Wed Mar 25, 2020 8:24 am

Re: API for multiple renderer processes

Postby magreenblatt » Wed Nov 25, 2020 10:24 am

For renderer configuration purposes you can use the extra_info passed to CreateBrowser.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: API for multiple renderer processes

Postby gshaibi » Thu Nov 26, 2020 4:44 am

Thanks for the quick reply!
In my case, extra_info at CreateBrowser will not be enough because I need to send a dynamic configuration based on the domain of the renderer, which I don't know yet at the browser creation time.
I also need to get the pid of each renderer that spawns, when it is spawned. How can I do that?
gshaibi
Techie
 
Posts: 17
Joined: Wed Mar 25, 2020 8:24 am

Re: API for multiple renderer processes

Postby magreenblatt » Thu Nov 26, 2020 1:06 pm

gshaibi wrote:Thanks for the quick reply!
In my case, extra_info at CreateBrowser will not be enough because I need to send a dynamic configuration based on the domain of the renderer, which I don't know yet at the browser creation time.

What, specifically, are you configuring? You can send the config via an IPC message after the navigation had committed, as indicated by OnLoadEnd or OnLoadingStateChange(isLoading=false).

gshaibi wrote: I also need to get the pid of each renderer that spawns, when it is spawned. How can I do that?

You can add code in the main() function for sub-processes before calling CefExecuteProcess. The renderer process is indicated by “--type=renderer” on the command line.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 79 guests