Execute HandleExternalProtocolHelper on the UI thread (fixes #3821)

This commit is contained in:
Marshall Greenblatt 2024-11-04 11:44:48 -05:00
parent f8ad36e72c
commit 0860ec2f3d
2 changed files with 3 additions and 1 deletions

View File

@ -140,6 +140,8 @@ void HandleExternalProtocolHelper(
const std::optional<url::Origin>& initiating_origin, const std::optional<url::Origin>& initiating_origin,
content::WeakDocumentPtr initiator_document, content::WeakDocumentPtr initiator_document,
const net::IsolationInfo& isolation_info) { const net::IsolationInfo& isolation_info) {
CEF_REQUIRE_UIT();
// May return nullptr if frame has been deleted or a cross-document navigation // May return nullptr if frame has been deleted or a cross-document navigation
// has committed in the same RenderFrameHost. // has committed in the same RenderFrameHost.
auto initiator_rfh = initiator_document.AsRenderFrameHostIfValid(); auto initiator_rfh = initiator_document.AsRenderFrameHostIfValid();

View File

@ -1116,7 +1116,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
init_state_->browser_, init_state_->frame_, init_state_->browser_, init_state_->frame_,
state->pending_request_.get(), allow_os_execution); state->pending_request_.get(), allow_os_execution);
if (allow_os_execution && init_state_->unhandled_request_callback_) { 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_);
} }
} }
} }