When the renderer process terminates abnormally

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

When the renderer process terminates abnormally

Postby banggi » Thu Jun 20, 2019 9:15 pm

Hi, first i apologize for my English skill.

I would like to be tested for one simple fix. This is the situation after the renderer process terminated abnormally.
Reference file : cef/libcef/browser/browser_host_impl.cc

My project is matched with one gl surface per renderer process. It is also an embedded environment.
So to destroy one surface, Browser call API(brower->GetHost()->CloseBrowser(true)) through IPC message from the system.

In normal case, there was no problem at all. because browser call the `CloseBrowser` API. However, in an abnormal termination situation, the surface is not terminated.
because platform_delegate_.reset(NULL) which is a process within the CefBrowserHostImpl::DestroyBrowser(), is not called.
In addition, the resources associated with the renderer process seem to be not released.

While i was looking for a way, I notice that CefBrowserHostImpl::RenderProcessGone is called when the renderer process terminates abnormally.
So i inserted the following code to destroy the resources and surfaces associated with the renderer process when the function is called.

Code: Select all
void CefBrowserHostImpl::RenderProcessGone(base::TerminationStatus status) {
 
  ...
 
  if (client_.get()) {
    CefRefPtr<CefRequestHandler> handler = client_->GetRequestHandler();
    if (handler.get()) {
      std::unique_ptr<NavigationLock> navigation_lock = CreateNavigationLock();
      handler->OnRenderProcessTerminated(this, ts);
      CEF_POST_TASK(CEF_UIT,
          base::Bind(&CefBrowserHostImpl::CloseBrowser, this, true));
    }
  }
}


Is this code likely to cause other problems?
banggi
Newbie
 
Posts: 9
Joined: Thu Jun 20, 2019 8:17 pm

Re: When the renderer process terminates abnormally

Postby magreenblatt » Thu Jun 20, 2019 11:39 pm

If your intention is to close the browser when the render process terminates, then you should implement OnRenderProcessTerminated in your client and call CloseBrowser from there instead of changing libcef.
magreenblatt
Site Admin
 
Posts: 9837
Joined: Fri May 29, 2009 6:57 pm

Re: When the renderer process terminates abnormally

Postby banggi » Fri Jun 21, 2019 12:12 am

Thank you for your response :)
banggi
Newbie
 
Posts: 9
Joined: Thu Jun 20, 2019 8:17 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 3 guests