Execute HandleExternalProtocolHelper on the UI thread (fixes #3821)

This commit is contained in:
Marshall Greenblatt 2024-11-04 12:01:19 -05:00
parent 3470f6ade4
commit 7a98b3fece
2 changed files with 3 additions and 1 deletions

View File

@ -59,6 +59,8 @@ void HandleExternalProtocolHelper(
const network::ResourceRequest& resource_request,
const std::optional<url::Origin>& 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();

View File

@ -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_);
}
}
}