Skip to content

Commit

Permalink
Print browser source renderer crashes to OBS log
Browse files Browse the repository at this point in the history
  • Loading branch information
WizardCM authored and RytoEX committed Feb 27, 2025
1 parent 4023fad commit 52c1527
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions browser-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ CefRefPtr<CefResourceRequestHandler> BrowserClient::GetResourceRequestHandler(Ce
return nullptr;
}

void BrowserClient::OnRenderProcessTerminated(CefRefPtr<CefBrowser>, TerminationStatus, int,
const CefString &error_string)
{
std::string str_text = error_string;
blog(LOG_ERROR, "[obs-browser: '%s'] Webpage has crashed unexpectedly! Reason: '%s'",
obs_source_get_name(bs->source), str_text.c_str());
}

CefResourceRequestHandler::ReturnValue BrowserClient::OnBeforeResourceLoad(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>,
CefRefPtr<CefRequest>,
CefRefPtr<CefCallback>)
Expand Down
2 changes: 2 additions & 0 deletions browser-client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ class BrowserClient : public CefClient,
GetResourceRequestHandler(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request, bool is_navigation, bool is_download,
const CefString &request_initiator, bool &disable_default_handling) override;
virtual void OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser, TerminationStatus status, int error_code,
const CefString &error_string) override;

/* CefResourceRequestHandler */
virtual CefResourceRequestHandler::ReturnValue OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser,
Expand Down

0 comments on commit 52c1527

Please sign in to comment.