diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.cc b/libcef/browser/chrome/chrome_content_browser_client_cef.cc index f55bddeef..4413884be 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.cc +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.cc @@ -59,6 +59,8 @@ void HandleExternalProtocolHelper( const network::ResourceRequest& resource_request, const std::optional& initiating_origin, content::WeakDocumentPtr initiator_document) { + 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_); } } }