CefUnresponsiveProcessCallback
Header: cef_unresponsive_process_callback.h
Category: Browser Handlers
Overview
User-implemented handler interfaces returned from CefClient and registered with CefBrowserHost.
CefUnresponsiveProcessCallback
Source File: include/cef_unresponsive_process_callback.h
Process / Thread Context: Browser process / UI thread (originating OnRenderProcessUnresponsive is UI thread). USER-CALLED (source=library).
Purpose: Async callback for handling an unresponsive process. CEF passes an instance to CefRequestHandler::OnRenderProcessUnresponsive; the application calls Wait() to reset the timer or Terminate() to kill the process.
Methods
void Wait()
Parameters:
- None.
Return Value: None.
Usage Instruction: Reset the unresponsive timeout. The hang monitor will continue waiting and may fire OnRenderProcessUnresponsive again if the process stays unresponsive.
Threading Constraint: Threading constraint not specified in header per-method; originating handler is UI thread.
void Terminate()
Parameters:
- None.
Return Value: None.
Usage Instruction: Terminate the unresponsive process. Results in a call to OnRenderProcessTerminated.
Threading Constraint: Threading constraint not specified in header per-method; originating handler is UI thread.
Usage Example
bool MyRequestHandler::OnRenderProcessUnresponsive(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefUnresponsiveProcessCallback> callback) override {
// Show custom "Page unresponsive" dialog with Wait / Terminate buttons:
// - On "Wait" button: callback->Wait();
// - On "Terminate" button: callback->Terminate();
return true; // application handles
}