diff --git a/libcef/browser/frame_host_impl.cc b/libcef/browser/frame_host_impl.cc index bccd581b40f4b28f70b86628d8405fbc03632f92..8e9b880de2e7e80b6a4282629a5ee95103323b76 100644 --- a/libcef/browser/frame_host_impl.cc +++ b/libcef/browser/frame_host_impl.cc @@ -1085,14 +1085,24 @@ void CefFrameHostImpl::SetScrollable(bool enable) { } void CefFrameHostImpl::GetHitData(int& type, CefString& extra_data) { + if (!CEF_CURRENTLY_ON_UIT()) { + return; + } + + if (is_temporary()) { + return; + } + + if (!render_frame_host_) { + return; + } + + if (!render_frame_.is_bound()) { + return; + } + std::string temp_extra_data; - SendToRenderFrame(__FUNCTION__, - base::BindOnce( - [](int32_t* out_type, std::string* out_extra_data, - const RenderFrameType& render_frame) { - render_frame->GetHitData(out_type, out_extra_data); - }, - &type, &temp_extra_data)); + render_frame_->GetHitData(&type, &temp_extra_data); extra_data = temp_extra_data; } #endif // defined(OHOS_INPUT_EVENTS)