cefclient implementation assumes the UI thread (cef\tests\cefclient\browser\client_handler.cc):
- Code: Select all
void ClientHandler::OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser,
TerminationStatus status) {
CEF_REQUIRE_UI_THREAD();
message_router_->OnRenderProcessTerminated(browser);
...
Other than that, this comes from WebContentsObserver::RenderProcessGone. I don't know the details, but you can assume this can be called for various reasons, UI, IO, DB, FILE etc.
So I won't assume the UI thread. But you can do the
- Code: Select all
if(current thread != UI) {
CefPostTask TID_UI .. args
return;
}
...
trick.