I've been debugging this strange issue, I was wondering if anyone has any insight/help to figure out what's going on.
Context:
I am hosting CefSharp.Winforms inside a WPF app (via WindowsFormsHost). The parent app is not mine, but loads my DLL, takes my WPF root element and inserts it into its visual tree.
It's a bit convoluted, but that's what I have to work with.
In certain, cases the parent app will recreate the HWND which hosts the WPF container, which cases the WM_CLOSE to be sent to all child windows of that contains (of which CEF window is one of them). When this happens, Cef subprocess terminates without any reason and doesn't notify the CefSharp host (i.e. via ClientHandler::OnRenderProcessTerminated)
So what happens is that my browser output goes blank (because the render subprocess terminated) and it's very difficult for me to detect this condition to recover from it.
The strangest thing is that when I attach WinDbg to the subprocess, and set various breakpoint, such
- Code: Select all
libcef!CefBrowserHostImpl::TryCloseBrowser
libcef!CefBrowserPlatformDelegateNativeWin::WndProc
libcef!cef_shutdown
they are never hit. So I can't track down what path it takes to terminate to see if there is an issue with cef not notifying it is going down.
Any ideas/thoughts on how to debug this?
The repro is 100% reliable but complicate because it involves a third party app (Autodesk Revit) which hosts my content and is the culprit for closing the top HWND. But I will try to make a self-contained example to test it out later
Any help and/or ideas would be appreciated, thank you!
Mark