How to know render process crashed

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.

How to know render process crashed

Postby froser » Wed Jan 17, 2018 12:46 am

Hello!
I'm trying to write a function to get the state of render process. I only need to know whether the render process is dead or alive, then I found following codes in chromium:

file: chromium\src\content\browser\frame_host\render_frame_host_manager.cc
code:

RenderFrameHostImpl* RenderFrameHostManager::Navigate(...)
{
...
// If the renderer isn't live, then try to create a new one to satisfy this
// navigation request.
if (!dest_render_frame_host->IsRenderFrameLive()) {
// Instruct the destination render frame host to set up a Mojo connection
// with the new render frame if necessary. Note that this call needs to
// occur before initializing the RenderView; the flow of creating the
// RenderView can cause browser-side code to execute that expects the this
// RFH's ServiceRegistry to be initialized (e.g., if the site is a WebUI
// site that is handled via Mojo, then Mojo WebUI code in //chrome will
// add a service to this RFH's ServiceRegistry).
....
}
}

The function 'IsRenderFrameLive' is exactly what I need, but I don't know how to get it from CEF interface.

By the way, in file src\content\browser\renderer_host\render_process_host_impl.cc, RenderProcessHostImpl::ProcessDied() will be called if render process crashed. Can I get a callback through CEF interface?
froser
Newbie
 
Posts: 2
Joined: Wed Jan 17, 2018 12:37 am

Re: How to know render process crashed

Postby froser » Wed Jan 17, 2018 2:46 am

I found a callback of 'CefRequestHandler::OnRenderProcessTerminated' which can solve my problem.
I can get render state through this callback. :D
froser
Newbie
 
Posts: 2
Joined: Wed Jan 17, 2018 12:37 am


Return to Support Forum

Who is online

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