diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.cc b/libcef/browser/chrome/chrome_content_browser_client_cef.cc index 3a3b06db2..cf28ac9d6 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.cc +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.cc @@ -140,6 +140,8 @@ void HandleExternalProtocolHelper( const std::optional& initiating_origin, content::WeakDocumentPtr initiator_document, const net::IsolationInfo& isolation_info) { + CEF_REQUIRE_UIT(); + // May return nullptr if frame has been deleted or a cross-document navigation // has committed in the same RenderFrameHost. auto initiator_rfh = initiator_document.AsRenderFrameHostIfValid(); diff --git a/libcef/browser/net_service/resource_request_handler_wrapper.cc b/libcef/browser/net_service/resource_request_handler_wrapper.cc index 045f0229a..895cf2c08 100644 --- a/libcef/browser/net_service/resource_request_handler_wrapper.cc +++ b/libcef/browser/net_service/resource_request_handler_wrapper.cc @@ -1116,7 +1116,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { init_state_->browser_, init_state_->frame_, state->pending_request_.get(), allow_os_execution); if (allow_os_execution && init_state_->unhandled_request_callback_) { - init_state_->unhandled_request_callback_.Run(); + CEF_POST_TASK(TID_UI, init_state_->unhandled_request_callback_); } } }